diff options
Diffstat (limited to 'drivers/i2c')
| -rw-r--r-- | drivers/i2c/i2c-core.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 10be7b5fbe97..855911ebdb4d 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
| @@ -1210,12 +1210,23 @@ static int i2c_detect_address(struct i2c_client *temp_client, | |||
| 1210 | return 0; | 1210 | return 0; |
| 1211 | 1211 | ||
| 1212 | /* Make sure there is something at this address */ | 1212 | /* Make sure there is something at this address */ |
| 1213 | if (i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL) < 0) | 1213 | if (addr == 0x73 && (adapter->class & I2C_CLASS_HWMON)) { |
| 1214 | return 0; | 1214 | /* Special probe for FSC hwmon chips */ |
| 1215 | union i2c_smbus_data dummy; | ||
| 1215 | 1216 | ||
| 1216 | /* Prevent 24RF08 corruption */ | 1217 | if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_READ, 0, |
| 1217 | if ((addr & ~0x0f) == 0x50) | 1218 | I2C_SMBUS_BYTE_DATA, &dummy) < 0) |
| 1218 | i2c_smbus_xfer(adapter, addr, 0, 0, 0, I2C_SMBUS_QUICK, NULL); | 1219 | return 0; |
| 1220 | } else { | ||
| 1221 | if (i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0, | ||
| 1222 | I2C_SMBUS_QUICK, NULL) < 0) | ||
| 1223 | return 0; | ||
| 1224 | |||
| 1225 | /* Prevent 24RF08 corruption */ | ||
| 1226 | if ((addr & ~0x0f) == 0x50) | ||
| 1227 | i2c_smbus_xfer(adapter, addr, 0, I2C_SMBUS_WRITE, 0, | ||
| 1228 | I2C_SMBUS_QUICK, NULL); | ||
| 1229 | } | ||
| 1219 | 1230 | ||
| 1220 | /* Finally call the custom detection function */ | 1231 | /* Finally call the custom detection function */ |
| 1221 | memset(&info, 0, sizeof(struct i2c_board_info)); | 1232 | memset(&info, 0, sizeof(struct i2c_board_info)); |
