summaryrefslogtreecommitdiffstats
path: root/drivers/char/pc8736x_gpio.c
diff options
context:
space:
mode:
authorAndre Haupt <andre@bitwigglers.org>2008-10-18 20:28:33 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-20 08:52:40 -0700
commitb64fd291acd8c921b4757faed1d4dded31c27edf (patch)
treed5b1d35a8412dfaf862bebfbb79a37850c0c29bc /drivers/char/pc8736x_gpio.c
parentb231cca4381ee15ec99afbfb244fbc0324869927 (diff)
downloadlinux-b64fd291acd8c921b4757faed1d4dded31c27edf.tar.gz
linux-b64fd291acd8c921b4757faed1d4dded31c27edf.tar.bz2
linux-b64fd291acd8c921b4757faed1d4dded31c27edf.zip
pc8736x_gpio: add support for PC87365 chips
This is only compile tested, because I do not own appropriate hardware. Signed-off-by: Andre Haupt <andre@bitwigglers.org> Cc: Jim Cromie <jim.cromie@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/pc8736x_gpio.c')
-rw-r--r--drivers/char/pc8736x_gpio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/char/pc8736x_gpio.c b/drivers/char/pc8736x_gpio.c
index b930de50407a..3f7da8cf3a80 100644
--- a/drivers/char/pc8736x_gpio.c
+++ b/drivers/char/pc8736x_gpio.c
@@ -41,7 +41,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 */
@@ -91,13 +92,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;