From patchwork Tue Mar 31 16:14:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 6131771 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 931AF9F1BE for ; Tue, 31 Mar 2015 16:18:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BF8BE201C8 for ; Tue, 31 Mar 2015 16:18:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 747FF201C0 for ; Tue, 31 Mar 2015 16:18:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753483AbbCaQSb (ORCPT ); Tue, 31 Mar 2015 12:18:31 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:34220 "EHLO mail-wi0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753017AbbCaQPz (ORCPT ); Tue, 31 Mar 2015 12:15:55 -0400 Received: by wixo5 with SMTP id o5so11771377wix.1; Tue, 31 Mar 2015 09:15:53 -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=7ENp/xdcaqlc9oF5MiTDlKIqTx3UjrGRGMCq6b7h/Rg=; b=vM98mAPthRHT1O7dHdTHh3Y4CrM0hFBOYkE0Re1nnZTbVDzDEITBPvi26ct19Vj1Zw hEbSsR95ua7H11nhetiP2+JidMIO6ClMCiFFnQKD1EDDCPlBlCMBhd0a4LYvofNr0e2C T4BYT9vXTa127I2Ek4B4UJAC695S+HMIgOn8LGgVsm1Q64R2nV7jXT/OFB6lgcyyzC6u KJ3TTR9KEbyaGE3C1i3D19v3U9u+/NxwzDwTQ3+WyOmGEmr6m40gwRKzeOaW17rixPpe tsAH/pHhwMrJLhGwUKD3es+5XcR+4xeqAIHFpHPPQPBspDyBcRUemdFxSSnS7buh23kl 7l/Q== X-Received: by 10.194.24.103 with SMTP id t7mr73853377wjf.15.1427818553847; Tue, 31 Mar 2015 09:15:53 -0700 (PDT) Received: from cizrna.lan ([109.72.12.56]) by mx.google.com with ESMTPSA id lx10sm20984796wjb.17.2015.03.31.09.15.51 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Mar 2015 09:15:53 -0700 (PDT) From: Tomeu Vizoso To: linux-pm@vger.kernel.org Cc: Tomeu Vizoso , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/6] [media] media-devnode: Implement dev_pm_ops.prepare callback Date: Tue, 31 Mar 2015 18:14:48 +0200 Message-Id: <1427818501-10201-5-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-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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 Have it return 1 so that media device nodes that are runtime-suspended won't be suspended when the system goes to a sleep state. This can make resume times considerably shorter because these devices don't need to be resumed when the system is awaken. Signed-off-by: Tomeu Vizoso --- drivers/media/media-devnode.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/media/media-devnode.c b/drivers/media/media-devnode.c index ebf9626..2c36d0a 100644 --- a/drivers/media/media-devnode.c +++ b/drivers/media/media-devnode.c @@ -76,8 +76,18 @@ static void media_devnode_release(struct device *cd) mdev->release(mdev); } +static int media_bus_prepare(struct device *dev) +{ + return 1; +} + +static const struct dev_pm_ops media_bus_pm_ops = { + .prepare = media_bus_prepare, +}; + static struct bus_type media_bus_type = { .name = MEDIA_NAME, + .pm = &media_bus_pm_ops, }; static ssize_t media_read(struct file *filp, char __user *buf,