From patchwork Fri Jul 1 18:54:34 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Munegowda, Keshava" X-Patchwork-Id: 937112 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p61IwN3j022626 for ; Fri, 1 Jul 2011 18:58:23 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757681Ab1GAS5r (ORCPT ); Fri, 1 Jul 2011 14:57:47 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:52304 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757626Ab1GAS5O (ORCPT ); Fri, 1 Jul 2011 14:57:14 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id p61Iv86e001520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Jul 2011 13:57:10 -0500 Received: from dbde71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id p61Iv4gd029339; Sat, 2 Jul 2011 00:27:04 +0530 (IST) Received: from dbdp31.itg.ti.com (172.24.170.98) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 8.3.106.1; Sat, 2 Jul 2011 00:27:04 +0530 Received: from localhost.localdomain (a0393220-desktop.india.ti.com [172.24.136.86]) by dbdp31.itg.ti.com (8.13.8/8.13.8) with ESMTP id p61IuXP0001776; Sat, 2 Jul 2011 00:26:55 +0530 (IST) From: Keshava Munegowda To: , , CC: Keshava Munegowda , , , , , , , , , , , Keshava Munegowda Subject: [PATCH 6/6 v2] arm: omap: usb: global Suspend and resume support of ehci and ohci Date: Sat, 2 Jul 2011 00:24:34 +0530 Message-ID: <1309546474-15363-7-git-send-email-keshava_mgowda@ti.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1309546474-15363-6-git-send-email-keshava_mgowda@ti.com> References: <1309546474-15363-1-git-send-email-keshava_mgowda@ti.com> <1309546474-15363-2-git-send-email-keshava_mgowda@ti.com> <1309546474-15363-3-git-send-email-keshava_mgowda@ti.com> <1309546474-15363-4-git-send-email-keshava_mgowda@ti.com> <1309546474-15363-5-git-send-email-keshava_mgowda@ti.com> <1309546474-15363-6-git-send-email-keshava_mgowda@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Fri, 01 Jul 2011 18:58:23 +0000 (UTC) From: Keshava Munegowda 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 --- 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, }, };