]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/hwmon/f71805f.c
move OMAP's transceiver glue to drivers/usb/otg
[linux-2.6-omap-h63xx.git] / drivers / hwmon / f71805f.c
index 6f60715f34f815021662f03c1ce605a60bf28827..7a14a2dbb752e8835fcc652f97d9f57277f53783 100644 (file)
@@ -10,6 +10,9 @@
  * The F71872F/FG is almost the same, with two more voltages monitored,
  * and 6 VID inputs.
  *
+ * The F71806F/FG is essentially the same as the F71872F/FG. It even has
+ * the same chip ID, so the driver can't differentiate between.
+ *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
 #include <linux/ioport.h>
 #include <asm/io.h>
 
+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 "f71805f"
@@ -159,7 +166,7 @@ struct f71805f_auto_point {
 struct f71805f_data {
        unsigned short addr;
        const char *name;
-       struct class_device *class_dev;
+       struct device *hwmon_dev;
 
        struct mutex update_lock;
        char valid;             /* !=0 if following fields are valid */
@@ -1378,9 +1385,9 @@ static int __devinit f71805f_probe(struct platform_device *pdev)
                }
        }
 
-       data->class_dev = hwmon_device_register(&pdev->dev);
-       if (IS_ERR(data->class_dev)) {
-               err = PTR_ERR(data->class_dev);
+       data->hwmon_dev = hwmon_device_register(&pdev->dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               err = PTR_ERR(data->hwmon_dev);
                dev_err(&pdev->dev, "Class registration failed (%d)\n", err);
                goto exit_remove_files;
        }
@@ -1407,7 +1414,7 @@ static int __devexit f71805f_remove(struct platform_device *pdev)
        struct resource *res;
        int i;
 
-       hwmon_device_unregister(data->class_dev);
+       hwmon_device_unregister(data->hwmon_dev);
        sysfs_remove_group(&pdev->dev.kobj, &f71805f_group);
        for (i = 0; i < 4; i++)
                sysfs_remove_group(&pdev->dev.kobj, &f71805f_group_optin[i]);
@@ -1485,7 +1492,7 @@ static int __init f71805f_find(int sioaddr, unsigned short *address,
 
        static const char *names[] = {
                "F71805F/FG",
-               "F71872F/FG",
+               "F71872F/FG or F71806F/FG",
        };
 
        superio_enter(sioaddr);
@@ -1494,7 +1501,7 @@ static int __init f71805f_find(int sioaddr, unsigned short *address,
        if (devid != SIO_FINTEK_ID)
                goto exit;
 
-       devid = superio_inw(sioaddr, SIO_REG_DEVID);
+       devid = force_id ? force_id : superio_inw(sioaddr, SIO_REG_DEVID);
        switch (devid) {
        case SIO_F71805F_ID:
                sio_data->kind = f71805f;