From e47b6a609b9d23694a466b56960d9d14ca5d6242 Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Thu, 5 Dec 2013 11:03:37 -0800 Subject: [PATCH] nyan: Switch USB VBUS GPIOs from outputs to pulled-up inputs The USB VBUS GPIOs on Nyan boards are two-directional: usually the SoC sets them high or low to enable USB power, but on overcurrent conditions they get forcefully driven low by the voltage source. To avoid driving it from two sides, we configure them on the SoC side as tristated input pins with a pull-up instead. BUG=None TEST=Made sure USB devices still get detected. Change-Id: I423cb312805cbacb651a569ddc1530813b148576 Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/178914 Reviewed-by: David Hendricks Reviewed-by: Tom Warren --- src/mainboard/google/nyan/mainboard.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mainboard/google/nyan/mainboard.c b/src/mainboard/google/nyan/mainboard.c index 2e19f2ccc0..a9f3fcf2ba 100644 --- a/src/mainboard/google/nyan/mainboard.c +++ b/src/mainboard/google/nyan/mainboard.c @@ -180,10 +180,10 @@ static void setup_pinmux(void) pinmux_set_config(PINMUX_SDMMC4_DAT7_INDEX, PINMUX_SDMMC4_DAT7_FUNC_SDMMC4 | pin_up); - /* TODO: This is supposed to work with the USB special function pinmux, - * but it doesn't. Go with GPIOs for now and solve the problem later. */ - gpio_output_open_drain(GPIO(N4), 1); /* USB VBUS EN0 */ - gpio_output_open_drain(GPIO(N5), 1); /* USB VBUS EN1 */ + /* We pull the USB VBUS signals up but keep them as inputs since the + * voltage source likes to drive them low on overcurrent conditions */ + gpio_input_pullup(GPIO(N4)); /* USB VBUS EN0 */ + gpio_input_pullup(GPIO(N5)); /* USB VBUS EN1 */ /* Clock output 1 (for external peripheral) */ pinmux_set_config(PINMUX_DAP_MCLK1_INDEX,