From patchwork Wed Nov 12 14:32:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5289611 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5455BC11AC for ; Wed, 12 Nov 2014 14:34:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8BC8520176 for ; Wed, 12 Nov 2014 14:34:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5C0B2015D for ; Wed, 12 Nov 2014 14:34:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752760AbaKLOcj (ORCPT ); Wed, 12 Nov 2014 09:32:39 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:63658 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752541AbaKLOch (ORCPT ); Wed, 12 Nov 2014 09:32:37 -0500 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 <0NEX00EJIKJ4N380@mailout1.w1.samsung.com>; Wed, 12 Nov 2014 14:35:28 +0000 (GMT) X-AuditID: cbfec7f4-b7f6c6d00000120b-a0-54636f8234b0 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 25.26.04619.28F63645; Wed, 12 Nov 2014 14:32:34 +0000 (GMT) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NEX00K83KE6S170@eusync3.samsung.com>; Wed, 12 Nov 2014 14:32:34 +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 v11 2/6] amba: Add helpers for (un)preparing AMBA clock Date: Wed, 12 Nov 2014 15:32:24 +0100 Message-id: <1415802748-30530-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415802748-30530-1-git-send-email-k.kozlowski@samsung.com> References: <1415802748-30530-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHLMWRmVeSWpSXmKPExsVy+t/xq7pN+ckhBkfemFlsnLGe1WL61AuM Fqun/mW1eP3C0OLp5sdMFmeb3rBbdE5cwm4xa8peJovLu+awWXzuPcJocfsyr8XaI3fZLe6e Ospmceb0JVaLCb8vsFkcXxtu8bJvP4uDoEdLcw+bx+yOmawei/e8ZPLYtKqTzePOtT1sHluu trN4zL77g9Gjb8sqRo8Vq7+ze3zeJBfAFcVlk5Kak1mWWqRvl8CVMefyNtaCqRwVWz+dZW9g /M7WxcjBISFgItG1J62LkRPIFJO4cG89UJiLQ0hgKaPE9pY9zBBOH5PEmtMbWUCq2ASMJTYv XwJWJSLQzizRt24qG0iCWWARk0TTVEUQW1jAXeL93ylMIDaLgKrE/2XzwJp5geITv5xghFgn J3Hy2GRWEJtTwEPiy7a/YHOEgGrOXD7IMoGRdwEjwypG0dTS5ILipPRcQ73ixNzi0rx0veT8 3E2MkDD/soNx8TGrQ4wCHIxKPLwVPMkhQqyJZcWVuYcYJTiYlUR4d+UAhXhTEiurUovy44tK c1KLDzEycXBKNTC6PDQViw6wP3swuVS685KFkLJCmsGlmWHOch0TLBc3bmE2NVljI2T5SHSa 8I+mN31Oz6ep2Lx8pXOmtvzWzXLlT7P5EzqzexhYf02NnLrziPGjpzopZwQ3ThEpMJaZsEjk bs/fEOXlZg/y2yKv16woUdcyeqrUen6jh+IVGdMU51eh3OHSgUosxRmJhlrMRcWJAOuXDzdR AgAA Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.5 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 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)