Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115956
b: refs/heads/master
c: b64fd29
h: refs/heads/master
v: v3
  • Loading branch information
Andre Haupt authored and Linus Torvalds committed Oct 20, 2008
1 parent 82ccb03 commit 40b66c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b231cca4381ee15ec99afbfb244fbc0324869927
refs/heads/master: b64fd291acd8c921b4757faed1d4dded31c27edf
11 changes: 8 additions & 3 deletions trunk/drivers/char/pc8736x_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 40b66c3

Please sign in to comment.