summaryrefslogtreecommitdiff
path: root/power
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-06-30 18:19:27 -0700
committerCommit Bot <commit-bot@chromium.org>2020-07-01 19:45:14 +0000
commit7465442b16f4f45f6353c27d10fb2f31231ae18e (patch)
tree5f55436bdb825e1dbfdffe37f03711b4174b204c /power
parent70ff3fbb9d7ebf9a20b42fecf7cdac0639347f7a (diff)
downloadchrome-ec-7465442b16f4f45f6353c27d10fb2f31231ae18e.tar.gz
sc7180: Add debug message for the switchcap no power case
On some board, we saw the behavior that the switchcap asserts its GPIO to report the output rail in a good range but actually the rail has no voltage. This CL adds a debug message for it by checking the PMIC_KPD_PWR_ODL GPIO value. This open-drain GPIO should be pulled by the PMIC. For the switchcap no power case, the message prints out and cancel the power on sequence. BRANCH=None BUG=b:159776965 TEST=Manually overrode the PMIC_KPD_PWR_ODL to low. Triggered the power on sequence and checked it cancelled: [28.365326 power state 1 = S5, in 0x0005] [28.365757 power on 4] RTC: 0x5eb941ba (1589199290.00 s) [28.366407 power state 5 = S5->S3, in 0x0005] [28.366862 power button released in time] [28.369017 set_system_power(1)] [28.495140 set_pmic_pwron(1)] [28.495614 PMIC_KPD_PWR_ODL not pulled up by PMIC; cancel pwron] [28.496110 POWER_GOOD not seen in time] [28.496487 set_system_power(0)] RTC: 0x5eb941ba (1589199290.00 s) [28.507645 power state 1 = S5, in 0x0005] Change-Id: Id2362a8c87746cc756192aae0b0489cf3d95d133 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2277344 Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Diffstat (limited to 'power')
-rw-r--r--power/sc7180.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/power/sc7180.c b/power/sc7180.c
index 0af461e680..4372973914 100644
--- a/power/sc7180.c
+++ b/power/sc7180.c
@@ -400,6 +400,11 @@ static int set_pmic_pwron(int enable)
if (enable == is_pmic_pwron())
return EC_SUCCESS;
+ if (!gpio_get_level(GPIO_PMIC_KPD_PWR_ODL)) {
+ CPRINTS("PMIC_KPD_PWR_ODL not pulled up by PMIC; cancel pwron");
+ return EC_ERROR_UNKNOWN;
+ }
+
/*
* Power-on sequence:
* 1. Hold down PMIC_KPD_PWR_ODL, which is a power-on trigger