diff options
author | Petr Cvek <petr.cvek@tul.cz> | 2008-02-06 04:37:48 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-06 13:41:08 -0500 |
commit | f63fd7e299ee13da071ecfce2b90b58c5e1562b1 (patch) | |
tree | d62d0462c4ff6e6008c39b49e3de8498c69b7dbe /drivers/parport | |
parent | a9000d037d7dd08ac46168560b3a3d3bb743bfa6 (diff) |
parport_pc: detection for SuperIO IT87XX POST
Add detection for IT87XX SuperIO chip and disabling its POST feature, which
made noise on parallel port's pins.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/parport')
-rw-r--r-- | drivers/parport/parport_pc.c | 45 |
1 files changed, 39 insertions, 6 deletions
diff --git a/drivers/parport/parport_pc.c b/drivers/parport/parport_pc.c index db26b4017bc1..238628d3a854 100644 --- a/drivers/parport/parport_pc.c +++ b/drivers/parport/parport_pc.c | |||
@@ -1540,6 +1540,38 @@ static void __devinit detect_and_report_smsc (void) | |||
1540 | smsc_check(0x3f0,0x44); | 1540 | smsc_check(0x3f0,0x44); |
1541 | smsc_check(0x370,0x44); | 1541 | smsc_check(0x370,0x44); |
1542 | } | 1542 | } |
1543 | |||
1544 | static void __devinit detect_and_report_it87(void) | ||
1545 | { | ||
1546 | u16 dev; | ||
1547 | u8 r; | ||
1548 | if (verbose_probing) | ||
1549 | printk(KERN_DEBUG "IT8705 Super-IO detection, now testing port 2E ...\n"); | ||
1550 | if (!request_region(0x2e, 1, __FUNCTION__)) | ||
1551 | return; | ||
1552 | outb(0x87, 0x2e); | ||
1553 | outb(0x01, 0x2e); | ||
1554 | outb(0x55, 0x2e); | ||
1555 | outb(0x55, 0x2e); | ||
1556 | outb(0x20, 0x2e); | ||
1557 | dev = inb(0x2f) << 8; | ||
1558 | outb(0x21, 0x2e); | ||
1559 | dev |= inb(0x2f); | ||
1560 | if (dev == 0x8712 || dev == 0x8705 || dev == 0x8715 || | ||
1561 | dev == 0x8716 || dev == 0x8718 || dev == 0x8726) { | ||
1562 | printk(KERN_INFO "IT%04X SuperIO detected.\n", dev); | ||
1563 | outb(0x07, 0x2E); /* Parallel Port */ | ||
1564 | outb(0x03, 0x2F); | ||
1565 | outb(0xF0, 0x2E); /* BOOT 0x80 off */ | ||
1566 | r = inb(0x2f); | ||
1567 | outb(0xF0, 0x2E); | ||
1568 | outb(r | 8, 0x2F); | ||
1569 | outb(0x02, 0x2E); /* Lock */ | ||
1570 | outb(0x02, 0x2F); | ||
1571 | |||
1572 | release_region(0x2e, 1); | ||
1573 | } | ||
1574 | } | ||
1543 | #endif /* CONFIG_PARPORT_PC_SUPERIO */ | 1575 | #endif /* CONFIG_PARPORT_PC_SUPERIO */ |
1544 | 1576 | ||
1545 | static int get_superio_dma (struct parport *p) | 1577 | static int get_superio_dma (struct parport *p) |
@@ -3164,24 +3196,25 @@ static void __init parport_pc_find_ports (int autoirq, int autodma) | |||
3164 | int count = 0, err; | 3196 | int count = 0, err; |
3165 | 3197 | ||
3166 | #ifdef CONFIG_PARPORT_PC_SUPERIO | 3198 | #ifdef CONFIG_PARPORT_PC_SUPERIO |
3167 | detect_and_report_winbond (); | 3199 | detect_and_report_it87(); |
3168 | detect_and_report_smsc (); | 3200 | detect_and_report_winbond(); |
3201 | detect_and_report_smsc(); | ||
3169 | #endif | 3202 | #endif |
3170 | 3203 | ||
3171 | /* Onboard SuperIO chipsets that show themselves on the PCI bus. */ | 3204 | /* Onboard SuperIO chipsets that show themselves on the PCI bus. */ |
3172 | count += parport_pc_init_superio (autoirq, autodma); | 3205 | count += parport_pc_init_superio(autoirq, autodma); |
3173 | 3206 | ||
3174 | /* PnP ports, skip detection if SuperIO already found them */ | 3207 | /* PnP ports, skip detection if SuperIO already found them */ |
3175 | if (!count) { | 3208 | if (!count) { |
3176 | err = pnp_register_driver (&parport_pc_pnp_driver); | 3209 | err = pnp_register_driver(&parport_pc_pnp_driver); |
3177 | if (!err) | 3210 | if (!err) |
3178 | pnp_registered_parport = 1; | 3211 | pnp_registered_parport = 1; |
3179 | } | 3212 | } |
3180 | 3213 | ||
3181 | /* ISA ports and whatever (see asm/parport.h). */ | 3214 | /* ISA ports and whatever (see asm/parport.h). */ |
3182 | parport_pc_find_nonpci_ports (autoirq, autodma); | 3215 | parport_pc_find_nonpci_ports(autoirq, autodma); |
3183 | 3216 | ||
3184 | err = pci_register_driver (&parport_pc_pci_driver); | 3217 | err = pci_register_driver(&parport_pc_pci_driver); |
3185 | if (!err) | 3218 | if (!err) |
3186 | pci_registered_parport = 1; | 3219 | pci_registered_parport = 1; |
3187 | } | 3220 | } |