]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: (adm1275) Allow setting sample averaging
authorPotin Lai <potin.lai@quantatw.com>
Wed, 2 Mar 2022 12:38:16 +0000 (20:38 +0800)
committerGuenter Roeck <linux@roeck-us.net>
Wed, 2 Mar 2022 17:57:18 +0000 (09:57 -0800)
commit4493e47972324758d9519d45ec92b964b86aa205
tree04ca197a4361cbd613dd35abfb55ca550c34f248
parent5ac4ec6473482cd53a71a2c871b2bd3562fcf0c9
hwmon: (adm1275) Allow setting sample averaging

Current driver assume PWR_AVG and VI_AVG as 1 by default, and user needs
to set sample averaging via sysfs manually.

This patch parses the properties "adi,power-sample-average" and
"adi,volt-curr-sample-average" from device tree, and setting sample
averaging during probe. Input value must be one of value in the
list [1, 2, 4, 8, 16, 32, 64, 128].

Signed-off-by: Potin Lai <potin.lai@quantatw.com>
Link: https://lore.kernel.org/r/20220302123817.27025-2-potin.lai@quantatw.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/pmbus/adm1275.c