summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Yilun Lin <yllin@chromium.org>2021-08-19 09:10:06 +0800
committerCommit Bot <commit-bot@chromium.org>2021-08-20 06:40:54 +0000
commit1fb82e8268c4c31b21f910a0682d35a22ee5c45d (patch)
tree4bbed7318db1444dc02c1d319a3ec6337351605d
parentd7e8744e60998be4e8e4df18337171be67b093ff (diff)
downloadchrome-ec-1fb82e8268c4c31b21f910a0682d35a22ee5c45d.tar.gz
spherion: enable USM
Ultrasonic Module(USM) is used for noise cancelling the buzzing sound while charging. The sound is louder if we have USB peripheral connected. We only enable this function in S0, and disable it in S3 because the power consumption is significant. BUG=b:185978753 TEST=make buildall BRANCH=asurada Change-Id: Ic2bfbf5a1364f5da6d776a1be56abb66934f9496 Signed-off-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3105905 Tested-by: Eric Yilun Lin <yllin@google.com> Reviewed-by: Aseda Aboagye <aaboagye@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@google.com>
-rw-r--r--board/spherion/board.c12
-rw-r--r--board/spherion/gpio.inc2
2 files changed, 13 insertions, 1 deletions
diff --git a/board/spherion/board.c b/board/spherion/board.c
index 670eb91dd9..395791649f 100644
--- a/board/spherion/board.c
+++ b/board/spherion/board.c
@@ -112,3 +112,15 @@ void board_usb_mux_init(void)
PS8743_USB_EQ_RX_12_8_DB);
}
DECLARE_HOOK(HOOK_INIT, board_usb_mux_init, HOOK_PRIO_INIT_I2C + 1);
+
+static void board_suspend(void)
+{
+ gpio_set_level(GPIO_EN_5V_USM, 0);
+}
+DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, board_suspend, HOOK_PRIO_DEFAULT);
+
+static void board_resume(void)
+{
+ gpio_set_level(GPIO_EN_5V_USM, 1);
+}
+DECLARE_HOOK(HOOK_CHIPSET_RESUME, board_resume, HOOK_PRIO_DEFAULT);
diff --git a/board/spherion/gpio.inc b/board/spherion/gpio.inc
index a1b565b7d8..b618911e02 100644
--- a/board/spherion/gpio.inc
+++ b/board/spherion/gpio.inc
@@ -77,8 +77,8 @@ GPIO(EC_BATT_PRES_ODL, PIN(C, 0), GPIO_INPUT)
GPIO(BC12_DET_EN, PIN(J, 5), GPIO_OUT_LOW) /* EN_USB_C0_BC12_DET */
GPIO(EN_EC_ID_ODL, PIN(H, 5), GPIO_ODR_LOW)
GPIO(ENTERING_RW, PIN(C, 5), GPIO_OUT_LOW) /* EC_ENTERING_RW */
-GPIO(EC_USB_C0_MUX_RESET_L, PIN(D, 7), GPIO_OUT_HIGH)
GPIO(EC_KB_BL_EN, PIN(G, 3), GPIO_OUT_LOW) /* Keyboard backlight enable */
+GPIO(EN_5V_USM, PIN(D, 7), GPIO_OUT_LOW)
/* I2C pins - Alternate function below configures I2C module on these pins */
GPIO(I2C_A_SCL, PIN(B, 3), GPIO_INPUT) /* I2C_CHG_BATT_SCL */