aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/agp/sis-agp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/agp/sis-agp.c')
-rw-r--r--drivers/char/agp/sis-agp.c278
1 files changed, 167 insertions, 111 deletions
diff --git a/drivers/char/agp/sis-agp.c b/drivers/char/agp/sis-agp.c
index 125f4282d95..eb1a1c73819 100644
--- a/drivers/char/agp/sis-agp.c
+++ b/drivers/char/agp/sis-agp.c
@@ -143,96 +143,6 @@ static struct agp_bridge_driver sis_driver = {
143 .agp_type_to_mask_type = agp_generic_type_to_mask_type, 143 .agp_type_to_mask_type = agp_generic_type_to_mask_type,
144}; 144};
145 145
146static struct agp_device_ids sis_agp_device_ids[] __devinitdata =
147{
148 {
149 .device_id = PCI_DEVICE_ID_SI_5591_AGP,
150 .chipset_name = "5591",
151 },
152 {
153 .device_id = PCI_DEVICE_ID_SI_530,
154 .chipset_name = "530",
155 },
156 {
157 .device_id = PCI_DEVICE_ID_SI_540,
158 .chipset_name = "540",
159 },
160 {
161 .device_id = PCI_DEVICE_ID_SI_550,
162 .chipset_name = "550",
163 },
164 {
165 .device_id = PCI_DEVICE_ID_SI_620,
166 .chipset_name = "620",
167 },
168 {
169 .device_id = PCI_DEVICE_ID_SI_630,
170 .chipset_name = "630",
171 },
172 {
173 .device_id = PCI_DEVICE_ID_SI_635,
174 .chipset_name = "635",
175 },
176 {
177 .device_id = PCI_DEVICE_ID_SI_645,
178 .chipset_name = "645",
179 },
180 {
181 .device_id = PCI_DEVICE_ID_SI_646,
182 .chipset_name = "646",
183 },
184 {
185 .device_id = PCI_DEVICE_ID_SI_648,
186 .chipset_name = "648",
187 },
188 {
189 .device_id = PCI_DEVICE_ID_SI_650,
190 .chipset_name = "650",
191 },
192 {
193 .device_id = PCI_DEVICE_ID_SI_651,
194 .chipset_name = "651",
195 },
196 {
197 .device_id = PCI_DEVICE_ID_SI_655,
198 .chipset_name = "655",
199 },
200 {
201 .device_id = PCI_DEVICE_ID_SI_661,
202 .chipset_name = "661",
203 },
204 {
205 .device_id = PCI_DEVICE_ID_SI_730,
206 .chipset_name = "730",
207 },
208 {
209 .device_id = PCI_DEVICE_ID_SI_735,
210 .chipset_name = "735",
211 },
212 {
213 .device_id = PCI_DEVICE_ID_SI_740,
214 .chipset_name = "740",
215 },
216 {
217 .device_id = PCI_DEVICE_ID_SI_741,
218 .chipset_name = "741",
219 },
220 {
221 .device_id = PCI_DEVICE_ID_SI_745,
222 .chipset_name = "745",
223 },
224 {
225 .device_id = PCI_DEVICE_ID_SI_746,
226 .chipset_name = "746",
227 },
228 {
229 .device_id = PCI_DEVICE_ID_SI_760,
230 .chipset_name = "760",
231 },
232 { }, /* dummy final entry, always present */
233};
234
235
236// chipsets that require the 'delay hack' 146// chipsets that require the 'delay hack'
237static int sis_broken_chipsets[] __devinitdata = { 147static int sis_broken_chipsets[] __devinitdata = {
238 PCI_DEVICE_ID_SI_648, 148 PCI_DEVICE_ID_SI_648,
@@ -269,29 +179,15 @@ static void __devinit sis_get_driver(struct agp_bridge_data *bridge)
269static int __devinit agp_sis_probe(struct pci_dev *pdev, 179static int __devinit agp_sis_probe(struct pci_dev *pdev,
270 const struct pci_device_id *ent) 180 const struct pci_device_id *ent)
271{ 181{
272 struct agp_device_ids *devs = sis_agp_device_ids;
273 struct agp_bridge_data *bridge; 182 struct agp_bridge_data *bridge;
274 u8 cap_ptr; 183 u8 cap_ptr;
275 int j;
276 184
277 cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP); 185 cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
278 if (!cap_ptr) 186 if (!cap_ptr)
279 return -ENODEV; 187 return -ENODEV;
280 188
281 /* probe for known chipsets */
282 for (j = 0; devs[j].chipset_name; j++) {
283 if (pdev->device == devs[j].device_id) {
284 printk(KERN_INFO PFX "Detected SiS %s chipset\n",
285 devs[j].chipset_name);
286 goto found;
287 }
288 }
289
290 printk(KERN_ERR PFX "Unsupported SiS chipset (device id: %04x)\n",
291 pdev->device);
292 return -ENODEV;
293 189
294found: 190 printk(KERN_INFO PFX "Detected SiS chipset - id:%i\n", pdev->device);
295 bridge = agp_alloc_bridge(); 191 bridge = agp_alloc_bridge();
296 if (!bridge) 192 if (!bridge)
297 return -ENOMEM; 193 return -ENOMEM;
@@ -320,12 +216,172 @@ static void __devexit agp_sis_remove(struct pci_dev *pdev)
320 216
321static struct pci_device_id agp_sis_pci_table[] = { 217static struct pci_device_id agp_sis_pci_table[] = {
322 { 218 {
323 .class = (PCI_CLASS_BRIDGE_HOST << 8), 219 .class = (PCI_CLASS_BRIDGE_HOST << 8),
324 .class_mask = ~0, 220 .class_mask = ~0,
325 .vendor = PCI_VENDOR_ID_SI, 221 .vendor = PCI_VENDOR_ID_SI,
326 .device = PCI_ANY_ID, 222 .device = PCI_DEVICE_ID_SI_5591_AGP,
327 .subvendor = PCI_ANY_ID, 223 .subvendor = PCI_ANY_ID,
328 .subdevice = PCI_ANY_ID, 224 .subdevice = PCI_ANY_ID,
225 },
226 {
227 .class = (PCI_CLASS_BRIDGE_HOST << 8),
228 .class_mask = ~0,
229 .vendor = PCI_VENDOR_ID_SI,
230 .device = PCI_DEVICE_ID_SI_530,
231 .subvendor = PCI_ANY_ID,
232 .subdevice = PCI_ANY_ID,
233 },
234 {
235 .class = (PCI_CLASS_BRIDGE_HOST << 8),
236 .class_mask = ~0,
237 .vendor = PCI_VENDOR_ID_SI,
238 .device = PCI_DEVICE_ID_SI_540,
239 .subvendor = PCI_ANY_ID,
240 .subdevice = PCI_ANY_ID,
241 },
242 {
243 .class = (PCI_CLASS_BRIDGE_HOST << 8),
244 .class_mask = ~0,
245 .vendor = PCI_VENDOR_ID_SI,
246 .device = PCI_DEVICE_ID_SI_550,
247 .subvendor = PCI_ANY_ID,
248 .subdevice = PCI_ANY_ID,
249 },
250 {
251 .class = (PCI_CLASS_BRIDGE_HOST << 8),
252 .class_mask = ~0,
253 .vendor = PCI_VENDOR_ID_SI,
254 .device = PCI_DEVICE_ID_SI_620,
255 .subvendor = PCI_ANY_ID,
256 .subdevice = PCI_ANY_ID,
257 },
258 {
259 .class = (PCI_CLASS_BRIDGE_HOST << 8),
260 .class_mask = ~0,
261 .vendor = PCI_VENDOR_ID_SI,
262 .device = PCI_DEVICE_ID_SI_630,
263 .subvendor = PCI_ANY_ID,
264 .subdevice = PCI_ANY_ID,
265 },
266 {
267 .class = (PCI_CLASS_BRIDGE_HOST << 8),
268 .class_mask = ~0,
269 .vendor = PCI_VENDOR_ID_SI,
270 .device = PCI_DEVICE_ID_SI_635,
271 .subvendor = PCI_ANY_ID,
272 .subdevice = PCI_ANY_ID,
273 },
274 {
275 .class = (PCI_CLASS_BRIDGE_HOST << 8),
276 .class_mask = ~0,
277 .vendor = PCI_VENDOR_ID_SI,
278 .device = PCI_DEVICE_ID_SI_645,
279 .subvendor = PCI_ANY_ID,
280 .subdevice = PCI_ANY_ID,
281 },
282 {
283 .class = (PCI_CLASS_BRIDGE_HOST << 8),
284 .class_mask = ~0,
285 .vendor = PCI_VENDOR_ID_SI,
286 .device = PCI_DEVICE_ID_SI_646,
287 .subvendor = PCI_ANY_ID,
288 .subdevice = PCI_ANY_ID,
289 },
290 {
291 .class = (PCI_CLASS_BRIDGE_HOST << 8),
292 .class_mask = ~0,
293 .vendor = PCI_VENDOR_ID_SI,
294 .device = PCI_DEVICE_ID_SI_648,
295 .subvendor = PCI_ANY_ID,
296 .subdevice = PCI_ANY_ID,
297 },
298 {
299 .class = (PCI_CLASS_BRIDGE_HOST << 8),
300 .class_mask = ~0,
301 .vendor = PCI_VENDOR_ID_SI,
302 .device = PCI_DEVICE_ID_SI_650,
303 .subvendor = PCI_ANY_ID,
304 .subdevice = PCI_ANY_ID,
305 },
306 {
307 .class = (PCI_CLASS_BRIDGE_HOST << 8),
308 .class_mask = ~0,
309 .vendor = PCI_VENDOR_ID_SI,
310 .device = PCI_DEVICE_ID_SI_651,
311 .subvendor = PCI_ANY_ID,
312 .subdevice = PCI_ANY_ID,
313 },
314 {
315 .class = (PCI_CLASS_BRIDGE_HOST << 8),
316 .class_mask = ~0,
317 .vendor = PCI_VENDOR_ID_SI,
318 .device = PCI_DEVICE_ID_SI_655,
319 .subvendor = PCI_ANY_ID,
320 .subdevice = PCI_ANY_ID,
321 },
322 {
323 .class = (PCI_CLASS_BRIDGE_HOST << 8),
324 .class_mask = ~0,
325 .vendor = PCI_VENDOR_ID_SI,
326 .device = PCI_DEVICE_ID_SI_661,
327 .subvendor = PCI_ANY_ID,
328 .subdevice = PCI_ANY_ID,
329 },
330 {
331 .class = (PCI_CLASS_BRIDGE_HOST << 8),
332 .class_mask = ~0,
333 .vendor = PCI_VENDOR_ID_SI,
334 .device = PCI_DEVICE_ID_SI_730,
335 .subvendor = PCI_ANY_ID,
336 .subdevice = PCI_ANY_ID,
337 },
338 {
339 .class = (PCI_CLASS_BRIDGE_HOST << 8),
340 .class_mask = ~0,
341 .vendor = PCI_VENDOR_ID_SI,
342 .device = PCI_DEVICE_ID_SI_735,
343 .subvendor = PCI_ANY_ID,
344 .subdevice = PCI_ANY_ID,
345 },
346 {
347 .class = (PCI_CLASS_BRIDGE_HOST << 8),
348 .class_mask = ~0,
349 .vendor = PCI_VENDOR_ID_SI,
350 .device = PCI_DEVICE_ID_SI_740,
351 .subvendor = PCI_ANY_ID,
352 .subdevice = PCI_ANY_ID,
353 },
354 {
355 .class = (PCI_CLASS_BRIDGE_HOST << 8),
356 .class_mask = ~0,
357 .vendor = PCI_VENDOR_ID_SI,
358 .device = PCI_DEVICE_ID_SI_741,
359 .subvendor = PCI_ANY_ID,
360 .subdevice = PCI_ANY_ID,
361 },
362 {
363 .class = (PCI_CLASS_BRIDGE_HOST << 8),
364 .class_mask = ~0,
365 .vendor = PCI_VENDOR_ID_SI,
366 .device = PCI_DEVICE_ID_SI_745,
367 .subvendor = PCI_ANY_ID,
368 .subdevice = PCI_ANY_ID,
369 },
370 {
371 .class = (PCI_CLASS_BRIDGE_HOST << 8),
372 .class_mask = ~0,
373 .vendor = PCI_VENDOR_ID_SI,
374 .device = PCI_DEVICE_ID_SI_746,
375 .subvendor = PCI_ANY_ID,
376 .subdevice = PCI_ANY_ID,
377 },
378 {
379 .class = (PCI_CLASS_BRIDGE_HOST << 8),
380 .class_mask = ~0,
381 .vendor = PCI_VENDOR_ID_SI,
382 .device = PCI_DEVICE_ID_SI_760,
383 .subvendor = PCI_ANY_ID,
384 .subdevice = PCI_ANY_ID,
329 }, 385 },
330 { } 386 { }
331}; 387};