From patchwork Mon Apr 1 06:36:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lad, Prabhakar" X-Patchwork-Id: 2369381 Return-Path: X-Original-To: patchwork-davinci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by patchwork2.kernel.org (Postfix) with ESMTP id 342E1DFB7B for ; Mon, 1 Apr 2013 06:41:07 +0000 (UTC) Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r316b8Ka000439; Mon, 1 Apr 2013 01:37:08 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r316b8vP001026; Mon, 1 Apr 2013 01:37:08 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.2.342.3; Mon, 1 Apr 2013 01:37:07 -0500 Received: from linux.omap.com (dlelxs01.itg.ti.com [157.170.227.31]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r316b700028063; Mon, 1 Apr 2013 01:37:07 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 92EAF80627; Mon, 1 Apr 2013 00:37:07 -0600 (CST) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp52.itg.ti.com (dflp52.itg.ti.com [128.247.22.96]) by linux.omap.com (Postfix) with ESMTP id 0003980626 for ; Mon, 1 Apr 2013 00:37:05 -0600 (CST) Received: from white.ext.ti.com (white.ext.ti.com [192.94.93.38]) by dflp52.itg.ti.com (8.13.7/8.13.8) with ESMTP id r316b5wt018703 for ; Mon, 1 Apr 2013 01:37:05 -0500 (CDT) Received: from mail6.bemta7.messagelabs.com (mail6.bemta7.messagelabs.com [216.82.255.55]) by white.ext.ti.com (8.13.7/8.13.7) with ESMTP id r316b5hR028178 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 1 Apr 2013 01:37:05 -0500 Received: from [216.82.253.67:20828] by server-14.bemta-7.messagelabs.com id 4C/1C-00330-11B29515; Mon, 01 Apr 2013 06:37:05 +0000 X-Env-Sender: prabhakar.csengg@gmail.com X-Msg-Ref: server-13.tower-158.messagelabs.com!1364798224!3296632!1 X-Originating-IP: [209.85.192.175] X-SpamReason: No, hits=0.0 required=7.0 tests=ML_RADAR_SPEW_LINKS_14, spamassassin: X-StarScan-Received: X-StarScan-Version: 6.8.6.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 20445 invoked from network); 1 Apr 2013 06:37:04 -0000 Received: from mail-pd0-f175.google.com (HELO mail-pd0-f175.google.com) (209.85.192.175) by server-13.tower-158.messagelabs.com with RC4-SHA encrypted SMTP; 1 Apr 2013 06:37:04 -0000 Received: by mail-pd0-f175.google.com with SMTP id t10so1074076pdi.20 for ; Sun, 31 Mar 2013 23:37:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer; bh=Tkda6ou7XgAPLl0iBWfUyDY2pC2nDtwnXo12l/1gLjY=; b=ypiUoO0fpef4fbwKqOPzMmcb+yKgFV+PQEwYwc5e8aE2mCKnzRNnMKJCR0E7f6NTuz fTuqq69NhyACxm0VQfHS40Ly9XrzRQAGl+1kn4XAgUtUVbUkHna6nsvRj3Y/MxgJhF7P qXHXqHyrd8jU/vxg/LIEirYOxbwAbNkPTO9oM5GJoCaI6SSDm6F4wytSRdubb7lfeLoV cYLuNpCQCi9JXZtocU8Cbtp2jw2DtxmlqLomq6pATdV2aNv34RiBaXBJ15fxdmzBZsfs VUucM+Twpm7OgSGLULUNmBlEvuryHfknjT0ZN6xA5FBCQt8Fj5jqDBGOrAV5XadJroDd R+IA== X-Received: by 10.66.50.138 with SMTP id c10mr17092566pao.220.1364798223969; Sun, 31 Mar 2013 23:37:03 -0700 (PDT) Received: from localhost.localdomain ([122.166.13.141]) by mx.google.com with ESMTPS id 1sm12617386pba.32.2013.03.31.23.36.58 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 31 Mar 2013 23:37:02 -0700 (PDT) From: Prabhakar lad To: DLOS , LMML Subject: [PATCH v2] davinci: vpif: add pm_runtime support Date: Mon, 1 Apr 2013 12:06:50 +0530 Message-ID: <1364798210-31517-1-git-send-email-prabhakar.csengg@gmail.com> X-Mailer: git-send-email 1.7.4.1 CC: Mauro Carvalho Chehab , LKML , Sakari Ailus , Hans Verkuil X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com From: Lad, Prabhakar Add pm_runtime support to the TI Davinci VPIF driver. Signed-off-by: Lad, Prabhakar Cc: Mauro Carvalho Chehab Cc: Hans Verkuil Cc: Laurent Pinchart Cc: Sakari Ailus Cc: Sekhar Nori --- Changes for v2: 1: Removed use of clk API as pointed by Laurent and Sekhar. drivers/media/platform/davinci/vpif.c | 24 +++++++----------------- 1 files changed, 7 insertions(+), 17 deletions(-) diff --git a/drivers/media/platform/davinci/vpif.c b/drivers/media/platform/davinci/vpif.c index 28638a8..599cabb 100644 --- a/drivers/media/platform/davinci/vpif.c +++ b/drivers/media/platform/davinci/vpif.c @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include #include #include @@ -44,7 +44,6 @@ static struct resource *res; spinlock_t vpif_lock; void __iomem *vpif_base; -struct clk *vpif_clk; /** * ch_params: video standard configuration parameters for vpif @@ -439,19 +438,15 @@ static int vpif_probe(struct platform_device *pdev) goto fail; } - vpif_clk = clk_get(&pdev->dev, "vpif"); - if (IS_ERR(vpif_clk)) { - status = PTR_ERR(vpif_clk); - goto clk_fail; - } - clk_prepare_enable(vpif_clk); + pm_runtime_enable(&pdev->dev); + pm_runtime_resume(&pdev->dev); + + pm_runtime_get(&pdev->dev); spin_lock_init(&vpif_lock); dev_info(&pdev->dev, "vpif probe success\n"); return 0; -clk_fail: - iounmap(vpif_base); fail: release_mem_region(res->start, res_len); return status; @@ -459,11 +454,6 @@ fail: static int vpif_remove(struct platform_device *pdev) { - if (vpif_clk) { - clk_disable_unprepare(vpif_clk); - clk_put(vpif_clk); - } - iounmap(vpif_base); release_mem_region(res->start, res_len); return 0; @@ -472,13 +462,13 @@ static int vpif_remove(struct platform_device *pdev) #ifdef CONFIG_PM static int vpif_suspend(struct device *dev) { - clk_disable_unprepare(vpif_clk); + pm_runtime_put(dev); return 0; } static int vpif_resume(struct device *dev) { - clk_prepare_enable(vpif_clk); + pm_runtime_get(dev); return 0; }