summaryrefslogtreecommitdiff
path: root/include/power_button.h
diff options
context:
space:
mode:
authorJameson Thies <jthies@google.com>2022-07-29 19:56:20 +0000
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-08-16 15:50:08 +0000
commite273823c19f2f902a67ccbdee51489119bb28669 (patch)
tree51ad7d2f81af29187996073b9cb0885492181688 /include/power_button.h
parent2e68f3ee03f51fb0a3f8c0cad6868b2f1fb34a5a (diff)
downloadchrome-ec-e273823c19f2f902a67ccbdee51489119bb28669.tar.gz
TCMPV2: Add USB PD power button support in S0/S0ix/S3 states
Currently a USB PD power button can only be used wake a device which is shutdown. To account for devices which use a USB PD power button and cannot enable a HID interface, this CL adds USB PD power button support to Suspend and On power states. When a device is either suspended or on, a short USB PD power button press will simulate a 500ms power button press and a long USB PD power button press will shutdown the device. BUG=b:236022894 TEST=make try_build_boards, make runhosttests and zmake test test-drivers. Also working interactively with a dock that supports sending alerts on button presses. BRANCH=None Signed-off-by: Jameson Thies <jthies@google.com> Change-Id: I3a8adaa01dbf07a03b0e1451d3a5af5d5f39c442 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3794615 Reviewed-by: Abe Levkoy <alevkoy@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'include/power_button.h')
-rw-r--r--include/power_button.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/power_button.h b/include/power_button.h
index a4264ab557..3c2eabf13e 100644
--- a/include/power_button.h
+++ b/include/power_button.h
@@ -69,4 +69,11 @@ int64_t get_time_dsw_pwrok(void);
*/
void board_pwrbtn_to_pch(int level);
+/**
+ * Simulates a power button press.
+ *
+ * @param duration Simulated power button press duration in ms.
+ */
+void power_button_simulate_press(int duration);
+
#endif /* __CROS_EC_POWER_BUTTON_H */