devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: linux-clk@vger.kernel.org
Cc: Marek Vasut <marex@denx.de>,
	Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Rob Herring <robh+dt@kernel.org>, Stephen Boyd <sboyd@kernel.org>,
	devicetree@vger.kernel.org, linux-power@fi.rohmeurope.com
Subject: [PATCH 2/2] clk: bd718x7: Add rohm,clock-output-is-critical property
Date: Wed, 20 Oct 2021 10:49:56 +0200	[thread overview]
Message-ID: <20211020084956.83041-2-marex@denx.de> (raw)
In-Reply-To: <20211020084956.83041-1-marex@denx.de>

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 <matti.vaittinen@fi.rohmeurope.com>
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


  reply	other threads:[~2021-10-20  8:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20  8:49 [PATCH 1/2] dt-bindings: mfd: rohm,bd71847-pmic: Document rohm,clock-output-is-critical property Marek Vasut
2021-10-20  8:49 ` Marek Vasut [this message]
2021-10-20 10:14 ` Vaittinen, Matti
2021-10-20 11:06   ` Marek Vasut
2021-10-28 21:24     ` Rob Herring
2021-10-29  7:43       ` Vaittinen, Matti
2021-11-08 15:01       ` Marek Vasut

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=20211020084956.83041-2-marex@denx.de \
    --to=marex@denx.de \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    /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).