From 0207f0c53ba644a3fc2a4df8ce6f316faf6b7033 Mon Sep 17 00:00:00 2001 From: Vadim Bendebury Date: Wed, 10 Jan 2018 11:14:20 -0800 Subject: pp: add API to show when press is expected This patch adds an API which exports current physical presence state machine state to allow the caller to see if the state machine is in one of the three distinct states: - no PP process in progress - user PP input is expected - PP process in progress, user input is not currently expected BRANCH=cr50 BUG=b:62537474 TEST=with the rest of the patches applied verified that PP state is properly communicated through this API. Change-Id: Ia10cd20c490dadef595f30e0b7257e51b6abf8fa Signed-off-by: Vadim Bendebury Reviewed-on: https://chromium-review.googlesource.com/860998 Reviewed-by: Randall Spangler Reviewed-by: Mary Ruthven --- include/physical_presence.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include') diff --git a/include/physical_presence.h b/include/physical_presence.h index f2678993fc..0acbc65691 100644 --- a/include/physical_presence.h +++ b/include/physical_presence.h @@ -61,4 +61,16 @@ int physical_detect_press(void); */ void board_physical_presence_enable(int enable); +/** + * An API to report physical presence FSM state to an external entity. Of + * interest are states when key press is currently required or is expected + * soon. + */ +enum pp_fsm_state { + PP_OTHER = 0, + PP_AWAITING_PRESS = 1, + PP_BETWEEN_PRESSES = 2, +}; +enum pp_fsm_state physical_presense_fsm_state(void); + #endif /* __CROS_EC_PHYSICAL_PRESENCE_H */ -- cgit v1.2.1