summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorEdward Hill <ecgh@chromium.org>2020-08-26 16:43:28 -0600
committerCommit Bot <commit-bot@chromium.org>2020-08-29 02:43:31 +0000
commitd986a057af8246e6062b60f223a5ecbcdd6144de (patch)
treece9ad8276ae0f4c930f02b101e777f548ed0f3c9 /common
parentdeed6c7cd265fe0cbfd2d64e3082cd8d8b9a2f38 (diff)
downloadchrome-ec-d986a057af8246e6062b60f223a5ecbcdd6144de.tar.gz
power_button: Add CONFIG_POWER_BUTTON_TO_PCH_CUSTOM
Allow board to provide board_pwrbtn_to_pch function to override the default behavior of gpio_set_level(GPIO_PCH_PWRBTN_L, level) as the means for asserting power button signal to PCH. BUG=b:164921478 BRANCH=zork TEST=power button timing Signed-off-by: Edward Hill <ecgh@chromium.org> Change-Id: I8f5ffb2759318fdc941155b60be8bf4aa7dd4771 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2378557 Reviewed-by: Furquan Shaikh <furquan@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/power_button_x86.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index 0d2d5e5b71..661f9b2a3d 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -145,7 +145,10 @@ static void set_pwrbtn_to_pch(int high, int init)
}
#endif
CPRINTS("PB PCH pwrbtn=%s", high ? "HIGH" : "LOW");
- gpio_set_level(GPIO_PCH_PWRBTN_L, high);
+ if (IS_ENABLED(CONFIG_POWER_BUTTON_TO_PCH_CUSTOM))
+ board_pwrbtn_to_pch(high);
+ else
+ gpio_set_level(GPIO_PCH_PWRBTN_L, high);
}
void power_button_pch_press(void)