From patchwork Fri Nov 14 08:50:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5304131 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 C6B259F2ED for ; Fri, 14 Nov 2014 08:52:22 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0D79C20149 for ; Fri, 14 Nov 2014 08:52:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 241C02017D for ; Fri, 14 Nov 2014 08:52:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754746AbaKNIuo (ORCPT ); Fri, 14 Nov 2014 03:50:44 -0500 Received: from mailout4.w1.samsung.com ([210.118.77.14]:57110 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754631AbaKNIun (ORCPT ); Fri, 14 Nov 2014 03:50:43 -0500 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NF00078OU11CY60@mailout4.w1.samsung.com>; Fri, 14 Nov 2014 08:53:25 +0000 (GMT) X-AuditID: cbfec7f4-b7f6c6d00000120b-f3-5465c260411f Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 6E.FB.04619.062C5645; Fri, 14 Nov 2014 08:50:40 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync1.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NF00074XTWBTB70@eusync1.samsung.com>; Fri, 14 Nov 2014 08:50:40 +0000 (GMT) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Russell King , Dan Williams , Vinod Koul , Ulf Hansson , Alan Stern , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org Cc: Kevin Hilman , Laurent Pinchart , Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v12 2/6] amba: Add helpers for (un)preparing AMBA clock Date: Fri, 14 Nov 2014 09:50:29 +0100 Message-id: <1415955033-29093-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415955033-29093-1-git-send-email-k.kozlowski@samsung.com> References: <1415955033-29093-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPLMWRmVeSWpSXmKPExsVy+t/xy7oJh1JDDJ52slhsnLGe1WL61AuM Fqun/mW1eP3C0OLp5sdMFmeb3rBbdE5cwm4xa8peJovLu+awWXzuPcJocfsyr8XaI3fZLe6e Ospmceb0JVaLCb8vsFkcXxtu8bJvP4uDoEdLcw+bx+yOmawei/e8ZPLYtKqTzePOtT1sHluu trN4zL77g9Gjb8sqRo8Vq7+ze3zeJBfAFcVlk5Kak1mWWqRvl8CVMefyNtaCqRwVWz+dZW9g /M7WxcjJISFgItE+rw/KFpO4cG89kM3FISSwlFHiUvtFRginj0li68d9jCBVbALGEpuXLwGr EhFoZ5boWzcVrJ1ZYBGTRNNURRBbWMBd4sjHf2ANLAKqEp9OTQCr4QWKn2j4yQKxTk7i5LHJ rCA2p4CHxOSNq8DiQkA1ny//YZ7AyLuAkWEVo2hqaXJBcVJ6rqFecWJucWleul5yfu4mRkig f9nBuPiY1SFGAQ5GJR5eg4LUECHWxLLiytxDjBIczEoivEq7gUK8KYmVValF+fFFpTmpxYcY mTg4pRoY5xml/g01384x5cF6ubZ50h2RiQo3Ha2Vj83M6zf4vdAxOWJ32IqVL5e+qt9vIMvC zDSjWSr7kt4lhWNzt70SC56x8Nr7dYG/uqSvSzeeeP2NaeWje/fT37HbKcVuV2Wrf2zs/DCM 1aVN4H+v1GOd6sh81zlPvk5bKbzMS3nS2xTv8yy1B8JLlViKMxINtZiLihMBMQTq61ICAAA= 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 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 d024bd9c9d9b..2afc618b15ce 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -98,6 +98,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)