From 30975fb73d51f65d95e9508e4af9c85badd5388c Mon Sep 17 00:00:00 2001 From: Chris Morgan Date: Fri, 27 May 2022 13:18:20 -0500 Subject: rockchip: Add option to prevent booting on power plug-in For Rockchip boards with the all rk8xx series PMICs (excluding the rk808), it is sometimes desirable to not boot whenever the device is plugged in. An example would be for the Odroid Go Advance. This provides a configurable option to check the PMIC says it was powered because of a plug-in event. 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. This patch parallels the work done in the following patch series: https://lore.kernel.org/u-boot/20220121133732.2397273-1-andre.przywara@arm.com/ Signed-off-by: Chris Morgan Reviewed-by: Jaehoon Chung --- include/power/rk8xx_pmic.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/power') diff --git a/include/power/rk8xx_pmic.h b/include/power/rk8xx_pmic.h index 8ff0af35c5..3cbfc02195 100644 --- a/include/power/rk8xx_pmic.h +++ b/include/power/rk8xx_pmic.h @@ -214,6 +214,9 @@ enum { #define RK817_ON_SOURCE 0xf5 #define RK817_OFF_SOURCE 0xf6 +#define RK8XX_ON_PWRON BIT(7) +#define RK8XX_ON_PLUG_IN BIT(6) + struct reg_data { u8 reg; u8 val; -- cgit v1.2.1