hwmon: (sch5627) Disallow write access if virtual registers are locked
authorArmin Wolf <W_Armin@gmx.de>
Thu, 7 Sep 2023 05:26:36 +0000 (07:26 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:08 +0000 (11:59 +0100)
commitaeb30fa670d4193b72f1f71c458a28471dde41c5
tree80b4423ad9dad32028877e7350d7fccebeec7ed2
parent11842b094a6402cb7e93010d3805de9bf25beede
hwmon: (sch5627) Disallow write access if virtual registers are locked

[ Upstream commit 7da8a635436029957c5350da3acf51d78ed64071 ]

When the lock bit inside SCH5627_REG_CTRL is set, then the virtual
registers become read-only until the next power cycle.
Disallow write access to those registers in such a case.

Tested on a Fujitsu Esprimo P720.

Fixes: aa9f833dfc12 ("hwmon: (sch5627) Add pwmX_auto_channels_temp support")
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20230907052639.16491-3-W_Armin@gmx.de
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/sch5627.c