power: supply: axp20x_usb_power: Allow offlining
authorSamuel Holland <samuel@sholland.org>
Wed, 15 Jan 2020 03:40:46 +0000 (21:40 -0600)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Wed, 15 Jan 2020 20:37:45 +0000 (21:37 +0100)
commitecbc8dd78ed9fab5bc02d8cf2e839a3a0f2cdc5f
tree3bfde93a72e0d5948776953a9db036b2ed967d25
parent56900d4541a9e2e9263a2db9246e216edad5f928
power: supply: axp20x_usb_power: Allow offlining

AXP803/AXP813 have a flag that enables/disables the USB power supply
input. Allow control of this flag via the ONLINE property on those
variants.

It may be necessary to offline the USB power supply input when using
the USB port in OTG mode, or to allow userspace to disable charging.

When the USB VBUS input is disabled via the PATH_SEL bit, the VBUS_USED
bit in PWR_INPUT_STATUS is cleared, so there is no change needed when
getting the property.

Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Samuel Holland <samuel@sholland.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/axp20x_usb_power.c