From 26944b35448a9171219ee5e25a0ae7ccd64e8b3d Mon Sep 17 00:00:00 2001 From: Matt Wang Date: Wed, 13 Jul 2022 15:26:40 +0800 Subject: kinox: modify the SIO_LEGO_EN_L for AIO button Add the SIO_LEGO_EN_L control when using the AIO device. SIO_LEGO_EN_L set to 0 can use the AIO power button. SIO_LEGO_EN_L set to 1 cannot use the AIO power button. BUG=b:238157622 BRANCH=none TEST=Has been confirmed that the AIO power button has a function. Signed-off-by: Matt Wang Change-Id: I036a7e177de440f9cf056a778589d97ad5cc1dd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3759836 Reviewed-by: Elmo Lan Reviewed-by: Ricky Chang Commit-Queue: Ricky Chang --- board/kinox/gpio.inc | 2 +- board/kinox/power_detection.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/board/kinox/gpio.inc b/board/kinox/gpio.inc index 5c5f52ecc1..6e2784e081 100644 --- a/board/kinox/gpio.inc +++ b/board/kinox/gpio.inc @@ -58,7 +58,7 @@ GPIO(CPU_C10_GATE_L, PIN(6, 7), GPIO_INPUT) GPIO(EC_PCH_PWR_BTN_ODL, PIN(C, 1), GPIO_ODR_HIGH) GPIO(GSC_EC_RECOVERY_BTN_OD, PIN(2, 2), GPIO_INPUT) -GPIO(SIO_LEGO_EN, PIN(9, 6), GPIO_INPUT | GPIO_PULL_UP) +GPIO(SIO_LEGO_EN_L, PIN(9, 6), GPIO_OUT_LOW) /* HDMI CEC */ /* TODO(b/197474873): Enable HDMI CEC */ diff --git a/board/kinox/power_detection.c b/board/kinox/power_detection.c index fdd88f1d4e..d930a7846e 100644 --- a/board/kinox/power_detection.c +++ b/board/kinox/power_detection.c @@ -291,11 +291,13 @@ void set_the_obp(int power_type_index, int adp_type) switch (adp_type) { case TIO1: case TIO2: + gpio_set_level(GPIO_SIO_LEGO_EN_L, 0); charge_manager_update_charge( CHARGE_SUPPLIER_PROPRIETARY, DEDICATED_CHARGE_PORT, &pi); break; case TINY: + gpio_set_level(GPIO_SIO_LEGO_EN_L, 1); charge_manager_update_charge(CHARGE_SUPPLIER_DEDICATED, DEDICATED_CHARGE_PORT, &pi); -- cgit v1.2.1