]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (max16065) Fix alarm attributes
authorGuenter Roeck <linux@roeck-us.net>
Sun, 21 Jul 2024 13:41:17 +0000 (06:41 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:10:50 +0000 (15:10 +0200)
commitd5c43b103987149e2b60e8156eadb9e173ae3cc1
treec9c7c9f34dfe7899cc465c4609f24beaf09c5c3b
parentd522354ca1c8bbc4bb9f947631553e6bf9a8aa22
hwmon: (max16065) Fix alarm attributes

[ Upstream commit 119abf7d1815f098f7f91ae7abc84324a19943d7 ]

Chips reporting overcurrent alarms report it in the second alarm register.
That means the second alarm register has to be read, even if the chip only
supports 8 or fewer ADC channels.

MAX16067 and MAX16068 report undervoltage and overvoltage alarms in
separate registers. Fold register contents together to report both with
the existing alarm attribute. This requires actually storing the chip type
in struct max16065_data. Rename the variable 'chip' to match the variable
name used in the probe function.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Fixes: f5bae2642e3d ("hwmon: Driver for MAX16065 System Manager and compatibles")
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/hwmon/max16065.c