hwmon: (tmp401) Fix device detection for TMP411B and TMP411C
Guenter Roeck
maintainerPATCH 1/1 hwmon: (tmp401) Fix device detection for TMP411B and TMP411C
Turns out that TMP411B and TMP411C have different and unique device IDs.
--- drivers/hwmon/tmp401.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/hwmon/tmp401.c +14 -0
@@ -90,6 +90,8 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 };#define TMP401_MANUFACTURER_ID 0x55#define TMP401_DEVICE_ID 0x11#define TMP411_DEVICE_ID 0x12 +#define TMP411B_DEVICE_ID 0x13 +#define TMP411C_DEVICE_ID 0x10#define TMP431_DEVICE_ID 0x31/*
@@ -562,6 +564,18 @@ static int tmp401_detect(struct i2c_client *client, kind = tmp401;break ;case TMP411_DEVICE_ID : +if (client->addr !=0x4c ) +return -ENODEV ; + kind = tmp411; +break ; +case TMP411B_DEVICE_ID : +if (client->addr !=0x4d ) +return -ENODEV ; + kind = tmp411; +break ; +case TMP411C_DEVICE_ID : +if (client->addr !=0x4e ) +return -ENODEV ; kind = tmp411;break ;case TMP431_DEVICE_ID :
Signature · 7 lines
1.7.9.7 _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Hi Guenter,
Quoted 1 line · Guenter Roeck
Turns out that TMP411B and TMP411C have different and unique device IDs.
Good catch.
drivers/hwmon/tmp401.c static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 }; · line 92
Quoted 13 lines
Signed-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/tmp401.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)drivers/hwmon/tmp401.c +0
-0@@ -90,6 +90,8 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 };#define TMP401_MANUFACTURER_ID 0x55#define TMP401_DEVICE_ID 0x11#define TMP411_DEVICE_ID 0x12
I'd rename TMP411_DEVICE_ID to TMP411A_DEVICE_ID for consistency. Either way:
Quoted 24 lines
drivers/hwmon/tmp401.c +14
-0+#define TMP411B_DEVICE_ID 0x13 +#define TMP411C_DEVICE_ID 0x10#define TMP431_DEVICE_ID 0x31/* @@ -562,6 +564,18 @@ static int tmp401_detect(struct i2c_client *client, kind = tmp401;break ;case TMP411_DEVICE_ID : +if (client->addr !=0x4c ) +return -ENODEV ; + kind = tmp411; +break ; +case TMP411B_DEVICE_ID : +if (client->addr !=0x4d ) +return -ENODEV ; + kind = tmp411; +break ; +case TMP411C_DEVICE_ID : +if (client->addr !=0x4e ) +return -ENODEV ; kind = tmp411;break ;case TMP431_DEVICE_ID :
Signature · 6 lines
Jean Delvare _______________________________________________ lm-sensors mailing list [email protected] http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Guenter Roeck
maintainerQuoted 12 lines · Jean Delvare
Hi Guenter,
Quoted 1 line · Guenter Roeck
Turns out that TMP411B and TMP411C have different and unique device IDs.
Good catch.
Quoted 5 lines
Signed-off-by Guenter Roeck <[email protected]>--- drivers/hwmon/tmp401.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
Quoted 10 lines
drivers/hwmon/tmp401.c static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 }; · line 92
Quoted 8 lines
drivers/hwmon/tmp401.c +0
-0@@ -90,6 +90,8 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 };#define TMP401_MANUFACTURER_ID 0x55#define TMP401_DEVICE_ID 0x11#define TMP411_DEVICE_ID 0x12I'd rename
TMP411_DEVICE_IDtoTMP411A_DEVICE_IDfor consistency.
I'll do that.
Quoted 4 lines
Either way:
Acked-by Jean Delvare <[email protected]>
Thanks,
Guenter
_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors