diff mbox series

[v1] clk: gate: export clk_gate_endisable

Message ID 20240806073832.13568-1-zhangqing@rock-chips.com (mailing list archive)
State Rejected, archived
Headers show
Series [v1] clk: gate: export clk_gate_endisable | expand

Commit Message

zhangqing Aug. 6, 2024, 7:38 a.m. UTC
make clk_gate_endisable not static, export API for other use.

Signed-off-by: Elaine Zhang <zhangqing@rock-chips.com>
---
 drivers/clk/clk-gate.c       | 3 ++-
 include/linux/clk-provider.h | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)

Comments

Stephen Boyd Aug. 6, 2024, 5:52 p.m. UTC | #1
Quoting Elaine Zhang (2024-08-06 00:38:32)
> make clk_gate_endisable not static, export API for other use.

What other use?
Stephen Boyd Aug. 7, 2024, 8:57 p.m. UTC | #2
Quoting zhangqing@rock-chips.com (2024-08-06 18:28:34)
> Hi,
> 
> Some modules, which need to do workaround, need to disabled the clock directly,
> independent of the reference count.

We don't want clk consumers going behind the clk provider and turning it
off and on. You'll need to figure out some other way to do this. Are
there really other consumers besides the one changing the pin to a gpio?
If there's only one user then it seems like clk_disable() should work?
zhangqing Aug. 8, 2024, 1:09 a.m. UTC | #3
Hi,

在 2024/8/8 4:57, Stephen Boyd 写道:
> Quoting zhangqing@rock-chips.com (2024-08-06 18:28:34)
>> Hi,
>>
>> Some modules, which need to do workaround, need to disabled the clock directly,
>> independent of the reference count.
> We don't want clk consumers going behind the clk provider and turning it
> off and on. You'll need to figure out some other way to do this. Are
> there really other consumers besides the one changing the pin to a gpio?
> If there's only one user then it seems like clk_disable() should work?
Well, then I use other ways to workaround module problems.
diff mbox series

Patch

diff --git a/drivers/clk/clk-gate.c b/drivers/clk/clk-gate.c
index 68e585a02fd9..531bb84a5b3e 100644
--- a/drivers/clk/clk-gate.c
+++ b/drivers/clk/clk-gate.c
@@ -53,7 +53,7 @@  static inline void clk_gate_writel(struct clk_gate *gate, u32 val)
  *
  * So, result is always: enable xor set2dis.
  */
-static void clk_gate_endisable(struct clk_hw *hw, int enable)
+void clk_gate_endisable(struct clk_hw *hw, int enable)
 {
 	struct clk_gate *gate = to_clk_gate(hw);
 	int set = gate->flags & CLK_GATE_SET_TO_DISABLE ? 1 : 0;
@@ -87,6 +87,7 @@  static void clk_gate_endisable(struct clk_hw *hw, int enable)
 	else
 		__release(gate->lock);
 }
+EXPORT_SYMBOL_GPL(clk_gate_endisable);
 
 static int clk_gate_enable(struct clk_hw *hw)
 {
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 4a537260f655..db7132e9c057 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -630,6 +630,7 @@  struct clk *clk_register_gate(struct device *dev, const char *name,
 void clk_unregister_gate(struct clk *clk);
 void clk_hw_unregister_gate(struct clk_hw *hw);
 int clk_gate_is_enabled(struct clk_hw *hw);
+void clk_gate_endisable(struct clk_hw *hw, int enable);
 
 struct clk_div_table {
 	unsigned int	val;