1 #include <linux/ioport.h>
6 static unsigned pc873xx_probelist
[] = {0x398, 0x26e, 0};
8 static char *pc873xx_names
[] = {
9 "PC87303", "PC87306", "PC87312", "PC87332", "PC87334"
12 static unsigned int base
, model
;
15 unsigned int __init
pc873xx_get_base()
20 char *__init
pc873xx_get_model()
22 return pc873xx_names
[model
];
25 static unsigned char __init
pc873xx_read(unsigned int base
, int reg
)
31 static void __init
pc873xx_write(unsigned int base
, int reg
, unsigned char data
)
35 local_irq_save(flags
);
38 outb(data
, base
+ 1); /* Must be written twice */
39 local_irq_restore(flags
);
42 int __init
pc873xx_probe(void)
46 while ((base
= pc873xx_probelist
[index
++])) {
48 if (request_region(base
, 2, "Super IO PC873xx") == NULL
)
51 val
= pc873xx_read(base
, REG_SID
);
52 if ((val
& 0xf0) == 0x10) {
55 } else if ((val
& 0xf8) == 0x70) {
58 } else if ((val
& 0xf8) == 0x50) {
61 } else if ((val
& 0xf8) == 0x40) {
66 release_region(base
, 2);
69 return (base
== 0) ? -1 : 1;
72 void __init
pc873xx_enable_epp19(void)
76 printk(KERN_INFO
"PC873xx enabling EPP v1.9\n");
77 data
= pc873xx_read(base
, REG_PCR
);
78 pc873xx_write(base
, REG_PCR
, (data
& 0xFC) | 0x02);
81 void __init
pc873xx_enable_ide(void)
85 printk(KERN_INFO
"PC873xx enabling IDE interrupt\n");
86 data
= pc873xx_read(base
, REG_FER
);
87 pc873xx_write(base
, REG_FER
, data
| 0x40);