diff options
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/Kconfig | 4 | ||||
-rw-r--r-- | drivers/hwmon/ad7414.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/ad7418.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adcxx.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adt7411.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adt7462.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/adt7470.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/applesmc.c | 18 | ||||
-rw-r--r-- | drivers/hwmon/asus_atk0110.c | 5 | ||||
-rw-r--r-- | drivers/hwmon/atxp1.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/coretemp.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/f75375s.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/hp_accel.c | 4 | ||||
-rw-r--r-- | drivers/hwmon/i5k_amb.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/ibmaem.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/ibmpex.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/it87.c | 32 | ||||
-rw-r--r-- | drivers/hwmon/lm70.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/lm73.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/max1111.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/mc13783-adc.c | 1 | ||||
-rw-r--r-- | drivers/hwmon/sht15.c | 14 | ||||
-rw-r--r-- | drivers/hwmon/w83793.c | 2 | ||||
-rw-r--r-- | drivers/hwmon/wm831x-hwmon.c | 1 |
24 files changed, 72 insertions, 27 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index e4595e6147b..9be8e1754a0 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -217,8 +217,8 @@ config SENSORS_ASC7621 | |||
217 | depends on HWMON && I2C | 217 | depends on HWMON && I2C |
218 | help | 218 | help |
219 | If you say yes here you get support for the aSC7621 | 219 | If you say yes here you get support for the aSC7621 |
220 | family of SMBus sensors chip found on most Intel X48, X38, 975, | 220 | family of SMBus sensors chip found on most Intel X38, X48, X58, |
221 | 965 and 945 desktop boards. Currently supported chips: | 221 | 945, 965 and 975 desktop boards. Currently supported chips: |
222 | aSC7621 | 222 | aSC7621 |
223 | aSC7621a | 223 | aSC7621a |
224 | 224 | ||
diff --git a/drivers/hwmon/ad7414.c b/drivers/hwmon/ad7414.c index bfda8c80ef2..1e4c21fc1a8 100644 --- a/drivers/hwmon/ad7414.c +++ b/drivers/hwmon/ad7414.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/err.h> | 27 | #include <linux/err.h> |
28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
29 | #include <linux/sysfs.h> | 29 | #include <linux/sysfs.h> |
30 | #include <linux/slab.h> | ||
30 | 31 | ||
31 | 32 | ||
32 | /* AD7414 registers */ | 33 | /* AD7414 registers */ |
diff --git a/drivers/hwmon/ad7418.c b/drivers/hwmon/ad7418.c index f97b5b35687..ffc781fec18 100644 --- a/drivers/hwmon/ad7418.c +++ b/drivers/hwmon/ad7418.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/err.h> | 20 | #include <linux/err.h> |
21 | #include <linux/mutex.h> | 21 | #include <linux/mutex.h> |
22 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
23 | #include <linux/slab.h> | ||
23 | 24 | ||
24 | #include "lm75.h" | 25 | #include "lm75.h" |
25 | 26 | ||
diff --git a/drivers/hwmon/adcxx.c b/drivers/hwmon/adcxx.c index 74d9c5195e4..fbdc7655303 100644 --- a/drivers/hwmon/adcxx.c +++ b/drivers/hwmon/adcxx.c | |||
@@ -37,6 +37,7 @@ | |||
37 | #include <linux/init.h> | 37 | #include <linux/init.h> |
38 | #include <linux/module.h> | 38 | #include <linux/module.h> |
39 | #include <linux/kernel.h> | 39 | #include <linux/kernel.h> |
40 | #include <linux/slab.h> | ||
40 | #include <linux/device.h> | 41 | #include <linux/device.h> |
41 | #include <linux/err.h> | 42 | #include <linux/err.h> |
42 | #include <linux/sysfs.h> | 43 | #include <linux/sysfs.h> |
diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c index 3471884e42d..4086c7257f9 100644 --- a/drivers/hwmon/adt7411.c +++ b/drivers/hwmon/adt7411.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/i2c.h> | 21 | #include <linux/i2c.h> |
22 | #include <linux/hwmon.h> | 22 | #include <linux/hwmon.h> |
23 | #include <linux/hwmon-sysfs.h> | 23 | #include <linux/hwmon-sysfs.h> |
24 | #include <linux/slab.h> | ||
24 | 25 | ||
25 | #define ADT7411_REG_INT_TEMP_VDD_LSB 0x03 | 26 | #define ADT7411_REG_INT_TEMP_VDD_LSB 0x03 |
26 | #define ADT7411_REG_EXT_TEMP_AIN14_LSB 0x04 | 27 | #define ADT7411_REG_EXT_TEMP_AIN14_LSB 0x04 |
diff --git a/drivers/hwmon/adt7462.c b/drivers/hwmon/adt7462.c index b8156b4893b..2af0c7b6b4e 100644 --- a/drivers/hwmon/adt7462.c +++ b/drivers/hwmon/adt7462.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mutex.h> | 28 | #include <linux/mutex.h> |
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/log2.h> | 30 | #include <linux/log2.h> |
31 | #include <linux/slab.h> | ||
31 | 32 | ||
32 | /* Addresses to scan */ | 33 | /* Addresses to scan */ |
33 | static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END }; | 34 | static const unsigned short normal_i2c[] = { 0x58, 0x5C, I2C_CLIENT_END }; |
diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c index 3445ce1cba8..9e775717abb 100644 --- a/drivers/hwmon/adt7470.c +++ b/drivers/hwmon/adt7470.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/log2.h> | 30 | #include <linux/log2.h> |
31 | #include <linux/kthread.h> | 31 | #include <linux/kthread.h> |
32 | #include <linux/slab.h> | ||
32 | 33 | ||
33 | /* Addresses to scan */ | 34 | /* Addresses to scan */ |
34 | static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; | 35 | static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; |
diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c index c1605b528e8..0f28d91f29d 100644 --- a/drivers/hwmon/applesmc.c +++ b/drivers/hwmon/applesmc.c | |||
@@ -142,6 +142,12 @@ static const char *temperature_sensors_sets[][41] = { | |||
142 | "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S", | 142 | "TM1S", "TM2P", "TM2S", "TM3S", "TM8P", "TM8S", "TM9P", "TM9S", |
143 | "TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S", | 143 | "TN0C", "TN0D", "TN0H", "TS0C", "Tp0C", "Tp1C", "Tv0S", "Tv1S", |
144 | NULL }, | 144 | NULL }, |
145 | /* Set 17: iMac 9,1 */ | ||
146 | { "TA0P", "TC0D", "TC0H", "TC0P", "TG0D", "TG0H", "TH0P", "TL0P", | ||
147 | "TN0D", "TN0H", "TN0P", "TO0P", "Tm0P", "Tp0P", NULL }, | ||
148 | /* Set 18: MacBook Pro 2,2 */ | ||
149 | { "TB0T", "TC0D", "TC0P", "TG0H", "TG0P", "TG0T", "TM0P", "TTF0", | ||
150 | "Th0H", "Th1H", "Tm0P", "Ts0P", NULL }, | ||
145 | }; | 151 | }; |
146 | 152 | ||
147 | /* List of keys used to read/write fan speeds */ | 153 | /* List of keys used to read/write fan speeds */ |
@@ -1350,6 +1356,10 @@ static __initdata struct dmi_match_data applesmc_dmi_data[] = { | |||
1350 | { .accelerometer = 1, .light = 1, .temperature_set = 15 }, | 1356 | { .accelerometer = 1, .light = 1, .temperature_set = 15 }, |
1351 | /* MacPro3,1: temperature set 16 */ | 1357 | /* MacPro3,1: temperature set 16 */ |
1352 | { .accelerometer = 0, .light = 0, .temperature_set = 16 }, | 1358 | { .accelerometer = 0, .light = 0, .temperature_set = 16 }, |
1359 | /* iMac 9,1: light sensor only, temperature set 17 */ | ||
1360 | { .accelerometer = 0, .light = 0, .temperature_set = 17 }, | ||
1361 | /* MacBook Pro 2,2: accelerometer, backlight and temperature set 18 */ | ||
1362 | { .accelerometer = 1, .light = 1, .temperature_set = 18 }, | ||
1353 | }; | 1363 | }; |
1354 | 1364 | ||
1355 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". | 1365 | /* Note that DMI_MATCH(...,"MacBook") will match "MacBookPro1,1". |
@@ -1375,6 +1385,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { | |||
1375 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | 1385 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), |
1376 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3") }, | 1386 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro3") }, |
1377 | &applesmc_dmi_data[9]}, | 1387 | &applesmc_dmi_data[9]}, |
1388 | { applesmc_dmi_match, "Apple MacBook Pro 2,2", { | ||
1389 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple Computer, Inc."), | ||
1390 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro2,2") }, | ||
1391 | &applesmc_dmi_data[18]}, | ||
1378 | { applesmc_dmi_match, "Apple MacBook Pro", { | 1392 | { applesmc_dmi_match, "Apple MacBook Pro", { |
1379 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), | 1393 | DMI_MATCH(DMI_BOARD_VENDOR,"Apple"), |
1380 | DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") }, | 1394 | DMI_MATCH(DMI_PRODUCT_NAME,"MacBookPro") }, |
@@ -1415,6 +1429,10 @@ static __initdata struct dmi_system_id applesmc_whitelist[] = { | |||
1415 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | 1429 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), |
1416 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, | 1430 | DMI_MATCH(DMI_PRODUCT_NAME, "MacPro") }, |
1417 | &applesmc_dmi_data[4]}, | 1431 | &applesmc_dmi_data[4]}, |
1432 | { applesmc_dmi_match, "Apple iMac 9,1", { | ||
1433 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple Inc."), | ||
1434 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac9,1") }, | ||
1435 | &applesmc_dmi_data[17]}, | ||
1418 | { applesmc_dmi_match, "Apple iMac 8", { | 1436 | { applesmc_dmi_match, "Apple iMac 8", { |
1419 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), | 1437 | DMI_MATCH(DMI_BOARD_VENDOR, "Apple"), |
1420 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") }, | 1438 | DMI_MATCH(DMI_PRODUCT_NAME, "iMac8") }, |
diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c index 028284f544e..16c42024072 100644 --- a/drivers/hwmon/asus_atk0110.c +++ b/drivers/hwmon/asus_atk0110.c | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/hwmon.h> | 10 | #include <linux/hwmon.h> |
11 | #include <linux/list.h> | 11 | #include <linux/list.h> |
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/slab.h> | ||
13 | 14 | ||
14 | #include <acpi/acpi.h> | 15 | #include <acpi/acpi.h> |
15 | #include <acpi/acpixf.h> | 16 | #include <acpi/acpixf.h> |
@@ -1168,15 +1169,19 @@ static int atk_create_files(struct atk_data *data) | |||
1168 | int err; | 1169 | int err; |
1169 | 1170 | ||
1170 | list_for_each_entry(s, &data->sensor_list, list) { | 1171 | list_for_each_entry(s, &data->sensor_list, list) { |
1172 | sysfs_attr_init(&s->input_attr.attr); | ||
1171 | err = device_create_file(data->hwmon_dev, &s->input_attr); | 1173 | err = device_create_file(data->hwmon_dev, &s->input_attr); |
1172 | if (err) | 1174 | if (err) |
1173 | return err; | 1175 | return err; |
1176 | sysfs_attr_init(&s->label_attr.attr); | ||
1174 | err = device_create_file(data->hwmon_dev, &s->label_attr); | 1177 | err = device_create_file(data->hwmon_dev, &s->label_attr); |
1175 | if (err) | 1178 | if (err) |
1176 | return err; | 1179 | return err; |
1180 | sysfs_attr_init(&s->limit1_attr.attr); | ||
1177 | err = device_create_file(data->hwmon_dev, &s->limit1_attr); | 1181 | err = device_create_file(data->hwmon_dev, &s->limit1_attr); |
1178 | if (err) | 1182 | if (err) |
1179 | return err; | 1183 | return err; |
1184 | sysfs_attr_init(&s->limit2_attr.attr); | ||
1180 | err = device_create_file(data->hwmon_dev, &s->limit2_attr); | 1185 | err = device_create_file(data->hwmon_dev, &s->limit2_attr); |
1181 | if (err) | 1186 | if (err) |
1182 | return err; | 1187 | return err; |
diff --git a/drivers/hwmon/atxp1.c b/drivers/hwmon/atxp1.c index 94cadc19f0c..33cc143b206 100644 --- a/drivers/hwmon/atxp1.c +++ b/drivers/hwmon/atxp1.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/err.h> | 28 | #include <linux/err.h> |
29 | #include <linux/mutex.h> | 29 | #include <linux/mutex.h> |
30 | #include <linux/sysfs.h> | 30 | #include <linux/sysfs.h> |
31 | #include <linux/slab.h> | ||
31 | 32 | ||
32 | MODULE_LICENSE("GPL"); | 33 | MODULE_LICENSE("GPL"); |
33 | MODULE_DESCRIPTION("System voltages control via Attansic ATXP1"); | 34 | MODULE_DESCRIPTION("System voltages control via Attansic ATXP1"); |
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 2d7bceeed0b..e9b7fbc5a44 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -228,7 +228,7 @@ static int __devinit adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device * | |||
228 | if (err) { | 228 | if (err) { |
229 | dev_warn(dev, | 229 | dev_warn(dev, |
230 | "Unable to access MSR 0xEE, for Tjmax, left" | 230 | "Unable to access MSR 0xEE, for Tjmax, left" |
231 | " at default"); | 231 | " at default\n"); |
232 | } else if (eax & 0x40000000) { | 232 | } else if (eax & 0x40000000) { |
233 | tjmax = tjmax_ee; | 233 | tjmax = tjmax_ee; |
234 | } | 234 | } |
@@ -466,7 +466,7 @@ static int __init coretemp_init(void) | |||
466 | family 6 CPU */ | 466 | family 6 CPU */ |
467 | if ((c->x86 == 0x6) && (c->x86_model > 0xf)) | 467 | if ((c->x86 == 0x6) && (c->x86_model > 0xf)) |
468 | printk(KERN_WARNING DRVNAME ": Unknown CPU " | 468 | printk(KERN_WARNING DRVNAME ": Unknown CPU " |
469 | "model %x\n", c->x86_model); | 469 | "model 0x%x\n", c->x86_model); |
470 | continue; | 470 | continue; |
471 | } | 471 | } |
472 | 472 | ||
diff --git a/drivers/hwmon/f75375s.c b/drivers/hwmon/f75375s.c index 277398f9c93..bad2cf3ef4a 100644 --- a/drivers/hwmon/f75375s.c +++ b/drivers/hwmon/f75375s.c | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/err.h> | 35 | #include <linux/err.h> |
36 | #include <linux/mutex.h> | 36 | #include <linux/mutex.h> |
37 | #include <linux/f75375s.h> | 37 | #include <linux/f75375s.h> |
38 | #include <linux/slab.h> | ||
38 | 39 | ||
39 | /* Addresses to scan */ | 40 | /* Addresses to scan */ |
40 | static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END }; | 41 | static const unsigned short normal_i2c[] = { 0x2d, 0x2e, I2C_CLIENT_END }; |
diff --git a/drivers/hwmon/hp_accel.c b/drivers/hwmon/hp_accel.c index be475e844c2..c8ab5051667 100644 --- a/drivers/hwmon/hp_accel.c +++ b/drivers/hwmon/hp_accel.c | |||
@@ -217,6 +217,10 @@ static struct dmi_system_id lis3lv02d_dmi_ids[] = { | |||
217 | AXIS_DMI_MATCH("DV7", "HP Pavilion dv7", x_inverted), | 217 | AXIS_DMI_MATCH("DV7", "HP Pavilion dv7", x_inverted), |
218 | AXIS_DMI_MATCH("HP8710", "HP Compaq 8710", y_inverted), | 218 | AXIS_DMI_MATCH("HP8710", "HP Compaq 8710", y_inverted), |
219 | AXIS_DMI_MATCH("HDX18", "HP HDX 18", x_inverted), | 219 | AXIS_DMI_MATCH("HDX18", "HP HDX 18", x_inverted), |
220 | AXIS_DMI_MATCH("HPB432x", "HP ProBook 432", xy_rotated_left), | ||
221 | AXIS_DMI_MATCH("HPB442x", "HP ProBook 442", xy_rotated_left), | ||
222 | AXIS_DMI_MATCH("HPB452x", "HP ProBook 452", y_inverted), | ||
223 | AXIS_DMI_MATCH("HPB522x", "HP ProBook 522", xy_swap), | ||
220 | { NULL, } | 224 | { NULL, } |
221 | /* Laptop models without axis info (yet): | 225 | /* Laptop models without axis info (yet): |
222 | * "NC6910" "HP Compaq 6910" | 226 | * "NC6910" "HP Compaq 6910" |
diff --git a/drivers/hwmon/i5k_amb.c b/drivers/hwmon/i5k_amb.c index 27d7f72a5f1..e880e2c3871 100644 --- a/drivers/hwmon/i5k_amb.c +++ b/drivers/hwmon/i5k_amb.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/log2.h> | 30 | #include <linux/log2.h> |
31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
32 | #include <linux/platform_device.h> | 32 | #include <linux/platform_device.h> |
33 | #include <linux/slab.h> | ||
33 | 34 | ||
34 | #define DRVNAME "i5k_amb" | 35 | #define DRVNAME "i5k_amb" |
35 | 36 | ||
diff --git a/drivers/hwmon/ibmaem.c b/drivers/hwmon/ibmaem.c index 405d3fb5d76..eaee546af19 100644 --- a/drivers/hwmon/ibmaem.c +++ b/drivers/hwmon/ibmaem.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/kdev_t.h> | 29 | #include <linux/kdev_t.h> |
30 | #include <linux/spinlock.h> | 30 | #include <linux/spinlock.h> |
31 | #include <linux/idr.h> | 31 | #include <linux/idr.h> |
32 | #include <linux/slab.h> | ||
32 | #include <linux/sched.h> | 33 | #include <linux/sched.h> |
33 | #include <linux/platform_device.h> | 34 | #include <linux/platform_device.h> |
34 | #include <linux/math64.h> | 35 | #include <linux/math64.h> |
diff --git a/drivers/hwmon/ibmpex.c b/drivers/hwmon/ibmpex.c index a36363312f2..06d4eafcf76 100644 --- a/drivers/hwmon/ibmpex.c +++ b/drivers/hwmon/ibmpex.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/hwmon-sysfs.h> | 25 | #include <linux/hwmon-sysfs.h> |
26 | #include <linux/jiffies.h> | 26 | #include <linux/jiffies.h> |
27 | #include <linux/mutex.h> | 27 | #include <linux/mutex.h> |
28 | #include <linux/slab.h> | ||
28 | 29 | ||
29 | #define REFRESH_INTERVAL (2 * HZ) | 30 | #define REFRESH_INTERVAL (2 * HZ) |
30 | #define DRVNAME "ibmpex" | 31 | #define DRVNAME "ibmpex" |
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 1002befd87d..5be09c048c5 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c | |||
@@ -539,14 +539,14 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr, | |||
539 | 539 | ||
540 | struct it87_data *data = dev_get_drvdata(dev); | 540 | struct it87_data *data = dev_get_drvdata(dev); |
541 | long val; | 541 | long val; |
542 | u8 reg; | ||
542 | 543 | ||
543 | if (strict_strtol(buf, 10, &val) < 0) | 544 | if (strict_strtol(buf, 10, &val) < 0) |
544 | return -EINVAL; | 545 | return -EINVAL; |
545 | 546 | ||
546 | mutex_lock(&data->update_lock); | 547 | reg = it87_read_value(data, IT87_REG_TEMP_ENABLE); |
547 | 548 | reg &= ~(1 << nr); | |
548 | data->sensor &= ~(1 << nr); | 549 | reg &= ~(8 << nr); |
549 | data->sensor &= ~(8 << nr); | ||
550 | if (val == 2) { /* backwards compatibility */ | 550 | if (val == 2) { /* backwards compatibility */ |
551 | dev_warn(dev, "Sensor type 2 is deprecated, please use 4 " | 551 | dev_warn(dev, "Sensor type 2 is deprecated, please use 4 " |
552 | "instead\n"); | 552 | "instead\n"); |
@@ -554,14 +554,16 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr, | |||
554 | } | 554 | } |
555 | /* 3 = thermal diode; 4 = thermistor; 0 = disabled */ | 555 | /* 3 = thermal diode; 4 = thermistor; 0 = disabled */ |
556 | if (val == 3) | 556 | if (val == 3) |
557 | data->sensor |= 1 << nr; | 557 | reg |= 1 << nr; |
558 | else if (val == 4) | 558 | else if (val == 4) |
559 | data->sensor |= 8 << nr; | 559 | reg |= 8 << nr; |
560 | else if (val != 0) { | 560 | else if (val != 0) |
561 | mutex_unlock(&data->update_lock); | ||
562 | return -EINVAL; | 561 | return -EINVAL; |
563 | } | 562 | |
563 | mutex_lock(&data->update_lock); | ||
564 | data->sensor = reg; | ||
564 | it87_write_value(data, IT87_REG_TEMP_ENABLE, data->sensor); | 565 | it87_write_value(data, IT87_REG_TEMP_ENABLE, data->sensor); |
566 | data->valid = 0; /* Force cache refresh */ | ||
565 | mutex_unlock(&data->update_lock); | 567 | mutex_unlock(&data->update_lock); |
566 | return count; | 568 | return count; |
567 | } | 569 | } |
@@ -1841,14 +1843,10 @@ static void __devinit it87_init_device(struct platform_device *pdev) | |||
1841 | it87_write_value(data, IT87_REG_TEMP_HIGH(i), 127); | 1843 | it87_write_value(data, IT87_REG_TEMP_HIGH(i), 127); |
1842 | } | 1844 | } |
1843 | 1845 | ||
1844 | /* Check if temperature channels are reset manually or by some reason */ | 1846 | /* Temperature channels are not forcibly enabled, as they can be |
1845 | tmp = it87_read_value(data, IT87_REG_TEMP_ENABLE); | 1847 | * set to two different sensor types and we can't guess which one |
1846 | if ((tmp & 0x3f) == 0) { | 1848 | * is correct for a given system. These channels can be enabled at |
1847 | /* Temp1,Temp3=thermistor; Temp2=thermal diode */ | 1849 | * run-time through the temp{1-3}_type sysfs accessors if needed. */ |
1848 | tmp = (tmp & 0xc0) | 0x2a; | ||
1849 | it87_write_value(data, IT87_REG_TEMP_ENABLE, tmp); | ||
1850 | } | ||
1851 | data->sensor = tmp; | ||
1852 | 1850 | ||
1853 | /* Check if voltage monitors are reset manually or by some reason */ | 1851 | /* Check if voltage monitors are reset manually or by some reason */ |
1854 | tmp = it87_read_value(data, IT87_REG_VIN_ENABLE); | 1852 | tmp = it87_read_value(data, IT87_REG_VIN_ENABLE); |
diff --git a/drivers/hwmon/lm70.c b/drivers/hwmon/lm70.c index ab8a5d3c769..fd108cfc05c 100644 --- a/drivers/hwmon/lm70.c +++ b/drivers/hwmon/lm70.c | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/mutex.h> | 34 | #include <linux/mutex.h> |
35 | #include <linux/mod_devicetable.h> | 35 | #include <linux/mod_devicetable.h> |
36 | #include <linux/spi/spi.h> | 36 | #include <linux/spi/spi.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | 39 | ||
39 | #define DRVNAME "lm70" | 40 | #define DRVNAME "lm70" |
diff --git a/drivers/hwmon/lm73.c b/drivers/hwmon/lm73.c index c5f39ba103c..4d1b76bc814 100644 --- a/drivers/hwmon/lm73.c +++ b/drivers/hwmon/lm73.c | |||
@@ -16,7 +16,6 @@ | |||
16 | 16 | ||
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/init.h> | 18 | #include <linux/init.h> |
19 | #include <linux/slab.h> | ||
20 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
21 | #include <linux/hwmon.h> | 20 | #include <linux/hwmon.h> |
22 | #include <linux/hwmon-sysfs.h> | 21 | #include <linux/hwmon-sysfs.h> |
diff --git a/drivers/hwmon/max1111.c b/drivers/hwmon/max1111.c index 9ac497271ad..12a54aa2977 100644 --- a/drivers/hwmon/max1111.c +++ b/drivers/hwmon/max1111.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/hwmon.h> | 20 | #include <linux/hwmon.h> |
21 | #include <linux/hwmon-sysfs.h> | 21 | #include <linux/hwmon-sysfs.h> |
22 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
23 | #include <linux/slab.h> | ||
23 | 24 | ||
24 | #define MAX1111_TX_BUF_SIZE 1 | 25 | #define MAX1111_TX_BUF_SIZE 1 |
25 | #define MAX1111_RX_BUF_SIZE 2 | 26 | #define MAX1111_RX_BUF_SIZE 2 |
diff --git a/drivers/hwmon/mc13783-adc.c b/drivers/hwmon/mc13783-adc.c index 883fa8197da..ce3c7bc8181 100644 --- a/drivers/hwmon/mc13783-adc.c +++ b/drivers/hwmon/mc13783-adc.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/kernel.h> | 24 | #include <linux/kernel.h> |
25 | #include <linux/module.h> | 25 | #include <linux/module.h> |
26 | #include <linux/hwmon.h> | 26 | #include <linux/hwmon.h> |
27 | #include <linux/slab.h> | ||
27 | #include <linux/init.h> | 28 | #include <linux/init.h> |
28 | #include <linux/err.h> | 29 | #include <linux/err.h> |
29 | 30 | ||
diff --git a/drivers/hwmon/sht15.c b/drivers/hwmon/sht15.c index 864a371f6eb..a610e7880fb 100644 --- a/drivers/hwmon/sht15.c +++ b/drivers/hwmon/sht15.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/err.h> | 36 | #include <linux/err.h> |
37 | #include <linux/sht15.h> | 37 | #include <linux/sht15.h> |
38 | #include <linux/regulator/consumer.h> | 38 | #include <linux/regulator/consumer.h> |
39 | #include <linux/slab.h> | ||
39 | #include <asm/atomic.h> | 40 | #include <asm/atomic.h> |
40 | 41 | ||
41 | #define SHT15_MEASURE_TEMP 3 | 42 | #define SHT15_MEASURE_TEMP 3 |
@@ -302,13 +303,13 @@ error_ret: | |||
302 | **/ | 303 | **/ |
303 | static inline int sht15_calc_temp(struct sht15_data *data) | 304 | static inline int sht15_calc_temp(struct sht15_data *data) |
304 | { | 305 | { |
305 | int d1 = 0; | 306 | int d1 = temppoints[0].d1; |
306 | int i; | 307 | int i; |
307 | 308 | ||
308 | for (i = 1; i < ARRAY_SIZE(temppoints); i++) | 309 | for (i = ARRAY_SIZE(temppoints) - 1; i > 0; i--) |
309 | /* Find pointer to interpolate */ | 310 | /* Find pointer to interpolate */ |
310 | if (data->supply_uV > temppoints[i - 1].vdd) { | 311 | if (data->supply_uV > temppoints[i - 1].vdd) { |
311 | d1 = (data->supply_uV/1000 - temppoints[i - 1].vdd) | 312 | d1 = (data->supply_uV - temppoints[i - 1].vdd) |
312 | * (temppoints[i].d1 - temppoints[i - 1].d1) | 313 | * (temppoints[i].d1 - temppoints[i - 1].d1) |
313 | / (temppoints[i].vdd - temppoints[i - 1].vdd) | 314 | / (temppoints[i].vdd - temppoints[i - 1].vdd) |
314 | + temppoints[i - 1].d1; | 315 | + temppoints[i - 1].d1; |
@@ -541,7 +542,12 @@ static int __devinit sht15_probe(struct platform_device *pdev) | |||
541 | /* If a regulator is available, query what the supply voltage actually is!*/ | 542 | /* If a regulator is available, query what the supply voltage actually is!*/ |
542 | data->reg = regulator_get(data->dev, "vcc"); | 543 | data->reg = regulator_get(data->dev, "vcc"); |
543 | if (!IS_ERR(data->reg)) { | 544 | if (!IS_ERR(data->reg)) { |
544 | data->supply_uV = regulator_get_voltage(data->reg); | 545 | int voltage; |
546 | |||
547 | voltage = regulator_get_voltage(data->reg); | ||
548 | if (voltage) | ||
549 | data->supply_uV = voltage; | ||
550 | |||
545 | regulator_enable(data->reg); | 551 | regulator_enable(data->reg); |
546 | /* setup a notifier block to update this if another device | 552 | /* setup a notifier block to update this if another device |
547 | * causes the voltage to change */ | 553 | * causes the voltage to change */ |
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index 9de81a4c15a..612807d9715 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c | |||
@@ -1294,7 +1294,7 @@ static int watchdog_close(struct inode *inode, struct file *filp) | |||
1294 | static ssize_t watchdog_write(struct file *filp, const char __user *buf, | 1294 | static ssize_t watchdog_write(struct file *filp, const char __user *buf, |
1295 | size_t count, loff_t *offset) | 1295 | size_t count, loff_t *offset) |
1296 | { | 1296 | { |
1297 | size_t ret; | 1297 | ssize_t ret; |
1298 | struct w83793_data *data = filp->private_data; | 1298 | struct w83793_data *data = filp->private_data; |
1299 | 1299 | ||
1300 | if (count) { | 1300 | if (count) { |
diff --git a/drivers/hwmon/wm831x-hwmon.c b/drivers/hwmon/wm831x-hwmon.c index c16e9e74c35..97b1f834a47 100644 --- a/drivers/hwmon/wm831x-hwmon.c +++ b/drivers/hwmon/wm831x-hwmon.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/err.h> | 24 | #include <linux/err.h> |
25 | #include <linux/hwmon.h> | 25 | #include <linux/hwmon.h> |
26 | #include <linux/hwmon-sysfs.h> | 26 | #include <linux/hwmon-sysfs.h> |
27 | #include <linux/slab.h> | ||
27 | 28 | ||
28 | #include <linux/mfd/wm831x/core.h> | 29 | #include <linux/mfd/wm831x/core.h> |
29 | #include <linux/mfd/wm831x/auxadc.h> | 30 | #include <linux/mfd/wm831x/auxadc.h> |