diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-15 17:05:44 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-15 17:05:44 -0500 |
| commit | 477d4e4fbedafb1cc636124f2de06defceb399b0 (patch) | |
| tree | b855e5b1488f224c08ab2576d0c15e187842cba7 | |
| parent | fe9d1159b299642f9e1a9b56bbf67a24c31bb418 (diff) | |
| parent | 52d159eecced3e4ead901e2a14347f5c11ea4bab (diff) | |
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
hwmon: (w83795) Check for BEEP pin availability
hwmon: (w83795) Clear intrusion alarm immediately
hwmon: (w83795) Read the intrusion state properly
hwmon: (w83795) Print the actual temperature channels as sources
hwmon: (w83795) List all usable temperature sources
hwmon: (w83795) Expose fan control method
hwmon: (w83795) Fix fan control mode attributes
hwmon: (lm95241) Check validity of input values
hwmon: Change mail address of Hans J. Koch
| -rw-r--r-- | drivers/hwmon/amc6821.c | 2 | ||||
| -rw-r--r-- | drivers/hwmon/lm93.c | 4 | ||||
| -rw-r--r-- | drivers/hwmon/lm95241.c | 19 | ||||
| -rw-r--r-- | drivers/hwmon/max6650.c | 2 | ||||
| -rw-r--r-- | drivers/hwmon/w83795.c | 207 |
5 files changed, 192 insertions, 42 deletions
diff --git a/drivers/hwmon/amc6821.c b/drivers/hwmon/amc6821.c index fa9708c2d723..4033974d1bb3 100644 --- a/drivers/hwmon/amc6821.c +++ b/drivers/hwmon/amc6821.c | |||
| @@ -4,7 +4,7 @@ | |||
| 4 | Copyright (C) 2009 T. Mertelj <tomaz.mertelj@guest.arnes.si> | 4 | Copyright (C) 2009 T. Mertelj <tomaz.mertelj@guest.arnes.si> |
| 5 | 5 | ||
| 6 | Based on max6650.c: | 6 | Based on max6650.c: |
| 7 | Copyright (C) 2007 Hans J. Koch <hjk@linutronix.de> | 7 | Copyright (C) 2007 Hans J. Koch <hjk@hansjkoch.de> |
| 8 | 8 | ||
| 9 | This program is free software; you can redistribute it and/or modify | 9 | This program is free software; you can redistribute it and/or modify |
| 10 | it under the terms of the GNU General Public License as published by | 10 | it under the terms of the GNU General Public License as published by |
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c index 6669255aadcf..c9ed14eba5a6 100644 --- a/drivers/hwmon/lm93.c +++ b/drivers/hwmon/lm93.c | |||
| @@ -20,7 +20,7 @@ | |||
| 20 | Adapted to 2.6.20 by Carsten Emde <cbe@osadl.org> | 20 | Adapted to 2.6.20 by Carsten Emde <cbe@osadl.org> |
| 21 | Copyright (c) 2006 Carsten Emde, Open Source Automation Development Lab | 21 | Copyright (c) 2006 Carsten Emde, Open Source Automation Development Lab |
| 22 | 22 | ||
| 23 | Modified for mainline integration by Hans J. Koch <hjk@linutronix.de> | 23 | Modified for mainline integration by Hans J. Koch <hjk@hansjkoch.de> |
| 24 | Copyright (c) 2007 Hans J. Koch, Linutronix GmbH | 24 | Copyright (c) 2007 Hans J. Koch, Linutronix GmbH |
| 25 | 25 | ||
| 26 | This program is free software; you can redistribute it and/or modify | 26 | This program is free software; you can redistribute it and/or modify |
| @@ -2629,7 +2629,7 @@ static void __exit lm93_exit(void) | |||
| 2629 | } | 2629 | } |
| 2630 | 2630 | ||
| 2631 | MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>, " | 2631 | MODULE_AUTHOR("Mark M. Hoffman <mhoffman@lightlink.com>, " |
| 2632 | "Hans J. Koch <hjk@linutronix.de"); | 2632 | "Hans J. Koch <hjk@hansjkoch.de>"); |
| 2633 | MODULE_DESCRIPTION("LM93 driver"); | 2633 | MODULE_DESCRIPTION("LM93 driver"); |
| 2634 | MODULE_LICENSE("GPL"); | 2634 | MODULE_LICENSE("GPL"); |
| 2635 | 2635 | ||
diff --git a/drivers/hwmon/lm95241.c b/drivers/hwmon/lm95241.c index 464340f25496..4546d82f024a 100644 --- a/drivers/hwmon/lm95241.c +++ b/drivers/hwmon/lm95241.c | |||
| @@ -128,9 +128,12 @@ static ssize_t set_interval(struct device *dev, struct device_attribute *attr, | |||
| 128 | { | 128 | { |
| 129 | struct i2c_client *client = to_i2c_client(dev); | 129 | struct i2c_client *client = to_i2c_client(dev); |
| 130 | struct lm95241_data *data = i2c_get_clientdata(client); | 130 | struct lm95241_data *data = i2c_get_clientdata(client); |
| 131 | unsigned long val; | ||
| 131 | 132 | ||
| 132 | strict_strtol(buf, 10, &data->interval); | 133 | if (strict_strtoul(buf, 10, &val) < 0) |
| 133 | data->interval = data->interval * HZ / 1000; | 134 | return -EINVAL; |
| 135 | |||
| 136 | data->interval = val * HZ / 1000; | ||
| 134 | 137 | ||
| 135 | return count; | 138 | return count; |
| 136 | } | 139 | } |
| @@ -188,7 +191,9 @@ static ssize_t set_type##flag(struct device *dev, \ | |||
| 188 | struct lm95241_data *data = i2c_get_clientdata(client); \ | 191 | struct lm95241_data *data = i2c_get_clientdata(client); \ |
| 189 | \ | 192 | \ |
| 190 | long val; \ | 193 | long val; \ |
| 191 | strict_strtol(buf, 10, &val); \ | 194 | \ |
| 195 | if (strict_strtol(buf, 10, &val) < 0) \ | ||
| 196 | return -EINVAL; \ | ||
| 192 | \ | 197 | \ |
| 193 | if ((val == 1) || (val == 2)) { \ | 198 | if ((val == 1) || (val == 2)) { \ |
| 194 | \ | 199 | \ |
| @@ -227,7 +232,9 @@ static ssize_t set_min##flag(struct device *dev, \ | |||
| 227 | struct lm95241_data *data = i2c_get_clientdata(client); \ | 232 | struct lm95241_data *data = i2c_get_clientdata(client); \ |
| 228 | \ | 233 | \ |
| 229 | long val; \ | 234 | long val; \ |
| 230 | strict_strtol(buf, 10, &val); \ | 235 | \ |
| 236 | if (strict_strtol(buf, 10, &val) < 0) \ | ||
| 237 | return -EINVAL;\ | ||
| 231 | \ | 238 | \ |
| 232 | mutex_lock(&data->update_lock); \ | 239 | mutex_lock(&data->update_lock); \ |
| 233 | \ | 240 | \ |
| @@ -256,7 +263,9 @@ static ssize_t set_max##flag(struct device *dev, \ | |||
| 256 | struct lm95241_data *data = i2c_get_clientdata(client); \ | 263 | struct lm95241_data *data = i2c_get_clientdata(client); \ |
| 257 | \ | 264 | \ |
| 258 | long val; \ | 265 | long val; \ |
| 259 | strict_strtol(buf, 10, &val); \ | 266 | \ |
| 267 | if (strict_strtol(buf, 10, &val) < 0) \ | ||
| 268 | return -EINVAL; \ | ||
| 260 | \ | 269 | \ |
| 261 | mutex_lock(&data->update_lock); \ | 270 | mutex_lock(&data->update_lock); \ |
| 262 | \ | 271 | \ |
diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c index a0160ee5caef..9a11532ecae8 100644 --- a/drivers/hwmon/max6650.c +++ b/drivers/hwmon/max6650.c | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | * max6650.c - Part of lm_sensors, Linux kernel modules for hardware | 2 | * max6650.c - Part of lm_sensors, Linux kernel modules for hardware |
| 3 | * monitoring. | 3 | * monitoring. |
| 4 | * | 4 | * |
| 5 | * (C) 2007 by Hans J. Koch <hjk@linutronix.de> | 5 | * (C) 2007 by Hans J. Koch <hjk@hansjkoch.de> |
| 6 | * | 6 | * |
| 7 | * based on code written by John Morris <john.morris@spirentcom.com> | 7 | * based on code written by John Morris <john.morris@spirentcom.com> |
| 8 | * Copyright (c) 2003 Spirent Communications | 8 | * Copyright (c) 2003 Spirent Communications |
diff --git a/drivers/hwmon/w83795.c b/drivers/hwmon/w83795.c index 1d840aa83782..cdbc7448491e 100644 --- a/drivers/hwmon/w83795.c +++ b/drivers/hwmon/w83795.c | |||
| @@ -165,10 +165,14 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = { | |||
| 165 | 165 | ||
| 166 | #define W83795_REG_VID_CTRL 0x6A | 166 | #define W83795_REG_VID_CTRL 0x6A |
| 167 | 167 | ||
| 168 | #define W83795_REG_ALARM_CTRL 0x40 | ||
| 169 | #define ALARM_CTRL_RTSACS (1 << 7) | ||
| 168 | #define W83795_REG_ALARM(index) (0x41 + (index)) | 170 | #define W83795_REG_ALARM(index) (0x41 + (index)) |
| 171 | #define W83795_REG_CLR_CHASSIS 0x4D | ||
| 169 | #define W83795_REG_BEEP(index) (0x50 + (index)) | 172 | #define W83795_REG_BEEP(index) (0x50 + (index)) |
| 170 | 173 | ||
| 171 | #define W83795_REG_CLR_CHASSIS 0x4D | 174 | #define W83795_REG_OVT_CFG 0x58 |
| 175 | #define OVT_CFG_SEL (1 << 7) | ||
| 172 | 176 | ||
| 173 | 177 | ||
| 174 | #define W83795_REG_FCMS1 0x201 | 178 | #define W83795_REG_FCMS1 0x201 |
| @@ -178,6 +182,14 @@ static const u8 IN_LSB_SHIFT_IDX[][2] = { | |||
| 178 | 182 | ||
| 179 | #define W83795_REG_TSS(index) (0x209 + (index)) | 183 | #define W83795_REG_TSS(index) (0x209 + (index)) |
| 180 | 184 | ||
| 185 | #define TSS_MAP_RESERVED 0xff | ||
| 186 | static const u8 tss_map[4][6] = { | ||
| 187 | { 0, 1, 2, 3, 4, 5}, | ||
| 188 | { 6, 7, 8, 9, 0, 1}, | ||
| 189 | {10, 11, 12, 13, 2, 3}, | ||
| 190 | { 4, 5, 4, 5, TSS_MAP_RESERVED, TSS_MAP_RESERVED}, | ||
| 191 | }; | ||
| 192 | |||
| 181 | #define PWM_OUTPUT 0 | 193 | #define PWM_OUTPUT 0 |
| 182 | #define PWM_FREQ 1 | 194 | #define PWM_FREQ 1 |
| 183 | #define PWM_START 2 | 195 | #define PWM_START 2 |
| @@ -369,6 +381,7 @@ struct w83795_data { | |||
| 369 | u8 setup_pwm[3]; /* Register value */ | 381 | u8 setup_pwm[3]; /* Register value */ |
| 370 | 382 | ||
| 371 | u8 alarms[6]; /* Register value */ | 383 | u8 alarms[6]; /* Register value */ |
| 384 | u8 enable_beep; | ||
| 372 | u8 beeps[6]; /* Register value */ | 385 | u8 beeps[6]; /* Register value */ |
| 373 | 386 | ||
| 374 | char valid; | 387 | char valid; |
| @@ -499,8 +512,11 @@ static void w83795_update_limits(struct i2c_client *client) | |||
| 499 | } | 512 | } |
| 500 | 513 | ||
| 501 | /* Read beep settings */ | 514 | /* Read beep settings */ |
| 502 | for (i = 0; i < ARRAY_SIZE(data->beeps); i++) | 515 | if (data->enable_beep) { |
| 503 | data->beeps[i] = w83795_read(client, W83795_REG_BEEP(i)); | 516 | for (i = 0; i < ARRAY_SIZE(data->beeps); i++) |
| 517 | data->beeps[i] = | ||
| 518 | w83795_read(client, W83795_REG_BEEP(i)); | ||
| 519 | } | ||
| 504 | 520 | ||
| 505 | data->valid_limits = 1; | 521 | data->valid_limits = 1; |
| 506 | } | 522 | } |
| @@ -577,6 +593,7 @@ static struct w83795_data *w83795_update_device(struct device *dev) | |||
| 577 | struct i2c_client *client = to_i2c_client(dev); | 593 | struct i2c_client *client = to_i2c_client(dev); |
| 578 | struct w83795_data *data = i2c_get_clientdata(client); | 594 | struct w83795_data *data = i2c_get_clientdata(client); |
| 579 | u16 tmp; | 595 | u16 tmp; |
| 596 | u8 intrusion; | ||
| 580 | int i; | 597 | int i; |
| 581 | 598 | ||
| 582 | mutex_lock(&data->update_lock); | 599 | mutex_lock(&data->update_lock); |
| @@ -648,9 +665,24 @@ static struct w83795_data *w83795_update_device(struct device *dev) | |||
| 648 | w83795_read(client, W83795_REG_PWM(i, PWM_OUTPUT)); | 665 | w83795_read(client, W83795_REG_PWM(i, PWM_OUTPUT)); |
