diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-07-14 16:38:29 -0400 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 16:38:29 -0400 |
commit | d4653bf946a5856a17342cd47c47d10b16b1cc22 (patch) | |
tree | 5f794e0e821d08e7f7bff06399aac9212fc47c76 /drivers/i2c | |
parent | 3401b2fff38fbb8b73ea6bcc69a8370ae5d2a7a0 (diff) |
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/chips/eeprom.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/i2c/chips/eeprom.c b/drivers/i2c/chips/eeprom.c index 7dee001e5133..213a9f98decc 100644 --- a/drivers/i2c/chips/eeprom.c +++ b/drivers/i2c/chips/eeprom.c | |||
@@ -159,6 +159,8 @@ static struct bin_attribute eeprom_attr = { | |||
159 | 159 | ||
160 | static int eeprom_attach_adapter(struct i2c_adapter *adapter) | 160 | static int eeprom_attach_adapter(struct i2c_adapter *adapter) |
161 | { | 161 | { |
162 | if (!(adapter->class & (I2C_CLASS_DDC | I2C_CLASS_SPD))) | ||
163 | return 0; | ||
162 | return i2c_probe(adapter, &addr_data, eeprom_detect); | 164 | return i2c_probe(adapter, &addr_data, eeprom_detect); |
163 | } | 165 | } |
164 | 166 | ||
@@ -169,6 +171,12 @@ static int eeprom_detect(struct i2c_adapter *adapter, int address, int kind) | |||
169 | struct eeprom_data *data; | 171 | struct eeprom_data *data; |
170 | int err = 0; | 172 | int err = 0; |
171 | 173 | ||
174 | /* EDID EEPROMs are often 24C00 EEPROMs, which answer to all | ||
175 | addresses 0x50-0x57, but we only care about 0x50. So decline | ||
176 | attaching to addresses >= 0x51 on DDC buses */ | ||
177 | if (!(adapter->class & I2C_CLASS_SPD) && address >= 0x51) | ||
178 | goto exit; | ||
179 | |||
172 | /* There are three ways we can read the EEPROM data: | 180 | /* There are three ways we can read the EEPROM data: |
173 | (1) I2C block reads (faster, but unsupported by most adapters) | 181 | (1) I2C block reads (faster, but unsupported by most adapters) |
174 | (2) Consecutive byte reads (100% overhead) | 182 | (2) Consecutive byte reads (100% overhead) |