]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00251209-1 usb: add host 1 vbus callback
authorPeter Chen <peter.chen@freescale.com>
Fri, 1 Mar 2013 07:33:24 +0000 (15:33 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:55 +0000 (08:35 +0200)
The callback will be used at probe and remove

Signed-off-by: Peter Chen <peter.chen@freescale.com>
arch/arm/mach-mx6/board-mx6q_sabresd.c
arch/arm/mach-mx6/usb_h1.c

index 56fe1d68bb901370c3e6eb20d1696c2ded5d2c91..c5a4f23f7250ac7b6f0c169106e0e66dba2044cf 100644 (file)
@@ -1094,6 +1094,14 @@ static void imx6q_sabresd_usbotg_vbus(bool on)
                gpio_set_value(SABRESD_USB_OTG_PWR, 0);
 }
 
+static void imx6q_sabresd_host1_vbus(bool on)
+{
+       if (on)
+               gpio_set_value(SABRESD_USB_H1_PWR, 1);
+       else
+               gpio_set_value(SABRESD_USB_H1_PWR, 0);
+}
+
 static void __init imx6q_sabresd_init_usb(void)
 {
        int ret = 0;
@@ -1116,13 +1124,14 @@ static void __init imx6q_sabresd_init_usb(void)
                        ret);
                return;
        }
-       gpio_direction_output(SABRESD_USB_H1_PWR, 1);
+       gpio_direction_output(SABRESD_USB_H1_PWR, 0);
        if (board_is_mx6_reva())
                mxc_iomux_set_gpr_register(1, 13, 1, 1);
        else
                mxc_iomux_set_gpr_register(1, 13, 1, 0);
 
        mx6_set_otghost_vbus_func(imx6q_sabresd_usbotg_vbus);
+       mx6_set_host1_vbus_func(imx6q_sabresd_host1_vbus);
 
 }
 
index eb79bf35b16c27c76b99569e7e85ed8bc812ad86..d983e2870045c0e27c85d12aba1a177e5d2de12d 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved.
+ * Copyright (C) 2011-2013 Freescale Semiconductor, Inc. All Rights Reserved.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -401,8 +401,7 @@ static int  __init mx6_usb_h1_init(void)
                imx_mxc_ehci_data_entry_single(MX6SL, 1, HS1)};
 
        mx6_get_host1_vbus_func(&mx6_set_usb_host1_vbus);
-       if (mx6_set_usb_host1_vbus)
-               mx6_set_usb_host1_vbus(true);
+       usbh1_config.platform_driver_vbus = mx6_set_usb_host1_vbus;
 
        /* Some phy and power's special controls for host1
         * 1. The external charger detector needs to be disabled
@@ -457,8 +456,6 @@ static void __exit mx6_usb_h1_exit(void)
                        | BM_ANADIG_USB2_PLL_480_CTRL_POWER \
                        | BM_ANADIG_USB2_PLL_480_CTRL_EN_USB_CLKS, \
                        anatop_base_addr + HW_ANADIG_USB2_PLL_480_CTRL_CLR);
-       if (mx6_set_usb_host1_vbus)
-               mx6_set_usb_host1_vbus(false);
 
        return ;
 }