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: 9283875 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 35BD1600CB for ; Tue, 16 Aug 2016 13:39:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 24AEC28999 for ; Tue, 16 Aug 2016 13:39:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 18AA028BF7; Tue, 16 Aug 2016 13:39:19 +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 833F928999 for ; Tue, 16 Aug 2016 13:39:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753548AbcHPNgn (ORCPT ); Tue, 16 Aug 2016 09:36:43 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:41847 "EHLO mailout3.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753549AbcHPNgg (ORCPT ); Tue, 16 Aug 2016 09:36:36 -0400 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>; 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 Cc: Marek Szyprowski , Charles Keepax , Javier Martinez Canillas , a.hajda@samsung.com, Bartlomiej Zolnierkiewicz Subject: [RFC 05/17] clk: fixed-rate: Switch to new clock controller API 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== 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-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);