]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
arm: mxs: olinuxino: Enable USB only when needed
authorMarek Vasut <marex@denx.de>
Mon, 28 Apr 2014 01:38:42 +0000 (03:38 +0200)
committerStefano Babic <sbabic@denx.de>
Mon, 29 Sep 2014 07:02:16 +0000 (09:02 +0200)
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 <marex@denx.de>
Cc: Stefano Babic <sbabic@denx.de>
board/olimex/mx23_olinuxino/mx23_olinuxino.c

index e2a03a110b6d69c2bf0016f39ec59d6d1aae325f..65cbbf15b73194ec15311c288f17e7c23cf3dbc4 100644 (file)
@@ -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)
 {