usb: chipidea: support generic phy in PM code path
Subsystems (2)
PATCH 1/1 usb: chipidea: support generic phy in PM code path
Support generic phy in PM code path: call phy_power_off/phy_power_on in ci_controller_suspend/ci_controller_resume.
--- drivers/usb/chipidea/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/chipidea/core.c +3 -1
@@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci)usleep_range (ci->platdata->phy_clkgate_delay_us, ci->platdata->phy_clkgate_delay_us +50 );usb_phy_set_suspend (ci->usb_phy,1 ); +phy_power_off (ci->phy); ci->in_lpm = true;enable_irq (ci->irq); }
@@ -1132,9 +1133,10 @@ static int ci_controller_resume(struct device *dev) }ci_hdrc_enter_lpm (ci, false); -if (ci->usb_phy) { +if (ci->usb_phy || ci->phy) {usb_phy_set_suspend (ci->usb_phy,0 );usb_phy_set_wakeup (ci->usb_phy, false); +phy_power_on (ci->phy);hw_wait_phy_stable (); }
Signature · 1 line
2.9.3
Quoted 13 lines · Jisheng Zhang
Support generic phy in PM code path: call phy_power_off/phy_power_on in ci_controller_suspend/ci_controller_resume.
Signed-off-by Jisheng Zhang <[email protected]>--- drivers/usb/chipidea/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/usb/chipidea/core.c +0
-0
drivers/usb/chipidea/core.c static void ci_controller_suspend(struct ci_hdrc *ci) · line 1119
Quoted 4 lines
drivers/usb/chipidea/core.c +1
-0@@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci)usleep_range (ci->platdata->phy_clkgate_delay_us, ci->platdata->phy_clkgate_delay_us +50 );usb_phy_set_suspend (ci->usb_phy,1 ); +phy_power_off (ci->phy);
How could you support USB wakeup after PHY is powered off?
Peter
Quoted 22 lines
drivers/usb/chipidea/core.c +2
-1ci->in_lpm = true;enable_irq (ci->irq); }@@ -1132,9 +1133,10 @@ static int ci_controller_resume(struct device *dev) }ci_hdrc_enter_lpm (ci, false); -if (ci->usb_phy) { +if (ci->usb_phy || ci->phy) {usb_phy_set_suspend (ci->usb_phy,0 );usb_phy_set_wakeup (ci->usb_phy, false); +phy_power_on (ci->phy);hw_wait_phy_stable (); }Signature · 6 lines
2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Best Regards, Peter Chen
Hi Peter,
Quoted 9 lines · On Mon, 22 Aug 2016 13:33:08 +0800 Peter Chen wrote:
Quoted 8 lines · Jisheng Zhang
Support generic phy in PM code path: call phy_power_off/phy_power_on in ci_controller_suspend/ci_controller_resume.
Signed-off-by Jisheng Zhang <[email protected]>--- drivers/usb/chipidea/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Quoted 11 lines
drivers/usb/chipidea/core.c static void ci_controller_suspend(struct ci_hdrc *ci) · line 1119
Quoted 9 lines
drivers/usb/chipidea/core.c +1
-0@@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci)usleep_range (ci->platdata->phy_clkgate_delay_us, ci->platdata->phy_clkgate_delay_us +50 );usb_phy_set_suspend (ci->usb_phy,1 ); +phy_power_off (ci->phy);How could you support USB wakeup after PHY is powered off?
Per my understanding, the PHY's power off just power off data communication part but leaves the circuits involved in wakeup detection active.
Thanks,
Jisheng
Quoted 26 lines
Peter
Quoted 22 lines
drivers/usb/chipidea/core.c +2
-1ci->in_lpm = true;enable_irq (ci->irq); }@@ -1132,9 +1133,10 @@ static int ci_controller_resume(struct device *dev) }ci_hdrc_enter_lpm (ci, false); -if (ci->usb_phy) { +if (ci->usb_phy || ci->phy) {usb_phy_set_suspend (ci->usb_phy,0 );usb_phy_set_wakeup (ci->usb_phy, false); +phy_power_on (ci->phy);hw_wait_phy_stable (); }Signature · 6 lines
2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 25 lines · Jisheng Zhang
Hi Peter,
Quoted 9 lines · On Mon, 22 Aug 2016 13:33:08 +0800 Peter Chen wrote:
Quoted 8 lines · Jisheng Zhang
Support generic phy in PM code path: call phy_power_off/phy_power_on in ci_controller_suspend/ci_controller_resume.
Signed-off-by Jisheng Zhang <[email protected]>--- drivers/usb/chipidea/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Quoted 11 lines
drivers/usb/chipidea/core.c static void ci_controller_suspend(struct ci_hdrc *ci) · line 1119
Quoted 9 lines
drivers/usb/chipidea/core.c +1
-0@@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci)usleep_range (ci->platdata->phy_clkgate_delay_us, ci->platdata->phy_clkgate_delay_us +50 );usb_phy_set_suspend (ci->usb_phy,1 ); +phy_power_off (ci->phy);How could you support USB wakeup after PHY is powered off?
Quoted 3 lines
Per my understanding, the PHY's power off just power off data communication part but leaves the circuits involved in wakeup detection active.
Ok, I hope so.
Peter
Quoted 28 lines
Quoted 27 lines
Peter
Quoted 22 lines
drivers/usb/chipidea/core.c +2
-1ci->in_lpm = true;enable_irq (ci->irq); }@@ -1132,9 +1133,10 @@ static int ci_controller_resume(struct device *dev) }ci_hdrc_enter_lpm (ci, false); -if (ci->usb_phy) { +if (ci->usb_phy || ci->phy) {usb_phy_set_suspend (ci->usb_phy,0 );usb_phy_set_wakeup (ci->usb_phy, false); +phy_power_on (ci->phy);hw_wait_phy_stable (); }Signature · 6 lines
2.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Best Regards, Peter Chen
+ Kishon
Hi Peter, Kishon,
Quoted 26 lines · On Mon, 22 Aug 2016 15:29:07 +0800 Peter Chen wrote:
Quoted 25 lines · Jisheng Zhang
Hi Peter,
Quoted 20 lines · On Mon, 22 Aug 2016 13:33:08 +0800 Peter Chen wrote:
Quoted 13 lines · Jisheng Zhang
Support generic phy in PM code path: call phy_power_off/phy_power_on in ci_controller_suspend/ci_controller_resume.
Signed-off-by Jisheng Zhang <[email protected]>--- drivers/usb/chipidea/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/usb/chipidea/core.c +0
-0drivers/usb/chipidea/core.c static void ci_controller_suspend(struct ci_hdrc *ci) · line 1119
Quoted 4 lines
drivers/usb/chipidea/core.c +1
-0@@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci)usleep_range (ci->platdata->phy_clkgate_delay_us, ci->platdata->phy_clkgate_delay_us +50 );usb_phy_set_suspend (ci->usb_phy,1 ); +phy_power_off (ci->phy);How could you support USB wakeup after PHY is powered off?
Quoted 5 lines
Quoted 3 lines
Per my understanding, the PHY's power off just power off data communication part but leaves the circuits involved in wakeup detection active.
Ok, I hope so.
If most parts of the phy can be powered off during runtime suspend to save power, or phy HW support suspend mode, with usb phy, usb_phy_set_suspend() could be used, but with the generic phy, it seems there's no corresponding API for this purpose. I'm not sure whether using phy_power_off() is correct here. Is it acceptable to extend the generic phy? such as, phy_suspend()/phy_resume()?
Thanks,
Jisheng
Hi,
Quoted 36 lines · Jisheng Zhang
+ Kishon
Hi Peter, Kishon,
Quoted 30 lines · On Mon, 22 Aug 2016 15:29:07 +0800 Peter Chen wrote:
Quoted 28 lines · Jisheng Zhang
Hi Peter,
Quoted 9 lines · On Mon, 22 Aug 2016 13:33:08 +0800 Peter Chen wrote:
Quoted 8 lines · Jisheng Zhang
Support generic phy in PM code path: call phy_power_off/phy_power_on in ci_controller_suspend/ci_controller_resume.
Signed-off-by Jisheng Zhang <[email protected]>--- drivers/usb/chipidea/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Quoted 11 lines
drivers/usb/chipidea/core.c static void ci_controller_suspend(struct ci_hdrc *ci) · line 1119
Quoted 9 lines
drivers/usb/chipidea/core.c +1
-0@@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci)usleep_range (ci->platdata->phy_clkgate_delay_us, ci->platdata->phy_clkgate_delay_us +50 );usb_phy_set_suspend (ci->usb_phy,1 ); +phy_power_off (ci->phy);How could you support USB wakeup after PHY is powered off?
Per my understanding, the PHY's power off just power off data communication part but leaves the circuits involved in wakeup detection active.
Quoted 7 lines
Quoted 1 line
Ok, I hope so.
If most parts of the phy can be powered off during runtime suspend to save power, or phy HW support suspend mode, with usb phy,
usb_phy_set_suspend()could be used, but with the generic phy, it seems there's no corresponding API for this purpose. I'm not sure whether usingphy_power_off()is correct here. Is it acceptable to extend the generic phy? such as, phy_suspend()/phy_resume()?
phy_pm_runtime_put() could be used right?
Thanks
Kishon
Quoted 41 lines · On Mon, 22 Aug 2016 13:53:37 +0530 Kishon Vijay Abraham I wrote:
Hi,
Quoted 38 lines · Jisheng Zhang
+ Kishon
Hi Peter, Kishon,
Quoted 31 lines · On Mon, 22 Aug 2016 15:29:07 +0800 Peter Chen wrote:
Quoted 25 lines · Jisheng Zhang
Hi Peter,
Quoted 9 lines · On Mon, 22 Aug 2016 13:33:08 +0800 Peter Chen wrote:
Quoted 8 lines · Jisheng Zhang
Support generic phy in PM code path: call phy_power_off/phy_power_on in ci_controller_suspend/ci_controller_resume.
Signed-off-by Jisheng Zhang <[email protected]>--- drivers/usb/chipidea/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)Quoted 11 lines
drivers/usb/chipidea/core.c static void ci_controller_suspend(struct ci_hdrc *ci) · line 1119
Quoted 9 lines
drivers/usb/chipidea/core.c +1
-0@@ -1116,6 +1116,7 @@ static void ci_controller_suspend(struct ci_hdrc *ci)usleep_range (ci->platdata->phy_clkgate_delay_us, ci->platdata->phy_clkgate_delay_us +50 );usb_phy_set_suspend (ci->usb_phy,1 ); +phy_power_off (ci->phy);How could you support USB wakeup after PHY is powered off?
Quoted 3 lines
Per my understanding, the PHY's power off just power off data communication part but leaves the circuits involved in wakeup detection active.
Ok, I hope so.
Quoted 8 lines
Quoted 5 lines
If most parts of the phy can be powered off during runtime suspend to save power, or phy HW support suspend mode, with usb phy,
usb_phy_set_suspend()could be used, but with the generic phy, it seems there's no corresponding API for this purpose. I'm not sure whether usingphy_power_off()is correct here. Is it acceptable to extend the generic phy? such as, phy_suspend()/phy_resume()?
phy_pm_runtime_put()could be used right?
oh yeah, Great!!! Thanks for the inspiration. Now, I know what should I do for my platform and the chipidea core driver ;)
Will cook a v2 patch
Thank you so much,
Jisheng