diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /drivers/hwmon/w83793.c | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'drivers/hwmon/w83793.c')
-rw-r--r-- | drivers/hwmon/w83793.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/drivers/hwmon/w83793.c b/drivers/hwmon/w83793.c index 697202e27891..854f9117f1aa 100644 --- a/drivers/hwmon/w83793.c +++ b/drivers/hwmon/w83793.c | |||
@@ -35,7 +35,6 @@ | |||
35 | #include <linux/slab.h> | 35 | #include <linux/slab.h> |
36 | #include <linux/i2c.h> | 36 | #include <linux/i2c.h> |
37 | #include <linux/hwmon.h> | 37 | #include <linux/hwmon.h> |
38 | #include <linux/smp_lock.h> | ||
39 | #include <linux/hwmon-vid.h> | 38 | #include <linux/hwmon-vid.h> |
40 | #include <linux/hwmon-sysfs.h> | 39 | #include <linux/hwmon-sysfs.h> |
41 | #include <linux/err.h> | 40 | #include <linux/err.h> |
@@ -421,14 +420,17 @@ store_beep_enable(struct device *dev, struct device_attribute *attr, | |||
421 | 420 | ||
422 | /* Write any value to clear chassis alarm */ | 421 | /* Write any value to clear chassis alarm */ |
423 | static ssize_t | 422 | static ssize_t |
424 | store_chassis_clear(struct device *dev, | 423 | store_chassis_clear_legacy(struct device *dev, |
425 | struct device_attribute *attr, const char *buf, | 424 | struct device_attribute *attr, const char *buf, |
426 | size_t count) | 425 | size_t count) |
427 | { | 426 | { |
428 | struct i2c_client *client = to_i2c_client(dev); | 427 | struct i2c_client *client = to_i2c_client(dev); |
429 | struct w83793_data *data = i2c_get_clientdata(client); | 428 | struct w83793_data *data = i2c_get_clientdata(client); |
430 | u8 val; | 429 | u8 val; |
431 | 430 | ||
431 | dev_warn(dev, "Attribute chassis is deprecated, " | ||
432 | "use intrusion0_alarm instead\n"); | ||
433 | |||
432 | mutex_lock(&data->update_lock); | 434 | mutex_lock(&data->update_lock); |
433 | val = w83793_read_value(client, W83793_REG_CLR_CHASSIS); | 435 | val = w83793_read_value(client, W83793_REG_CLR_CHASSIS); |
434 | val |= 0x80; | 436 | val |= 0x80; |
@@ -437,6 +439,28 @@ store_chassis_clear(struct device *dev, | |||
437 | return count; | 439 | return count; |
438 | } | 440 | } |
439 | 441 | ||
442 | /* Write 0 to clear chassis alarm */ | ||
443 | static ssize_t | ||
444 | store_chassis_clear(struct device *dev, | ||
445 | struct device_attribute *attr, const char *buf, | ||
446 | size_t count) | ||
447 | { | ||
448 | struct i2c_client *client = to_i2c_client(dev); | ||
449 | struct w83793_data *data = i2c_get_clientdata(client); | ||
450 | unsigned long val; | ||
451 | u8 reg; | ||
452 | |||
453 | if (strict_strtoul(buf, 10, &val) || val != 0) | ||
454 | return -EINVAL; | ||
455 | |||
456 | mutex_lock(&data->update_lock); | ||
457 | reg = w83793_read_value(client, W83793_REG_CLR_CHASSIS); | ||
458 | w83793_write_value(client, W83793_REG_CLR_CHASSIS, reg | 0x80); | ||
459 | data->valid = 0; /* Force cache refresh */ | ||
460 | mutex_unlock(&data->update_lock); | ||
461 | return count; | ||
462 | } | ||
463 | |||
440 | #define FAN_INPUT 0 | 464 | #define FAN_INPUT 0 |
441 | #define FAN_MIN 1 | 465 | #define FAN_MIN 1 |
442 | static ssize_t | 466 | static ssize_t |
@@ -1102,6 +1126,8 @@ static DEVICE_ATTR(vrm, S_IWUSR | S_IRUGO, show_vrm, store_vrm); | |||
1102 | 1126 | ||
1103 | static struct sensor_device_attribute_2 sda_single_files[] = { | 1127 | static struct sensor_device_attribute_2 sda_single_files[] = { |
1104 | SENSOR_ATTR_2(chassis, S_IWUSR | S_IRUGO, show_alarm_beep, | 1128 | SENSOR_ATTR_2(chassis, S_IWUSR | S_IRUGO, show_alarm_beep, |
1129 | store_chassis_clear_legacy, ALARM_STATUS, 30), | ||
1130 | SENSOR_ATTR_2(intrusion0_alarm, S_IWUSR | S_IRUGO, show_alarm_beep, | ||
1105 | store_chassis_clear, ALARM_STATUS, 30), | 1131 | store_chassis_clear, ALARM_STATUS, 30), |
1106 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_beep_enable, | 1132 | SENSOR_ATTR_2(beep_enable, S_IWUSR | S_IRUGO, show_beep_enable, |
1107 | store_beep_enable, NOT_USED, NOT_USED), | 1133 | store_beep_enable, NOT_USED, NOT_USED), |
@@ -1323,7 +1349,7 @@ static ssize_t watchdog_write(struct file *filp, const char __user *buf, | |||
1323 | static long watchdog_ioctl(struct file *filp, unsigned int cmd, | 1349 | static long watchdog_ioctl(struct file *filp, unsigned int cmd, |
1324 | unsigned long arg) | 1350 | unsigned long arg) |
1325 | { | 1351 | { |
1326 | static struct watchdog_info ident = { | 1352 | struct watchdog_info ident = { |
1327 | .options = WDIOF_KEEPALIVEPING | | 1353 | .options = WDIOF_KEEPALIVEPING | |
1328 | WDIOF_SETTIMEOUT | | 1354 | WDIOF_SETTIMEOUT | |
1329 | WDIOF_CARDRESET, | 1355 | WDIOF_CARDRESET, |
@@ -1333,7 +1359,6 @@ static long watchdog_ioctl(struct file *filp, unsigned int cmd, | |||
1333 | int val, ret = 0; | 1359 | int val, ret = 0; |
1334 | struct w83793_data *data = filp->private_data; | 1360 | struct w83793_data *data = filp->private_data; |
1335 | 1361 | ||
1336 | lock_kernel(); | ||
1337 | switch (cmd) { | 1362 | switch (cmd) { |
1338 | case WDIOC_GETSUPPORT: | 1363 | case WDIOC_GETSUPPORT: |
1339 | if (!nowayout) | 1364 | if (!nowayout) |
@@ -1387,7 +1412,6 @@ static long watchdog_ioctl(struct file *filp, unsigned int cmd, | |||
1387 | default: | 1412 | default: |
1388 | ret = -ENOTTY; | 1413 | ret = -ENOTTY; |
1389 | } | 1414 | } |
1390 | unlock_kernel(); | ||
1391 | return ret; | 1415 | return ret; |
1392 | } | 1416 | } |
1393 | 1417 | ||
@@ -1897,7 +1921,7 @@ static void w83793_update_nonvolatile(struct device *dev) | |||
1897 | struct w83793_data *data = i2c_get_clientdata(client); | 1921 | struct w83793_data *data = i2c_get_clientdata(client); |
1898 | int i, j; | 1922 | int i, j; |
1899 | /* | 1923 | /* |
1900 | They are somewhat "stable" registers, and to update them everytime | 1924 | They are somewhat "stable" registers, and to update them every time |
1901 | takes so much time, it's just not worthy. Update them in a long | 1925 | takes so much time, it's just not worthy. Update them in a long |
1902 | interval to avoid exception. | 1926 | interval to avoid exception. |
1903 | */ | 1927 | */ |