From patchwork Wed Sep 24 13:50:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 4966061 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 A08239F3DF for ; Wed, 24 Sep 2014 13:52:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8036A20272 for ; Wed, 24 Sep 2014 13:52:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 327542026F for ; Wed, 24 Sep 2014 13:52:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754010AbaIXNue (ORCPT ); Wed, 24 Sep 2014 09:50:34 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:51565 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754003AbaIXNub (ORCPT ); Wed, 24 Sep 2014 09:50:31 -0400 Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) 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 <0NCE00ICRRWV3AB0@mailout3.w1.samsung.com>; Wed, 24 Sep 2014 14:53:19 +0100 (BST) X-AuditID: cbfec7f4-b7f156d0000063c7-bc-5422cc24966a Received: from eusync1.samsung.com ( [203.254.199.211]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 83.00.25543.42CC2245; Wed, 24 Sep 2014 14:50:28 +0100 (BST) 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 <0NCE005ZMRRU2800@eusync1.samsung.com>; Wed, 24 Sep 2014 14:50:28 +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 v7 2/5] amba: Add helpers for (un)preparing AMBA clock Date: Wed, 24 Sep 2014 15:50:09 +0200 Message-id: <1411566612-32277-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1411566612-32277-1-git-send-email-k.kozlowski@samsung.com> References: <1411566612-32277-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsVy+t/xy7oqZ5RCDKZf5rDYOGM9q8X0qRcY LVZP/ctqceDPDkaL1y8MLc42vWG3WDJ5PqvFrCl7mSwWti1hsbi8aw6bxefeI4wWty/zWqw9 cpfd4t3LCIu7p46yWby9M53F4szpS6wWE35fYLM4vjbc4mXffhYHEY+W5h42j80rtDwW73nJ 5HHn2h42jyVvDrF6bLnazuIx++4PRo++LasYPVas/s7u8XmTnMfez79ZArijuGxSUnMyy1KL 9O0SuDJePJ7BVnCHvaLvzT/WBsYjbF2MHBwSAiYS61dwdTFyApliEhfurQcKc3EICSxllJj6 bB4rhNPHJDGr8y8zSBWbgLHE5uVLwKpEBI6wSDy79wTMYRY4yigxvfctE0iVsICbxJSevewg NouAqsTh/snsIOt4Bdwl1s5IhFgnJ3Hy2GRWkDCngIfE261aIGEhoIq+3udsExh5FzAyrGIU TS1NLihOSs811CtOzC0uzUvXS87P3cQIiYQvOxgXH7M6xCjAwajEwztBXClEiDWxrLgy9xCj BAezkgjvoVNAId6UxMqq1KL8+KLSnNTiQ4xMHJxSDYzrzprOYFg279bBmul3LnYlPll4Kv+X UkHfypshUpy/WZ4rzVTZb7E7Qir877qrEs95L529Me/bfP/fSr3rtKp7GxxMohXmbXtrUNdU 9pHN75HVb86johlrHe74MOfxbN14eNev92ZnN66uNrivqmJU/2Kb74kZV+wf6ERU/AsQ4pzI Wmr+82KIEktxRqKhFnNRcSIAVmGCD2ICAAA= 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() inline functions for handling the AMBA bus clock by device drivers. Signed-off-by: Krzysztof Kozlowski --- 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 fdd7e1b61f60..bb352d0bd737 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -92,6 +92,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 void amba_pclk_prepare(struct amba_device *dev) +{ + 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)