Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Kyle Roeschley and committed by
Guenter Roeck
5ff02752 58a24b52

+2 -1
+2 -1
drivers/hwmon/tmp421.c
··· 127 127 128 128 mutex_lock(&data->update_lock); 129 129 130 - if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) { 130 + if (time_after(jiffies, data->last_updated + (HZ / 2)) || 131 + !data->valid) { 131 132 data->config = i2c_smbus_read_byte_data(client, 132 133 TMP421_CONFIG_REG_1); 133 134