aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/nvidia
diff options
context:
space:
mode:
authorAntonino A. Daplas <adaplas@gmail.com>2007-05-08 03:37:27 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-08 14:15:26 -0400
commit66fd14120edea89d353fac0649e9ec0045ec958f (patch)
tree193693e3081e0f43783a190dfaa51fb8561a7511 /drivers/video/nvidia
parent71c6efd9930bd87249d007120425341d1293303d (diff)
nvidiafb: bring back generic ddc reading
Make nvidiafb use fb_ddc_read(). This patch was submitted before but was reverted due to problems in a non-x86 platform. This includes a fix for that where ddc reading is bypassed if there is no DDC bus (duh). Signed-off-by: Antonino Daplas <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video/nvidia')
-rw-r--r--drivers/video/nvidia/nv_i2c.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c
index b8588973e400..b91d4045431d 100644
--- a/drivers/video/nvidia/nv_i2c.c
+++ b/drivers/video/nvidia/nv_i2c.c
@@ -70,8 +70,6 @@ static int nvidia_gpio_getscl(void *data)
70 if (VGA_RD08(par->PCIO, 0x3d5) & 0x04) 70 if (VGA_RD08(par->PCIO, 0x3d5) & 0x04)
71 val = 1; 71 val = 1;
72 72
73 val = VGA_RD08(par->PCIO, 0x3d5);
74
75 return val; 73 return val;
76} 74}
77 75
@@ -159,51 +157,13 @@ void nvidia_delete_i2c_busses(struct nvidia_par *par)
159 157
160} 158}
161 159
162static u8 *nvidia_do_probe_i2c_edid(struct nvidia_i2c_chan *chan)
163{
164 u8 start = 0x0;
165 struct i2c_msg msgs[] = {
166 {
167 .addr = 0x50,
168 .len = 1,
169 .buf = &start,
170 }, {
171 .addr = 0x50,
172 .flags = I2C_M_RD,
173 .len = EDID_LENGTH,
174 },
175 };
176 u8 *buf;
177
178 if (!chan->par)
179 return NULL;
180
181 buf = kmalloc(EDID_LENGTH, GFP_KERNEL);
182 if (!buf) {
183 dev_warn(&chan->par->pci_dev->dev, "Out of memory!\n");
184 return NULL;
185 }
186 msgs[1].buf = buf;
187
188 if (i2c_transfer(&chan->adapter, msgs, 2) == 2)
189 return buf;
190 dev_dbg(&chan->par->pci_dev->dev, "Unable to read EDID block.\n");
191 kfree(buf);
192 return NULL;
193}
194
195int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) 160int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid)
196{ 161{
197 struct nvidia_par *par = info->par; 162 struct nvidia_par *par = info->par;
198 u8 *edid = NULL; 163 u8 *edid = NULL;
199 int i;
200 164
201 for (i = 0; i < 3; i++) { 165 if (par->chan[conn - 1].par)
202 /* Do the real work */ 166 edid = fb_ddc_read(&par->chan[conn - 1].adapter);
203 edid = nvidia_do_probe_i2c_edid(&par->chan[conn - 1]);
204 if (edid)
205 break;
206 }
207 167
208 if (!edid && conn == 1) { 168 if (!edid && conn == 1) {
209 /* try to get from firmware */ 169 /* try to get from firmware */