i2c/eeprom: Only probe buses with DDC or SPD class
The eeprom driver shouldn't probe i2c buses which don't want to be probed. Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
committed by
Jean Delvare
parent
3401b2fff3
commit
d4653bf946
@@ -159,6 +159,8 @@ static struct bin_attribute eeprom_attr = {
|
|||||||
|
|
||||||
static int eeprom_attach_adapter(struct i2c_adapter *adapter)
|
static int eeprom_attach_adapter(struct i2c_adapter *adapter)
|
||||||
{
|
{
|
||||||
|
if (!(adapter->class & (I2C_CLASS_DDC | I2C_CLASS_SPD)))
|
||||||
|
return 0;
|
||||||
return i2c_probe(adapter, &addr_data, eeprom_detect);
|
return i2c_probe(adapter, &addr_data, eeprom_detect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,6 +171,12 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind)
|
|||||||
struct eeprom_data *data;
|
struct eeprom_data *data;
|
||||||
int err = 0;
|
int err = 0;
|
||||||
|
|
||||||
|
/* EDID EEPROMs are often 24C00 EEPROMs, which answer to all
|
||||||
|
addresses 0x50-0x57, but we only care about 0x50. So decline
|
||||||
|
attaching to addresses >= 0x51 on DDC buses */
|
||||||
|
if (!(adapter->class & I2C_CLASS_SPD) && address >= 0x51)
|
||||||
|
goto exit;
|
||||||
|
|
||||||
/* There are three ways we can read the EEPROM data:
|
/* There are three ways we can read the EEPROM data:
|
||||||
(1) I2C block reads (faster, but unsupported by most adapters)
|
(1) I2C block reads (faster, but unsupported by most adapters)
|
||||||
(2) Consecutive byte reads (100% overhead)
|
(2) Consecutive byte reads (100% overhead)
|
||||||
|
Reference in New Issue
Block a user