]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: bq25890: Add support for setting IINLIM
authorMarek Vasut <marex@denx.de>
Mon, 1 Aug 2022 02:57:27 +0000 (04:57 +0200)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sun, 11 Sep 2022 12:39:15 +0000 (14:39 +0200)
commitc381adb27cb16163d76ca92924a948050ea7da6e
treec32c6ca69ca7655ed8f4aad73051b14d3689fab0
parent3dee4c1b63d1ec650d1b2401f983d7d24642736f
power: supply: bq25890: Add support for setting IINLIM

Let user set input current limit via sysfs. This is useful in case there
are multiple chargers connected to the device, each of which with its own
arbitrary maximum current which it can provide, some of which may provide
more than the default 500mA. In that case, userspace can listen for plug
events generated by each charger and adjust the current limit accordingly,
e.g. to permit battery to charge faster.

Note that the IINLIM is reset every time the bq25890 is disconnected from
a charger, so the userspace must adjust the limit repeatly on every plug
event.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/bq25890_charger.c