]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (lm90) Only re-read registers if volatile
authorGuenter Roeck <linux@roeck-us.net>
Fri, 5 Nov 2021 23:04:52 +0000 (16:04 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 13 Jul 2022 15:38:17 +0000 (08:38 -0700)
commit06b68c96109b2866e5ed2fc94fb4aba97e1a2d6e
tree2c12deb3f0b5974ba4183726bf5eb4a6c3a9317d
parent7a763c9d3c20ce5e41682feab9df0310f4269b2b
hwmon: (lm90) Only re-read registers if volatile

When reading 16-bit volatile registers, the code uses a trick to
determine if a temperature is consistent: It reads the high part
of the register twice. If the values are the same, the code assumes
that the reading is consistent. If the value differs, the code
re-reads the second register as well and assumes that it now has
correct values.

This is only necessary for volatile registers. Add a parameter to
lm90_read16() to indicate if the register is volatile to avoid the
extra overhead for non-volatile registers.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm90.c