]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00225131-04 MX6 USB: implement platform_phy_power_on for USB otg and h1
authormake shi <b15407@freescale.com>
Thu, 20 Sep 2012 09:12:47 +0000 (17:12 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:27 +0000 (08:35 +0200)
IC designer had clarified that 1P1 can be turned off if we do not need support
remote wakeup. So If there is no requirement for USB remote wake up, the 1P1
can be turn off. USB driver will support dynamically turn on(off) 1P1 during
system suspend. 1P1 will be turn on depend on USB wakeup is enabled.

Set stop_mode_config bit to turn on 1P1 during system suspend to support USB
host remote wake up or USB device DP/DM wake up.

Signed-off-by: make shi <b15407@freescale.com>
arch/arm/mach-mx6/usb_dr.c
arch/arm/mach-mx6/usb_h1.c

index 908af2482c8c91b9d5a03f92a5344633ae19ecc6..7b79d98c7d5cb37df472c040fb0575a2309feec7 100644 (file)
@@ -229,6 +229,13 @@ static void usbotg_clock_gate(bool on)
        pr_debug("usb_oh3_clk:%d, usb_phy_clk1_ref_count:%d\n", clk_get_usecount(usb_oh3_clk), clk_get_usecount(usb_phy1_clk));
 }
 
+static void dr_platform_phy_power_on(void)
+{
+       void __iomem *anatop_base_addr = MX6_IO_ADDRESS(ANATOP_BASE_ADDR);
+       __raw_writel(BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG,
+                               anatop_base_addr + HW_ANADIG_ANA_MISC0_SET);
+}
+
 void mx6_set_otghost_vbus_func(driver_vbus_func driver_vbus)
 {
        dr_utmi_config.platform_driver_vbus = driver_vbus;
@@ -625,6 +632,7 @@ void __init mx6_usb_dr_init(void)
        dr_utmi_config.is_wakeup_event = _is_host_wakeup;
        dr_utmi_config.wakeup_pdata = &dr_wakeup_config;
        dr_utmi_config.wakeup_handler = host_wakeup_handler;
+       dr_utmi_config.platform_phy_power_on = dr_platform_phy_power_on;
        pdev = imx6q_add_fsl_ehci_otg(&dr_utmi_config);
        dr_wakeup_config.usb_pdata[1] = pdev->dev.platform_data;
 #endif
@@ -639,6 +647,7 @@ void __init mx6_usb_dr_init(void)
        dr_utmi_config.wakeup_pdata = &dr_wakeup_config;
        dr_utmi_config.wakeup_handler = device_wakeup_handler;
        dr_utmi_config.charger_base_addr = anatop_base_addr;
+       dr_utmi_config.platform_phy_power_on = dr_platform_phy_power_on;
        pdev = imx6q_add_fsl_usb2_udc(&dr_utmi_config);
        dr_wakeup_config.usb_pdata[2] = pdev->dev.platform_data;
 #endif
index 36aa2aabbe88924a6f251083c254a2b4c60c5894..f86a4f42b0bd7b2787b809e537aca73b0e9030d9 100644 (file)
@@ -90,6 +90,13 @@ static void usbh1_internal_phy_clock_gate(bool on)
        }
 }
 
+static void usbh1_platform_phy_power_on(void)
+{
+       void __iomem *anatop_base_addr = MX6_IO_ADDRESS(ANATOP_BASE_ADDR);
+       __raw_writel(BM_ANADIG_ANA_MISC0_STOP_MODE_CONFIG,
+                               anatop_base_addr + HW_ANADIG_ANA_MISC0_SET);
+}
+
 static int usb_phy_enable(struct fsl_usb2_platform_data *pdata)
 {
        u32 tmp;
@@ -367,6 +374,7 @@ static struct fsl_usb2_platform_data usbh1_config = {
        .phy_lowpower_suspend = _phy_lowpower_suspend,
        .is_wakeup_event = _is_usbh1_wakeup,
        .wakeup_handler = h1_wakeup_handler,
+       .platform_phy_power_on = usbh1_platform_phy_power_on,
        .transceiver = "utmi",
        .phy_regs = USB_PHY1_BASE_ADDR,
 };