From: heiko@sntech•de (Heiko Stübner)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 2/3] s3c-hsudc: add basic runtime_pm calls
Date: Sun, 8 Jan 2012 21:58:28 +0100 [thread overview]
Message-ID: <201201082158.28694.heiko@sntech.de> (raw)
In-Reply-To: <201201082156.44142.heiko@sntech.de>
This will enable the system to check for activity of the usb gadget
and also in a later patch to control the usbphy power-domain.
When handling the power domain there, it will be possible to remove
another reference to architecture code.
Signed-off-by: Heiko Stuebner <heiko@sntech•de>
---
drivers/usb/gadget/s3c-hsudc.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/usb/gadget/s3c-hsudc.c b/drivers/usb/gadget/s3c-hsudc.c
index 41b3a58..5e87293 100644
--- a/drivers/usb/gadget/s3c-hsudc.c
+++ b/drivers/usb/gadget/s3c-hsudc.c
@@ -30,6 +30,7 @@
#include <linux/prefetch.h>
#include <linux/platform_data/s3c-hsudc.h>
#include <linux/regulator/consumer.h>
+#include <linux/pm_runtime.h>
#include <mach/regs-s3c2443-clock.h>
@@ -1178,6 +1179,9 @@ static int s3c_hsudc_start(struct usb_gadget *gadget,
dev_info(hsudc->dev, "bound driver %s\n", driver->driver.name);
s3c_hsudc_reconfig(hsudc);
+
+ pm_runtime_get_sync(hsudc->dev);
+
s3c_hsudc_init_phy();
if (hsudc->pd->gpio_init)
hsudc->pd->gpio_init();
@@ -1208,6 +1212,9 @@ static int s3c_hsudc_stop(struct usb_gadget *gadget,
hsudc->gadget.dev.driver = NULL;
hsudc->gadget.speed = USB_SPEED_UNKNOWN;
s3c_hsudc_uninit_phy();
+
+ pm_runtime_put(hsudc->dev);
+
if (hsudc->pd->gpio_uninit)
hsudc->pd->gpio_uninit();
s3c_hsudc_stop_activity(hsudc);
@@ -1362,6 +1369,8 @@ static int __devinit s3c_hsudc_probe(struct platform_device *pdev)
if (ret)
goto err_add_udc;
+ pm_runtime_enable(dev);
+
return 0;
err_add_udc:
device_unregister(&hsudc->gadget.dev);
--
1.7.2.3
next prev parent reply other threads:[~2012-01-08 20:58 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-08 20:56 [PATCH 0/3] s3c-hsudc powerdomain using generic power domains Heiko Stübner
2012-01-08 20:57 ` [PATCH 1/3] s3c-hsudc: Use helper functions instead of generic container_of Heiko Stübner
2012-01-24 9:36 ` Felipe Balbi
2012-01-08 20:58 ` Heiko Stübner [this message]
2012-01-24 9:37 ` [PATCH 2/3] s3c-hsudc: add basic runtime_pm calls Felipe Balbi
2012-01-08 20:59 ` [PATCH 3/3] S3C2443: add power domain for usb phy Heiko Stübner
2012-01-24 9:38 ` Felipe Balbi
2012-01-24 9:50 ` Heiko Stübner
2012-01-24 9:51 ` Felipe Balbi
2012-01-24 10:09 ` Heiko Stübner
2012-01-24 10:12 ` Felipe Balbi
2012-01-24 10:13 ` Heiko Stübner
2012-01-24 10:15 ` Felipe Balbi
2012-01-24 10:31 ` Heiko Stübner
2012-01-24 13:01 ` Kukjin Kim
2012-01-24 13:07 ` Felipe Balbi
2012-01-24 13:27 ` Heiko Stübner
2012-01-24 13:30 ` Felipe Balbi
2012-02-01 16:35 ` Heiko Stübner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201201082158.28694.heiko@sntech.de \
--to=heiko@sntech$(echo .)de \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox