linux-clk.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandru Ardelean <alexandru.ardelean@analog.com>
To: <linux-clk@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-renesas-soc@vger.kernel.org>
Cc: <sboyd@kernel.org>, <mturquette@baylibre.com>, <jsarha@ti.com>,
	<ce3a@gmx.de>, <geert+renesas@glider.be>, <horms@verge.net.au>,
	<magnus.damm@gmail.com>, <wsa+renesas@sang-engineering.com>,
	Michael Hennerich <michael.hennerich@analog.com>,
	Alexandru Ardelean <alexandru.ardelean@analog.com>
Subject: [PATCH v3] clk: clk-gpio: propagate rate change to parent
Date: Fri, 8 Nov 2019 09:17:18 +0200	[thread overview]
Message-ID: <20191108071718.17985-1-alexandru.ardelean@analog.com> (raw)
In-Reply-To: <20191106113551.5557-1-alexandru.ardelean@analog.com>

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

For an external clock source, which is gated via a GPIO, the
rate change should typically be propagated to the parent clock.

The situation where we are requiring this propagation, is when an
external clock is connected to override an internal clock (which typically
has a fixed rate). The external clock can have a different rate than the
internal one, and may also be variable, thus requiring the rate
propagation.

This rate change wasn't propagated until now, and it's unclear about cases
where this shouldn't be propagated. Thus, it's unclear whether this is
fixing a bug, or extending the current driver behavior. Also, it's unsure
about whether this may break any existing setups; in the case that it does,
a device-tree property may be added to disable this flag.

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
---

Changelog v2 -> v3:
* limited CLK_SET_RATE_PARENT to both gate clk-gpio drivers; did not pay
  close attention to Stephen's comment when he mentioned to only the gate
  clk-gpio driver

Changelog v1 -> v2:
* added CLK_SET_RATE_PARENT to both gate & mux clk-gpio drivers

 drivers/clk/clk-gpio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk-gpio.c b/drivers/clk/clk-gpio.c
index 9d930edd6516..13304cf5f2a8 100644
--- a/drivers/clk/clk-gpio.c
+++ b/drivers/clk/clk-gpio.c
@@ -280,7 +280,7 @@ static int gpio_clk_driver_probe(struct platform_device *pdev)
 	else
 		clk = clk_register_gpio_gate(&pdev->dev, node->name,
 				parent_names ?  parent_names[0] : NULL, gpiod,
-				0);
+				CLK_SET_RATE_PARENT);
 	if (IS_ERR(clk))
 		return PTR_ERR(clk);
 
-- 
2.20.1


  parent reply	other threads:[~2019-11-08  7:16 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
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 ` Alexandru Ardelean [this message]
2019-11-08 21:08   ` [PATCH v3] " 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=20191108071718.17985-1-alexandru.ardelean@analog.com \
    --to=alexandru.ardelean@analog.com \
    --cc=ce3a@gmx.de \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=jsarha@ti.com \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=michael.hennerich@analog.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=wsa+renesas@sang-engineering.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).