Thread (7 messages) 7 messages, 3 authors, 2021-11-08
STALE1682d

[PATCH 2/2] clk: bd718x7: Add rohm,clock-output-is-critical property

From: Marek Vasut <marex@denx.de>
Date: 2021-10-20 08:50:30
Also in: linux-devicetree
Subsystem: common clk framework, rohm power management ic device drivers, the rest · Maintainers: Michael Turquette, Stephen Boyd, Matti Vaittinen, Linus Torvalds

Add the possibility to configure PMIC 32kHz output clock as CRITICAL,
so that they are never gated off. This is useful in case those clock
supply some vital clock net, which requires the clock to always run.

The iMX8M RTC XTAL input is one such example, if the clock are ever
gated off, the system locks up completely. The clock must be present
and enabled even if the RTC is unused.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Matti Vaittinen <redacted>
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Stephen Boyd <sboyd@kernel.org>
Cc: devicetree@vger.kernel.org
Cc: linux-power@fi.rohmeurope.com
To: linux-clk@vger.kernel.org
---
 drivers/clk/clk-bd718x7.c | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/drivers/clk/clk-bd718x7.c b/drivers/clk/clk-bd718x7.c
index ac40b669d60b..a59bc57f13bc 100644
--- a/drivers/clk/clk-bd718x7.c
+++ b/drivers/clk/clk-bd718x7.c
@@ -125,6 +125,13 @@ static int bd71837_clk_probe(struct platform_device *pdev)
 	c->pdev = pdev;
 	c->hw.init = &init;
 
+	/*
+	 * The clock supply vital clock net, e.g. SoC XTAL input,
+	 * and the clock must not ever be turned off.
+	 */
+	if (of_property_read_bool(parent->of_node, "rohm,clock-output-is-critical"))
+		init.flags |= CLK_IS_CRITICAL,
+
 	of_property_read_string_index(parent->of_node,
 				      "clock-output-names", 0, &init.name);
 
-- 
2.33.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help