Skip to contentSkip to conversation

ohci-nxp: Use ohci_finish_controller_resume()

PATCH In review Roland Stigge 3 participants 4 messages Jun 3, 2012 – Jun 4, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ohci-nxp: Use ohci_finish_controller_resume()

OHCI drivers are supposed to use ohci_finish_controller_resume(). This patch adds respective suspend and resume code to ohci-nxp. The following compiler warning is fixed this way:

drivers/usb/host/ohci-hub.c:321: warning: 'ohci_finish_controller_resume' defined but not used

---
Applies to v3.5-rc1

 drivers/usb/host/ohci-nxp.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/usb/host/ohci-nxp.c +21 -0
@@ -432,6 +432,23 @@ static int usb_hcd_nxp_remove(struct pla
 	return 0;
 }
 
+#ifdef CONFIG_PM
+static int usb_hcd_suspend(struct platform_device *pdev, pm_message_t message)
+{
+	clk_disable(usb_clk);
+	return 0;
+}
+
+static int usb_hcd_resume(struct platform_device *pdev)
+{
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
+
+	clk_enable(usb_clk);
+	ohci_finish_controller_resume(hcd);
+	return 0;
+}
+#endif
+
 /* work with hotplug and coldplug */
 MODULE_ALIAS("platform:usb-ohci");
 
@@ -451,5 +468,9 @@ static struct platform_driver usb_hcd_nx
 	},
 	.probe = usb_hcd_nxp_probe,
 	.remove = usb_hcd_nxp_remove,
+#ifdef CONFIG_PM
+	.suspend = usb_hcd_suspend,
+	.resume = usb_hcd_resume,
+#endif
 };
 
maintainer
#1 lore raw
Quoted 6 lines · Roland Stigge

OHCI drivers are supposed to use ohci_finish_controller_resume(). This patch adds respective suspend and resume code to ohci-nxp. The following compiler warning is fixed this way:

drivers/usb/host/ohci-hub.c:321: warning: 'ohci_finish_controller_resume' defined but not used

This is not a correct description of the patch. A correct description would be something like:

Add suspend/resume support to the ohci-nxp driver.

The compiler warning needs a completely different fix; ohci_finish_controller_resume should be given a __maybe_unused annotation.

Alan Stern

Quoted 43 lines

---
Applies to v3.5-rc1

 drivers/usb/host/ohci-nxp.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
drivers/usb/host/ohci-nxp.c +21 -0
@@ -432,6 +432,23 @@ static int usb_hcd_nxp_remove(struct pla
 	return 0;
 }
 
+#ifdef CONFIG_PM
+static int usb_hcd_suspend(struct platform_device *pdev, pm_message_t message)
+{
+	clk_disable(usb_clk);
+	return 0;
+}
+
+static int usb_hcd_resume(struct platform_device *pdev)
+{
+	struct usb_hcd *hcd = platform_get_drvdata(pdev);
+
+	clk_enable(usb_clk);
+	ohci_finish_controller_resume(hcd);
+	return 0;
+}
+#endif
+
 /* work with hotplug and coldplug */
 MODULE_ALIAS("platform:usb-ohci");
 
@@ -451,5 +468,9 @@ static struct platform_driver usb_hcd_nx
 	},
 	.probe = usb_hcd_nxp_probe,
 	.remove = usb_hcd_nxp_remove,
+#ifdef CONFIG_PM
+	.suspend = usb_hcd_suspend,
+	.resume = usb_hcd_resume,
+#endif
 };
#3 lore raw
In reply to Roland Stigge

Hi,

Quoted 42 lines · Roland Stigge

OHCI drivers are supposed to use ohci_finish_controller_resume(). This patch adds respective suspend and resume code to ohci-nxp. The following compiler warning is fixed this way:

drivers/usb/host/ohci-hub.c:321: warning: 'ohci_finish_controller_resume' defined but not used

---
Applies to v3.5-rc1

?drivers/usb/host/ohci-nxp.c | ? 21 +++++++++++++++++++++ ?1 file changed, 21 insertions(+)

drivers/usb/host/ohci-nxp.c +17 -0
@@ -432,6 +432,23 @@ static int usb_hcd_nxp_remove(struct pla
 ? ? ? ?return 0;
 ?}
 
+#ifdef CONFIG_PM
+static int usb_hcd_suspend(struct platform_device *pdev, pm_message_t message)
+{
+ ? ? ? clk_disable(usb_clk);
+ ? ? ? return 0;
+}
+
+static int usb_hcd_resume(struct platform_device *pdev)
+{
+ ? ? ? struct usb_hcd *hcd = platform_get_drvdata(pdev);
+
+ ? ? ? clk_enable(usb_clk);
+ ? ? ? ohci_finish_controller_resume(hcd);
+ ? ? ? return 0;
+}
+#endif
+

?/* work with hotplug and coldplug */
?MODULE_ALIAS("platform:usb-ohci");

drivers/usb/host/ohci-nxp.c static struct platform_driver usb_hcd_nx · line 474

Quoted 7 lines
drivers/usb/host/ohci-nxp.c +4 -0
@@ -451,5 +468,9 @@ static struct platform_driver usb_hcd_nx
 ? ? ? ?},
 ? ? ? ?.probe = usb_hcd_nxp_probe,
 ? ? ? ?.remove = usb_hcd_nxp_remove,
+#ifdef CONFIG_PM
+ ? ? ? .suspend = usb_hcd_suspend,
+ ? ? ? .resume = usb_hcd_resume,
+#endif

Please make use of the SET_SYSTEM_SLEEP_PM_OPS() initializer.

Thanks
Kishon

#2 lore raw
In reply to Alan Stern

Hi!

Quoted 7 lines · Alan Stern
Quoted 6 lines

OHCI drivers are supposed to use ohci_finish_controller_resume(). This patch adds respective suspend and resume code to ohci-nxp. The following compiler warning is fixed this way:

drivers/usb/host/ohci-hub.c:321: warning: 'ohci_finish_controller_resume' defined but not used

Quoted 8 lines

This is not a correct description of the patch. A correct description would be something like:

Add suspend/resume support to the ohci-nxp driver.

The compiler warning needs a completely different fix; ohci_finish_controller_resume should be given a __maybe_unused annotation.

Thanks for the suggestion! I'll rather do the latter.

Roland