From patchwork Thu Apr 16 13:39:12 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Baldyga X-Patchwork-Id: 6225911 Return-Path: X-Original-To: patchwork-dmaengine@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 F1870BF4A6 for ; Thu, 16 Apr 2015 13:39:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1E0272027D for ; Thu, 16 Apr 2015 13:39:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BCEAA202AE for ; Thu, 16 Apr 2015 13:39:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756939AbbDPNju (ORCPT ); Thu, 16 Apr 2015 09:39:50 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:58931 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753799AbbDPNjt (ORCPT ); Thu, 16 Apr 2015 09:39:49 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NMW00107J9WYB00@mailout2.samsung.com>; Thu, 16 Apr 2015 22:39:32 +0900 (KST) X-AuditID: cbfee61b-f79536d000000f1f-c8-552fbb94ad64 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 89.E3.03871.49BBF255; Thu, 16 Apr 2015 22:39:32 +0900 (KST) Received: from AMDC2122.DIGITAL.local ([106.120.53.17]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NMW00D4SJ9HOBA0@mmp2.samsung.com>; Thu, 16 Apr 2015 22:39:32 +0900 (KST) From: Robert Baldyga To: linux@arm.linux.org.uk, dan.j.williams@intel.com, vinod.koul@intel.com Cc: lars@metafoo.de, dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, m.szyprowski@samsung.com, Robert Baldyga Subject: [PATCH 1/3] amba: add no_pm_pclk_management flag to amba_driver Date: Thu, 16 Apr 2015 15:39:12 +0200 Message-id: <1429191554-24972-2-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1429191554-24972-1-git-send-email-r.baldyga@samsung.com> References: <1429191554-24972-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGLMWRmVeSWpSXmKPExsVy+t9jQd0pu/VDDdbOVbSYPvUCo8XqqX9Z LZZMns9qcXnXHDaL25d5LdYeuctu8eDwTnaLl337WRw4PFqae9g8Fu95yeSx5M0hVo++LasY PT5vkgtgjeKySUnNySxLLdK3S+DK2Pe+m7lgG1/FqvbsBsbf3F2MnBwSAiYSk95+ZIawxSQu 3FvPBmILCUxnlOhbA1TDBWT/ZJRYMHEBE0iCTUBHYsv3CYxdjBwcIgJeErtfxYHUMAtMYJT4 tnURWI2wgIfExx3TwAaxCKhKtB65zgJi8wq4SlzumMACsUxO4uSxyawgNqeAm8THrweZIRa7 Srw6spV5AiPvAkaGVYyiqQXJBcVJ6blGesWJucWleel6yfm5mxjBofVMegfjqgaLQ4wCHIxK PLw/UvRDhVgTy4orcw8xSnAwK4nwPtgOFOJNSaysSi3Kjy8qzUktPsQozcGiJM47R1cuVEgg PbEkNTs1tSC1CCbLxMEp1cBYdUKm8N3CnfPd18q/XG9u2VrAty7nY+je5pe3M1ojEwvjoz+u 2r7shHWw4jbmG+u3zNl37OOBKVPF3uS5idra6+zQmZx5Ip+VeUGYRsHNwEkf790+deRu52b5 zF2te9ZvK+VZtKTFxkbxUaadsK9slM2ChCNnpriutixq+y/v9KRx6YtA4WsNSizFGYmGWsxF xYkA2CDVsCkCAAA= Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 This patch introduces no_pm_pclk_management flag in struct amba_driver. It causes that pclk is not touched in pm_runtime callbacks. This allows to manage clock in device driver independently of power domain management. Signed-off-by: Robert Baldyga --- drivers/amba/bus.c | 6 ++++-- include/linux/amba/bus.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index f009936..75035f0 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c @@ -140,9 +140,10 @@ static struct device_attribute amba_dev_attrs[] = { static int amba_pm_runtime_suspend(struct device *dev) { struct amba_device *pcdev = to_amba_device(dev); + struct amba_driver *pcdrv = to_amba_driver(dev->driver); int ret = pm_generic_runtime_suspend(dev); - if (ret == 0 && dev->driver) { + if (ret == 0 && dev->driver && !pcdrv->no_pm_pclk_management) { if (pm_runtime_is_irq_safe(dev)) clk_disable(pcdev->pclk); else @@ -155,9 +156,10 @@ static int amba_pm_runtime_suspend(struct device *dev) static int amba_pm_runtime_resume(struct device *dev) { struct amba_device *pcdev = to_amba_device(dev); + struct amba_driver *pcdrv = to_amba_driver(dev->driver); int ret; - if (dev->driver) { + if (dev->driver && !pcdrv->no_pm_pclk_management) { if (pm_runtime_is_irq_safe(dev)) ret = clk_enable(pcdev->pclk); else diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index 50fc668..a77378c 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -44,6 +44,7 @@ struct amba_driver { int (*suspend)(struct amba_device *, pm_message_t); int (*resume)(struct amba_device *); const struct amba_id *id_table; + unsigned int no_pm_pclk_management:1; }; /*