diff options
Diffstat (limited to 'drivers/parisc/superio.c')
-rw-r--r-- | drivers/parisc/superio.c | 35 |
1 files changed, 21 insertions, 14 deletions
diff --git a/drivers/parisc/superio.c b/drivers/parisc/superio.c index bab3bcabcb6e..d14888e149bb 100644 --- a/drivers/parisc/superio.c +++ b/drivers/parisc/superio.c | |||
@@ -24,6 +24,9 @@ | |||
24 | * Major changes to get basic interrupt infrastructure working to | 24 | * Major changes to get basic interrupt infrastructure working to |
25 | * hopefully be able to support all SuperIO devices. Currently | 25 | * hopefully be able to support all SuperIO devices. Currently |
26 | * works with serial. -- John Marvin <jsm@fc.hp.com> | 26 | * works with serial. -- John Marvin <jsm@fc.hp.com> |
27 | * | ||
28 | * Converted superio_init() to be a PCI_FIXUP_FINAL callee. | ||
29 | * -- Kyle McMartin <kyle@parisc-linux.org> | ||
27 | */ | 30 | */ |
28 | 31 | ||
29 | 32 | ||
@@ -141,10 +144,10 @@ superio_interrupt(int parent_irq, void *devp, struct pt_regs *regs) | |||
141 | } | 144 | } |
142 | 145 | ||
143 | /* Initialize Super I/O device */ | 146 | /* Initialize Super I/O device */ |
144 | 147 | static void | |
145 | static void __devinit | 148 | superio_init(struct pci_dev *pcidev) |
146 | superio_init(struct superio_device *sio) | ||
147 | { | 149 | { |
150 | struct superio_device *sio = &sio_dev; | ||
148 | struct pci_dev *pdev = sio->lio_pdev; | 151 | struct pci_dev *pdev = sio->lio_pdev; |
149 | u16 word; | 152 | u16 word; |
150 | 153 | ||
@@ -160,8 +163,8 @@ superio_init(struct superio_device *sio) | |||
160 | /* ...then properly fixup the USB to point at suckyio PIC */ | 163 | /* ...then properly fixup the USB to point at suckyio PIC */ |
161 | sio->usb_pdev->irq = superio_fixup_irq(sio->usb_pdev); | 164 | sio->usb_pdev->irq = superio_fixup_irq(sio->usb_pdev); |
162 | 165 | ||
163 | printk (KERN_INFO "SuperIO: Found NS87560 Legacy I/O device at %s (IRQ %i) \n", | 166 | printk(KERN_INFO "SuperIO: Found NS87560 Legacy I/O device at %s (IRQ %i) \n", |
164 | pci_name(pdev),pdev->irq); | 167 | pci_name(pdev), pdev->irq); |
165 | 168 | ||
166 | pci_read_config_dword (pdev, SIO_SP1BAR, &sio->sp1_base); | 169 | pci_read_config_dword (pdev, SIO_SP1BAR, &sio->sp1_base); |
167 | sio->sp1_base &= ~1; | 170 | sio->sp1_base &= ~1; |
@@ -274,7 +277,7 @@ superio_init(struct superio_device *sio) | |||
274 | 277 | ||
275 | sio->suckyio_irq_enabled = 1; | 278 | sio->suckyio_irq_enabled = 1; |
276 | } | 279 | } |
277 | 280 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO, superio_init); | |
278 | 281 | ||
279 | static void superio_disable_irq(unsigned int irq) | 282 | static void superio_disable_irq(unsigned int irq) |
280 | { | 283 | { |
@@ -452,8 +455,10 @@ static void superio_fixup_pci(struct pci_dev *pdev) | |||
452 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, superio_fixup_pci); | 455 | DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415, superio_fixup_pci); |
453 | 456 | ||
454 | 457 | ||
455 | static int __devinit superio_probe(struct pci_dev *dev, const struct pci_device_id *id) | 458 | static int __devinit |
459 | superio_probe(struct pci_dev *dev, const struct pci_device_id *id) | ||
456 | { | 460 | { |
461 | struct superio_device *sio = &sio_dev; | ||
457 | 462 | ||
458 | /* | 463 | /* |
459 | ** superio_probe(00:0e.0) ven 0x100b dev 0x2 sv 0x0 sd 0x0 class 0x1018a | 464 | ** superio_probe(00:0e.0) ven 0x100b dev 0x2 sv 0x0 sd 0x0 class 0x1018a |
@@ -466,7 +471,8 @@ static int __devinit superio_probe(struct pci_dev *dev, const struct pci_device_ | |||
466 | dev->subsystem_vendor, dev->subsystem_device, | 471 | dev->subsystem_vendor, dev->subsystem_device, |
467 | dev->class); | 472 | dev->class); |
468 | 473 | ||
469 | superio_init(&sio_dev); | 474 | if (!sio->suckyio_irq_enabled) |
475 | BUG(); /* Enabled by PCI_FIXUP_FINAL */ | ||
470 | 476 | ||
471 | if (dev->device == PCI_DEVICE_ID_NS_87560_LIO) { /* Function 1 */ | 477 | if (dev->device == PCI_DEVICE_ID_NS_87560_LIO) { /* Function 1 */ |
472 | superio_parport_init(); | 478 | superio_parport_init(); |
@@ -481,19 +487,21 @@ static int __devinit superio_probe(struct pci_dev *dev, const struct pci_device_ | |||
481 | DBG_INIT("superio_probe: WTF? Fire Extinguisher?\n"); | 487 | DBG_INIT("superio_probe: WTF? Fire Extinguisher?\n"); |
482 | } | 488 | } |
483 | 489 | ||
484 | /* Let appropriate other driver claim this device. */ | 490 | /* Let appropriate other driver claim this device. */ |
485 | return -ENODEV; | 491 | return -ENODEV; |
486 | } | 492 | } |
487 | 493 | ||
488 | static struct pci_device_id superio_tbl[] = { | 494 | static struct pci_device_id superio_tbl[] = { |
489 | { PCI_VENDOR_ID_NS, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, | 495 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_LIO) }, |
496 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87560_USB) }, | ||
497 | { PCI_DEVICE(PCI_VENDOR_ID_NS, PCI_DEVICE_ID_NS_87415) }, | ||
490 | { 0, } | 498 | { 0, } |
491 | }; | 499 | }; |
492 | 500 | ||
493 | static struct pci_driver superio_driver = { | 501 | static struct pci_driver superio_driver = { |
494 | .name = "SuperIO", | 502 | .name = "SuperIO", |
495 | .id_table = superio_tbl, | 503 | .id_table = superio_tbl, |
496 | .probe = superio_probe, | 504 | .probe = superio_probe, |
497 | }; | 505 | }; |
498 | 506 | ||
499 | static int __init superio_modinit(void) | 507 | static int __init superio_modinit(void) |
@@ -506,6 +514,5 @@ static void __exit superio_exit(void) | |||
506 | pci_unregister_driver(&superio_driver); | 514 | pci_unregister_driver(&superio_driver); |
507 | } | 515 | } |
508 | 516 | ||
509 | |||
510 | module_init(superio_modinit); | 517 | module_init(superio_modinit); |
511 | module_exit(superio_exit); | 518 | module_exit(superio_exit); |