]> 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>
Sun, 17 Mar 2013 23:27:59 +0000 (16:27 -0700)
commit1ea55deb5c02a2f5c2fab552cb1762a2ff7f5fa6
tree11b7e9b6ee013832808a7000a432c35070e361c9
parent9ebb512bb9fcad5390ad9dece7864e0bdfae1a58
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