From patchwork Tue Aug 16 13:35:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9283907 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 B6D1E600CB for ; Tue, 16 Aug 2016 13:40:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A560628999 for ; Tue, 16 Aug 2016 13:40:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 99BCC28BF7; Tue, 16 Aug 2016 13:40:38 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CB8B28999 for ; Tue, 16 Aug 2016 13:40:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753933AbcHPNkE (ORCPT ); Tue, 16 Aug 2016 09:40:04 -0400 Received: from mailout4.w1.samsung.com ([210.118.77.14]:23649 "EHLO mailout4.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750803AbcHPNgi (ORCPT ); Tue, 16 Aug 2016 09:36:38 -0400 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout4.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC0006GE8GZWY30@mailout4.w1.samsung.com>; Tue, 16 Aug 2016 14:36:35 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-42-57b316e31222 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 84.AB.04866.3E613B75; Tue, 16 Aug 2016 14:36:35 +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:35 +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 Cc: Marek Szyprowski , Charles Keepax , Javier Martinez Canillas , a.hajda@samsung.com, Bartlomiej Zolnierkiewicz Subject: [RFC 07/17] clk: mux: Switch to new clock controller API Date: Tue, 16 Aug 2016 15:35:04 +0200 Message-id: <1471354514-24224-8-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+NgFlrMIsWRmVeSWpSXmKPExsVy+t/xq7qPxTaHGzxawGZxa905VosrFw8x WWycsZ7VYm3vURaLqQ+fsFn8m3KD3eJA42VGi1/vjrBbvHm7hsni9QtDi/7Hr5ktdrQtZLHY 9Pgaq8XHnnusFh1/vzBaXN41h81i4u0N7BYzzu9jsjg0dS+jxdojd9ktLp5ytXg6czObxeE3 7awWP850s1i8W/2E0eLVwTYWi1W7/jA6SHts+NzE5tH0/hibx+VrF5k93t9oZfeYdf8skNvX y+Sxc9Zddo9NqzrZPDYvqfd4OfE3m8eWfqBQ35ZVjB6fN8l5bJwbGsAXxWWTkpqTWZZapG+X wJVxu/MZY8Fd/YqV3R/ZGhgb1LsYOTkkBEwk3j3rZIOwxSQu3FsPZHNxCAksZZQ43XOFGcJp ZJL427ScEaSKTcBYYvPyJWBVIgKr2CQW/l3LBOIwC7xklDh78hcTSJWwgKPEjatzWUBsFgFV icfTp4PFeQXcJdZuucIIsU9O4uSxyawgNqeAh8S5C43MILYQUM3J9e0sExh5FzAyrGIUTS1N LihOSs810itOzC0uzUvXS87P3cQIibqvOxiXHrM6xCjAwajEw3uCYVO4EGtiWXFl7iFGCQ5m JRHew6Kbw4V4UxIrq1KL8uOLSnNSiw8xSnOwKInzztz1PkRIID2xJDU7NbUgtQgmy8TBKdXA GGUtyLfk4raTtqxm4UJJa56s2zDTcqL2rS8yZ7Nf7j2vd0fBOaFhLsOR67XqG954HtsxWzgq T8faiPnnV5kpMeoi0yeIK9zzy9PkjfkVOUk9oThrlVPoYu6Y4t29P3f1Tlx4P/vu67j7ibbM U7cvu5636vO+tFlHnwk49+2zKDe79HDjgU+LZZVYijMSDbWYi4oTAV7O9422AgAA Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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-mux.c | 32 ++++++++++++++++++-------------- drivers/clk/samsung/clk.c | 4 ++-- include/linux/clk-provider.h | 12 ++++++++---- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/clk/clk-mux.c b/drivers/clk/clk-mux.c index 16a3d5717f4e..a85bbef1992b 100644 --- a/drivers/clk/clk-mux.c +++ b/drivers/clk/clk-mux.c @@ -113,7 +113,8 @@ const struct clk_ops clk_mux_ro_ops = { }; EXPORT_SYMBOL_GPL(clk_mux_ro_ops); -struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_mux_table(struct device *dev, + struct clk_ctrl *ctrl, const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u32 mask, @@ -159,7 +160,7 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name, mux->hw.init = &init; hw = &mux->hw; - ret = clk_hw_register(dev, hw); + ret = clk_hw_register_with_ctrl(dev, ctrl, hw); if (ret) { kfree(mux); hw = ERR_PTR(ret); @@ -169,7 +170,8 @@ struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name, } EXPORT_SYMBOL_GPL(clk_hw_register_mux_table); -struct clk *clk_register_mux_table(struct device *dev, const char *name, +struct clk *clk_register_mux_table(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u32 mask, @@ -177,16 +179,17 @@ struct clk *clk_register_mux_table(struct device *dev, const char *name, { struct clk_hw *hw; - hw = clk_hw_register_mux_table(dev, name, parent_names, num_parents, - flags, reg, shift, mask, clk_mux_flags, - table, lock); + hw = clk_hw_register_mux_table(dev, ctrl, name, parent_names, + num_parents, flags, reg, shift, mask, + clk_mux_flags, table, lock); if (IS_ERR(hw)) return ERR_CAST(hw); return hw->clk; } EXPORT_SYMBOL_GPL(clk_register_mux_table); -struct clk *clk_register_mux(struct device *dev, const char *name, +struct clk *clk_register_mux(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u8 width, @@ -194,13 +197,14 @@ struct clk *clk_register_mux(struct device *dev, const char *name, { u32 mask = BIT(width) - 1; - return clk_register_mux_table(dev, name, parent_names, num_parents, - flags, reg, shift, mask, clk_mux_flags, - NULL, lock); + return clk_register_mux_table(dev, ctrl, name, parent_names, + num_parents, flags, reg, shift, mask, + clk_mux_flags, NULL, lock); } EXPORT_SYMBOL_GPL(clk_register_mux); -struct clk_hw *clk_hw_register_mux(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_mux(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u8 width, @@ -208,9 +212,9 @@ struct clk_hw *clk_hw_register_mux(struct device *dev, const char *name, { u32 mask = BIT(width) - 1; - return clk_hw_register_mux_table(dev, name, parent_names, num_parents, - flags, reg, shift, mask, clk_mux_flags, - NULL, lock); + return clk_hw_register_mux_table(dev, ctrl, name, parent_names, + num_parents, flags, reg, shift, mask, + clk_mux_flags, NULL, lock); } EXPORT_SYMBOL_GPL(clk_hw_register_mux); diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index 79332011f258..1a296bbabd47 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -197,8 +197,8 @@ void __init samsung_clk_register_mux(struct samsung_clk_provider *ctx, unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_mux(NULL, list->name, list->parent_names, - list->num_parents, list->flags, + clk = clk_register_mux(NULL, ctx->clk_ctrl, list->name, + list->parent_names, list->num_parents, list->flags, ctx->reg_base + list->offset, list->shift, list->width, list->mux_flags, &ctx->lock); if (IS_ERR(clk)) { diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h index 289290655283..f5f062d267a9 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -493,23 +493,27 @@ struct clk_mux { extern const struct clk_ops clk_mux_ops; extern const struct clk_ops clk_mux_ro_ops; -struct clk *clk_register_mux(struct device *dev, const char *name, +struct clk *clk_register_mux(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u8 width, u8 clk_mux_flags, spinlock_t *lock); -struct clk_hw *clk_hw_register_mux(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_mux(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u8 width, u8 clk_mux_flags, spinlock_t *lock); -struct clk *clk_register_mux_table(struct device *dev, const char *name, +struct clk *clk_register_mux_table(struct device *dev, struct clk_ctrl *ctrl, + const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u32 mask, u8 clk_mux_flags, u32 *table, spinlock_t *lock); -struct clk_hw *clk_hw_register_mux_table(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_mux_table(struct device *dev, + struct clk_ctrl *ctrl, const char *name, const char * const *parent_names, u8 num_parents, unsigned long flags, void __iomem *reg, u8 shift, u32 mask,