From patchwork Tue Sep 16 12:59:18 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 4917891 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 5DDAE9F350 for ; Tue, 16 Sep 2014 12:59:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0CAFF201DC for ; Tue, 16 Sep 2014 13:01:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ACA552020F for ; Tue, 16 Sep 2014 13:01:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753394AbaIPNA3 (ORCPT ); Tue, 16 Sep 2014 09:00:29 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:30519 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753974AbaIPM7h (ORCPT ); Tue, 16 Sep 2014 08:59:37 -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 <0NBZ00NJPW8550A0@mailout1.w1.samsung.com>; Tue, 16 Sep 2014 14:02:29 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-b7-54183436badc Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 7E.64.25543.63438145; Tue, 16 Sep 2014 13:59:34 +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 <0NBZ00CMUW32T2A0@eusync2.samsung.com>; Tue, 16 Sep 2014 13:59:34 +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 , "Rafael J. Wysocki" , Len Brown , Pavel Machek , Randy Dunlap , Alan Stern , linux-doc@vger.kernel.org, linux-pm@vger.kernel.org Cc: Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v5 2/4] amba: Add helper macros for (un)preparing AMBA clock Date: Tue, 16 Sep 2014 14:59:18 +0200 Message-id: <1410872360-27029-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1410872360-27029-1-git-send-email-k.kozlowski@samsung.com> References: <1410872360-27029-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsVy+t/xK7pmJhIhBitua1tsnLGe1WL61AuM Fqun/mW1OPBnB6PF6xeGFmeb3rBbLJk8n9Vi1pS9TBYL25awWFzeNYfN4nPvEUaL25d5LdYe uctu8e5lhMXdU0fZLN7emc5iceb0JVaLCb8vsFkcXxtu8bJvP4uDiEdLcw+bx+YVWh6L97xk 8rhzbQ+bx5I3h1g9tlxtZ/GYffcHo0ffllWMHitWf2f3+LxJzmPv598sAdxRXDYpqTmZZalF +nYJXBl7Dx9kKTjAXnHp4UumBsY1bF2MnBwSAiYSTQv2MEPYYhIX7q0HinNxCAksZZQ4t/c3 E4TTxyTx4/xcsA42AWOJzcuXgFWJCBxhkXh27wmYwyxwlFFieu9bJpAqYQEfibdfb4PNZRFQ lZizYR9YN6+Au8S22wuYIPbJSZw8NpkVxOYU8JC4vvcaWL0QUM3NqROYJzDyLmBkWMUomlqa XFCclJ5rqFecmFtcmpeul5yfu4kREg9fdjAuPmZ1iFGAg1GJhzfjn3iIEGtiWXFl7iFGCQ5m JRFeD02JECHelMTKqtSi/Pii0pzU4kOMTBycUg2MQdKXHvy8Vno6IPvIko74trSyoN2l7A78 vMKub9IXdXlybkvodl41d8H+3dyTLDxutEUIP3110TS8cU70uT7+rG4/ziOf112Jia9YcuCO V772jv9VoUnTMrMVChmkW74/set8XfTqyV+hl807HmxnDgoQ9j5/79WLQ1uU13zt3lf3Y8oT xo4yJZbijERDLeai4kQA4ArUhmUCAAA= 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)