lkml.org 
[lkml]   [2019]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] clk: clk-gpio: Add dt option to propagate rate change to parent
From
Date
Quoting Alexandru Ardelean (2019-11-06 03:35:51)
> 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;

Is there a DT binding update somewhere? It looks like a linux-ism from
the DT perspective. I wonder if we can somehow figure out that it's OK
to call clk_set_rate() on the parent here? Or is it safe to assume that
we can just always call set rate on the parent? I think for a gate it's
good and we can just do so, but for a mux maybe not. Care to describe
your scenario a little more so we can understand why you want to set
this flag? Is it for a mux or a gate type gpio?

\
 
 \ /
  Last update: 2019-11-06 23:43    [W:0.093 / U:71.924 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site