summaryrefslogtreecommitdiff
path: root/board/dratini
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-09 19:21:17 +0000
commitca1261e28bc485c90dec3feb1bed583ac1c7159a (patch)
tree5c76c4021abff55d730bfb994871c8759217ac6f /board/dratini
parent2508d5ea2f745d7ce9563a6514b1476d5985b23f (diff)
downloadchrome-ec-ca1261e28bc485c90dec3feb1bed583ac1c7159a.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/+/4098335 Reviewed-by: Mary Ruthven <mruthven@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com>
Diffstat (limited to 'board/dratini')
-rw-r--r--board/dratini/board.c22
-rw-r--r--board/dratini/gpio.inc3
2 files changed, 25 insertions, 0 deletions
diff --git a/board/dratini/board.c b/board/dratini/board.c
index 4aca0c3938..f109379767 100644
--- a/board/dratini/board.c
+++ b/board/dratini/board.c
@@ -164,11 +164,33 @@ 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(const struct usb_mux *me,
+ mux_state_t mux_state)
+{
+ int port = me->usb_port;
+ 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;
+}
+
const struct usb_mux_chain usb_muxes[CONFIG_USB_PD_PORT_MAX_COUNT] = {
[USB_PD_PORT_TCPC_0] = {
.mux = &(const struct usb_mux) {
.usb_port = USB_PD_PORT_TCPC_0,
.driver = &anx7447_usb_mux_driver,
+ .board_set = &board_anx7447_mux_set_c0,
.hpd_update = &anx7447_tcpc_update_hpd_status,
},
},
diff --git a/board/dratini/gpio.inc b/board/dratini/gpio.inc
index 654a3ae4d0..bf1a8a431c 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 */