hwmon: (tmp102) Convert to use regmap, and drop local cache

By converting the driver to regmap, we can use regmap to cache non-volatile
registers. Stop caching the temperature register; while potentially reading
it more often can result in reading it more often than necessary, this is
offset by the gain due to not re-reading the limit registers.

A positive side effect of this change is that limit registers can now be
read and updated before the first temperature conversion is complete.

Acked-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
This commit is contained in:
Guenter Roeck
2016-06-20 09:55:46 -07:00
parent a9f92ccf33
commit 28a340db90
2 changed files with 71 additions and 78 deletions

View File

@@ -1561,6 +1561,7 @@ config SENSORS_TMP102
tristate "Texas Instruments TMP102"
depends on I2C
depends on THERMAL || !THERMAL_OF
select REGMAP_I2C
help
If you say yes here you get support for Texas Instruments TMP102
sensor chips.