]> git.infradead.org Git - users/hch/misc.git/commit
hwmon: (ina2xx) Add support for current limits
authorGuenter Roeck <linux@roeck-us.net>
Wed, 28 Aug 2024 22:23:53 +0000 (15:23 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Fri, 30 Aug 2024 15:34:23 +0000 (08:34 -0700)
commit4d5c2d986757e4d6f56761af8ab689218a2bc432
tree9e9dcc666e6f020993c2c7731997da3c656abe0d
parent9965ebd1836fb75c7a80f20ca65469f5df0d6063
hwmon: (ina2xx) Add support for current limits

While the chips supported by this driver do not directly support current
limits, they do support setting shunt voltage limits. The shunt voltage
divided by the shunt resistor value is the current. On top of that,
calibration values are set such that in the shunt voltage register and
the current register report the same values. That means we can report and
configure current limits based on shunt voltage limits, and we can do so
with much better accuracy than by setting shunt voltage limits.

Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/ina2xx.rst
drivers/hwmon/ina2xx.c