X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=drivers%2Fchar%2Fpc8736x_gpio.c;h=8ecbcc174c150b5deccde7ca3f5ab0c199781b0f;hb=a4b7d3bb744bbaaceb94a9aaf6b5cbc6e5d230f0;hp=8715dc9f4a531f2f64445642970e6c603f04ba82;hpb=d21c95c569c462da20d491b75d0a45bd70ddc1bf;p=safe%2Fjmp%2Flinux-2.6 diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c index 8715dc9..8ecbcc1 100644 --- a/drivers/char/pc8736x_gpio.c +++ b/drivers/char/pc8736x_gpio.c @@ -40,7 +40,8 @@ static u8 pc8736x_gpio_shadow[4]; #define SIO_BASE2 0x4E /* alt command-reg to check */ #define SIO_SID 0x20 /* SuperI/O ID Register */ -#define SIO_SID_VALUE 0xe9 /* Expected value in SuperI/O ID Register */ +#define SIO_SID_PC87365 0xe5 /* Expected value in ID Register for PC87365 */ +#define SIO_SID_PC87366 0xe9 /* Expected value in ID Register for PC87366 */ #define SIO_CF1 0x21 /* chip config, bit0 is chip enable */ @@ -90,13 +91,17 @@ static inline int superio_inb(int addr) static int pc8736x_superio_present(void) { + int id; + /* try the 2 possible values, read a hardware reg to verify */ superio_cmd = SIO_BASE1; - if (superio_inb(SIO_SID) == SIO_SID_VALUE) + id = superio_inb(SIO_SID); + if (id == SIO_SID_PC87365 || id == SIO_SID_PC87366) return superio_cmd; superio_cmd = SIO_BASE2; - if (superio_inb(SIO_SID) == SIO_SID_VALUE) + id = superio_inb(SIO_SID); + if (id == SIO_SID_PC87365 || id == SIO_SID_PC87366) return superio_cmd; return 0; @@ -212,7 +217,6 @@ static struct nsc_gpio_ops pc8736x_gpio_ops = { .gpio_current = pc8736x_gpio_current }; -/* No BKL needed here; no global resources accessed */ static int pc8736x_gpio_open(struct inode *inode, struct file *file) { unsigned m = iminor(inode);