summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Palatin <vpalatin@chromium.org>2016-11-14 17:42:27 +0100
committerchrome-bot <chrome-bot@chromium.org>2016-11-16 07:10:13 -0800
commit173d77a63d4a58b5f5ec417c9f8b0e879053419d (patch)
tree270271776ceba5aea25672f615891d7e9ad19dcc
parent75232b40acfd95b0a42ca1ad391d211081b9b36a (diff)
downloadchrome-ec-173d77a63d4a58b5f5ec417c9f8b0e879053419d.tar.gz
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 <vpalatin@chromium.org> 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 <shawnn@chromium.org> Tested-by: David Schneider <dnschneid@chromium.org> Commit-Queue: Vincent Palatin <vpalatin@chromium.org> (cherry picked from commit 16ab6c66c957832c5943f4750dd1970355a697e1) Reviewed-on: https://chromium-review.googlesource.com/411760 Commit-Ready: Vincent Palatin <vpalatin@chromium.org> Tested-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r--board/kevin/gpio.inc4
-rw-r--r--board/kevin/usb_pd_policy.c2
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