From patchwork Tue Aug 16 13:35:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9284017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id EA8C760839 for ; Tue, 16 Aug 2016 14:11:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5B122867C for ; Tue, 16 Aug 2016 14:11:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9ED82867F; Tue, 16 Aug 2016 14:11:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F1FCE2867C for ; Tue, 16 Aug 2016 14:11:22 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1EB11266B36; Tue, 16 Aug 2016 16:11:22 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C7A6B266895; Tue, 16 Aug 2016 16:08:17 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 61530266841; Tue, 16 Aug 2016 16:08:14 +0200 (CEST) Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by alsa0.perex.cz (Postfix) with ESMTP id 9DC3A2668C5 for ; Tue, 16 Aug 2016 15:36:36 +0200 (CEST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout1.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC000K748GY9B30@mailout1.w1.samsung.com> for alsa-devel@alsa-project.org; Tue, 16 Aug 2016 14:36:34 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-39-57b316e28003 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 61.AB.04866.2E613B75; Tue, 16 Aug 2016 14:36:34 +0100 (BST) Received: from AMDC2174.DIGITAL.local ([106.120.53.17]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0OC000MRK8GNJF30@eusync3.samsung.com>; Tue, 16 Aug 2016 14:36:33 +0100 (BST) From: Krzysztof Kozlowski To: Michael Turquette , Stephen Boyd , Stephen Warren , Lee Jones , Eric Anholt , Florian Fainelli , Ray Jui , Scott Branden , bcm-kernel-feedback-list@broadcom.com, Krzysztof Kozlowski , Sylwester Nawrocki , Tomasz Figa , Kukjin Kim , Russell King , Mark Brown , linux-clk@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-i2c@vger.kernel.org, alsa-devel@alsa-project.org Date: Tue, 16 Aug 2016 15:35:03 +0200 Message-id: <1471354514-24224-7-git-send-email-k.kozlowski@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> References: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrEIsWRmVeSWpSXmKPExsVy+t/xq7qPxDaHGzw+xmRxa905VosrFw8x WWycsZ7VYm3vURaLqQ+fsFn8m3KD3eJA42VGi1/vjrBbvHm7hsni9QtDi/7Hr5ktdrQtZLHY 9Pgaq8XHnnusFh1/vzBaXN41h81i4u0N7BYzzu9jsjg0dS+jxdojd9ktLp5ytXg6czObxeE3 7awWP850s1i8W/2E0eLVwTYWi1W7/jA6SHts+NzE5tH0/hibx+VrF5k93t9oZfeYdf8skNvX y+Sxc9Zddo9NqzrZPDYvqfd4OfE3m8eWfqBQ35ZVjB6fN8l5bJwbGsAXxWWTkpqTWZZapG+X wJUxa00Xc8FjyYrjb7YwNjAeFu1i5OSQEDCRuPjsCxuELSZx4d56IJuLQ0hgKaPEzWkzmCGc RiaJLxc7WEGq2ASMJTYvXwJWJSKwik1i4d+1TCAOs8BLRomzJ38BORwcwgJOEpu3BII0sAio Spz+e48FxOYVcJc4cgWkHmSdnMTJY5PBhnIKeEicu9DIDGILAdWcXN/OMoGRdwEjwypG0dTS 5ILipPRcI73ixNzi0rx0veT83E2MkJj7uoNx6TGrQ4wCHIxKPLwnGDaFC7EmlhVX5h5ilOBg VhLhPSy6OVyINyWxsiq1KD++qDQntfgQozQHi5I478xd70OEBNITS1KzU1MLUotgskwcnFIN jO1VDV37l93x+anwZ+X72jxd23a/uzc2bX2fINC3i9F3RexeRen+c+vMdxTVttbUzv8oOLnq bYxhVtd/zck8+88b2BxPu3zcZKfs4ahIlwfTg6+273bVVzwUKWR8mOm063+fI0f8H9zjcAwS yOx/n/VIONrj8bYrk99NCMn4GrJxf46eeLpdmBJLcUaioRZzUXEiAIUWxHS1AgAA Cc: a.hajda@samsung.com, Javier Martinez Canillas , Charles Keepax , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [alsa-devel] [RFC 06/17] clk: gate: Switch to new clock controller API X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Allocate a clock controller and use new clk_register_with_ctrl() API. Signed-off-by: Krzysztof Kozlowski --- drivers/clk/clk-gate.c | 8 +++++--- drivers/clk/samsung/clk.c | 5 +++-- include/linux/clk-provider.h | 6 ++++-- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c index 4e691e35483a..5eea0457778d 100644 --- a/drivers/clk/clk-gate.c +++ b/drivers/clk/clk-gate.c @@ -120,7 +120,8 @@ EXPORT_SYMBOL_GPL(clk_gate_ops); * @clk_gate_flags: gate-specific flags for this clock * @lock: shared register lock for this clock */ -struct clk_hw *clk_hw_register_gate(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_gate(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 clk_gate_flags, spinlock_t *lock) @@ -166,14 +167,15 @@ struct clk_hw *clk_hw_register_gate(struct device *dev, const char *name, } EXPORT_SYMBOL_GPL(clk_hw_register_gate); -struct clk *clk_register_gate(struct device *dev, const char *name, +struct clk *clk_register_gate(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 clk_gate_flags, spinlock_t *lock) { struct clk_hw *hw; - hw = clk_hw_register_gate(dev, name, parent_name, flags, reg, + hw = clk_hw_register_gate(dev, ctrl, name, parent_name, flags, reg, bit_idx, clk_gate_flags, lock); if (IS_ERR(hw)) return ERR_CAST(hw); diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index cb1e4398d6e5..79332011f258 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -268,8 +268,9 @@ void __init samsung_clk_register_gate(struct samsung_clk_provider *ctx, unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_gate(NULL, list->name, list->parent_name, - list->flags, ctx->reg_base + list->offset, + clk = clk_register_gate(NULL, ctx->clk_ctrl, list->name, + list->parent_name, list->flags, + ctx->reg_base + list->offset, list->bit_idx, list->gate_flags, &ctx->lock); if (IS_ERR(clk)) { pr_err("%s: failed to register clock %s\n", __func__, diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 2ee4e337e784..289290655283 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -340,11 +340,13 @@ struct clk_gate { #define CLK_GATE_HIWORD_MASK BIT(1) extern const struct clk_ops clk_gate_ops; -struct clk *clk_register_gate(struct device *dev, const char *name, +struct clk *clk_register_gate(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 clk_gate_flags, spinlock_t *lock); -struct clk_hw *clk_hw_register_gate(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_gate(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char *parent_name, unsigned long flags, void __iomem *reg, u8 bit_idx, u8 clk_gate_flags, spinlock_t *lock);