mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2026-01-04 22:11:41 +00:00
In order to support waking from Deep S3 the trackpad interrupt is routed to the EC. The EC needs to enable this interrupt when going into S3, and disable it otherwise. It also needs to filter events and only wake the system when it is not in tablet mode. This is accomplished with the following rules: 1) Enable trackpad wake in S0->S3 transition, if !tablet_mode 2) Disable trackpad wake in S3->S5 transition 3) Disable trackpad wake in S3->S0 transition 4) Disable trackpad wake when entering tablet mode in S3 5) Enable trackpad wake when lid angle is <180 degrees and in S3 And finally a check in the trackpad interrupt itself to ensure that it only sends the wake event if not in tablet mode. The function to enable or disable trackpad wake uses a static variable to keep track of the enable state because when enabling the GPIO for wake it first clears pending events and if multiple transitions are happening (suspending, plus lid angle rotation) this can get called multiple times in quick succession. Currently a placeholder KEY_PRESSED event is used to wake the AP since we do not have device specific events. Fixing this behavior is tracked in b/36024430. BUG=b:35587072 BRANCH=none TEST=manual testing on eve P1b: 1) ensure that trackpad wake in clamshell mode works 2) ensure that trackpad wake in tablet mode does not waork 3) ensure that if in S3 during transition to or from tablet mode the wake event is enabled appropriately Change-Id: Ib2020b5010bdde396a3b05243894431b67edb503 Signed-off-by: Duncan Laurie <dlaurie@google.com> Reviewed-on: https://chromium-review.googlesource.com/450954 Reviewed-by: Gwendal Grignou <gwendal@chromium.org>