]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: cros: allow to set input voltage and current limit
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Tue, 7 May 2019 09:52:48 +0000 (11:52 +0200)
committerSebastian Reichel <sre@kernel.org>
Fri, 28 Jun 2019 15:28:27 +0000 (17:28 +0200)
commitc381c611075e307f542a166829fd0a12a5e94b12
tree5fcbf30bd0b5b075ebebb8f048b2ea1b8066f91b
parent4690679716124ddf0e68d64b2f53ea2d2c964feb
power: supply: cros: allow to set input voltage and current limit

This patch allows reading and writing the input voltage and current
limit through the POWER_SUPPLY_PROP_INPUT_VOLTAGE_LIMIT and
POWER_SUPPLY_PROP_INPUT_CURRENT_LIMIT sysfs properties. This allows
userspace to see current values and to re-configure these values at
runtime based on system-level knowledge or user input.

By default there is no limit, this is reported as a -1 when reading from
userspace. Writing a value will set the current or voltage limit in uA
or uV, and writing any negative value will remove that limit.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/cros_usbpd-charger.c