]> git.karo-electronics.de Git - karo-tx-linux.git/commit
hwmon: (adt7410) Don't re-read non-volatile registers
authorLars-Peter Clausen <lars@metafoo.de>
Tue, 12 Mar 2013 10:38:45 +0000 (11:38 +0100)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 21 Mar 2013 15:09:41 +0000 (08:09 -0700)
commite8e901f6282e6dadf659dbcaf3ebd84dd7c6dc56
tree0127e16e80674d902e66eaaa86ad0fbaf8ad7b9e
parent2f90226d6e089b400619f51aaca1f5bd83f54a42
hwmon: (adt7410) Don't re-read non-volatile registers

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>
drivers/hwmon/adt7410.c