]> err.no Git - linux-2.6/blobdiff - drivers/hwmon/abituguru3.c
Add documentation for extended crashkernel syntax
[linux-2.6] / drivers / hwmon / abituguru3.c
index cf6ac4cdff9a61d885eb54cd59f0a295c6430325..cb2331bfd9d5a0f040c49e61fdba8fe0daca7111 100644 (file)
@@ -124,7 +124,7 @@ struct abituguru3_motherboard_info {
    The structure is dynamically allocated, at the same time when a new
    abituguru3 device is allocated. */
 struct abituguru3_data {
-       struct class_device *class_dev; /* hwmon registered device */
+       struct device *hwmon_dev;       /* hwmon registered device */
        struct mutex update_lock;       /* protect access to data and uGuru */
        unsigned short addr;            /* uguru base address */
        char valid;                     /* !=0 if following fields are valid */
@@ -351,7 +351,7 @@ static const struct abituguru3_motherboard_info abituguru3_motherboards[] = {
                { "AUX4 Fan",           38, 2, 60, 1, 0 },
                { NULL, 0, 0, 0, 0, 0 } }
        },
-       { 0x0014, "unknown", {
+       { 0x0014, "Abit AB9 Pro", {
                { "CPU Core",            0, 0, 10, 1, 0 },
                { "DDR",                 1, 0, 10, 1, 0 },
                { "DDR VTT",             2, 0, 10, 1, 0 },
@@ -691,8 +691,9 @@ static int abituguru3_read(struct abituguru3_data *data, u8 bank, u8 offset,
 
 /* Sensor settings are stored 1 byte per offset with the bytes
    placed add consecutive offsets. */
-int abituguru3_read_increment_offset(struct abituguru3_data *data, u8 bank,
-       u8 offset, u8 count, u8 *buf, int offset_count)
+static int abituguru3_read_increment_offset(struct abituguru3_data *data,
+                                           u8 bank, u8 offset, u8 count,
+                                           u8 *buf, int offset_count)
 {
        int i, x;
 
@@ -932,9 +933,9 @@ static int __devinit abituguru3_probe(struct platform_device *pdev)
                                &abituguru3_sysfs_attr[i].dev_attr))
                        goto abituguru3_probe_error;
 
-       data->class_dev = hwmon_device_register(&pdev->dev);
-       if (IS_ERR(data->class_dev)) {
-               res = PTR_ERR(data->class_dev);
+       data->hwmon_dev = hwmon_device_register(&pdev->dev);
+       if (IS_ERR(data->hwmon_dev)) {
+               res = PTR_ERR(data->hwmon_dev);
                goto abituguru3_probe_error;
        }
 
@@ -956,7 +957,7 @@ static int __devexit abituguru3_remove(struct platform_device *pdev)
        struct abituguru3_data *data = platform_get_drvdata(pdev);
 
        platform_set_drvdata(pdev, NULL);
-       hwmon_device_unregister(data->class_dev);
+       hwmon_device_unregister(data->hwmon_dev);
        for (i = 0; data->sysfs_attr[i].dev_attr.attr.name; i++)
                device_remove_file(&pdev->dev, &data->sysfs_attr[i].dev_attr);
        for (i = 0; i < ARRAY_SIZE(abituguru3_sysfs_attr); i++)
@@ -1053,12 +1054,13 @@ static struct platform_driver abituguru3_driver = {
 
 static int __init abituguru3_detect(void)
 {
-       /* See if there is an uguru3 there. An idle uGuru3 will hold 0x00
-          at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05 at
-          CMD instead, why is unknown. So we test for 0x05 too. */
+       /* See if there is an uguru3 there. An idle uGuru3 will hold 0x00 or
+          0x08 at DATA and 0xAC at CMD. Sometimes the uGuru3 will hold 0x05
+          at CMD instead, why is unknown. So we test for 0x05 too. */
        u8 data_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_DATA);
        u8 cmd_val = inb_p(ABIT_UGURU3_BASE + ABIT_UGURU3_CMD);
-       if ((data_val == 0x00) && ((cmd_val == 0xAC) || (cmd_val == 0x05)))
+       if (((data_val == 0x00) || (data_val == 0x08)) &&
+                       ((cmd_val == 0xAC) || (cmd_val == 0x05)))
                return ABIT_UGURU3_BASE;
 
        ABIT_UGURU3_DEBUG("no Abit uGuru3 found, data = 0x%02X, cmd = "