]> www.infradead.org Git - users/dwmw2/linux.git/commit
power: supply: axp20x_ac_power: Fix reporting online status
authorSamuel Holland <samuel@sholland.org>
Mon, 13 Jan 2020 03:53:03 +0000 (21:53 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:36:54 +0000 (04:36 -0800)
commit74c3dfabd3a0ff4737f781fe239cda5d26ac2f77
tree09578687c3cdf91bf4c99b40bd24b6a45486f5dc
parent716e0dc338578e1ef9a9874954f40d95a1d3a2a8
power: supply: axp20x_ac_power: Fix reporting online status

commit 1c51aad8475d670ad58ae60adc9d32342381df8d upstream.

AXP803/AXP813 have a flag that enables/disables the AC power supply
input. This flag does not affect the status bits in PWR_INPUT_STATUS.
Its effect can be verified by checking the battery charge/discharge
state (bit 2 of PWR_INPUT_STATUS), or by examining the current draw on
the AC input.

Take this flag into account when getting the ONLINE property of the AC
input, on PMICs where this flag is present.

Fixes: 7693b5643fd2 ("power: supply: add AC power supply driver for AXP813")
Cc: stable@vger.kernel.org
Signed-off-by: Samuel Holland <samuel@sholland.org>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/power/supply/axp20x_ac_power.c