From patchwork Mon Sep 22 09:46:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 4946741 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 ADD8C9F4DC for ; Mon, 22 Sep 2014 09:49:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 929BA2021A for ; Mon, 22 Sep 2014 09:49:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9AA9E20219 for ; Mon, 22 Sep 2014 09:49:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753778AbaIVJsr (ORCPT ); Mon, 22 Sep 2014 05:48:47 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:62961 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752350AbaIVJq5 (ORCPT ); Mon, 22 Sep 2014 05:46:57 -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 <0NCA00IXQRB1NE60@mailout1.w1.samsung.com>; Mon, 22 Sep 2014 10:49:50 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-1c-541ff00e38d3 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 08.EA.25543.E00FF145; Mon, 22 Sep 2014 10:46:54 +0100 (BST) 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 <0NCA006NUR61YU10@eusync3.samsung.com>; Mon, 22 Sep 2014 10:46:54 +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 v6 2/4] amba: Add helper macros for (un)preparing AMBA clock Date: Mon, 22 Sep 2014 11:46:27 +0200 Message-id: <1411379189-3017-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1411379189-3017-1-git-send-email-k.kozlowski@samsung.com> References: <1411379189-3017-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t/xq7p8H+RDDPoP21hsnLGe1WL61AuM Fqun/mW1OPBnB6PF6xeGFmeb3rBbLJk8n9Vi1pS9TBYL25awWFzeNYfN4nPvEUaL25d5LdYe uctu8e5lhMXdU0fZLN7emc5iceb0JVaLCb8vsFkcXxtu8bJvP4uDiEdLcw+bx+YVWh6L97xk 8rhzbQ+bx5I3h1g9tlxtZ/GYffcHo0ffllWMHitWf2f3+LxJzmPv598sAdxRXDYpqTmZZalF +nYJXBl7Dx9kKTjAXnHp4UumBsY1bF2MnBwSAiYSfzZ+YYWwxSQu3FsPFOfiEBJYyijR0vCS GcLpY5J49riJHaSKTcBYYvPyJWBVIgJHWCSe3XsC5jALHGWUmN77lgmkSljAR+LVjR6gDg4O FgFVibl9MiBhXgE3iUtTprBArJOTOHlsMthqTgF3if3PWsAWCAHVHDk0m2kCI+8CRoZVjKKp pckFxUnpuYZ6xYm5xaV56XrJ+bmbGCHR8GUH4+JjVocYBTgYlXh4FzTJhwixJpYVV+YeYpTg YFYS4X36HCjEm5JYWZValB9fVJqTWnyIkYmDU6qBcfPMwiNu6fPrbso1S2Wt95PpXyi8QvHk LbGCvWGJMwOmq5TUZtR//6Gz89dxlpI+yebQu9N3usdtlr29Qmh3ctCe232FguW/SxpDXywR 5+jMuvLUNcCpWfqLgmPggVWPlq2U+ld/8qvvmoM5050LPokd/ZltKTSHffJU7n6z76suRqwz SzkYpsRSnJFoqMVcVJwIAIfCFfxkAgAA Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-7.9 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)