From patchwork Tue Aug 16 13:35:02 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Krzysztof Kozlowski X-Patchwork-Id: 9284015 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 E39B460839 for ; Tue, 16 Aug 2016 14:10:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D59A42867C for ; Tue, 16 Aug 2016 14:10:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9DDB2867F; Tue, 16 Aug 2016 14:10:47 +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 E14552867C for ; Tue, 16 Aug 2016 14:10:46 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id F09B2266AE7; Tue, 16 Aug 2016 16:10:45 +0200 (CEST) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 6757426688A; 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 916BB26683F; Tue, 16 Aug 2016 16:08:13 +0200 (CEST) Received: from mailout3.w1.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by alsa0.perex.cz (Postfix) with ESMTP id 0D10B2668C4 for ; Tue, 16 Aug 2016 15:36:35 +0200 (CEST) Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0OC000GCR8GXPZ30@mailout3.w1.samsung.com> for alsa-devel@alsa-project.org; Tue, 16 Aug 2016 14:36:33 +0100 (BST) X-AuditID: cbfec7f5-f792a6d000001302-36-57b316e03490 Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 7F.9B.04866.0E613B75; Tue, 16 Aug 2016 14:36:32 +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:32 +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:02 +0200 Message-id: <1471354514-24224-6-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: H4sIAAAAAAAAAzWRe0gTcQDH/d3dbudoclw+DoVFg0osX734JRL6R+0iqP4oF0Ho0muKTtem khXoST7SfKEjlYL5GMJqTjeDNUpymqamOVYqC1+ooGmbolJZSs7Rf9/HB75/fAmUasaCibTM bFaVKcsQ4wJseHfga/hsoFkaVW87B53tozz4xW5DYGe9kQcNFR8wqJlbwOFu3SQfvuccAG67 +vhw9ccrBK4sRcOq+RUUWoqbMGiaH+fB9afTPFi6swmgw/ochzXfOviw/nM3Am2adwAa+qb4 0D50AS42mHHYu1rCg78+lWPQ9XIBwO89xRjUW/+CuBCmY6MQZwrd/TjjGLejjHuyiM80zozs 2coKhHnTOMVnTPonOGNuzWeWa/7gTFfVXlTZpQfMhknEdL64cc3vliA2hc1Iy2VVkeeTBKlm 3Q6q7Am/b5/5jRSA5qNlwJegydN0HTcAvDqQHps24mVAQFCkDtAdW27cU1Akh9BrjxM8GidP 0ea21n3In9TjdNOOAfEYlFwG9MjgNuKhDpIMbbC85Xk0Rh6hy3669nMhKaFnNcO4d05ED/bX 7jO+e/zoGId61yT0oLEEqwZCLfDRgwA2J1mpviNXnIxQyxTqnEx5RHKWwgS8z21ZgK4/xgZI AogPCD/6mKQUT5arzlPYAE2gYn9hb4BZSglTZHkPWFVWoiong1XbQAiBiYOEDVb3dYqUy7LZ dJZVsqr/LUL4BhcA0VjsbSpd3sJxQjhXnqA4EazcenSPci7EuGu1kaW1ku7DspaLE9Ys3ZpG KwkoHm9zWgThiQPHrqwUJ53pXQzzi79899nxpZ6r8Rs3kbOK3Utm7YQ2SBUoaisd3uQ0DxWO KKnTWIR3i9mp9vWhzjj6tdtlwqpDU0PjuUP5YkydKosOQ1Vq2T/NJ12NtQIAAA== Cc: a.hajda@samsung.com, Javier Martinez Canillas , Charles Keepax , Bartlomiej Zolnierkiewicz , Marek Szyprowski Subject: [alsa-devel] [RFC 05/17] clk: fixed-rate: 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-fixed-rate.c | 28 ++++++++++++++++++---------- drivers/clk/samsung/clk.c | 2 +- include/linux/clk-provider.h | 10 ++++++++-- 3 files changed, 27 insertions(+), 13 deletions(-) diff --git a/drivers/clk/clk-fixed-rate.c b/drivers/clk/clk-fixed-rate.c index 2edb39342a02..0a5c4f2105da 100644 --- a/drivers/clk/clk-fixed-rate.c +++ b/drivers/clk/clk-fixed-rate.c @@ -55,6 +55,7 @@ EXPORT_SYMBOL_GPL(clk_fixed_rate_ops); * @fixed_accuracy: non-adjustable clock rate */ struct clk_hw *clk_hw_register_fixed_rate_with_accuracy(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate, unsigned long fixed_accuracy) { @@ -81,7 +82,7 @@ struct clk_hw *clk_hw_register_fixed_rate_with_accuracy(struct device *dev, /* register the clock */ hw = &fixed->hw; - ret = clk_hw_register(dev, hw); + ret = clk_hw_register_with_ctrl(dev, ctrl, hw); if (ret) { kfree(fixed); hw = ERR_PTR(ret); @@ -92,13 +93,14 @@ struct clk_hw *clk_hw_register_fixed_rate_with_accuracy(struct device *dev, EXPORT_SYMBOL_GPL(clk_hw_register_fixed_rate_with_accuracy); struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate, unsigned long fixed_accuracy) { struct clk_hw *hw; - hw = clk_hw_register_fixed_rate_with_accuracy(dev, name, parent_name, - flags, fixed_rate, fixed_accuracy); + hw = clk_hw_register_fixed_rate_with_accuracy(dev, ctrl, name, + parent_name, flags, fixed_rate, fixed_accuracy); if (IS_ERR(hw)) return ERR_CAST(hw); return hw->clk; @@ -114,21 +116,27 @@ EXPORT_SYMBOL_GPL(clk_register_fixed_rate_with_accuracy); * @flags: framework-specific flags * @fixed_rate: non-adjustable clock rate */ -struct clk_hw *clk_hw_register_fixed_rate(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_fixed_rate(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align + const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate) { - return clk_hw_register_fixed_rate_with_accuracy(dev, name, parent_name, - flags, fixed_rate, 0); + return clk_hw_register_fixed_rate_with_accuracy(dev, ctrl, name, + parent_name, flags, + fixed_rate, 0); } EXPORT_SYMBOL_GPL(clk_hw_register_fixed_rate); -struct clk *clk_register_fixed_rate(struct device *dev, const char *name, +struct clk *clk_register_fixed_rate(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align + const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate) { - return clk_register_fixed_rate_with_accuracy(dev, name, parent_name, - flags, fixed_rate, 0); + return clk_register_fixed_rate_with_accuracy(dev, ctrl, name, + parent_name, flags, + fixed_rate, 0); } EXPORT_SYMBOL_GPL(clk_register_fixed_rate); @@ -174,7 +182,7 @@ void of_fixed_clk_setup(struct device_node *node) of_property_read_string(node, "clock-output-names", &clk_name); - clk = clk_register_fixed_rate_with_accuracy(NULL, clk_name, NULL, + clk = clk_register_fixed_rate_with_accuracy(NULL, NULL, clk_name, NULL, 0, rate, accuracy); if (!IS_ERR(clk)) of_clk_add_provider(node, of_clk_src_simple_get, clk); diff --git a/drivers/clk/samsung/clk.c b/drivers/clk/samsung/clk.c index fdeb35a48d3a..cb1e4398d6e5 100644 --- a/drivers/clk/samsung/clk.c +++ b/drivers/clk/samsung/clk.c @@ -147,7 +147,7 @@ void __init samsung_clk_register_fixed_rate(struct samsung_clk_provider *ctx, unsigned int idx, ret; for (idx = 0; idx < nr_clk; idx++, list++) { - clk = clk_register_fixed_rate(NULL, list->name, + clk = clk_register_fixed_rate(NULL, ctx->clk_ctrl, list->name, list->parent_name, list->flags, list->fixed_rate); 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 3589f164ff94..2ee4e337e784 100644 --- a/include/linux/clk-provider.h +++ b/include/linux/clk-provider.h @@ -283,17 +283,23 @@ struct clk_fixed_rate { #define to_clk_fixed_rate(_hw) container_of(_hw, struct clk_fixed_rate, hw) extern const struct clk_ops clk_fixed_rate_ops; -struct clk *clk_register_fixed_rate(struct device *dev, const char *name, +struct clk *clk_register_fixed_rate(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align + const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate); -struct clk_hw *clk_hw_register_fixed_rate(struct device *dev, const char *name, +struct clk_hw *clk_hw_register_fixed_rate(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align + const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate); struct clk *clk_register_fixed_rate_with_accuracy(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate, unsigned long fixed_accuracy); void clk_unregister_fixed_rate(struct clk *clk); struct clk_hw *clk_hw_register_fixed_rate_with_accuracy(struct device *dev, + struct clk_ctrl *ctrl, // FIXME: re-align const char *name, const char *parent_name, unsigned long flags, unsigned long fixed_rate, unsigned long fixed_accuracy); void clk_hw_unregister_fixed_rate(struct clk_hw *hw);