aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-05-04 05:09:28 -0400
committerJean Delvare <khali@linux-fr.org>2010-05-04 05:09:28 -0400
commitb1d4b390ea4bb480e65974ce522a04022608a8df (patch)
tree4db4a309249ce830e20218b89a7d27af55262e7a /drivers/i2c
parente4a7b9b04de15f6b63da5ccdd373ffa3057a3681 (diff)
i2c: Fix probing of FSC hardware monitoring chips
Some FSC hardware monitoring chips (Syleus at least) doesn't like quick writes we typically use to probe for I2C chips. Use a regular byte read instead for the address they live at (0x73). These are the only known chips living at this address on PC systems. For clarity, this fix should not be needed for kernels 2.6.30 and later, as we started instantiating the hwmon devices explicitly based on DMI data. Still, this fix is valuable in the following two cases: * Support for recent FSC chips on older kernels. The DMI-based device instantiation is more difficult to backport than the device support itself. * Case where the DMI-based device instantiation fails, whatever the reason. We fall back to probing in that case, so it should work. This fixes kernel bug #15634: https://bugzilla.kernel.org/show_bug.cgi?id=15634 Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Hans de Goede <hdegoede@redhat.com> Cc: stable@kernel.org
Diffstat (limited to 'drivers/i2c')
-rw-r--r--drivers/i2c/i2c-core.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c
index b9306b1a6baa..5105126225c3 100644
--- a/drivers/i2c/i2c-core.c
+++ b/drivers/i2c/i2c-core.c
@@ -1264,12 +1264,23 @@ static int i2c_detect_address(struct i2c_client *temp_client,
1264 return 0; 1264 return 0;
1265 1265
1266 /* Make sure there is something at this address */ 1266 /* Make sure there is something at this address */
1267 if (i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL) < 0) 1267 if (addr == 0x73 && (adapter->class & I2C_CLASS_HWMON)) {
1268 return 0; 1268 /* Special probe for FSC hwmon chips */
1269 union i2c_smbus_data dummy;
1269 1270
1270 /* Prevent 24RF08 corruption */ 1271 if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_READ, 0,
1271 if ((addr & ~0x0f) == 0x50) 1272 I2C_SMBUS_BYTE_DATA, &dummy) < 0)
1272 i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL); 1273 return 0;
1274 } else {
1275 if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0,
1276 I2C_SMBUS_QUICK, NULL) < 0)
1277 return 0;
1278
1279 /* Prevent 24RF08 corruption */
1280 if ((addr & ~0x0f) == 0x50)
1281 i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0,
1282 I2C_SMBUS_QUICK, NULL);
1283 }
1273 1284
1274 /* Finally call the custom detection function */ 1285 /* Finally call the custom detection function */
1275 memset(&info, 0, sizeof(struct i2c_board_info)); 1286 memset(&info, 0, sizeof(struct i2c_board_info));