lkml.org 
[lkml]   [2011]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 6/6 v3] arm: omap: usb: global Suspend and resume support of ehci and ohci
Date
The global suspend and resume functions for ehci and ohci
drivers are implemented; these functions does the
pm_runtime_get_sync and pm_runtime_put_sync of the
parent device usbhs core driver respectively.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
---
drivers/usb/host/ehci-omap.c | 22 ++++++++++++++++++++--
drivers/usb/host/ohci-omap3.c | 21 +++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/drivers/usb/host/ehci-omap.c b/drivers/usb/host/ehci-omap.c
index 178f63e..a02a684 100644
--- a/drivers/usb/host/ehci-omap.c
+++ b/drivers/usb/host/ehci-omap.c
@@ -259,14 +259,32 @@ static void ehci_hcd_omap_shutdown(struct platform_device *pdev)
hcd->driver->shutdown(hcd);
}

+static int omap_ehci_resume(struct device *dev)
+{
+ if (dev->parent)
+ pm_runtime_get_sync(dev->parent);
+ return 0;
+}
+
+static int omap_ehci_suspend(struct device *dev)
+{
+ if (dev->parent)
+ pm_runtime_put_sync(dev->parent);
+ return 0;
+}
+
+static const struct dev_pm_ops omap_ehci_dev_pm_ops = {
+ .suspend = omap_ehci_suspend,
+ .resume = omap_ehci_resume,
+};
+
static struct platform_driver ehci_hcd_omap_driver = {
.probe = ehci_hcd_omap_probe,
.remove = ehci_hcd_omap_remove,
.shutdown = ehci_hcd_omap_shutdown,
- /*.suspend = ehci_hcd_omap_suspend, */
- /*.resume = ehci_hcd_omap_resume, */
.driver = {
.name = "ehci-omap",
+ .pm = &omap_ehci_dev_pm_ops,
}
};

diff --git a/drivers/usb/host/ohci-omap3.c b/drivers/usb/host/ohci-omap3.c
index 6ce50de..a1a7981 100644
--- a/drivers/usb/host/ohci-omap3.c
+++ b/drivers/usb/host/ohci-omap3.c
@@ -230,12 +230,33 @@ static void ohci_hcd_omap3_shutdown(struct platform_device *pdev)
hcd->driver->shutdown(hcd);
}

+
+static int omap_ohci_resume(struct device *dev)
+{
+ if (dev->parent)
+ pm_runtime_get_sync(dev->parent);
+ return 0;
+}
+
+static int omap_ohci_suspend(struct device *dev)
+{
+ if (dev->parent)
+ pm_runtime_put_sync(dev->parent);
+ return 0;
+}
+
+static const struct dev_pm_ops omap_ohci_dev_pm_ops = {
+ .suspend = omap_ohci_suspend,
+ .resume = omap_ohci_resume,
+};
+
static struct platform_driver ohci_hcd_omap3_driver = {
.probe = ohci_hcd_omap3_probe,
.remove = __devexit_p(ohci_hcd_omap3_remove),
.shutdown = ohci_hcd_omap3_shutdown,
.driver = {
.name = "ohci-omap3",
+ .pm = &omap_ohci_dev_pm_ops,
},
};

--
1.7.0.4


\
 
 \ /
  Last update: 2011-07-08 13:07    [W:0.062 / U:0.500 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site