linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rajan Vaja <rajan.vaja@xilinx.com>
To: <mturquette@baylibre.com>, <sboyd@kernel.org>,
	<michal.simek@xilinx.com>, <lee.jones@linaro.org>,
	<kristo@kernel.org>, <quanyang.wang@windriver.com>
Cc: <linux-clk@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	<linux-kernel@vger.kernel.org>,
	Rajan Vaja <rajan.vaja@xilinx.com>
Subject: [PATCH v6 4/4] clk: zynqmp: Handle divider specific read only flag
Date: Mon, 28 Jun 2021 00:01:22 -0700	[thread overview]
Message-ID: <20210628070122.26217-5-rajan.vaja@xilinx.com> (raw)
In-Reply-To: <20210628070122.26217-1-rajan.vaja@xilinx.com>

Add support for divider specific read only CCF flag
(CLK_DIVIDER_READ_ONLY).

Signed-off-by: Rajan Vaja <rajan.vaja@xilinx.com>
---
 drivers/clk/zynqmp/divider.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/clk/zynqmp/divider.c b/drivers/clk/zynqmp/divider.c
index c07423e03bc8..cb49281f9cf9 100644
--- a/drivers/clk/zynqmp/divider.c
+++ b/drivers/clk/zynqmp/divider.c
@@ -256,6 +256,11 @@ static const struct clk_ops zynqmp_clk_divider_ops = {
 	.set_rate = zynqmp_clk_divider_set_rate,
 };
 
+static const struct clk_ops zynqmp_clk_divider_ro_ops = {
+	.recalc_rate = zynqmp_clk_divider_recalc_rate,
+	.round_rate = zynqmp_clk_divider_round_rate,
+};
+
 /**
  * zynqmp_clk_get_max_divisor() - Get maximum supported divisor from firmware.
  * @clk_id:		Id of clock
@@ -334,7 +339,10 @@ struct clk_hw *zynqmp_clk_register_divider(const char *name,
 		return ERR_PTR(-ENOMEM);
 
 	init.name = name;
-	init.ops = &zynqmp_clk_divider_ops;
+	if (nodes->type_flag & CLK_DIVIDER_READ_ONLY)
+		init.ops = &zynqmp_clk_divider_ro_ops;
+	else
+		init.ops = &zynqmp_clk_divider_ops;
 
 	init.flags = zynqmp_clk_map_common_ccf_flags(nodes->flag);
 
-- 
2.32.0.93.g670b81a


  parent reply	other threads:[~2021-06-28  7:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-28  7:01 [PATCH v6 0/4] clk: zynqmp: Add firmware specific clock flags Rajan Vaja
2021-06-28  7:01 ` [PATCH v6 1/4] clk: zynqmp: Use firmware specific common " Rajan Vaja
2021-06-29  6:10   ` Stephen Boyd
2021-06-29  6:10   ` Stephen Boyd
2021-06-28  7:01 ` [PATCH v6 2/4] clk: zynqmp: Use firmware specific divider " Rajan Vaja
2021-06-29  6:10   ` Stephen Boyd
2021-06-28  7:01 ` [PATCH v6 3/4] clk: zynqmp: Use firmware specific mux " Rajan Vaja
2021-06-29  6:10   ` Stephen Boyd
2021-06-28  7:01 ` Rajan Vaja [this message]
2021-06-29  6:10   ` [PATCH v6 4/4] clk: zynqmp: Handle divider specific read only flag Stephen Boyd

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=20210628070122.26217-5-rajan.vaja@xilinx.com \
    --to=rajan.vaja@xilinx.com \
    --cc=kristo@kernel.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=mturquette@baylibre.com \
    --cc=quanyang.wang@windriver.com \
    --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).