diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/dme1737.c | 29 | ||||
-rw-r--r-- | drivers/hwmon/fschmd.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/it87.c | 5 |
3 files changed, 27 insertions, 9 deletions
diff --git a/drivers/hwmon/dme1737.c b/drivers/hwmon/dme1737.c index 2c2cb1ec94c5..27d62574284f 100644 --- a/drivers/hwmon/dme1737.c +++ b/drivers/hwmon/dme1737.c | |||
@@ -572,7 +572,7 @@ static struct dme1737_data *dme1737_update_device(struct device *dev) | |||
572 | 572 | ||
573 | /* Sample register contents every 1 sec */ | 573 | /* Sample register contents every 1 sec */ |
574 | if (time_after(jiffies, data->last_update + HZ) || !data->valid) { | 574 | if (time_after(jiffies, data->last_update + HZ) || !data->valid) { |
575 | if (data->type != sch5027) { | 575 | if (data->type == dme1737) { |
576 | data->vid = dme1737_read(data, DME1737_REG_VID) & | 576 | data->vid = dme1737_read(data, DME1737_REG_VID) & |
577 | 0x3f; | 577 | 0x3f; |
578 | } | 578 | } |
@@ -1621,9 +1621,6 @@ static struct attribute *dme1737_misc_attr[] = { | |||
1621 | &sensor_dev_attr_zone1_auto_point1_temp_hyst.dev_attr.attr, | 1621 | &sensor_dev_attr_zone1_auto_point1_temp_hyst.dev_attr.attr, |
1622 | &sensor_dev_attr_zone2_auto_point1_temp_hyst.dev_attr.attr, | 1622 | &sensor_dev_attr_zone2_auto_point1_temp_hyst.dev_attr.attr, |
1623 | &sensor_dev_attr_zone3_auto_point1_temp_hyst.dev_attr.attr, | 1623 | &sensor_dev_attr_zone3_auto_point1_temp_hyst.dev_attr.attr, |
1624 | /* Misc */ | ||
1625 | &dev_attr_vrm.attr, | ||
1626 | &dev_attr_cpu0_vid.attr, | ||
1627 | NULL | 1624 | NULL |
1628 | }; | 1625 | }; |
1629 | 1626 | ||
@@ -1631,6 +1628,18 @@ static const struct attribute_group dme1737_misc_group = { | |||
1631 | .attrs = dme1737_misc_attr, | 1628 | .attrs = dme1737_misc_attr, |
1632 | }; | 1629 | }; |
1633 | 1630 | ||
1631 | /* The following struct holds VID-related attributes. Their creation | ||
1632 | depends on the chip type which is determined during module load. */ | ||
1633 | static struct attribute *dme1737_vid_attr[] = { | ||
1634 | &dev_attr_vrm.attr, | ||
1635 | &dev_attr_cpu0_vid.attr, | ||
1636 | NULL | ||
1637 | }; | ||
1638 | |||
1639 | static const struct attribute_group dme1737_vid_group = { | ||
1640 | .attrs = dme1737_vid_attr, | ||
1641 | }; | ||
1642 | |||
1634 | /* The following structs hold the PWM attributes, some of which are optional. | 1643 | /* The following structs hold the PWM attributes, some of which are optional. |
1635 | * Their creation depends on the chip configuration which is determined during | 1644 | * Their creation depends on the chip configuration which is determined during |
1636 | * module load. */ | 1645 | * module load. */ |
@@ -1902,6 +1911,9 @@ static void dme1737_remove_files(struct device *dev) | |||
1902 | if (data->type != sch5027) { | 1911 | if (data->type != sch5027) { |
1903 | sysfs_remove_group(&dev->kobj, &dme1737_misc_group); | 1912 | sysfs_remove_group(&dev->kobj, &dme1737_misc_group); |
1904 | } | 1913 | } |
1914 | if (data->type == dme1737) { | ||
1915 | sysfs_remove_group(&dev->kobj, &dme1737_vid_group); | ||
1916 | } | ||
1905 | 1917 | ||
1906 | sysfs_remove_group(&dev->kobj, &dme1737_group); | 1918 | sysfs_remove_group(&dev->kobj, &dme1737_group); |
1907 | 1919 | ||
@@ -1933,6 +1945,13 @@ static int dme1737_create_files(struct device *dev) | |||
1933 | goto exit_remove; | 1945 | goto exit_remove; |
1934 | } | 1946 | } |
1935 | 1947 | ||
1948 | /* Create VID-related sysfs attributes */ | ||
1949 | if ((data->type == dme1737) && | ||
1950 | (err = sysfs_create_group(&dev->kobj, | ||
1951 | &dme1737_vid_group))) { | ||
1952 | goto exit_remove; | ||
1953 | } | ||
1954 | |||
1936 | /* Create fan sysfs attributes */ | 1955 | /* Create fan sysfs attributes */ |
1937 | for (ix = 0; ix < ARRAY_SIZE(dme1737_fan_group); ix++) { | 1956 | for (ix = 0; ix < ARRAY_SIZE(dme1737_fan_group); ix++) { |
1938 | if (data->has_fan & (1 << ix)) { | 1957 | if (data->has_fan & (1 << ix)) { |
@@ -2127,7 +2146,7 @@ static int dme1737_init_device(struct device *dev) | |||
2127 | data->pwm_acz[2] = 4; /* pwm3 -> zone3 */ | 2146 | data->pwm_acz[2] = 4; /* pwm3 -> zone3 */ |
2128 | 2147 | ||
2129 | /* Set VRM */ | 2148 | /* Set VRM */ |
2130 | if (data->type != sch5027) { | 2149 | if (data->type == dme1737) { |
2131 | data->vrm = vid_which_vrm(); | 2150 | data->vrm = vid_which_vrm(); |
2132 | } | 2151 | } |
2133 | 2152 | ||
diff --git a/drivers/hwmon/fschmd.c b/drivers/hwmon/fschmd.c index 2a7a85a6dc36..da1b1f9488af 100644 --- a/drivers/hwmon/fschmd.c +++ b/drivers/hwmon/fschmd.c | |||
@@ -819,7 +819,7 @@ static int watchdog_release(struct inode *inode, struct file *filp) | |||
819 | static ssize_t watchdog_write(struct file *filp, const char __user *buf, | 819 | static ssize_t watchdog_write(struct file *filp, const char __user *buf, |
820 | size_t count, loff_t *offset) | 820 | size_t count, loff_t *offset) |
821 | { | 821 | { |
822 | size_t ret; | 822 | int ret; |
823 | struct fschmd_data *data = filp->private_data; | 823 | struct fschmd_data *data = filp->private_data; |
824 | 824 | ||
825 | if (count) { | 825 | if (count) { |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index ffeb2a10e1a7..a3749cb0f181 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -1028,12 +1028,11 @@ static int __init it87_find(unsigned short *address, | |||
1028 | chip_type, *address, sio_data->revision); | 1028 | chip_type, *address, sio_data->revision); |
1029 | 1029 | ||
1030 | /* Read GPIO config and VID value from LDN 7 (GPIO) */ | 1030 | /* Read GPIO config and VID value from LDN 7 (GPIO) */ |
1031 | if (chip_type != IT8705F_DEVID) { | 1031 | if (sio_data->type != it87) { |
1032 | int reg; | 1032 | int reg; |
1033 | 1033 | ||
1034 | superio_select(GPIO); | 1034 | superio_select(GPIO); |
1035 | if ((chip_type == it8718) || | 1035 | if (sio_data->type == it8718 || sio_data->type == it8720) |
1036 | (chip_type == it8720)) | ||
1037 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); | 1036 | sio_data->vid_value = superio_inb(IT87_SIO_VID_REG); |
1038 | 1037 | ||
1039 | reg = superio_inb(IT87_SIO_PINX2_REG); | 1038 | reg = superio_inb(IT87_SIO_PINX2_REG); |