Skip to contentSkip to conversation

hwmon (w83627hf) Don't touch nonexistent I2C address registers

PATCH In review Jean Delvare 2 participants 2 messages Oct 26, 2012 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon (w83627hf) Don't touch nonexistent I2C address registers

Only the W83627HF could be accessed through I2C. All other supported chips are LPC-only, so they do not have I2C address registers. Don't write to nonexistent or reserved registers on these chips.

---
 drivers/hwmon/w83627hf.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/w83627hf.c +4 -2
@@ -1732,8 +1732,10 @@ static void __devinit w83627hf_init_devi
 	/* Minimize conflicts with other winbond i2c-only clients...  */
 	/* disable i2c subclients... how to disable main i2c client?? */
 	/* force i2c address to relatively uncommon address */
-	w83627hf_write_value(data, W83781D_REG_I2C_SUBADDR, 0x89);
-	w83627hf_write_value(data, W83781D_REG_I2C_ADDR, force_i2c);
+	if (type = w83627hf) {
+		w83627hf_write_value(data, W83781D_REG_I2C_SUBADDR, 0x89);
+		w83627hf_write_value(data, W83781D_REG_I2C_ADDR, force_i2c);
+	}
 
 	/* Read VID only once */
 	if (type = w83627hf || type = w83637hf) {
Signature · 6 lines
Jean Delvare

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

Only the W83627HF could be accessed through I2C. All other supported chips are LPC-only, so they do not have I2C address registers. Don't write to nonexistent or reserved registers on these chips.

Quoted 29 lines
---
 drivers/hwmon/w83627hf.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwmon/w83627hf.c +4 -2
@@ -1732,8 +1732,10 @@ static void __devinit w83627hf_init_devi
 	/* Minimize conflicts with other winbond i2c-only clients...  */
 	/* disable i2c subclients... how to disable main i2c client?? */
 	/* force i2c address to relatively uncommon address */
-	w83627hf_write_value(data, W83781D_REG_I2C_SUBADDR, 0x89);
-	w83627hf_write_value(data, W83781D_REG_I2C_ADDR, force_i2c);
+	if (type = w83627hf) {
+		w83627hf_write_value(data, W83781D_REG_I2C_SUBADDR, 0x89);
+		w83627hf_write_value(data, W83781D_REG_I2C_ADDR, force_i2c);
+	}
 
 	/* Read VID only once */
 	if (type = w83627hf || type = w83637hf) {
Signature · 7 lines
-- 
Jean Delvare

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

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