From: Krzysztof Kozlowski <k.kozlowski@samsung.com> To: Michael Turquette <mturquette@baylibre.com>, Stephen Boyd <sboyd@codeaurora.org>, Stephen Warren <swarren@wwwdotorg.org>, Lee Jones <lee@kernel.org>, Eric Anholt <eric@anholt.net>, Florian Fainelli <f.fainelli@gmail.com>, Ray Jui <rjui@broadcom.com>, Scott Branden <sbranden@broadcom.com>, bcm-kernel-feedback-list@broadcom.com, Krzysztof Kozlowski <k.kozlowski@samsung.com>, Sylwester Nawrocki <s.nawrocki@samsung.com>, Tomasz Figa <tomasz.figa@gmail.com>, Kukjin Kim <kgene@kernel.org>, Russell King <linux@armlinux.org.uk>, Mark Brown <broonie@kernel.org>, 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 <m.szyprowski@samsung.com>, Charles Keepax <ckeepax@opensource.wolfsonmicro.com>, Javier Martinez Canillas <javier@osg.samsung.com>, a.hajda@samsung.com, Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> Subject: [RFC 05/17] clk: fixed-rate: Switch to new clock controller API Date: Tue, 16 Aug 2016 15:35:02 +0200 [thread overview] Message-ID: <1471354514-24224-6-git-send-email-k.kozlowski@samsung.com> (raw) In-Reply-To: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> Allocate a clock controller and use new clk_register_with_ctrl() API. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> --- 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); -- 1.9.1
WARNING: multiple messages have this Message-ID (diff)
From: k.kozlowski@samsung.com (Krzysztof Kozlowski) To: linux-arm-kernel@lists.infradead.org Subject: [RFC 05/17] clk: fixed-rate: Switch to new clock controller API Date: Tue, 16 Aug 2016 15:35:02 +0200 [thread overview] Message-ID: <1471354514-24224-6-git-send-email-k.kozlowski@samsung.com> (raw) In-Reply-To: <1471354514-24224-1-git-send-email-k.kozlowski@samsung.com> Allocate a clock controller and use new clk_register_with_ctrl() API. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> --- 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); -- 1.9.1
next prev parent reply other threads:[~2016-08-16 13:36 UTC|newest] Thread overview: 69+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-08-16 13:34 [RFC 00/17] clk: Add per-controller locks to fix deadlocks Krzysztof Kozlowski 2016-08-16 13:34 ` Krzysztof Kozlowski 2016-08-16 13:34 ` [RFC 01/17] clk: bcm2835: Rename clk_register to avoid name conflict Krzysztof Kozlowski 2016-08-16 13:34 ` Krzysztof Kozlowski 2016-08-16 13:34 ` Krzysztof Kozlowski 2016-08-16 13:34 ` [RFC 02/17] clk: Add clock controller to fine-grain the prepare lock Krzysztof Kozlowski 2016-08-16 13:34 ` Krzysztof Kozlowski 2016-08-16 13:34 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 03/17] clk: s2mps11: Switch to new clock controller API Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 04/17] clk: samsung: Allocate a clock controller in context Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski [this message] 2016-08-16 13:35 ` [RFC 05/17] clk: fixed-rate: Switch to new clock controller API Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 06/17] clk: gate: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 07/17] clk: mux: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 08/17] clk: fixed-factor: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 09/17] clk: divider: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 10/17] clk: composite: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 11/17] clk: gpio: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 12/17] ASoC: samsung: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 14:13 ` Mark Brown 2016-08-16 14:13 ` Mark Brown 2016-08-16 14:13 ` Mark Brown 2016-08-16 16:41 ` Krzysztof Kozlowski 2016-08-16 16:41 ` Krzysztof Kozlowski 2016-08-16 16:41 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 13/17] clk: samsung: audss: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 14/17] clk: samsung: clkout: " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 15/17] clk: Use per-controller locking Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 16/17] Revert "i2c: exynos5: Fix possible ABBA deadlock by keeping I2C clock prepared" Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:35 ` [RFC 17/17] Revert "i2c: s3c2410: fix ABBA deadlock by keeping " Krzysztof Kozlowski 2016-08-16 13:35 ` Krzysztof Kozlowski 2016-08-16 13:51 ` [RFC 00/17] clk: Add per-controller locks to fix deadlocks Krzysztof Kozlowski 2016-08-16 13:51 ` Krzysztof Kozlowski 2016-08-19 14:46 ` Charles Keepax 2016-08-19 14:46 ` Charles Keepax 2016-08-19 14:46 ` Charles Keepax 2016-08-19 16:58 ` Krzysztof Kozlowski 2016-08-19 16:58 ` Krzysztof Kozlowski 2016-08-19 16:58 ` Krzysztof Kozlowski 2016-08-19 19:31 ` Javier Martinez Canillas 2016-08-19 19:31 ` Javier Martinez Canillas 2016-08-19 19:31 ` Javier Martinez Canillas 2016-08-20 16:03 ` Krzysztof Kozlowski 2016-08-20 16:03 ` Krzysztof Kozlowski 2016-08-20 16:03 ` Krzysztof Kozlowski 2016-09-09 0:24 ` Stephen Boyd 2016-09-09 0:24 ` Stephen Boyd 2016-09-09 0:24 ` Stephen Boyd [not found] ` <CGME20161104105318eucas1p2e9458dbe7039f2a81419fae8cf6bc4c8@eucas1p2.samsung.com> 2016-11-04 10:53 ` Marek Szyprowski 2016-11-04 10:53 ` Marek Szyprowski 2016-11-04 10:53 ` Marek Szyprowski 2016-11-12 2:38 ` Stephen Boyd 2016-11-12 2:38 ` Stephen Boyd 2016-11-12 2:38 ` Stephen Boyd
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1471354514-24224-6-git-send-email-k.kozlowski@samsung.com \ --to=k.kozlowski@samsung.com \ --cc=a.hajda@samsung.com \ --cc=alsa-devel@alsa-project.org \ --cc=b.zolnierkie@samsung.com \ --cc=bcm-kernel-feedback-list@broadcom.com \ --cc=broonie@kernel.org \ --cc=ckeepax@opensource.wolfsonmicro.com \ --cc=eric@anholt.net \ --cc=f.fainelli@gmail.com \ --cc=javier@osg.samsung.com \ --cc=kgene@kernel.org \ --cc=lee@kernel.org \ --cc=linux-arm-kernel@lists.infradead.org \ --cc=linux-clk@vger.kernel.org \ --cc=linux-i2c@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-rpi-kernel@lists.infradead.org \ --cc=linux-samsung-soc@vger.kernel.org \ --cc=linux@armlinux.org.uk \ --cc=m.szyprowski@samsung.com \ --cc=mturquette@baylibre.com \ --cc=rjui@broadcom.com \ --cc=s.nawrocki@samsung.com \ --cc=sboyd@codeaurora.org \ --cc=sbranden@broadcom.com \ --cc=swarren@wwwdotorg.org \ --cc=tomasz.figa@gmail.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.