diff options
-rw-r--r-- | drivers/hwmon/adt7475.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c index d20130723d68..688b0a1af5a8 100644 --- a/drivers/hwmon/adt7475.c +++ b/drivers/hwmon/adt7475.c | |||
@@ -40,6 +40,8 @@ | |||
40 | 40 | ||
41 | /* 7475 Common Registers */ | 41 | /* 7475 Common Registers */ |
42 | 42 | ||
43 | #define REG_DEVREV2 0x12 /* ADT7490 only */ | ||
44 | |||
43 | #define REG_VTT 0x1E /* ADT7490 only */ | 45 | #define REG_VTT 0x1E /* ADT7490 only */ |
44 | #define REG_EXTEND3 0x1F /* ADT7490 only */ | 46 | #define REG_EXTEND3 0x1F /* ADT7490 only */ |
45 | 47 | ||
@@ -1149,6 +1151,12 @@ static void adt7475_remove_files(struct i2c_client *client, | |||
1149 | static int adt7475_probe(struct i2c_client *client, | 1151 | static int adt7475_probe(struct i2c_client *client, |
1150 | const struct i2c_device_id *id) | 1152 | const struct i2c_device_id *id) |
1151 | { | 1153 | { |
1154 | static const char *names[] = { | ||
1155 | [adt7473] = "ADT7473", | ||
1156 | [adt7475] = "ADT7475", | ||
1157 | [adt7490] = "ADT7490", | ||
1158 | }; | ||
1159 | |||
1152 | struct adt7475_data *data; | 1160 | struct adt7475_data *data; |
1153 | int i, ret = 0, revision; | 1161 | int i, ret = 0, revision; |
1154 | u8 config3; | 1162 | u8 config3; |
@@ -1165,6 +1173,8 @@ static int adt7475_probe(struct i2c_client *client, | |||
1165 | case adt7490: | 1173 | case adt7490: |
1166 | data->has_voltage = 0x3e; /* in1 to in5 */ | 1174 | data->has_voltage = 0x3e; /* in1 to in5 */ |
1167 | revision = adt7475_read(REG_DEVID2) & 0x03; | 1175 | revision = adt7475_read(REG_DEVID2) & 0x03; |
1176 | if (revision == 0x03) | ||
1177 | revision += adt7475_read(REG_DEVREV2); | ||
1168 | break; | 1178 | break; |
1169 | default: | 1179 | default: |
1170 | data->has_voltage = 0x06; /* in1, in2 */ | 1180 | data->has_voltage = 0x06; /* in1, in2 */ |
@@ -1234,6 +1244,14 @@ static int adt7475_probe(struct i2c_client *client, | |||
1234 | goto eremove; | 1244 | goto eremove; |
1235 | } | 1245 | } |
1236 | 1246 | ||
1247 | dev_info(&client->dev, "%s device, revision %d\n", | ||
1248 | names[id->driver_data], revision); | ||
1249 | if ((data->has_voltage & (1 << 0)) || data->has_fan4 || data->has_pwm2) | ||
1250 | dev_info(&client->dev, "Optional features:%s%s%s\n", | ||
1251 | (data->has_voltage & (1 << 0)) ? " in0" : "", | ||
1252 | data->has_fan4 ? " fan4" : "", | ||
1253 | data->has_pwm2 ? " pwm2" : ""); | ||
1254 | |||
1237 | return 0; | 1255 | return 0; |
1238 | 1256 | ||
1239 | eremove: | 1257 | eremove: |