[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210624121633.22179-5-rajan.vaja@xilinx.com>
Date: Thu, 24 Jun 2021 05:16:33 -0700
From: Rajan Vaja <rajan.vaja@...inx.com>
To: <mturquette@...libre.com>, <sboyd@...nel.org>,
<michal.simek@...inx.com>, <lee.jones@...aro.org>,
<kristo@...nel.org>, <quanyang.wang@...driver.com>
CC: <linux-clk@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, Rajan Vaja <rajan.vaja@...inx.com>
Subject: [PATCH v5 4/4] clk: zynqmp: Handle divider specific read only flag
Add support for divider specific read only CCF flag
(CLK_DIVIDER_READ_ONLY).
Signed-off-by: Rajan Vaja <rajan.vaja@...inx.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
Powered by blists - more mailing lists