From 959bc1d5fa83eab057f12cb5ef79bd37ec98eb83 Mon Sep 17 00:00:00 2001 From: Igor Grinberg Date: Mon, 3 Nov 2014 11:32:19 +0200 Subject: omap3: cm-t35: move the USB hub reset code Extract the USB hub reset code to a common location where it can be reused by other compulab boards. Signed-off-by: Igor Grinberg Reviewed-by: Tom Rini --- board/compulab/common/common.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'board/compulab/common/common.c') diff --git a/board/compulab/common/common.c b/board/compulab/common/common.c index 6d2d7b0..f2ce522 100644 --- a/board/compulab/common/common.c +++ b/board/compulab/common/common.c @@ -8,6 +8,7 @@ #include #include +#include #include "common.h" #include "eeprom.h" @@ -23,3 +24,24 @@ void cl_print_pcb_info(void) printf("PCB: %u.%u\n", rev_major, rev_minor); } + +#ifdef CONFIG_CMD_USB +int cl_usb_hub_init(int gpio, const char *label) +{ + if (gpio_request(gpio, label)) { + printf("Error: can't obtain GPIO%d for %s", gpio, label); + return -1; + } + + gpio_direction_output(gpio, 0); + udelay(10); + gpio_set_value(gpio, 1); + udelay(1000); + return 0; +} + +void cl_usb_hub_deinit(int gpio) +{ + gpio_free(gpio); +} +#endif -- cgit v1.1