summaryrefslogtreecommitdiff
path: root/board/guybrush
diff options
context:
space:
mode:
authorBhanu Prakash Maiya <bhanumaiya@google.com>2021-07-15 00:29:18 -0700
committerCommit Bot <commit-bot@chromium.org>2021-07-17 00:19:17 +0000
commit7baf77c0b7adaba1f93d38af569e2210483447de (patch)
tree5bfc8f167a7d6a1676880de8b17b89109d1166da /board/guybrush
parentfa3752236056753cc1c0449bfff4267f85ec60e0 (diff)
downloadchrome-ec-7baf77c0b7adaba1f93d38af569e2210483447de.tar.gz
guybrush: Enable LID ANGLE config on board
This patch implements lid_angle_peripheral_enable function. BRANCH=none BUG=b:178400750 TEST=Accel implementation tested on Guybrush $ ectool motionsense lid_angle Signed-off-by: Bhanu Prakash Maiya <bhanumaiya@chromium.org> Signed-off-by: Latchiamaran Senram <latchiamaran.senram@bosch.corp-partner.google.com> Change-Id: I0ece0c23350fd870c5fa696ae77dc221ef60dc4e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3029667 Commit-Queue: Bhanu Prakash Maiya <bhanumaiya@google.com> Tested-by: Bhanu Prakash Maiya <bhanumaiya@google.com> Auto-Submit: Bhanu Prakash Maiya <bhanumaiya@google.com> Reviewed-by: Diana Z <dzigterman@chromium.org>
Diffstat (limited to 'board/guybrush')
-rw-r--r--board/guybrush/board.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/board/guybrush/board.c b/board/guybrush/board.c
index b91512f3b5..f6a707047d 100644
--- a/board/guybrush/board.c
+++ b/board/guybrush/board.c
@@ -19,6 +19,7 @@
#include "extpower.h"
#include "gpio.h"
#include "hooks.h"
+#include "keyboard_scan.h"
#include "lid_switch.h"
#include "power.h"
#include "power_button.h"
@@ -354,3 +355,22 @@ int board_get_soc_temp(int idx, int *temp_k)
return tmp112_get_val(idx, temp_k);
}
+
+#ifndef TEST_BUILD
+void lid_angle_peripheral_enable(int enable)
+{
+ int chipset_in_s0 = chipset_in_state(CHIPSET_STATE_ON);
+
+ if (enable) {
+ keyboard_scan_enable(1, KB_SCAN_DISABLE_LID_ANGLE);
+ } else {
+ /*
+ * Ensure that the chipset is off before disabling the keyboard.
+ * When the chipset is on, the EC keeps the keyboard enabled and
+ * the AP decides whether to ignore input devices or not.
+ */
+ if (!chipset_in_s0)
+ keyboard_scan_enable(0, KB_SCAN_DISABLE_LID_ANGLE);
+ }
+}
+#endif