summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2021-06-24 17:00:49 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-25 09:39:19 +0200
commit207e48f5616fd2b09ce0270ede49d1cde8b836e5 (patch)
tree0b638307fde17f56beeab30d17e74e6c6e7b4ce2
parent4d5b70a55c389b8f3ca85aec8d39fc480d766330 (diff)
downloadbarebox-207e48f5616fd2b09ce0270ede49d1cde8b836e5.tar.gz
barebox-207e48f5616fd2b09ce0270ede49d1cde8b836e5.tar.xz
clk: zynqmp: do not enable already enabled clocks
The pmu fw manages the permissions who can enable/disable the clocks. There are a few clocks (TOPSW_LSBUS and LSBUS) which are exposed to Barebox and Barebox assumes that is has to enable the clocks. However, the pmu fw considers the clocks under its control and returns a permission denied for the clock enable request. Assume that clocks that are already enabled don't need to be enable by Barebox to avoid the permission denied errors. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Link: https://lore.barebox.org/20210624150054.1205422-3-m.tretter@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/clk/zynqmp/clk-gate-zynqmp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/clk/zynqmp/clk-gate-zynqmp.c b/drivers/clk/zynqmp/clk-gate-zynqmp.c
index a3b9ee21e5..493c1dfeaa 100644
--- a/drivers/clk/zynqmp/clk-gate-zynqmp.c
+++ b/drivers/clk/zynqmp/clk-gate-zynqmp.c
@@ -28,6 +28,9 @@ static int zynqmp_clk_gate_enable(struct clk_hw *hw)
{
struct zynqmp_clk_gate *gate = to_zynqmp_clk_gate(hw);
+ if (clk_hw_is_enabled(hw))
+ return 0;
+
return gate->ops->clock_enable(gate->clk_id);
}