From patchwork Tue Nov 4 12:52: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: 5227451 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 7D7659F3EE for ; Tue, 4 Nov 2014 12:54:05 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C0EFC2013A for ; Tue, 4 Nov 2014 12:54:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D6D192012E for ; Tue, 4 Nov 2014 12:54:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753381AbaKDMxK (ORCPT ); Tue, 4 Nov 2014 07:53:10 -0500 Received: from mailout1.w1.samsung.com ([210.118.77.11]:49767 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751160AbaKDMxH (ORCPT ); Tue, 4 Nov 2014 07:53:07 -0500 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 <0NEI00JK4MLAVFA0@mailout1.w1.samsung.com>; Tue, 04 Nov 2014 12:55:58 +0000 (GMT) X-AuditID: cbfec7f4-b7f6c6d00000120b-8e-5458cc2f2c29 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 30.DE.04619.F2CC8545; Tue, 04 Nov 2014 12:53:03 +0000 (GMT) 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 <0NEI00F5DMGAFJ30@eusync3.samsung.com>; Tue, 04 Nov 2014 12:53:03 +0000 (GMT) From: Krzysztof Kozlowski To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Jonathan Corbet , Russell King , Dan Williams , Vinod Koul , Ulf Hansson , Alan Stern , Krzysztof Kozlowski , 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 Subject: [PATCH v9 1/4] amba: Add helpers for (un)preparing AMBA clock Date: Tue, 04 Nov 2014 13:52:47 +0100 Message-id: <1415105570-7871-2-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1415105570-7871-1-git-send-email-k.kozlowski@samsung.com> References: <1415105570-7871-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsVy+t/xq7r6ZyJCDFb81rPYOGM9q8WTA+2M FtOnXmC0WD31L6vF6xeGFk83P2ayONv0ht1iyeT5rBadE5ewW8yaspfJ4vKuOWwWn3uPMFrc vsxrsfbIXXaLdy8jLO6eOspmceb0JVaLCb8vsFkcXxtu8bJvP4uDiEdLcw+bx+yOmawei/e8 ZPLYtKqTzePOtT1sHov7JrN6LHlziNVjy9V2Fo/Zd38wevRtWcXosWL1d3aPz5vkPPZ+/s0S wBvFZZOSmpNZllqkb5fAlXHn72XWgqkcFRO+6TUwfmfrYuTgkBAwkfg+RamLkRPIFJO4cG89 UJiLQ0hgKaPExylnGUESQgJ9TBIb26VAbDYBY4nNy5eAFYkIrGKReLXnOpjDLPCRUeLm6o3M IFXCAm4Sn6/NZgWxWQRUJeb/msEOYvMCxRtffGSCWCcncfLYZLAaTgF3ia0b97FBbHOTePPo DdsERt4FjAyrGEVTS5MLipPScw31ihNzi0vz0vWS83M3MULi48sOxsXHrA4xCnAwKvHwZqhH hAixJpYVV+YeYpTgYFYS4TXeDRTiTUmsrEotyo8vKs1JLT7EyMTBKdXAaMKfwM3/04Nn50We GUvnff1z1H5ZSNubIEkPPYObZkfaOLsdZK7M1vpdUuXHxZDAyjdh20/GSa4GK+tfGU2YHntR mH2GdeqvU9XL8ksv/Jh109EgW7jb6MVu5Z1xBbc4LjzUeKk+u0HXfp8OW/yWtQEb+GaFrZVw 38Q7yWFHT8fSa+UibGsqlViKMxINtZiLihMBzSBEim0CAAA= 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)