summaryrefslogtreecommitdiff
path: root/drivers/hwmon/adt7410.c
AgeCommit message (Collapse)AuthorFilesLines
2013-04-08hwmon: (adt7x10) Add alarm interrupt supportLars-Peter Clausen1-2/+2
This allows an userspace application to poll() on the alarm files to get notified in case of a temperature threshold event. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (adt7410) Add support for the adt7310/adt7320Lars-Peter Clausen1-436/+31
The adt7310/adt7320 is the SPI version of the adt7410/adt7420. The register map layout is a bit different, i.e. the register addresses differ between the two variants, but the bit layouts of the individual registers are identical. So both chip variants can easily be supported by the same driver. The issue of non matching register address layouts is solved by a simple look-up table which translates the I2C addresses to the SPI addresses. The patch moves the bulk of the adt7410 driver to a common module that will be shared by the adt7410 and adt7310 drivers. This common module implements the driver logic and uses a set of virtual functions to perform IO access. The adt7410 and adt7310 driver modules provide proper implementations of these IO accessor functions for I2C respective SPI. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-04-08hwmon: (adt7410) Don't re-read non-volatile registersLars-Peter Clausen1-33/+58
Currently each time the temperature register is read the driver also reads the threshold and hysteresis registers. This increases the amount of I2C traffic and time needed to read the temperature by a factor of ~5. Neither the threshold nor the hysteresis change on their own, so once we have read them, we should be able to just use the cached value of the registers. This patch modifies the code accordingly and only reads the threshold and hysteresis registers once during probe. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-02-20hwmon: (adt7410) Add device table entry for the adt7420Lars-Peter Clausen1-1/+2
The adt7420 is software compatible to the adt7410. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-02-20hwmon: (adt7410) Use I2C_ADDRS helper macroLars-Peter Clausen1-5/+1
Use the I2C_ADDRS macro to initialize the I2C device's address_list. Doing so saves a few lines of boilerplate code. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-02-20hwmon: (adt7410) Use the SIMPLE_DEV_PM_OPS helper macroLars-Peter Clausen1-4/+2
Use the SIMPLE_DEV_PM_OPS macro to declare the driver's pm_ops. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-02-20hwmon: (adt7410) Let suspend/resume depend on CONFIG_PM_SLEEPLars-Peter Clausen1-1/+1
Only build the suspend/resume code if CONFIG_PM_SLEEP is selected. Currently the code is built if CONFIG_PM is selected, but it will also be selected if only runtime PM support is built into the kernel. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-02-20hwmon: (adt7410) Clear unwanted bits in the config registerLars-Peter Clausen1-0/+1
Make sure to clear the mode bits from the config register before setting the new mode. Otherwise we might end up with a different mode than we want to. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Reviewed-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2013-01-26hwmon: Replace SENSORS_LIMIT with clamp_valGuenter Roeck1-5/+5
SENSORS_LIMIT and the generic clamp_val have the same functionality, and clamp_val is more efficient. This patch reduces text size by 9052 bytes and bss size by 11624 bytes for x86_64 builds. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: George Joseph <george.joseph@fairview5.com> Acked-by: Jean Delvare <khali@linux-fr.org>
2012-09-24hwmon: (adt7410) handle errors from adt7410_update_device()Dan Carpenter1-2/+7
Smatch complains that adt7410_update_device() can return error pointers. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
2012-09-24hwmon: Driver for ADT7410Hartmut Knaack1-0/+459
This patch brings basic support for the Analog Devices ADT7410 temperature sensor. The following functionality has been implemented: * get current temperature * get/set minimum, maximum and critical temperature * get/set hysteresis * get alarm events for minimum, maximum and critical temperature All implemented sysfs attributes have been sucessfully tested at temperatures of 15°C to 40°C. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Guenter Roeck <linux@roeck-us.net>