Commit 475ef855 authored by David Hubbard's avatar David Hubbard Committed by Mark M. Hoffman

hwmon/w83627ehf: Add error messages for two error cases

If the Super-I/O device is disabled, it is likely the BIOS has a good
reason for leaving it disabled, so give a warning when enabling it --
it's not likely to be wired correctly or be able to give good data.

Also, if the Super-I/O device is configured with an address of 0, the
driver refuses to initialize it.
Signed-off-by: default avatarDavid Hubbard <david.c.hubbard@gmail.com>
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarMark M. Hoffman <mhoffman@lightlink.com>
parent 1ea6dd38
...@@ -1387,14 +1387,19 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr, ...@@ -1387,14 +1387,19 @@ static int __init w83627ehf_find(int sioaddr, unsigned short *addr,
| superio_inb(sioaddr, SIO_REG_ADDR + 1); | superio_inb(sioaddr, SIO_REG_ADDR + 1);
*addr = val & IOREGION_ALIGNMENT; *addr = val & IOREGION_ALIGNMENT;
if (*addr == 0) { if (*addr == 0) {
printk(KERN_ERR DRVNAME ": Refusing to enable a Super-I/O "
"device with a base I/O port 0.\n");
superio_exit(sioaddr); superio_exit(sioaddr);
return -ENODEV; return -ENODEV;
} }
/* Activate logical device if needed */ /* Activate logical device if needed */
val = superio_inb(sioaddr, SIO_REG_ENABLE); val = superio_inb(sioaddr, SIO_REG_ENABLE);
if (!(val & 0x01)) if (!(val & 0x01)) {
printk(KERN_WARNING DRVNAME ": Forcibly enabling Super-I/O. "
"Sensor is probably unusable.\n");
superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01); superio_outb(sioaddr, SIO_REG_ENABLE, val | 0x01);
}
superio_exit(sioaddr); superio_exit(sioaddr);
pr_info(DRVNAME ": Found %s chip at %#x\n", sio_name, *addr); pr_info(DRVNAME ": Found %s chip at %#x\n", sio_name, *addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment