aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/ad7314.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 14:15:09 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-23 14:15:09 -0700
commit1259f6ee15c1603dcae41eb6af5a5f9cf932d4d6 (patch)
treebf85658f7c5a2c86da3bc613d7fea13bbffe4e72 /drivers/hwmon/ad7314.c
parentMerge tag 'pm-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm (diff)
parenthwmon: (it87) Make temp3 attribute conditional for IT8782F (diff)
downloadlinux-dev-1259f6ee15c1603dcae41eb6af5a5f9cf932d4d6.tar.xz
linux-dev-1259f6ee15c1603dcae41eb6af5a5f9cf932d4d6.zip
Merge tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
Pull hwmon updates from Guenter Roeck: "New driver for INA219 and INA226, added support for IT8782F and IT8783E/F to it87 driver, plus cleanups in a couple of drivers." * tag 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: hwmon: (it87) Make temp3 attribute conditional for IT8782F hwmon: (it87) Convert to use devm_kzalloc and devm_request_region hwmon: INA219 and INA226 support hwmon: (it87) Create voltage attributes only if voltage is enabled hwmon: (ntc_thermistor) Fix checkpatch warning hwmon: (ntc_thermistor) Optimize and fix build warning hwmon: (ntc_thermistor) Return error code from hwmon_device_register hwmon: (ntc_thermistor) Convert to devm_kzalloc hwmon: (ad7314) Remove unused defines, and rename OFFSET to SHIFT acpi_power_meter: clean up code around setup_attrs acpi_power_meter: drop meter_rw_attrs, use common meter_attrs acpi_power_meter: remove duplicate code between register_{ro,rw}_attrs acpi_power_meter: use a {RW,RO}_SENSOR_TEMPLATE macro to clean things up acpi_power_meter: use the same struct {rw,ro}_sensor_template for both hwmon: use module_pci_driver hwmon: (it87) Add support for IT8782F and IT8783E/F
Diffstat (limited to 'drivers/hwmon/ad7314.c')
-rw-r--r--drivers/hwmon/ad7314.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/drivers/hwmon/ad7314.c b/drivers/hwmon/ad7314.c
index f85ce70d9677..cfec802cf9ca 100644
--- a/drivers/hwmon/ad7314.c
+++ b/drivers/hwmon/ad7314.c
@@ -18,21 +18,14 @@
#include <linux/hwmon-sysfs.h>
/*
- * AD7314 power mode
- */
-#define AD7314_PD 0x2000
-
-/*
* AD7314 temperature masks
*/
-#define AD7314_TEMP_SIGN 0x200
#define AD7314_TEMP_MASK 0x7FE0
-#define AD7314_TEMP_OFFSET 5
+#define AD7314_TEMP_SHIFT 5
/*
* ADT7301 and ADT7302 temperature masks
*/
-#define ADT7301_TEMP_SIGN 0x2000
#define ADT7301_TEMP_MASK 0x3FFF
enum ad7314_variant {
@@ -73,7 +66,7 @@ static ssize_t ad7314_show_temperature(struct device *dev,
return ret;
switch (spi_get_device_id(chip->spi_dev)->driver_data) {
case ad7314:
- data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_OFFSET;
+ data = (ret & AD7314_TEMP_MASK) >> AD7314_TEMP_SHIFT;
data = (data << 6) >> 6;
return sprintf(buf, "%d\n", 250 * data);