From patchwork Thu Nov 6 08:36:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 5240101 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 8B78BC11AC for ; Thu, 6 Nov 2014 08:38:15 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C49332010F for ; Thu, 6 Nov 2014 08:38:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D35D8200DB for ; Thu, 6 Nov 2014 08:38:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752117AbaKFIhK (ORCPT ); Thu, 6 Nov 2014 03:37:10 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:27067 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbaKFIhD (ORCPT ); Thu, 6 Nov 2014 03:37:03 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NEM0073H02CKSA0@mailout2.w1.samsung.com>; Thu, 06 Nov 2014 08:39:48 +0000 (GMT) X-AuditID: cbfec7f5-b7f956d000005ed7-8a-545b332cbd08 Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 45.8B.24279.C233B545; Thu, 06 Nov 2014 08:37:00 +0000 (GMT) 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 <0NEL00IEEZXIOS10@eusync2.samsung.com>; Thu, 06 Nov 2014 08:37:00 +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, Lars-Peter Clausen , Michal Simek Cc: Kevin Hilman , Laurent Pinchart , Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz , Krzysztof Kozlowski Subject: [PATCH v10 2/5] amba: Add helpers for (un)preparing AMBA clock Date: Thu, 06 Nov 2014 09:36:47 +0100 Message-id: <1415263010-7992-3-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415263010-7992-1-git-send-email-k.kozlowski@samsung.com> References: <1415263010-7992-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrILMWRmVeSWpSXmKPExsVy+t/xK7o6xtEhBid+6lhsnLGe1WL61AuM Fqun/mW1eP3C0OLp5sdMFmeb3rBbLJk8n9Wic+ISdotZU/YyWVzeNYfN4nPvEUaL25d5LdYe uctu8e5lhMXdU0fZLM6cvsRqMeH3BTaL42vDLV727WdxEPZoae5h85jdMZPVY/Gel0wem1Z1 snncubaHzWPJm0OsHluutrN4zL77g9Gjb8sqRo8Vq7+ze3zeJOex9/NvlgCeKC6blNSczLLU In27BK6MO38vsxZM5aiY8E2vgfE7WxcjJ4eEgIlEw//DTBC2mMSFe+uB4lwcQgJLGSV+vVvO CuH0MUl8P7AerINNwFhi8/IlYFUiAteZJbof97OAJJgFFjFJNE1VBLGFBdwlDmzbxg5iswio SkxZv5MRxOYVcJOY2D2NEWKdnMTJY5NZQWxOoPpfSz6AnSEEVNP+dTb7BEbeBYwMqxhFU0uT C4qT0nON9IoTc4tL89L1kvNzNzFCouHrDsalx6wOMQpwMCrx8EawR4cIsSaWFVfmHmKU4GBW EuGN0AMK8aYkVlalFuXHF5XmpBYfYmTi4JRqYDx9LOuu1B3X7vtt7b8WzZPcdE1sVszhgLcn jk550Hpe4emDdzeu6eYc1m3h5F3hWvlJlvt18cn3qV9MEnKNTGfk5scW97qe3zP/8Pnjad2V lfMc33/55Fvzjf3xgZjN8q87LZ6+DHn7f5GN7673z6R0upW0D82RrLszaeWe/QxnrE89sju1 +uI2JZbijERDLeai4kQACtoOpWQCAAA= 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 c324f5700d1a..ac02f9bd63dc 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h @@ -97,6 +97,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)