summaryrefslogtreecommitdiff
path: root/board/lazor/board.c
diff options
context:
space:
mode:
authorWai-Hong Tam <waihong@google.com>2020-08-31 15:28:37 -0700
committerCommit Bot <commit-bot@chromium.org>2020-09-02 01:45:15 +0000
commit60dc637cf3dd8366467925b74c646a825eff53a8 (patch)
treed806a03d993fc04bab2b56b4944b51063f0bd6c3 /board/lazor/board.c
parenta88a71767b5984f0ab5e8fe0ba753b092435e99e (diff)
downloadchrome-ec-60dc637cf3dd8366467925b74c646a825eff53a8.tar.gz
sc7180: Decouple the switchcap control from the power sequence
Currently, SC7180 power sequence is tightly coupled with a single switchcap part, i.e. DA9313. Should decouple the switchcap control from the power sequence, such that more different switchcap parts can be supported. BRANCH=None BUG=b:163867792 TEST=Built the affect images and booted into kernel. Change-Id: I7f63cd22bbc308672c40a734be4f6dfc80e07158 Signed-off-by: Wai-Hong Tam <waihong@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2386480 Reviewed-by: Stephen Boyd <swboyd@chromium.org> Reviewed-by: Philip Chen <philipchen@chromium.org>
Diffstat (limited to 'board/lazor/board.c')
-rw-r--r--board/lazor/board.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/board/lazor/board.c b/board/lazor/board.c
index 76739e7380..4c2e85e442 100644
--- a/board/lazor/board.c
+++ b/board/lazor/board.c
@@ -288,6 +288,21 @@ static void board_chipset_resume(void)
}
DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_chipset_resume, HOOK_PRIO_DEFAULT);
+void board_set_switchcap_power(int enable)
+{
+ gpio_set_level(GPIO_SWITCHCAP_ON, enable);
+}
+
+int board_is_switchcap_enabled(void)
+{
+ return gpio_get_level(GPIO_SWITCHCAP_ON);
+}
+
+int board_is_switchcap_power_good(void)
+{
+ return gpio_get_level(GPIO_DA9313_GPIO0);
+}
+
void board_reset_pd_mcu(void)
{
cprints(CC_USB, "Resetting TCPCs...");