Skip to contentSkip to conversation

hwmon: (lm90) Make SA56004 detection more

PATCH Applied Jean Delvare 3 participants 3 messages Jul 24, 2011 – Jul 28, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (lm90) Make SA56004 detection more

With a device ID register value of 0, the SA56004 detection is rather weak. Check several other register too to confirm the detection, as we do for other supported devices.

Cc Stijn Devriendt <[email protected]>
Cc Guenter Roeck <[email protected]>
---
 drivers/hwmon/lm90.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)
drivers/hwmon/lm90.c +13 -2
@@ -1283,8 +1283,19 @@ static int lm90_detect(struct i2c_client
 			}
 		}
 	} else
-	if (man_id = 0xA1) { /*  NXP Semiconductor/Philips */
-		if (chip_id = 0x00 && address >= 0x48 && address <= 0x4F) {
+	if (address >= 0x48 && address <= 0x4F
+	 && man_id = 0xA1) { /*  NXP Semiconductor/Philips */
+		int reg_config2;
+
+		reg_config2 = i2c_smbus_read_byte_data(new_client,
+						LM90_REG_R_CONFIG2);
+		if (reg_config2 < 0)
+			return -ENODEV;
+
+		if (chip_id = 0x00
+		 && (reg_config1 & 0x2A) = 0x00
+		 && (reg_config2 & 0xFE) = 0x00
+		 && reg_convrate <= 0x09) {
 			name = "sa56004";
 		}
 	}
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw
Quoted 14 lines

-----Original Message-----
From: Jean Delvare [mailto:[email protected]]
Sent: zondag 24 juli 2011 20:36
To: LM Sensors
Cc: Stijn Devriendt (sdevrien); Guenter Roeck
Subject: [PATCH] hwmon: (lm90) Make SA56004 detection more robust

With a device ID register value of 0, the SA56004 detection is rather weak. Check several other register too to confirm the detection, as we do for other supported devices.

Cc Stijn Devriendt <[email protected]>
Cc Guenter Roeck <[email protected]>
Quoted 7 lines
---
 drivers/hwmon/lm90.c |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- linux-3.0-rc6.orig/drivers/hwmon/lm90.c 2011-07-07
13:35:10.000000000 +0200
+++ linux-3.0-rc6/drivers/hwmon/lm90.c 2011-07-07

14:26:10.000000000

Quoted 26 lines

+0200

drivers/hwmon/lm90.c +13 -3
@@ -1283,8 +1283,19 @@ static int lm90_detect(struct i2c_client
 			}
 		}
 	} else
-	if (man_id = 0xA1) { /*  NXP Semiconductor/Philips */
-		if (chip_id = 0x00 && address >= 0x48 && address <0x4F) {
+	if (address >= 0x48 && address <= 0x4F
+	 && man_id = 0xA1) { /*  NXP Semiconductor/Philips */
+		int reg_config2;
+
+		reg_config2 = i2c_smbus_read_byte_data(new_client,
+						LM90_REG_R_CONFIG2);
+		if (reg_config2 < 0)
+			return -ENODEV;
+
+		if (chip_id = 0x00
+		 && (reg_config1 & 0x2A) = 0x00
+		 && (reg_config2 & 0xFE) = 0x00
+		 && reg_convrate <= 0x09) {
 			name = "sa56004";
 		}
 	}
 
 
--
Quoted 1 line

Jean Delvare

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

#2 lore raw
In reply to Jean Delvare
Quoted 7 lines · Jean Delvare

With a device ID register value of 0, the SA56004 detection is rather weak. Check several other register too to confirm the detection, as we do for other supported devices.

Cc Stijn Devriendt <[email protected]>
Cc Guenter Roeck <[email protected]>

Applied.

Thanks,
Guenter

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