]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (jc42) Convert register access and caching to regmap/regcache
authorMartin Blumenstingl <martin.blumenstingl@googlemail.com>
Sun, 23 Oct 2022 21:31:56 +0000 (23:31 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:08 +0000 (13:26 +0100)
commit9589ba695b5114ccd976a25160c7bd758d32d7cb
tree43824971e6e87d944772dcb694a02985a6f07cbe
parent90b713aadc1240bf2dd03d610d6c1d016a9123a2
hwmon: (jc42) Convert register access and caching to regmap/regcache

[ Upstream commit 8f2fa4726faf01094d7a5be7bd0c120c565f54d9 ]

Switch the jc42 driver to use an I2C regmap to access the registers.
Also move over to regmap's built-in caching instead of adding a
custom caching implementation. This works for JC42_REG_TEMP_UPPER,
JC42_REG_TEMP_LOWER and JC42_REG_TEMP_CRITICAL as these values never
change except when explicitly written. The cache For JC42_REG_TEMP is
dropped (regmap can't cache it because it's volatile, meaning it can
change at any time) as well for simplicity and consistency with other
drivers.

Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Link: https://lore.kernel.org/r/20221023213157.11078-2-martin.blumenstingl@googlemail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Stable-dep-of: 084ed144c448 ("hwmon: (jc42) Restore the min/max/critical temperatures on resume")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/Kconfig
drivers/hwmon/jc42.c