From: Marek Vasut Date: Mon, 28 Apr 2014 03:38:42 +0200 Subject: [U-Boot] [PATCH 4/5] arm: mxs: olinuxino: Enable USB only when needed In-Reply-To: <1398649123-7310-1-git-send-email-marex@denx.de> References: <1398649123-7310-1-git-send-email-marex@denx.de> Message-ID: <1398649123-7310-4-git-send-email-marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Enable the power to the USB port only when the USB port is really needed. Do not enable the power unconditionally. Signed-off-by: Marek Vasut Cc: Stefano Babic --- board/olimex/mx23_olinuxino/mx23_olinuxino.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/board/olimex/mx23_olinuxino/mx23_olinuxino.c b/board/olimex/mx23_olinuxino/mx23_olinuxino.c index e2a03a1..65cbbf1 100644 --- a/board/olimex/mx23_olinuxino/mx23_olinuxino.c +++ b/board/olimex/mx23_olinuxino/mx23_olinuxino.c @@ -30,13 +30,25 @@ int board_early_init_f(void) /* SSP0 clock at 96MHz */ mxs_set_sspclk(MXC_SSPCLK0, 96000, 0); + return 0; +} + #ifdef CONFIG_CMD_USB - /* Enable LAN9512 */ +int board_ehci_hcd_init(int port) +{ + /* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */ gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 1); -#endif + udelay(100); + return 0; +} +int board_ehci_hcd_exit(int port) +{ + /* Enable LAN9512 (Maxi) or GL850G (Mini) USB HUB power. */ + gpio_direction_output(MX23_PAD_GPMI_ALE__GPIO_0_17, 0); return 0; } +#endif int dram_init(void) { -- 1.9.2