Re: [PATCH RFC 2/2] usb: ehci-omap: add suspend/resume support
On Fri, May 14, 2010 at 7:01 AM, Gadiyar, Anand gadi...@ti.com wrote: Alan Stern wrote: On Thu, 13 May 2010, Anand Gadiyar wrote: Add support for suspend and resume to the ehci-omap driver. Added routines for platform_driver suspend/resume and wrappers around ehci_bus_suspend/resume. +#ifdef CONFIG_PM /*-*/ +static int ehci_omap_dev_suspend(struct device *dev) +{ + struct ehci_hcd_omap *omap = dev_get_drvdata(dev); + + if (!omap-suspended) + ehci_omap_enable(omap, 0); + return 0; +} + +static int ehci_omap_dev_resume(struct device *dev) +{ + struct ehci_hcd_omap *omap = dev_get_drvdata(dev); + + if (omap-suspended) + ehci_omap_enable(omap, 1); + return 0; +} + +static int ehci_omap_bus_suspend(struct usb_hcd *hcd) +{ + struct usb_bus *bus = hcd_to_bus(hcd); + int ret; + + ret = ehci_bus_suspend(hcd); + + ehci_omap_dev_suspend(bus-controller); + + return ret; +} +static int ehci_omap_bus_resume(struct usb_hcd *hcd) +{ + struct usb_bus *bus = hcd_to_bus(hcd); + int ret; + + ehci_omap_dev_resume(bus-controller); + + ret = ehci_bus_resume(hcd); + + return ret; +} You could use the runtime-PM interface instead of explicitly suspending and resuming the controller. It is now standard. Will work on this. I'll be out for a while, so it could be some time before I repost. Thanks, Anand Any more developments on this? -- Laine Walker-Avina -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC 2/2] usb: ehci-omap: add suspend/resume support
On Fri, Oct 8, 2010 at 1:17 AM, Laine Walker-Avina lwalk...@ieee.org wrote: On Fri, May 14, 2010 at 7:01 AM, Gadiyar, Anand gadi...@ti.com wrote: Alan Stern wrote: On Thu, 13 May 2010, Anand Gadiyar wrote: Add support for suspend and resume to the ehci-omap driver. Added routines for platform_driver suspend/resume and wrappers around ehci_bus_suspend/resume. ... You could use the runtime-PM interface instead of explicitly suspending and resuming the controller. It is now standard. Will work on this. I'll be out for a while, so it could be some time before I repost. Thanks, Anand Any more developments on this? Yup. We've rewritten this driver to factor out the common TLL and UHH programming, so that it plays nicely when EHCI and OHCI are both loaded. This was needed to be able to use the omap_device layer to use runtime PM We didn't want to do the work twice, that's why we abandoned this initial patch to do it cleanly once. The current version is being tested now and should be posted in a while. It's available on internal trees on dev.omapzoom.org, if you want to take a look. I can send a link if you like. - Anand -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH RFC 2/2] usb: ehci-omap: add suspend/resume support
Alan Stern wrote: On Thu, 13 May 2010, Anand Gadiyar wrote: Add support for suspend and resume to the ehci-omap driver. Added routines for platform_driver suspend/resume and wrappers around ehci_bus_suspend/resume. +#ifdef CONFIG_PM /*-*/ +static int ehci_omap_dev_suspend(struct device *dev) +{ + struct ehci_hcd_omap *omap = dev_get_drvdata(dev); + + if (!omap-suspended) + ehci_omap_enable(omap, 0); + return 0; +} + +static int ehci_omap_dev_resume(struct device *dev) +{ + struct ehci_hcd_omap *omap = dev_get_drvdata(dev); + + if (omap-suspended) + ehci_omap_enable(omap, 1); + return 0; +} + +static int ehci_omap_bus_suspend(struct usb_hcd *hcd) +{ + struct usb_bus *bus = hcd_to_bus(hcd); + int ret; + + ret = ehci_bus_suspend(hcd); + + ehci_omap_dev_suspend(bus-controller); + + return ret; +} +static int ehci_omap_bus_resume(struct usb_hcd *hcd) +{ + struct usb_bus *bus = hcd_to_bus(hcd); + int ret; + + ehci_omap_dev_resume(bus-controller); + + ret = ehci_bus_resume(hcd); + + return ret; +} You could use the runtime-PM interface instead of explicitly suspending and resuming the controller. It is now standard. Will work on this. I'll be out for a while, so it could be some time before I repost. Thanks, Anand -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH RFC 2/2] usb: ehci-omap: add suspend/resume support
On Thu, 13 May 2010, Anand Gadiyar wrote: Add support for suspend and resume to the ehci-omap driver. Added routines for platform_driver suspend/resume and wrappers around ehci_bus_suspend/resume. +#ifdef CONFIG_PM /*-*/ +static int ehci_omap_dev_suspend(struct device *dev) +{ + struct ehci_hcd_omap *omap = dev_get_drvdata(dev); + + if (!omap-suspended) + ehci_omap_enable(omap, 0); + return 0; +} + +static int ehci_omap_dev_resume(struct device *dev) +{ + struct ehci_hcd_omap *omap = dev_get_drvdata(dev); + + if (omap-suspended) + ehci_omap_enable(omap, 1); + return 0; +} + +static int ehci_omap_bus_suspend(struct usb_hcd *hcd) +{ + struct usb_bus *bus = hcd_to_bus(hcd); + int ret; + + ret = ehci_bus_suspend(hcd); + + ehci_omap_dev_suspend(bus-controller); + + return ret; +} +static int ehci_omap_bus_resume(struct usb_hcd *hcd) +{ + struct usb_bus *bus = hcd_to_bus(hcd); + int ret; + + ehci_omap_dev_resume(bus-controller); + + ret = ehci_bus_resume(hcd); + + return ret; +} You could use the runtime-PM interface instead of explicitly suspending and resuming the controller. It is now standard. Alan Stern -- To unsubscribe from this list: send the line unsubscribe linux-omap in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html