summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2022-04-28 14:17:28 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-04-29 19:11:27 +0000
commit90aa0fa4ae504b2b17bfb19ea90803be9c8495af (patch)
tree97c0fbe7c3e7ebbfbf431c210fd42a70eaafead0 /common
parent2dd94c6b793eaec5ed36b2d3f645f23c9837566c (diff)
downloadchrome-ec-90aa0fa4ae504b2b17bfb19ea90803be9c8495af.tar.gz
power: Add new chipset_power_on API
This is a simple API for subsystems to request the chipset to power on. It's required so that the chargesplash state machine can request a chipset power on upon AC connection. Right now it's only implemented for x86 and Qualcomm as an example. Support for other platforms can be added as required. BUG=b:228370390 BRANCH=none TEST=with follow-on CL, chargesplash can power on Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I73a0fa21d5aea6bc46ad23eed2b8d908d217fe0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3615483 Reviewed-by: caveh jalali <caveh@chromium.org> Reviewed-by: Wai-Hong Tam <waihong@google.com>
Diffstat (limited to 'common')
-rw-r--r--common/power_button_x86.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/common/power_button_x86.c b/common/power_button_x86.c
index ba972ca876..fd24f7a75b 100644
--- a/common/power_button_x86.c
+++ b/common/power_button_x86.c
@@ -459,6 +459,14 @@ static void powerbtn_x86_init(void)
}
DECLARE_HOOK(HOOK_INIT, powerbtn_x86_init, HOOK_PRIO_DEFAULT);
+void chipset_power_on(void)
+{
+ if (chipset_in_state(CHIPSET_STATE_ANY_OFF) &&
+ pwrbtn_state != PWRBTN_STATE_INIT_ON) {
+ power_button_pch_pulse();
+ }
+}
+
#ifdef CONFIG_LID_SWITCH
/**
* Handle switch changes based on lid event.
@@ -466,9 +474,9 @@ DECLARE_HOOK(HOOK_INIT, powerbtn_x86_init, HOOK_PRIO_DEFAULT);
static void powerbtn_x86_lid_change(void)
{
/* If chipset is off, pulse the power button on lid open to wake it. */
- if (lid_is_open() && chipset_in_state(CHIPSET_STATE_ANY_OFF)
- && pwrbtn_state != PWRBTN_STATE_INIT_ON)
- power_button_pch_pulse();
+ if (lid_is_open()) {
+ chipset_power_on();
+ }
}
DECLARE_HOOK(HOOK_LID_CHANGE, powerbtn_x86_lid_change, HOOK_PRIO_DEFAULT);
#endif