From patchwork Tue Mar 31 16:14:45 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6131831 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DBCB9BF4A6 for ; Tue, 31 Mar 2015 16:19:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 098592010E for ; Tue, 31 Mar 2015 16:19:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 80C8C201C8 for ; Tue, 31 Mar 2015 16:19:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752796AbbCaQPs (ORCPT ); Tue, 31 Mar 2015 12:15:48 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:36427 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752756AbbCaQPo (ORCPT ); Tue, 31 Mar 2015 12:15:44 -0400 Received: by wgra20 with SMTP id a20so24975596wgr.3; Tue, 31 Mar 2015 09:15:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=kdL0If4Ll2FqD9D3q8NoLwHVQUmsNzEgrN1vHarA6AU=; b=ieKafBmr4RgXWBxcL5oIAzLPv5EI7f2Gdo5wIuQw7awqJNrXMG8llHLigGNBVoL7mo 4zxQgOyHa5CTDCkjXcdDId+dHSBlPRNf/UjeAeQOB0oKMStEMr8JvWBFDpxY1sgGI7R5 eTOiBHQRSELWk87rxDw/e7qHZ97CdXmQZNRDGFwfy09Rfr3+snXU2YbemhdfD1CXuBzS bAKfjf/CMmZfR4m9ikVQxU3Xl3pHDpADftevZxMuVi0BJaDlr+SFYzfQpVDBqXxG5l+0 79WMOA4/UL+PiB8N4rS1yT7Psmfn8HhfTzfbbWCV0+1SVDPfn5fqSCJyKROPCE4olgN3 DdKA== X-Received: by 10.194.77.99 with SMTP id r3mr76134638wjw.149.1427818543281; Tue, 31 Mar 2015 09:15:43 -0700 (PDT) Received: from cizrna.lan ([109.72.12.56]) by mx.google.com with ESMTPSA id lx10sm20984796wjb.17.2015.03.31.09.15.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2015 09:15:42 -0700 (PDT) From: Tomeu Vizoso To: linux-pm@vger.kernel.org Cc: Tomeu Vizoso , Laurent Pinchart , Mauro Carvalho Chehab , 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 Message-Id: <1427818501-10201-2-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.3.4 In-Reply-To: <1427818501-10201-1-git-send-email-tomeu.vizoso@collabora.com> References: <1427818501-10201-1-git-send-email-tomeu.vizoso@collabora.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 #include +#include #include #include #include @@ -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;