sunxi: Add option to prevent booting on power plug-in
authorChris Morgan <macromorgan@hotmail.com>
Fri, 21 Jan 2022 13:37:32 +0000 (13:37 +0000)
committerAndre Przywara <andre.przywara@arm.com>
Sun, 30 Jan 2022 01:25:00 +0000 (01:25 +0000)
commit52bcc4f053bd25e3508887da01c9e8cddac49b2e
treebbb02dd3a127e2900821268dffaff1aad953a661
parent78592c094e7a81cc099b3f71b05463ddcabe2a73
sunxi: Add option to prevent booting on power plug-in

For sunxi boards with the AXP209, AXP221, AXP809, and AXP818 PMICs
(plus possibly others, I only confirmed the datasheets for these),
it is sometimes desirable to not boot whenever the device is
plugged in. An example would be when using the NTC CHIP inside a
PocketCHIP.
This provides a configurable option to check if bit 0 of
register 0 of the PMIC says it was powered because of a power button
press (0) or a plug-in event (1). If the value is 1 and this option
is selected, the device shuts down shortly after printing a message
to console stating the reason why it's shutting down. Powering up the
board with the power button is not affected.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
[Andre: reword to speak of boot, remove #ifdefs]
Signed-off-by: Andre Przywara <andre.przywara@arm.com>
arch/arm/mach-sunxi/Kconfig
board/sunxi/board.c