summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYilun Lin <yllin@chromium.org>2019-09-11 11:31:14 +0800
committerCommit Bot <commit-bot@chromium.org>2019-09-12 03:54:15 +0000
commitc3bc0acb2ad2d187c9598a8ecbb7d7fd1901f83e (patch)
tree0c3a6804b08542a09c8e3395fae0119d47891e86
parent83169d99fe128e9a6cfe264968bbb8eb71b39a7f (diff)
downloadchrome-ec-c3bc0acb2ad2d187c9598a8ecbb7d7fd1901f83e.tar.gz
krane: set tablet mode switch when base attached
The switch should be set to inform AP of base status change. TEST=event_path=$(grep cros_ec_buttons /sys/class/input/event*/device/name \ | sed -nE 's|.*(/input/event[0-9]*)/.*|/dev\1|p' | head -n 1) evtest --query "${event_path}" EV_SW SW_TABLET_MODE ensure the return code is 0 (for success). BUG=b:140608847 BRANCH=none Change-Id: I4ae2a783e7fc3ebbf42fdf0ff0e9a17630631e5d Signed-off-by: Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1795723 Reviewed-by: Nicolas Boichat <drinkcat@chromium.org> Commit-Queue: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--board/kukui/base_detect_krane.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/board/kukui/base_detect_krane.c b/board/kukui/base_detect_krane.c
index 13f0fc6744..68c8dc5ef8 100644
--- a/board/kukui/base_detect_krane.c
+++ b/board/kukui/base_detect_krane.c
@@ -9,6 +9,7 @@
#include "console.h"
#include "gpio.h"
#include "hooks.h"
+#include "tablet_mode.h"
#include "timer.h"
#include "usb_pd.h"
#include "util.h"
@@ -92,7 +93,7 @@ static void base_detect_deferred(void)
{
uint64_t time_now = get_time().val;
int mv;
- int device_type;
+ enum kukui_pogo_device_type device_type;
if (base_detect_debounce_time > time_now) {
hook_call_deferred(&base_detect_deferred_data,
@@ -124,16 +125,19 @@ static void base_detect_deferred(void)
case DEVICE_TYPE_DETACHED:
enable_power_supply(0);
enable_charge(0);
+ tablet_set_mode(1);
break;
case DEVICE_TYPE_DOCK:
enable_power_supply(0);
enable_charge(1);
+ tablet_set_mode(1);
break;
case DEVICE_TYPE_KEYBOARD:
enable_charge(0);
enable_power_supply(1);
+ tablet_set_mode(0);
break;
case DEVICE_TYPE_COUNT: