summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjohnwc_yeh <johnwc_yeh@compal.corp-partner.google.com>2021-08-26 17:24:02 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-31 01:46:51 +0000
commit79a2b10cc1588a5b5b0b06b93b7fc67c6759546c (patch)
treec6a1bec24ec23d8ed69a9cb8efe4414531c75233
parent885296030be2a8fcfed6fa287a281a341b52145d (diff)
downloadchrome-ec-79a2b10cc1588a5b5b0b06b93b7fc67c6759546c.tar.gz
Corori: Add GPIOC0 EC_ACOK_OTG for AC OTG OVP protect enable
When the Type-C AC plug-in and got AC status from RAA489000 then enables charger the OTP/OVP protect function. BUG=b:197039091 BRANCH=keeby TEST=make BOARD=corori Signed-off-by: johnwc_yeh <johnwc_yeh@compal.corp-partner.google.com> Change-Id: Ic7c3db22c2eece70b2f93970fce0089b54a75722 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3121585 Reviewed-by: Elmo Lan <elmo_lan@compal.corp-partner.google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Aseda Aboagye <aaboagye@chromium.org>
-rw-r--r--board/corori/board.c13
-rw-r--r--board/corori/gpio.inc2
2 files changed, 15 insertions, 0 deletions
diff --git a/board/corori/board.c b/board/corori/board.c
index a8dc9d5b53..cb92c04f60 100644
--- a/board/corori/board.c
+++ b/board/corori/board.c
@@ -443,3 +443,16 @@ uint16_t tcpc_get_alert_status(void)
return status;
}
+
+static void board_extpower(void)
+{
+ int extpower_present;
+
+ if (pd_is_connected(0))
+ extpower_present = extpower_is_present();
+ else
+ extpower_present = 0;
+
+ gpio_set_level(GPIO_EC_ACOK_OTG, extpower_present);
+}
+DECLARE_HOOK(HOOK_AC_CHANGE, board_extpower, HOOK_PRIO_DEFAULT);
diff --git a/board/corori/gpio.inc b/board/corori/gpio.inc
index 204b798314..5f6f119648 100644
--- a/board/corori/gpio.inc
+++ b/board/corori/gpio.inc
@@ -88,6 +88,8 @@ GPIO(EC_AP_USB_C0_HPD, PIN(9, 3), GPIO_OUT_LOW)
GPIO(HDMI_SEL_L, PIN(7, 2), GPIO_OUT_HIGH)
GPIO(EC_BATTERY_PRES_ODL, PIN(E, 1), GPIO_INPUT)
GPIO(EN_USB_A0_VBUS, PIN(4, 1), GPIO_OUT_LOW) /* Enable A0 5V Charging */
+
+GPIO(EC_ACOK_OTG, PIN(C, 0), GPIO_OUT_LOW) /* OTG-OVP protect enable */
/*
* Lalala doesn't have these physical pins coming to the EC but uses other
* logic.