diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-09-09 04:18:14 +0300 |
---|---|---|
committer | Peter Chen <peter.chen@freescale.com> | 2015-10-22 04:24:25 +0300 |
commit | 1fbf46280eb6866c762de5ec8ba35f09097b0d53 (patch) | |
tree | 6a9690b485b84280cb75a149f5e802256099f7ae /drivers/usb | |
parent | 3ecb3e09b042e70799ff3a1ff464a5ecaa7547d9 (diff) | |
download | linux-1fbf46280eb6866c762de5ec8ba35f09097b0d53.tar.xz |
usb: chipidea: Add support for 'phy-clkgate-delay-us' property
Add support for the optional 'phy-clkgate-delay-us' property that is
used to describe the delay time between putting PHY into low power mode
and turning off the PHY clock.
Signed-off-by: Li Jun <jun.li@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Peter Chen <peter.chen@freescale.com>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/chipidea/core.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c index 573c2876b263..f4fd76ab3aef 100644 --- a/drivers/usb/chipidea/core.c +++ b/drivers/usb/chipidea/core.c @@ -688,6 +688,10 @@ static int ci_get_platdata(struct device *dev, if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL) platdata->flags |= CI_HDRC_FORCE_FULLSPEED; + if (of_find_property(dev->of_node, "phy-clkgate-delay-us", NULL)) + of_property_read_u32(dev->of_node, "phy-clkgate-delay-us", + &platdata->phy_clkgate_delay_us); + platdata->itc_setting = 1; if (of_find_property(dev->of_node, "itc-setting", NULL)) { ret = of_property_read_u32(dev->of_node, "itc-setting", @@ -1121,6 +1125,9 @@ static void ci_controller_suspend(struct ci_hdrc *ci) { disable_irq(ci->irq); ci_hdrc_enter_lpm(ci, true); + if (ci->platdata->phy_clkgate_delay_us) + usleep_range(ci->platdata->phy_clkgate_delay_us, + ci->platdata->phy_clkgate_delay_us + 50); usb_phy_set_suspend(ci->usb_phy, 1); ci->in_lpm = true; enable_irq(ci->irq); |