[RFC PATCH 01/35] clk: composite: add support for disable_unused clk operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Certain gate clocks require this for the init time clk_disable_unused
functionality to work properly, thus add support for it. If the gate
clock does not provide disable_unused ops, just call gate_ops->disable,
just like the core clock code would do.

Signed-off-by: Tero Kristo <t-kristo@xxxxxx>
---
 drivers/clk/clk-composite.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index 956b7e5..5cb1496 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -187,6 +187,20 @@ static void clk_composite_disable(struct clk_hw *hw)
 	gate_ops->disable(gate_hw);
 }
 
+static void clk_composite_disable_unused(struct clk_hw *hw)
+{
+	struct clk_composite *composite = to_clk_composite(hw);
+	const struct clk_ops *gate_ops = composite->gate_ops;
+	struct clk_hw *gate_hw = composite->gate_hw;
+
+	__clk_hw_set_clk(gate_hw, hw);
+
+	if (gate_ops->disable_unused)
+		gate_ops->disable_unused(gate_hw);
+	else
+		gate_ops->disable(gate_hw);
+}
+
 struct clk *clk_register_composite(struct device *dev, const char *name,
 			const char **parent_names, int num_parents,
 			struct clk_hw *mux_hw, const struct clk_ops *mux_ops,
@@ -267,6 +281,8 @@ struct clk *clk_register_composite(struct device *dev, const char *name,
 		clk_composite_ops->is_enabled = clk_composite_is_enabled;
 		clk_composite_ops->enable = clk_composite_enable;
 		clk_composite_ops->disable = clk_composite_disable;
+		clk_composite_ops->disable_unused =
+			clk_composite_disable_unused;
 	}
 
 	init.ops = clk_composite_ops;
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux