linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: clk-gpio: Add dt option to propagate rate change to parent
@ 2019-11-06 11:35 Alexandru Ardelean
  2019-11-06 22:43 ` Stephen Boyd
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alexandru Ardelean @ 2019-11-06 11:35 UTC (permalink / raw)
  To: linux-clk, linux-kernel
  Cc: sboyd, mturquette, jsarha, ce3a, Michael Hennerich, Alexandru Ardelean

From: Michael Hennerich <michael.hennerich@analog.com>

For certain setups/boards it's useful to propagate the rate change of the
clock up one level to the parent clock.

This change implements this by defining a `clk-set-rate-parent` device-tree
property which sets the `CLK_SET_RATE_PARENT` flag to the clock (when set).

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---
 drivers/clk/clk-gpio.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 9d930edd6516..6dfbc4b952fe 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -241,6 +241,7 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
 	struct device_node *node = pdev->dev.of_node;
 	const char **parent_names, *gpio_name;
 	unsigned int num_parents;
+	unsigned long clk_flags;
 	struct gpio_desc *gpiod;
 	struct clk *clk;
 	bool is_mux;
@@ -274,13 +275,16 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
 		return ret;
 	}
 
+	clk_flags = of_property_read_bool(node, "clk-set-rate-parent") ?
+			CLK_SET_RATE_PARENT : 0;
+
 	if (is_mux)
 		clk = clk_register_gpio_mux(&pdev->dev, node->name,
-				parent_names, num_parents, gpiod, 0);
+				parent_names, num_parents, gpiod, clk_flags);
 	else
 		clk = clk_register_gpio_gate(&pdev->dev, node->name,
 				parent_names ?  parent_names[0] : NULL, gpiod,
-				0);
+				clk_flags);
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2019-11-11  9:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-06 11:35 [PATCH] clk: clk-gpio: Add dt option to propagate rate change to parent Alexandru Ardelean
2019-11-06 22:43 ` Stephen Boyd
2019-11-07 13:25   ` Ardelean, Alexandru
     [not found]     ` <20191107225313.4ED9D21D7B@mail.kernel.org>
2019-11-08  6:50       ` Ardelean, Alexandru
2019-11-08  7:10         ` Ardelean, Alexandru
2019-11-08  7:09 ` [PATCH v2] clk: clk-gpio: " Alexandru Ardelean
2019-11-08  7:17 ` [PATCH v3] " Alexandru Ardelean
2019-11-08 21:08   ` Stephen Boyd
2019-11-11  9:31     ` Ardelean, Alexandru

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).