diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/nvidia/nv_i2c.c | 44 |
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 | ||
162 | static 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 | |||
195 | int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) | 160 | int 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 */ |