]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
hwmon: (isl28022) Fix current reading calculation
authorYikai Tsai <yikai.tsai.wiwynn@gmail.com>
Mon, 19 May 2025 08:40:51 +0000 (16:40 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 20 May 2025 04:56:18 +0000 (21:56 -0700)
commitb2446a16dbf2347a07af0cf994ca36576d94df77
tree18faac3c6c06e651eea16989b9a648dc6d71b9d6
parent0ddce5549012a3f3b9ddcf59822aa0d1be61e8e8
hwmon: (isl28022) Fix current reading calculation

According to the ISL28022 datasheet, bit15 of the current register is
representing -32768. Fix the calculation to properly handle this bit,
ensuring correct measurements for negative values.

Signed-off-by: Yikai Tsai <yikai.tsai.wiwynn@gmail.com>
Link: https://lore.kernel.org/r/20250519084055.3787-2-yikai.tsai.wiwynn@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/isl28022.c