power: suppy: ucs1002: disable power when max current is 0
authorLucas Stach <l.stach@pengutronix.de>
Tue, 19 Nov 2019 17:00:04 +0000 (18:00 +0100)
committerSebastian Reichel <sre@kernel.org>
Thu, 19 Dec 2019 00:07:53 +0000 (01:07 +0100)
commita3d70dacc727ada212aecb8d131a3910622763d6
treee0af520b3031f90e7189a5516caa17b6c9b4fee3
parent3c9c2d08128a510f67c5443387af5e2176407596
power: suppy: ucs1002: disable power when max current is 0

For some devices userspace needs the ability to completely cut the power
to the USB devices connected to the charge controller. An easy way to
achieve this is by allowing 0 as a valid max current and forcibly disable
the output in that case, as well as enable it again if the regulator is
in use and a non-0 max current is set.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Chris Healy <cphealy@gmail.com>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ucs1002_power.c