From patchwork Mon Oct 20 09:04:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5103441 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 271D09F374 for ; Mon, 20 Oct 2014 09:05:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DC4520154 for ; Mon, 20 Oct 2014 09:05:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5B5E12017D for ; Mon, 20 Oct 2014 09:05:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753385AbaJTJFe (ORCPT ); Mon, 20 Oct 2014 05:05:34 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:47572 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753293AbaJTJF0 (ORCPT ); Mon, 20 Oct 2014 05:05:26 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NDQ00CZ4K1QK890@mailout1.w1.samsung.com>; Mon, 20 Oct 2014 10:08:14 +0100 (BST) X-AuditID: cbfec7f4-b7f6c6d00000120b-24-5444d0505900 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id AC.1E.04619.050D4445; Mon, 20 Oct 2014 10:05:20 +0100 (BST) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NDQ008ZEJWR1P90@eusync4.samsung.com>; Mon, 20 Oct 2014 10:05:20 +0100 (BST) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Jonathan Corbet , Russell King , Dan Williams , Vinod Koul , Ulf Hansson , Alan Stern , Krzysztof Kozlowski , linux-pm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Lars-Peter Clausen , Michal Simek Cc: Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v8 2/5] amba: Add helpers for (un)preparing AMBA clock Date: Mon, 20 Oct 2014 11:04:45 +0200 Message-id: <1413795888-18559-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1413795888-18559-1-git-send-email-k.kozlowski@samsung.com> References: <1413795888-18559-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrLLMWRmVeSWpSXmKPExsVy+t/xa7oBF1xCDO4tk7TYOGM9q8WTA+2M FtOnXmC0WD31L6vF6xeGFmeb3rBbLJk8n9Vi1pS9TBYL25awWFzeNYfN4nPvEUaL25d5LdYe uctu8e5lhMXdU0fZLM6cvsRqMeH3BTaL42vDLV727WdxEPZoae5h81i85yWTx51re4Csvsms HkveHGL12HK1ncVj9t0fjB59W1YxeqxY/Z3d4/MmOY+9n3+zBHBHcdmkpOZklqUW6dslcGXc ut3CVPCIveLm4SPMDYwn2boYOTkkBEwk5vZ8h7LFJC7cWw9kc3EICSxllJj7ZjMThNPHJLHw ThtYFZuAscTm5UvAqkQEjrNILO65AOYwC0xhlGietJQJpEpYwE3i6fWj7CA2i4CqxP4JM4Fs Dg5eAXeJu99lINbJSZw8NpkVxOYU8JCY3vKYEcQWAirpXriKaQIj7wJGhlWMoqmlyQXFSem5 hnrFibnFpXnpesn5uZsYIVHwZQfj4mNWhxgFOBiVeHgFLF1ChFgTy4orcw8xSnAwK4nwMh0F CvGmJFZWpRblxxeV5qQWH2Jk4uCUamCcIOneeJ+78YXdjTWCB7nMNtbzaP+40F+x8iCv0J/Z tgc2cXUu7ZV/MPEEz1TPk7mHa4VmsC95+GH2domi/Ce1X217JquGnnESWPMiZtuusLMCa8Vr 300KnReVL1fwbV9prtfpg+4XSsTsJ9zdkOqrvCMulqt727LKqEt2m3/tnrV8y8nWpLsblFiK MxINtZiLihMBFvqTX2ACAAA= Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Add amba_pclk_prepare() and amba_pclk_unprepare() inline functions for handling the AMBA bus clock by device drivers. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Ulf Hansson --- include/linux/amba/bus.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index c324f5700d1a..ac02f9bd63dc 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -97,6 +97,16 @@ void amba_release_regions(struct amba_device *); #define amba_pclk_disable(d) \ do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) +static inline int amba_pclk_prepare(struct amba_device *dev) +{ + return clk_prepare(dev->pclk); +} + +static inline void amba_pclk_unprepare(struct amba_device *dev) +{ + clk_unprepare(dev->pclk); +} + /* Some drivers don't use the struct amba_device */ #define AMBA_CONFIG_BITS(a) (((a) >> 24) & 0xff) #define AMBA_REV_BITS(a) (((a) >> 20) & 0x0f)