aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/i810
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/i810')
-rw-r--r--drivers/video/i810/i810-i2c.c42
1 files changed, 1 insertions, 41 deletions
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