Skip to content

Commit f63fd7e

Browse files
Petr CvekLinus Torvalds
authored andcommitted
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>
1 parent a9000d0 commit f63fd7e

1 file changed

Lines changed: 39 additions & 6 deletions

File tree

‎drivers/parport/parport_pc.c‎

Lines changed: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,6 +1540,38 @@ static void __devinit detect_and_report_smsc (void)
15401540
smsc_check(0x3f0,0x44);
15411541
smsc_check(0x370,0x44);
15421542
}
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+
}
15431575
#endif /* CONFIG_PARPORT_PC_SUPERIO */
15441576

15451577
static int get_superio_dma (struct parport *p)
@@ -3164,24 +3196,25 @@ static void __init parport_pc_find_ports (int autoirq, int autodma)
31643196
int count = 0, err;
31653197

31663198
#ifdef CONFIG_PARPORT_PC_SUPERIO
3167-
detect_and_report_winbond ();
3168-
detect_and_report_smsc ();
3199+
detect_and_report_it87();
3200+
detect_and_report_winbond();
3201+
detect_and_report_smsc();
31693202
#endif
31703203

31713204
/* 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);
31733206

31743207
/* PnP ports, skip detection if SuperIO already found them */
31753208
if (!count) {
3176-
err = pnp_register_driver (&parport_pc_pnp_driver);
3209+
err = pnp_register_driver(&parport_pc_pnp_driver);
31773210
if (!err)
31783211
pnp_registered_parport = 1;
31793212
}
31803213

31813214
/* ISA ports and whatever (see asm/parport.h). */
3182-
parport_pc_find_nonpci_ports (autoirq, autodma);
3215+
parport_pc_find_nonpci_ports(autoirq, autodma);
31833216

3184-
err = pci_register_driver (&parport_pc_pci_driver);
3217+
err = pci_register_driver(&parport_pc_pci_driver);
31853218
if (!err)
31863219
pci_registered_parport = 1;
31873220
}

0 commit comments

Comments
 (0)