aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-10-03 04:14:45 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:10 -0400
commit946c4eab86cc67dac6021b56f45495f59b3970b4 (patch)
tree854eeeb716f8985d4e423b12a2d3e9653502abdf /drivers
parente80987f8db7b9c33089bb395ed54cb96d55eae04 (diff)
[PATCH] savagefb: Use generic DDC reading
Update driver to use generic DDC reading [khali@linux-fr.org: fix oops in i2c handling] Signed-off-by: Antonino Daplas <adaplas@pol.net> Signed-off-by: Jean Delvare <khali@linux-fr.org> Cc: Jurriaan <thunder7@xs4all.nl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/Kconfig1
-rw-r--r--drivers/video/savage/savagefb-i2c.c49
2 files changed, 7 insertions, 43 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 90911005d9de..0e371e060871 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -1148,6 +1148,7 @@ config FB_SAVAGE
1148 depends on FB && PCI && EXPERIMENTAL 1148 depends on FB && PCI && EXPERIMENTAL
1149 select I2C_ALGOBIT if FB_SAVAGE_I2C 1149 select I2C_ALGOBIT if FB_SAVAGE_I2C
1150 select I2C if FB_SAVAGE_I2C 1150 select I2C if FB_SAVAGE_I2C
1151 select FB_DDC if FB_SAVAGE_I2C
1151 select FB_MODE_HELPERS 1152 select FB_MODE_HELPERS
1152 select FB_CFB_FILLRECT 1153 select FB_CFB_FILLRECT
1153 select FB_CFB_COPYAREA 1154 select FB_CFB_COPYAREA
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c
index d7d810dbf0bd..3f94223b7f0c 100644
--- a/drivers/video/savage/savagefb-i2c.c
+++ b/drivers/video/savage/savagefb-i2c.c
@@ -213,52 +213,15 @@ void savagefb_delete_i2c_busses(struct fb_info *info)
213 par->chan.par = NULL; 213 par->chan.par = NULL;
214} 214}
215 215
216static u8 *savage_do_probe_i2c_edid(struct savagefb_i2c_chan *chan)
217{
218 u8 start = 0x0;
219 struct i2c_msg msgs[] = {
220 {
221 .addr = SAVAGE_DDC,
222 .len = 1,
223 .buf = &start,
224 }, {
225 .addr = SAVAGE_DDC,
226 .flags = I2C_M_RD,
227 .len = EDID_LENGTH,
228 },
229 };
230 u8 *buf = NULL;
231
232 if (chan->par) {
233 buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
234
235 if (buf) {
236 msgs[1].buf = buf;
237
238 if (i2c_transfer(&chan->adapter, msgs, 2) != 2) {
239 dev_dbg(&chan->par->pcidev->dev,
240 "Unable to read EDID block.\n");
241 kfree(buf);
242 buf = NULL;
243 }
244 }
245 }
246
247 return buf;
248}
249
250int savagefb_probe_i2c_connector(struct fb_info *info, u8 **out_edid) 216int savagefb_probe_i2c_connector(struct fb_info *info, u8 **out_edid)
251{ 217{
252 struct savagefb_par *par = info->par; 218 struct savagefb_par *par = info->par;
253 u8 *edid = NULL; 219 u8 *edid;
254 int i; 220
255 221 if (par->chan.par)
256 for (i = 0; i < 3; i++) { 222 edid = fb_ddc_read(&par->chan.adapter);
257 /* Do the real work */ 223 else
258 edid = savage_do_probe_i2c_edid(&par->chan); 224 edid = NULL;
259 if (edid)
260 break;
261 }
262 225
263 if (!edid) { 226 if (!edid) {
264 /* try to get from firmware */ 227 /* try to get from firmware */