aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-10-03 04:14:44 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:09 -0400
commite80987f8db7b9c33089bb395ed54cb96d55eae04 (patch)
treea443b3f990396ef1da3d17e7b081226cd82cb298 /drivers
parentbf5df0a2c54c2dc0fad619ac25d029119023610a (diff)
[PATCH] i810fb: Use generic DDC reading
Update driver to use generic DDC reading Signed-off-by: Antonino Daplas <adaplas@pol.net> 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/i810/i810-i2c.c42
2 files changed, 2 insertions, 41 deletions
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
index 6bf3e4169c1e..90911005d9de 100644
--- a/drivers/video/Kconfig
+++ b/drivers/video/Kconfig
@@ -829,6 +829,7 @@ config FB_I810_I2C
829 depends on FB_I810 && FB_I810_GTF 829 depends on FB_I810 && FB_I810_GTF
830 select I2C 830 select I2C
831 select I2C_ALGOBIT 831 select I2C_ALGOBIT
832 select FB_DDC
832 help 833 help
833 834
834config FB_INTEL 835config FB_INTEL
diff --git a/drivers/video/i810/i810-i2c.c b/drivers/video/i810/i810-i2c.c
index 7d06b38e80a0..b38d805db313 100644
--- a/drivers/video/i810/i810-i2c.c
+++ b/drivers/video/i810/i810-i2c.c
@@ -19,7 +19,6 @@
19#include "i810_main.h" 19#include "i810_main.h"
20#include "../edid.h" 20#include "../edid.h"
21 21
22#define I810_DDC 0x50
23/* bit locations in the registers */ 22/* bit locations in the registers */
24#define SCL_DIR_MASK 0x0001 23#define SCL_DIR_MASK 0x0001
25#define SCL_DIR 0x0002 24#define SCL_DIR 0x0002
@@ -150,53 +149,14 @@ void i810_delete_i2c_busses(struct i810fb_par *par)
150 par->chan[2].par = NULL; 149 par->chan[2].par = NULL;
151} 150}
152 151
153static u8 *i810_do_probe_i2c_edid(struct i810fb_i2c_chan *chan)
154{
155 u8 start = 0x0;
156 struct i2c_msg msgs[] = {
157 {
158 .addr = I810_DDC,
159 .len = 1,
160 .buf = &start,
161 }, {
162 .addr = I810_DDC,
163 .flags = I2C_M_RD,
164 .len = EDID_LENGTH,
165 },
166 };
167 u8 *buf;
168
169 buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
170 if (!buf) {
171 DPRINTK("i810-i2c: Failed to allocate memory\n");
172 return NULL;
173 }
174 msgs[1].buf = buf;
175
176 if (i2c_transfer(&chan->adapter, msgs, 2) == 2) {
177 DPRINTK("i810-i2c: I2C Transfer successful\n");
178 return buf;
179 }
180
181 DPRINTK("i810-i2c: Unable to read EDID block.\n");
182 kfree(buf);
183 return NULL;
184}
185
186int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid, int conn) 152int i810_probe_i2c_connector(struct fb_info *info, u8 **out_edid, int conn)
187{ 153{
188 struct i810fb_par *par = info->par; 154 struct i810fb_par *par = info->par;
189 u8 *edid = NULL; 155 u8 *edid = NULL;
190 int i;
191 156
192 DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn+1); 157 DPRINTK("i810-i2c: Probe DDC%i Bus\n", conn+1);
193 if (conn < par->ddc_num) { 158 if (conn < par->ddc_num) {
194 for (i = 0; i < 3; i++) { 159 edid = fb_ddc_read(&par->chan[conn].adapter);
195 /* Do the real work */
196 edid = i810_do_probe_i2c_edid(&par->chan[conn]);
197 if (edid)
198 break;
199 }
200 } else { 160 } else {
201 const u8 *e = fb_firmware_edid(info->device); 161 const u8 *e = fb_firmware_edid(info->device);
202 162