Skip to contentSkip to conversation

hwmon: (tmp401) Fix device detection for TMP411B and TMP411C

PATCH In review Guenter Roeck 2 participants 3 messages Mar 30, 2013 Hardware monitoring

lore
Share & tools
lore

Guenter Roeck

author maintainer
#0 lore raw

PATCH 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
index f4290ec..bcaeb2d 100644
@@ -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
Acked-by on v1 1/1
#1 lore raw

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
---
 drivers/hwmon/tmp401.c |   14 ++++++++++++++
 1 file changed, 14 insertions(+)
drivers/hwmon/tmp401.c +0 -0
index f4290ec..bcaeb2d 100644
@@ -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
author maintainer
#2 lore raw
In reply to Guenter Roeck
Quoted 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
---
 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
index f4290ec..bcaeb2d 100644
@@ -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.

I'll do that.

Quoted 4 lines

Either way:

Thanks,
Guenter

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors