public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] ohci-nxp: Use ohci_finish_controller_resume()
@ 2012-06-03 18:24 Roland Stigge
  2012-06-04 14:29 ` Alan Stern
  2012-06-04 14:54 ` ABRAHAM, KISHON VIJAY
  0 siblings, 2 replies; 4+ messages in thread
From: Roland Stigge @ 2012-06-03 18:24 UTC (permalink / raw)
  To: linux-arm-kernel

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

Signed-off-by: Roland Stigge <stigge@antcom.de>

---
Applies to v3.5-rc1

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

--- linux-2.6.orig/drivers/usb/host/ohci-nxp.c
+++ linux-2.6/drivers/usb/host/ohci-nxp.c
@@ -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
 };
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ohci-nxp: Use ohci_finish_controller_resume()
  2012-06-03 18:24 [PATCH] ohci-nxp: Use ohci_finish_controller_resume() Roland Stigge
@ 2012-06-04 14:29 ` Alan Stern
  2012-06-04 15:02   ` Roland Stigge
  2012-06-04 14:54 ` ABRAHAM, KISHON VIJAY
  1 sibling, 1 reply; 4+ messages in thread
From: Alan Stern @ 2012-06-04 14:29 UTC (permalink / raw)
  To: linux-arm-kernel

On Sun, 3 Jun 2012, Roland Stigge wrote:

> 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

> Signed-off-by: Roland Stigge <stigge@antcom.de>
> 
> ---
> Applies to v3.5-rc1
> 
>  drivers/usb/host/ohci-nxp.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
> 
> --- linux-2.6.orig/drivers/usb/host/ohci-nxp.c
> +++ linux-2.6/drivers/usb/host/ohci-nxp.c
> @@ -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
>  };

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ohci-nxp: Use ohci_finish_controller_resume()
  2012-06-03 18:24 [PATCH] ohci-nxp: Use ohci_finish_controller_resume() Roland Stigge
  2012-06-04 14:29 ` Alan Stern
@ 2012-06-04 14:54 ` ABRAHAM, KISHON VIJAY
  1 sibling, 0 replies; 4+ messages in thread
From: ABRAHAM, KISHON VIJAY @ 2012-06-04 14:54 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

On Sun, Jun 3, 2012 at 11:54 PM, Roland Stigge <stigge@antcom.de> wrote:
> 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
>
> Signed-off-by: Roland Stigge <stigge@antcom.de>
>
> ---
> Applies to v3.5-rc1
>
> ?drivers/usb/host/ohci-nxp.c | ? 21 +++++++++++++++++++++
> ?1 file changed, 21 insertions(+)
>
> --- linux-2.6.orig/drivers/usb/host/ohci-nxp.c
> +++ linux-2.6/drivers/usb/host/ohci-nxp.c
> @@ -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

Please make use of the SET_SYSTEM_SLEEP_PM_OPS() initializer.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] ohci-nxp: Use ohci_finish_controller_resume()
  2012-06-04 14:29 ` Alan Stern
@ 2012-06-04 15:02   ` Roland Stigge
  0 siblings, 0 replies; 4+ messages in thread
From: Roland Stigge @ 2012-06-04 15:02 UTC (permalink / raw)
  To: linux-arm-kernel

Hi!

On 06/04/2012 04:29 PM, Alan Stern wrote:
>> 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.

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

Roland

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-06-04 15:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-03 18:24 [PATCH] ohci-nxp: Use ohci_finish_controller_resume() Roland Stigge
2012-06-04 14:29 ` Alan Stern
2012-06-04 15:02   ` Roland Stigge
2012-06-04 14:54 ` ABRAHAM, KISHON VIJAY

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox