]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (pmbus/max20730) adjust the vout reading given voltage divider
authorChu Lin <linchuyuan@google.com>
Sun, 4 Oct 2020 03:14:45 +0000 (03:14 +0000)
committerGuenter Roeck <linux@roeck-us.net>
Tue, 6 Oct 2020 21:54:55 +0000 (14:54 -0700)
commit8f41de6fdfa3ca82ee57a482f9d1eaeef6c5004e
treedff7ee21914fcd8c1022033b56da80f5b02672a4
parent70f3257ba3dfe7127c779b6b516e691160b2599b
hwmon: (pmbus/max20730) adjust the vout reading given voltage divider

Problem:
We use voltage dividers so that the voltage presented at the voltage
sense pins is confusing. We might need to convert these readings to more
meaningful readings given the voltage divider.

Solution:
Read the voltage divider resistance from dts and convert the voltage
reading to a more meaningful reading.

Testing:
max20730 with voltage divider

Signed-off-by: Chu Lin <linchuyuan@google.com>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Link: https://lore.kernel.org/r/20201004031445.2321090-3-linchuyuan@google.com
[groeck: Return -EINVAL instead of -ENODEV on bad deevicetree data]
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/max20730.c