aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/nvidia/nv_i2c.c
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2006-10-03 04:14:43 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-03 11:04:09 -0400
commit346bc21026e7a92e1d7a4a1b3792c5e8b686133d (patch)
treebdd98de61d59b31a4d5a2a37353ea2090f617839 /drivers/video/nvidia/nv_i2c.c
parentfc5891c8a3ba284f13994d7bc1f1bfa8283982de (diff)
[PATCH] nvidiafb: 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/video/nvidia/nv_i2c.c')
-rw-r--r--drivers/video/nvidia/nv_i2c.c45
1 files changed, 3 insertions, 42 deletions
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
index 19eef3a0902..e48de3c9fd1 100644
--- a/drivers/video/nvidia/nv_i2c.c
+++ b/drivers/video/nvidia/nv_i2c.c
@@ -160,51 +160,12 @@ void nvidia_delete_i2c_busses(struct nvidia_par *par)
160 160
161} 161}
162 162
163static u8 *nvidia_do_probe_i2c_edid(struct nvidia_i2c_chan *chan)
164{
165 u8 start = 0x0;
166 struct i2c_msg msgs[] = {
167 {
168 .addr = 0x50,
169 .len = 1,
170 .buf = &start,
171 }, {
172 .addr = 0x50,
173 .flags = I2C_M_RD,
174 .len = EDID_LENGTH,
175 },
176 };
177 u8 *buf;
178
179 if (!chan->par)
180 return NULL;
181
182 buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
183 if (!buf) {
184 dev_warn(&chan->par->pci_dev->dev, "Out of memory!\n");
185 return NULL;
186 }
187 msgs[1].buf = buf;
188
189 if (i2c_transfer(&chan->adapter, msgs, 2) == 2)
190 return buf;
191 dev_dbg(&chan->par->pci_dev->dev, "Unable to read EDID block.\n");
192 kfree(buf);
193 return NULL;
194}
195
196int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) 163int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid)
197{ 164{
198 struct nvidia_par *par = info->par; 165 struct nvidia_par *par = info->par;
199 u8 *edid = NULL; 166 u8 *edid;
200 int i; 167
201 168 edid = fb_ddc_read(&par->chan[conn - 1].adapter);
202 for (i = 0; i < 3; i++) {
203 /* Do the real work */
204 edid = nvidia_do_probe_i2c_edid(&par->chan[conn - 1]);
205 if (edid)
206 break;
207 }
208 169
209 if (!edid && conn == 1) { 170 if (!edid && conn == 1) {
210 /* try to get from firmware */ 171 /* try to get from firmware */