hwmon: (fschmd) Add support for the FSC Hades IC
[safe/jmp/linux-2.6] / drivers / hwmon / vt1211.c
index e694164..73f77a9 100644 (file)
@@ -32,6 +32,7 @@
 #include <linux/err.h>
 #include <linux/mutex.h>
 #include <linux/ioport.h>
+#include <linux/acpi.h>
 #include <asm/io.h>
 
 static int uch_config = -1;
@@ -42,6 +43,10 @@ static int int_mode = -1;
 module_param(int_mode, int, 0);
 MODULE_PARM_DESC(int_mode, "Force the temperature interrupt mode");
 
+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 "vt1211"
@@ -795,7 +800,7 @@ static ssize_t set_pwm_auto_point_pwm(struct device *dev,
 
        if ((val < 0) || (val > 255)) {
                dev_err(dev, "pwm value %ld is out of range. "
-                       "Choose a value between 0 and 255." , val);
+                       "Choose a value between 0 and 255.\n" , val);
                return -EINVAL;
        }
 
@@ -1255,6 +1260,10 @@ static int __init vt1211_device_add(unsigned short address)
        }
 
        res.name = pdev->name;
+       err = acpi_check_resource_conflict(&res);
+       if (err)
+               goto EXIT_DEV_PUT;
+
        err = platform_device_add_resources(pdev, &res, 1);
        if (err) {
                printk(KERN_ERR DRVNAME ": Device resource addition failed "
@@ -1280,10 +1289,12 @@ EXIT:
 static int __init vt1211_find(int sio_cip, unsigned short *address)
 {
        int err = -ENODEV;
+       int devid;
 
        superio_enter(sio_cip);
 
-       if (superio_inb(sio_cip, SIO_VT1211_DEVID) != SIO_VT1211_ID) {
+       devid = force_id ? force_id : superio_inb(sio_cip, SIO_VT1211_DEVID);
+       if (devid != SIO_VT1211_ID) {
                goto EXIT;
        }