diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/chips/eeprom.c | 8 | ||||
-rw-r--r-- | drivers/i2c/chips/max6875.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index 6ea413f6d5e5..a2da31b0dd7b 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c | |||
@@ -163,6 +163,11 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) | |||
163 | struct eeprom_data *data; | 163 | struct eeprom_data *data; |
164 | int err = 0; | 164 | int err = 0; |
165 | 165 | ||
166 | /* prevent 24RF08 corruption */ | ||
167 | if (kind < 0) | ||
168 | i2c_smbus_xfer(adapter, address, 0, 0, 0, | ||
169 | I2C_SMBUS_QUICK, NULL); | ||
170 | |||
166 | /* There are three ways we can read the EEPROM data: | 171 | /* There are three ways we can read the EEPROM data: |
167 | (1) I2C block reads (faster, but unsupported by most adapters) | 172 | (1) I2C block reads (faster, but unsupported by most adapters) |
168 | (2) Consecutive byte reads (100% overhead) | 173 | (2) Consecutive byte reads (100% overhead) |
@@ -187,9 +192,6 @@ int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) | |||
187 | new_client->driver = &eeprom_driver; | 192 | new_client->driver = &eeprom_driver; |
188 | new_client->flags = 0; | 193 | new_client->flags = 0; |
189 | 194 | ||
190 | /* prevent 24RF08 corruption */ | ||
191 | i2c_smbus_write_quick(new_client, 0); | ||
192 | |||
193 | /* Fill in the remaining client fields */ | 195 | /* Fill in the remaining client fields */ |
194 | strlcpy(new_client->name, "eeprom", I2C_NAME_SIZE); | 196 | strlcpy(new_client->name, "eeprom", I2C_NAME_SIZE); |
195 | data->valid = 0; | 197 | data->valid = 0; |
diff --git a/drivers/i2c/chips/max6875.c b/drivers/i2c/chips/max6875.c index c4f14d9623c4..0230375f72e5 100644 --- a/drivers/i2c/chips/max6875.c +++ b/drivers/i2c/chips/max6875.c | |||
@@ -343,6 +343,11 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind) | |||
343 | struct max6875_data *data; | 343 | struct max6875_data *data; |
344 | int err = 0; | 344 | int err = 0; |
345 | 345 | ||
346 | /* Prevent 24RF08 corruption (in case of user error) */ | ||
347 | if (kind < 0) | ||
348 | i2c_smbus_xfer(adapter, address, 0, 0, 0, | ||
349 | I2C_SMBUS_QUICK, NULL); | ||
350 | |||
346 | /* There are three ways we can read the EEPROM data: | 351 | /* There are three ways we can read the EEPROM data: |
347 | (1) I2C block reads (faster, but unsupported by most adapters) | 352 | (1) I2C block reads (faster, but unsupported by most adapters) |
348 | (2) Consecutive byte reads (100% overhead) | 353 | (2) Consecutive byte reads (100% overhead) |
@@ -370,9 +375,6 @@ static int max6875_detect(struct i2c_adapter *adapter, int address, int kind) | |||
370 | new_client->driver = &max6875_driver; | 375 | new_client->driver = &max6875_driver; |
371 | new_client->flags = 0; | 376 | new_client->flags = 0; |
372 | 377 | ||
373 | /* Prevent 24RF08 corruption */ | ||
374 | i2c_smbus_write_quick(new_client, 0); | ||
375 | |||
376 | /* Setup the user section */ | 378 | /* Setup the user section */ |
377 | data->blocks[max6875_eeprom_user].type = max6875_eeprom_user; | 379 | data->blocks[max6875_eeprom_user].type = max6875_eeprom_user; |
378 | data->blocks[max6875_eeprom_user].slices = USER_EEPROM_SLICES; | 380 | data->blocks[max6875_eeprom_user].slices = USER_EEPROM_SLICES; |