summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2021-06-10 13:45:24 -0700
committerCommit Bot <commit-bot@chromium.org>2021-06-11 21:27:02 +0000
commit11582e4d3dddd511ccac28502519492c506645b5 (patch)
tree208b9f07c4f9908242c9795902c520f46ea1bfaf
parent9297ed09e4180cb7cab88cf7a6189030290a5028 (diff)
downloadchrome-ec-11582e4d3dddd511ccac28502519492c506645b5.tar.gz
Homestar: When the base state changes, update the virtual switch
Do the similar thing like crrev.com/c/2884609. When the base state changes, update the virtual switch. It sends a mode change event to notify AP and then AP will query the latest virtual switch of the base state. BRANCH=Trogdor BUG=b:190736240 TEST=Built the image without error. The change has been tested on another device. Should be safe. Change-Id: Ibae150091d65367d92abe1ae665e71b5caf8429a Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2953873 Reviewed-by: Ting Shen <phoenixshen@chromium.org>
-rw-r--r--board/homestar/base_detect.c3
-rw-r--r--board/homestar/board.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/board/homestar/base_detect.c b/board/homestar/base_detect.c
index 45fd6174be..5527018160 100644
--- a/board/homestar/base_detect.c
+++ b/board/homestar/base_detect.c
@@ -7,6 +7,7 @@
#include "adc.h"
#include "adc_chip.h"
+#include "base_state.h"
#include "board.h"
#include "chipset.h"
#include "common.h"
@@ -84,9 +85,9 @@ static void base_detect_change(enum base_status status)
if (current_base_status == status)
return;
- CPRINTS("Base %sconnected", connected ? "" : "not ");
gpio_set_level(GPIO_EN_BASE, connected);
tablet_set_mode(!connected);
+ base_set_state(connected);
current_base_status = status;
}
diff --git a/board/homestar/board.h b/board/homestar/board.h
index 76acc2c5c4..7fc4376745 100644
--- a/board/homestar/board.h
+++ b/board/homestar/board.h
@@ -64,6 +64,7 @@
#define CONFIG_FRONT_PROXIMITY_SWITCH
#define CONFIG_DETACHABLE_BASE
+#define CONFIG_BASE_ATTACHED_SWITCH
/* GPIO alias */
#define GPIO_AC_PRESENT GPIO_CHG_ACOK_OD