diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-07-14 16:38:28 -0400 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 16:38:28 -0400 |
commit | c1b6b4f2342d073698dfc2547240c35045a1d00e (patch) | |
tree | 2aa5024a099e1c4d5a5b4bc0ce5f832d80d6a15e /drivers/video/matrox | |
parent | 0d2b405a628309310b4fc02b26d713b855ad5f68 (diff) |
i2c: Let framebuffer drivers set their I2C bus class to DDC
Let framebuffer drivers set their I2C bus class to DDC. Once this is
done, we will be able to tell the eeprom driver to only probe for
EDID EEPROMs on these buses.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/video/matrox')
-rw-r--r-- | drivers/video/matrox/i2c-matroxfb.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/drivers/video/matrox/i2c-matroxfb.c b/drivers/video/matrox/i2c-matroxfb.c index 4baab7be58de..75ee5a12e549 100644 --- a/drivers/video/matrox/i2c-matroxfb.c +++ b/drivers/video/matrox/i2c-matroxfb.c | |||
@@ -104,7 +104,9 @@ static struct i2c_algo_bit_data matrox_i2c_algo_template = | |||
104 | }; | 104 | }; |
105 | 105 | ||
106 | static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo, | 106 | static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo, |
107 | unsigned int data, unsigned int clock, const char* name) { | 107 | unsigned int data, unsigned int clock, const char *name, |
108 | int class) | ||
109 | { | ||
108 | int err; | 110 | int err; |
109 | 111 | ||
110 | b->minfo = minfo; | 112 | b->minfo = minfo; |
@@ -114,6 +116,7 @@ static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo, | |||
114 | snprintf(b->adapter.name, sizeof(b->adapter.name), name, | 116 | snprintf(b->adapter.name, sizeof(b->adapter.name), name, |
115 | minfo->fbcon.node); | 117 | minfo->fbcon.node); |
116 | i2c_set_adapdata(&b->adapter, b); | 118 | i2c_set_adapdata(&b->adapter, b); |
119 | b->adapter.class = class; | ||
117 | b->adapter.algo_data = &b->bac; | 120 | b->adapter.algo_data = &b->bac; |
118 | b->adapter.dev.parent = &ACCESS_FBINFO(pcidev)->dev; | 121 | b->adapter.dev.parent = &ACCESS_FBINFO(pcidev)->dev; |
119 | b->bac = matrox_i2c_algo_template; | 122 | b->bac = matrox_i2c_algo_template; |
@@ -159,22 +162,29 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) { | |||
159 | switch (ACCESS_FBINFO(chip)) { | 162 | switch (ACCESS_FBINFO(chip)) { |
160 | case MGA_2064: | 163 | case MGA_2064: |
161 | case MGA_2164: | 164 | case MGA_2164: |
162 | err = i2c_bus_reg(&m2info->ddc1, minfo, DDC1B_DATA, DDC1B_CLK, "DDC:fb%u #0"); | 165 | err = i2c_bus_reg(&m2info->ddc1, minfo, |
166 | DDC1B_DATA, DDC1B_CLK, | ||
167 | "DDC:fb%u #0", I2C_CLASS_DDC); | ||
163 | break; | 168 | break; |
164 | default: | 169 | default: |
165 | err = i2c_bus_reg(&m2info->ddc1, minfo, DDC1_DATA, DDC1_CLK, "DDC:fb%u #0"); | 170 | err = i2c_bus_reg(&m2info->ddc1, minfo, |
171 | DDC1_DATA, DDC1_CLK, | ||
172 | "DDC:fb%u #0", I2C_CLASS_DDC); | ||
166 | break; | 173 | break; |
167 | } | 174 | } |
168 | if (err) | 175 | if (err) |
169 | goto fail_ddc1; | 176 | goto fail_ddc1; |
170 | if (ACCESS_FBINFO(devflags.dualhead)) { | 177 | if (ACCESS_FBINFO(devflags.dualhead)) { |
171 | err = i2c_bus_reg(&m2info->ddc2, minfo, DDC2_DATA, DDC2_CLK, "DDC:fb%u #1"); | 178 | err = i2c_bus_reg(&m2info->ddc2, minfo, |
179 | DDC2_DATA, DDC2_CLK, | ||
180 | "DDC:fb%u #1", I2C_CLASS_DDC); | ||
172 | if (err == -ENODEV) { | 181 | if (err == -ENODEV) { |
173 | printk(KERN_INFO "i2c-matroxfb: VGA->TV plug detected, DDC unavailable.\n"); | 182 | printk(KERN_INFO "i2c-matroxfb: VGA->TV plug detected, DDC unavailable.\n"); |
174 | } else if (err) | 183 | } else if (err) |
175 | printk(KERN_INFO "i2c-matroxfb: Could not register secondary output i2c bus. Continuing anyway.\n"); | 184 | printk(KERN_INFO "i2c-matroxfb: Could not register secondary output i2c bus. Continuing anyway.\n"); |
176 | /* Register maven bus even on G450/G550 */ | 185 | /* Register maven bus even on G450/G550 */ |
177 | err = i2c_bus_reg(&m2info->maven, minfo, MAT_DATA, MAT_CLK, "MAVEN:fb%u"); | 186 | err = i2c_bus_reg(&m2info->maven, minfo, |
187 | MAT_DATA, MAT_CLK, "MAVEN:fb%u", 0); | ||
178 | if (err) | 188 | if (err) |
179 | printk(KERN_INFO "i2c-matroxfb: Could not register Maven i2c bus. Continuing anyway.\n"); | 189 | printk(KERN_INFO "i2c-matroxfb: Could not register Maven i2c bus. Continuing anyway.\n"); |
180 | } | 190 | } |