summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Mittelberg <bmbm@google.com>2022-12-12 15:34:59 -0800
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-01-10 21:01:15 +0000
commitf7a5b61656cf545e8ce036100a15ce16f8a4644c (patch)
treef61ca25b8f9acfa8c00e5414a6f2f6842ec86a03
parent2132a0c4d3190b578e1ac566ba31bad744dda436 (diff)
downloadchrome-ec-f7a5b61656cf545e8ce036100a15ce16f8a4644c.tar.gz
dratini: Set TCPC_AUX_SWITCH to 0xC on Port 0 on mux set
When the screen brightness is changed, DP sends signal on AUX channel. This causes CCD mode to be disconnected. This patch sets the MUX to aux+ <-> sbu2, aux- <-> sbu1 to fix it. BUG=b:183123775 BRANCH=main,firmware-hatch-12672.B TEST=manually verify servod doesn't exit when screen turns off due to the device being idle for 8 minutes on dragonair Change-Id: I2c8761f81252d87d7aca4878023fb4db3d73812a Signed-off-by: Boris Mittelberg <bmbm@google.com> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/4126661 Reviewed-by: Mary Ruthven <mruthven@chromium.org>
-rw-r--r--board/dratini/board.c20
-rw-r--r--board/dratini/gpio.inc3
2 files changed, 23 insertions, 0 deletions
diff --git a/board/dratini/board.c b/board/dratini/board.c
index 87df7d3dfd..e50d168dca 100644
--- a/board/dratini/board.c
+++ b/board/dratini/board.c
@@ -164,9 +164,29 @@ const struct tcpc_config_t tcpc_config[CONFIG_USB_PD_PORT_MAX_COUNT] = {
},
};
+/* Set aux switch to 0xc when CCD enabled on port C0 */
+static int board_anx7447_mux_set_c0(int port, mux_state_t mux_state)
+{
+ int rv = EC_SUCCESS;
+
+ if (port != USB_PD_PORT_TCPC_0)
+ return rv;
+
+ if (gpio_get_level(GPIO_CCD_MODE_ODL))
+ return rv;
+
+ CPRINTS("C%d: set AUX_SW_SEL=0x%x", port, 0xc);
+ rv = tcpc_write(port, ANX7447_REG_TCPC_AUX_SWITCH, 0xc);
+ if (rv)
+ CPRINTS("C%d: Setting AUX_SW_SEL failed", port);
+
+ return rv;
+}
+
struct usb_mux usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_TCPC_0] = {
.driver = &anx7447_usb_mux_driver,
+ .board_set = &board_anx7447_mux_set_c0,
.hpd_update = &anx7447_tcpc_update_hpd_status,
},
[USB_PD_PORT_TCPC_1] = {
diff --git a/board/dratini/gpio.inc b/board/dratini/gpio.inc
index 1d83a9813a..30d621d1c9 100644
--- a/board/dratini/gpio.inc
+++ b/board/dratini/gpio.inc
@@ -79,6 +79,9 @@ GPIO(USB_C1_TCPC_RST_ODL, PIN(3, 2), GPIO_ODR_HIGH)
GPIO(EN_USB_A_5V, PIN(3, 5), GPIO_OUT_LOW)
GPIO(EN_USB_A_LOW_PWR_OD, PIN(9, 4), GPIO_OUT_LOW)
+/* CCD mode line*/
+GPIO(CCD_MODE_ODL, PIN(E, 5), GPIO_INPUT)
+
/* Misc Signals */
GPIO(EC_BATT_PRES_ODL, PIN(E, 1), GPIO_INPUT)
GPIO(LED_AMBER_C0_L, PIN(C, 4), GPIO_OUT_HIGH) /* Amber C0 port */