diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2015-09-08 21:18:14 -0400 |
---|---|---|
committer | Peter Chen <peter.chen@freescale.com> | 2015-10-21 21:24:25 -0400 |
commit | 1fbf46280eb6866c762de5ec8ba35f09097b0d53 (patch) | |
tree | 6a9690b485b84280cb75a149f5e802256099f7ae | |
parent | 3ecb3e09b042e70799ff3a1ff464a5ecaa7547d9 (diff) |
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>
-rw-r--r-- | drivers/usb/chipidea/core.c | 7 | ||||
-rw-r--r-- | include/linux/usb/chipidea.h | 1 |
2 files changed, 8 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, | |||
688 | if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL) | 688 | if (of_usb_get_maximum_speed(dev->of_node) == USB_SPEED_FULL) |
689 | platdata->flags |= CI_HDRC_FORCE_FULLSPEED; | 689 | platdata->flags |= CI_HDRC_FORCE_FULLSPEED; |
690 | 690 | ||
691 | if (of_find_property(dev->of_node, "phy-clkgate-delay-us", NULL)) | ||
692 | of_property_read_u32(dev->of_node, "phy-clkgate-delay-us", | ||
693 | &platdata->phy_clkgate_delay_us); | ||
694 | |||
691 | platdata->itc_setting = 1; | 695 | platdata->itc_setting = 1; |
692 | if (of_find_property(dev->of_node, "itc-setting", NULL)) { | 696 | if (of_find_property(dev->of_node, "itc-setting", NULL)) { |
693 | ret = of_property_read_u32(dev->of_node, "itc-setting", | 697 | ret = of_property_read_u32(dev->of_node, "itc-setting", |
@@ -1121,6 +1125,9 @@ static void ci_controller_suspend(struct ci_hdrc *ci) | |||
1121 | { | 1125 | { |
1122 | disable_irq(ci->irq); | 1126 | disable_irq(ci->irq); |
1123 | ci_hdrc_enter_lpm(ci, true); | 1127 | ci_hdrc_enter_lpm(ci, true); |
1128 | if (ci->platdata->phy_clkgate_delay_us) | ||
1129 | usleep_range(ci->platdata->phy_clkgate_delay_us, | ||
1130 | ci->platdata->phy_clkgate_delay_us + 50); | ||
1124 | usb_phy_set_suspend(ci->usb_phy, 1); | 1131 | usb_phy_set_suspend(ci->usb_phy, 1); |
1125 | ci->in_lpm = true; | 1132 | ci->in_lpm = true; |
1126 | enable_irq(ci->irq); | 1133 | enable_irq(ci->irq); |
diff --git a/include/linux/usb/chipidea.h b/include/linux/usb/chipidea.h index c5cddc6901d0..5dd75fa47dd8 100644 --- a/include/linux/usb/chipidea.h +++ b/include/linux/usb/chipidea.h | |||
@@ -71,6 +71,7 @@ struct ci_hdrc_platform_data { | |||
71 | /* VBUS and ID signal state tracking, using extcon framework */ | 71 | /* VBUS and ID signal state tracking, using extcon framework */ |
72 | struct ci_hdrc_cable vbus_extcon; | 72 | struct ci_hdrc_cable vbus_extcon; |
73 | struct ci_hdrc_cable id_extcon; | 73 | struct ci_hdrc_cable id_extcon; |
74 | u32 phy_clkgate_delay_us; | ||
74 | }; | 75 | }; |
75 | 76 | ||
76 | /* Default offset of capability registers */ | 77 | /* Default offset of capability registers */ |