hwmon: (ina238) Add support for current limits
authorGuenter Roeck <linux@roeck-us.net>
Sun, 31 Aug 2025 16:25:16 +0000 (09:25 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 7 Sep 2025 23:34:44 +0000 (16:34 -0700)
commita1d5f8ecb934066220b4cb1b8ba831a8726bf52f
treef837a3570551ad046e241bd118ac4780ae93d9e6
parentb7bce92f2890f6002bd3155c0510bd28b6ead4e1
hwmon: (ina238) Add support for current limits

Since the shunt voltage register and the current register now report the
same values, use the shunt voltage limit registers to report and adjust
current limits, using the same LSB as the LSB used for the actual current
register.

Handle current register accuracy differences in separate function to
improve code readability.

Reviewed-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz> # INA780
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/ina238.rst
drivers/hwmon/ina238.c