X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fhwmon%2Fsmsc47b397.c;h=eb03544c731ca47dd94c6d7d940b3f66a43dbcdd;hb=8b805ef617cf0e02f6d18b891f8deb6246421b01;hp=0b57d2ea2cf714493dc9174e614190036b04ca09;hpb=df3d80f5a5c74168be42788364d13cf6c83c7b9c;p=linux-2.6-omap-h63xx.git diff --git a/drivers/hwmon/smsc47b397.c b/drivers/hwmon/smsc47b397.c index 0b57d2ea2cf..eb03544c731 100644 --- a/drivers/hwmon/smsc47b397.c +++ b/drivers/hwmon/smsc47b397.c @@ -38,6 +38,10 @@ #include #include +static unsigned short force_id; +module_param(force_id, ushort, 0); +MODULE_PARM_DESC(force_id, "Override the detected device ID"); + static struct platform_device *pdev; #define DRVNAME "smsc47b397" @@ -331,11 +335,23 @@ exit: static int __init smsc47b397_find(unsigned short *addr) { u8 id, rev; + char *name; superio_enter(); - id = superio_inb(SUPERIO_REG_DEVID); - - if ((id != 0x6f) && (id != 0x81) && (id != 0x85)) { + id = force_id ? force_id : superio_inb(SUPERIO_REG_DEVID); + + switch(id) { + case 0x81: + name = "SCH5307-NS"; + break; + case 0x6f: + name = "LPC47B397-NC"; + break; + case 0x85: + case 0x8c: + name = "SCH5317"; + break; + default: superio_exit(); return -ENODEV; } @@ -348,8 +364,7 @@ static int __init smsc47b397_find(unsigned short *addr) printk(KERN_INFO DRVNAME ": found SMSC %s " "(base address 0x%04x, revision %u)\n", - id == 0x81 ? "SCH5307-NS" : id == 0x85 ? "SCH5317" : - "LPC47B397-NC", *addr, rev); + name, *addr, rev); superio_exit(); return 0;