From 173d77a63d4a58b5f5ec417c9f8b0e879053419d Mon Sep 17 00:00:00 2001 From: Vincent Palatin Date: Mon, 14 Nov 2016 17:42:27 +0100 Subject: kevin: keep the pull-up on the USB load switch enable Keep the pull-up enabled all the time on the GPIO connected to the load switch enable pin. This is not ideal but the pull-up bit is no-op in output mode on npcx and this avoids glitching the enable when transition from the 3A mode (output strong one) to the 1.5A mode (input with a weak pull-up). Signed-off-by: Vincent Palatin BRANCH=gru BUG=chrome-os-partner:59679 TEST=on Kevin, plug a USB key on port 0, then plug another USB device on port 1 and see that the key on port 0 is no longer disconnecting/re-enumerating. Change-Id: I075dacb1549239f1b60763659dac006f5b838e2c Reviewed-on: https://chromium-review.googlesource.com/411220 Reviewed-by: Shawn N Tested-by: David Schneider Commit-Queue: Vincent Palatin (cherry picked from commit 16ab6c66c957832c5943f4750dd1970355a697e1) Reviewed-on: https://chromium-review.googlesource.com/411760 Commit-Ready: Vincent Palatin Tested-by: Vincent Palatin --- board/kevin/gpio.inc | 4 ++-- board/kevin/usb_pd_policy.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/board/kevin/gpio.inc b/board/kevin/gpio.inc index bbd5b4f0cf..d8b8d6ab91 100644 --- a/board/kevin/gpio.inc +++ b/board/kevin/gpio.inc @@ -95,8 +95,8 @@ GPIO(LID_ACCEL_INT_L, PIN(C, 7), GPIO_INPUT) /* KSO2 is inverted */ GPIO(KBD_KSO2, PIN(1, 7), GPIO_OUT_LOW) -GPIO(USB_C0_5V_EN, PIN(D, 3), GPIO_OUT_LOW) -GPIO(USB_C1_5V_EN, PIN(D, 2), GPIO_OUT_LOW) +GPIO(USB_C0_5V_EN, PIN(D, 3), GPIO_OUT_LOW | GPIO_PULL_UP) +GPIO(USB_C1_5V_EN, PIN(D, 2), GPIO_OUT_LOW | GPIO_PULL_UP) GPIO(ENTERING_RW, PIN(7, 6), GPIO_OUT_LOW) GPIO(SYS_RST_L, PIN(6, 1), GPIO_OUT_HIGH | GPIO_OPEN_DRAIN) diff --git a/board/kevin/usb_pd_policy.c b/board/kevin/usb_pd_policy.c index 4e753d76a9..dbd8bceec3 100644 --- a/board/kevin/usb_pd_policy.c +++ b/board/kevin/usb_pd_policy.c @@ -64,7 +64,7 @@ static void board_vbus_update_source_current(int port) { enum gpio_signal gpio = port ? GPIO_USB_C1_5V_EN : GPIO_USB_C0_5V_EN; int flags = (vbus_rp[port] == TYPEC_RP_1A5 && vbus_en[port]) ? - (GPIO_INPUT | GPIO_PULL_UP) : GPIO_OUTPUT; + (GPIO_INPUT | GPIO_PULL_UP) : (GPIO_OUTPUT | GPIO_PULL_UP); /* * Driving USB_Cx_5V_EN high, actually put a 16.5k resistance -- cgit v1.2.1