linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@kernel.org>
To: Alexandru Ardelean <alexandru.ardelean@analog.com>,
	linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: mturquette@baylibre.com, jsarha@ti.com, ce3a@gmx.de,
	Michael Hennerich <michael.hennerich@analog.com>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>
Subject: Re: [PATCH] clk: clk-gpio: Add dt option to propagate rate change to parent
Date: Wed, 06 Nov 2019 14:43:05 -0800	[thread overview]
Message-ID: <20191106224306.A85342173E@mail.kernel.org> (raw)
In-Reply-To: <20191106113551.5557-1-alexandru.ardelean@analog.com>

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?


  reply	other threads:[~2019-11-06 22:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=20191106224306.A85342173E@mail.kernel.org \
    --to=sboyd@kernel.org \
    --cc=alexandru.ardelean@analog.com \
    --cc=ce3a@gmx.de \
    --cc=jsarha@ti.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=mturquette@baylibre.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: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).