summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp421.c
diff options
context:
space:
mode:
authorKyle Roeschley <kyle.roeschley@ni.com>2019-10-14 16:03:10 +0200
committerGuenter Roeck <linux@roeck-us.net>2019-11-06 23:37:19 +0100
commit5ff02752b318ecfabe2a79cf50f8a1d563b9eb02 (patch)
tree36c5f741dcbbe240e4ef5770c475590c37666e56 /drivers/hwmon/tmp421.c
parenthwmon: (w83793d) remove redundant assignment to variable res (diff)
downloadlinux-5ff02752b318ecfabe2a79cf50f8a1d563b9eb02.tar.xz
linux-5ff02752b318ecfabe2a79cf50f8a1d563b9eb02.zip
hwmon: (tmp421) Allow reading at 2Hz instead of 0.5Hz
Our driver configures the device to read at 2Hz, but then only allows the user to read cached temp values at up to 0.5Hz. Let's allow users to read as quickly as we do. Signed-off-by: Kyle Roeschley <kyle.roeschley@ni.com> Link: https://lore.kernel.org/r/20191014140310.7438-1-kyle.roeschley@ni.com Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/tmp421.c')
-rw-r--r--drivers/hwmon/tmp421.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c
index a94e35cff3e5..83a4fab151d2 100644
--- a/drivers/hwmon/tmp421.c
+++ b/drivers/hwmon/tmp421.c
@@ -127,7 +127,8 @@ static struct tmp421_data *tmp421_update_device(struct device *dev)
mutex_lock(&data->update_lock);
- if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) {
+ if (time_after(jiffies, data->last_updated + (HZ / 2)) ||
+ !data->valid) {
data->config = i2c_smbus_read_byte_data(client,
TMP421_CONFIG_REG_1);