Sometimes it is desirable to prevent a board from automatically booting as soon as the power cable is plugged in. For boards with an AXP PMIC, we can actually query the power up source.
Add a AXP_DISABLE_BOOT_ON_POWERON Kconfig option to enable this behaviour. Patch 1 prepares the PMIC header files to export the same symbol, which Chris' patch 2 then uses to do the actual work. I rearranged Chris' code to get rid of the nasty #ifdef's. This function is already a "good" example of why #ifdefs are bad, we don't need to add to that. I will try to clean that up further, but for now this doesn't need to block this patch. Cheers, Andre. Andre Przywara (1): pmic: axp: define ALDO_IN startup bit Chris Morgan (1): sunxi: Add option to prevent booting on power plug-in arch/arm/mach-sunxi/Kconfig | 10 ++++++++++ board/sunxi/board.c | 11 +++++++++++ include/axp152.h | 2 ++ include/axp209.h | 3 ++- include/axp221.h | 3 ++- include/axp305.h | 3 +++ include/axp809.h | 3 ++- include/axp818.h | 3 ++- 8 files changed, 34 insertions(+), 4 deletions(-) -- 2.25.1