From patchwork Mon Sep 15 10:13:51 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 4904111 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 AE090BEEA5 for ; Mon, 15 Sep 2014 10:16:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7FBA42015E for ; Mon, 15 Sep 2014 10:16:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4ED22201BF for ; Mon, 15 Sep 2014 10:16:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753759AbaIOKPQ (ORCPT ); Mon, 15 Sep 2014 06:15:16 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:18594 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753758AbaIOKOk (ORCPT ); Mon, 15 Sep 2014 06:14:40 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NBX003VUTX4UV90@mailout3.w1.samsung.com>; Mon, 15 Sep 2014 11:17:28 +0100 (BST) X-AuditID: cbfec7f5-b7f776d000003e54-a6-5416bc0dd934 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id D6.88.15956.D0CB6145; Mon, 15 Sep 2014 11:14:37 +0100 (BST) Received: from AMDC1943.digital.local ([106.116.151.171]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0NBX000N9TS7T610@eusync2.samsung.com>; Mon, 15 Sep 2014 11:14:37 +0100 (BST) From: Krzysztof Kozlowski To: Russell King , Dan Williams , Vinod Koul , linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Ulf Hansson , Grant Likely , Lars-Peter Clausen , Michal Simek , linux-pm@vger.kernel.org Cc: Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v3 2/4] amba: Add helper macros for (un)preparing AMBA clock Date: Mon, 15 Sep 2014 12:13:51 +0200 Message-id: <1410776033-22156-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1410776033-22156-1-git-send-email-k.kozlowski@samsung.com> References: <1410776033-22156-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t/xK7q8e8RCDBbvZLbYOGM9q8X0qRcY LVZP/ctqceDPDkaL1y8MLc42vWG3WDJ5PqvF5V1z2Cw+9x5htLh9mddi7ZG77BbvXkZYHF8b bvGybz+LA59HS3MPm8fiPS+ZPO5c28PmseTNIVaPvi2rGD0+b5Lz2Pv5N0sAexSXTUpqTmZZ apG+XQJXxt7DB1kKDrBXXHr4kqmBcQ1bFyMnh4SAicSuS6/YIWwxiQv31gPFuTiEBJYySrz4 /o0Jwuljkphx4ikjSBWbgLHE5uVLwKpEBN4xSdzafooFxGEWOMooMb33LRNIlbCAj8S2HxvB drAIqEpsXL+MBcTmFXCXOH5xCtQ+OYmTxyazgticAh4S2942gMWFgGo+PXnJOIGRdwEjwypG 0dTS5ILipPRcI73ixNzi0rx0veT83E2MkGD9uoNx6TGrQ4wCHIxKPLwzNoqFCLEmlhVX5h5i lOBgVhLhnboVKMSbklhZlVqUH19UmpNafIiRiYNTqoFxbcisNf5H13sLp32bveHWhceFkp9u RH/vERGxn119ZXHXhF9r1dyS6pQt5yTWRf4/wTNxn2lzaoZzcJtGSH2DUpHb0pOed/caLlv0 0a935e/wjDTPsIuB7+r0HkSy9Rwp5S0W85DVXn5jwuy/S8qXLt7Svyw443BM48JVLmKqrfkP Ty70exegxFKckWioxVxUnAgA3TIlczQCAAA= Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.6 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() macros for handling the AMBA bus clock by device drivers. Signed-off-by: Krzysztof Kozlowski --- include/linux/amba/bus.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index fdd7e1b61f60..ad52027a9cbf 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -92,6 +92,12 @@ void amba_release_regions(struct amba_device *); #define amba_pclk_disable(d) \ do { if (!IS_ERR((d)->pclk)) clk_disable((d)->pclk); } while (0) +#define amba_pclk_prepare(d) \ + (IS_ERR((d)->pclk) ? 0 : clk_prepare((d)->pclk)) + +#define amba_pclk_unprepare(d) \ + do { if (!IS_ERR((d)->pclk)) clk_unprepare((d)->pclk); } while (0) + /* 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)