LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
To: linux-pm@vger.kernel.org
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 1/6] [media] uvcvideo: Enable runtime PM of descendant devices
Date: Tue, 31 Mar 2015 18:14:45 +0200	[thread overview]
Message-ID: <1427818501-10201-2-git-send-email-tomeu.vizoso@collabora.com> (raw)
In-Reply-To: <1427818501-10201-1-git-send-email-tomeu.vizoso@collabora.com>

So UVC devices can remain runtime-suspended when the system goes into a
sleep state, they and all of their descendant devices need to have
runtime PM enable.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
 drivers/media/usb/uvc/uvc_driver.c | 4 ++++
 drivers/media/usb/uvc/uvc_status.c | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index cf27006..e98830a1 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -1792,6 +1792,8 @@ static int uvc_register_video(struct uvc_device *dev,
 		return ret;
 	}
 
+	pm_runtime_enable(&vdev->dev);
+
 	if (stream->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
 		stream->chain->caps |= V4L2_CAP_VIDEO_CAPTURE;
 	else
@@ -1932,6 +1934,8 @@ static int uvc_probe(struct usb_interface *intf,
 	if (media_device_register(&dev->mdev) < 0)
 		goto error;
 
+	pm_runtime_enable(&dev->mdev.devnode.dev);
+
 	dev->vdev.mdev = &dev->mdev;
 #endif
 	if (v4l2_device_register(&intf->dev, &dev->vdev) < 0)
diff --git a/drivers/media/usb/uvc/uvc_status.c b/drivers/media/usb/uvc/uvc_status.c
index f552ab9..b1d3d8c 100644
--- a/drivers/media/usb/uvc/uvc_status.c
+++ b/drivers/media/usb/uvc/uvc_status.c
@@ -13,6 +13,7 @@
 
 #include <linux/kernel.h>
 #include <linux/input.h>
+#include <linux/pm_runtime.h>
 #include <linux/slab.h>
 #include <linux/usb.h>
 #include <linux/usb/input.h>
@@ -46,6 +47,8 @@ static int uvc_input_init(struct uvc_device *dev)
 	if ((ret = input_register_device(input)) < 0)
 		goto error;
 
+	pm_runtime_enable(&input->dev);
+
 	dev->input = input;
 	return 0;
 
-- 
2.3.4


  reply	other threads:[~2015-03-31 16:15 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 16:14 [PATCH 0/6] Allow UVC devices to remain runtime-suspended when sleeping Tomeu Vizoso
2015-03-31 16:14 ` Tomeu Vizoso [this message]
2015-03-31 16:14 ` [PATCH 2/6] [media] v4l2-core: Implement dev_pm_ops.prepare() Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 3/6] Input: " Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 4/6] [media] media-devnode: Implement dev_pm_ops.prepare callback Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 5/6] Input: evdev - Enable runtime PM of the evdev input handler Tomeu Vizoso
2015-03-31 20:31   ` Dmitry Torokhov
2015-04-03 13:03     ` Tomeu Vizoso
2015-03-31 16:14 ` [PATCH 6/6] USB / PM: Allow USB devices to remain runtime-suspended when sleeping Tomeu Vizoso
2015-03-31 17:09   ` Alan Stern
2015-04-01 12:40     ` Oliver Neukum
2015-04-01 14:01       ` Alan Stern
2015-04-01 14:26         ` Oliver Neukum
2015-04-01 14:36           ` Alan Stern
2015-04-03 13:05     ` Tomeu Vizoso

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=1427818501-10201-2-git-send-email-tomeu.vizoso@collabora.com \
    --to=tomeu.vizoso@collabora.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --subject='Re: [PATCH 1/6] [media] uvcvideo: Enable runtime PM of descendant devices' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).