All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: sprd: change to implement .prepare instead of .enable
@ 2019-10-16 10:44 Chunyan Zhang
  2019-10-24  5:27 ` Chunyan Zhang
  0 siblings, 1 reply; 2+ messages in thread
From: Chunyan Zhang @ 2019-10-16 10:44 UTC (permalink / raw)
  To: Stephen Boyd
  Cc: linux-kernel, linux-clk, Orson Zhai, Baolin Wang, Xiaolong Zhang,
	Chunyan Zhang


From: Xiaolong Zhang <xiaolong.zhang@unisoc.com>

Some pll_sc_gate clocks need to wait a certain long time for being stable
after enabled, for this reason enabling this kind of clocks shouldn't be
done in clk_ops.enable() which would be called at interrupt context. So
we move the operation to .prepare(), and also hooks to .unprepare() with
disabling pll_sc_gate clocks.

Signed-off-by: Xiaolong Zhang <xiaolong.zhang@unisoc.com>
Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 drivers/clk/sprd/gate.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/sprd/gate.c b/drivers/clk/sprd/gate.c
index 1491c00575fa..d8b480f852f3 100644
--- a/drivers/clk/sprd/gate.c
+++ b/drivers/clk/sprd/gate.c
@@ -80,7 +80,7 @@ static int sprd_sc_gate_enable(struct clk_hw *hw)
 	return 0;
 }
 
-static int sprd_pll_sc_gate_enable(struct clk_hw *hw)
+static int sprd_pll_sc_gate_prepare(struct clk_hw *hw)
 {
 	struct sprd_gate *sg = hw_to_sprd_gate(hw);
 
@@ -120,9 +120,11 @@ const struct clk_ops sprd_sc_gate_ops = {
 };
 EXPORT_SYMBOL_GPL(sprd_sc_gate_ops);
 
+#define sprd_pll_sc_gate_unprepare sprd_sc_gate_disable
+
 const struct clk_ops sprd_pll_sc_gate_ops = {
-	.disable	= sprd_sc_gate_disable,
-	.enable		= sprd_pll_sc_gate_enable,
+	.unprepare	= sprd_pll_sc_gate_unprepare,
+	.prepare	= sprd_pll_sc_gate_prepare,
 	.is_enabled	= sprd_gate_is_enabled,
 };
 EXPORT_SYMBOL_GPL(sprd_pll_sc_gate_ops);
-- 
2.20.1



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] clk: sprd: change to implement .prepare instead of .enable
  2019-10-16 10:44 [PATCH] clk: sprd: change to implement .prepare instead of .enable Chunyan Zhang
@ 2019-10-24  5:27 ` Chunyan Zhang
  0 siblings, 0 replies; 2+ messages in thread
From: Chunyan Zhang @ 2019-10-24  5:27 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Stephen Boyd, Linux Kernel Mailing List, linux-clk, Orson Zhai,
	Baolin Wang, Xiaolong Zhang

Hi,

Please ignore this patch, and sorry for the noise.
I will resend this along with another patch.

Thanks,
Chunyan

On Wed, 16 Oct 2019 at 18:44, Chunyan Zhang <chunyan.zhang@unisoc.com> wrote:
>
>
> From: Xiaolong Zhang <xiaolong.zhang@unisoc.com>
>
> Some pll_sc_gate clocks need to wait a certain long time for being stable
> after enabled, for this reason enabling this kind of clocks shouldn't be
> done in clk_ops.enable() which would be called at interrupt context. So
> we move the operation to .prepare(), and also hooks to .unprepare() with
> disabling pll_sc_gate clocks.
>
> Signed-off-by: Xiaolong Zhang <xiaolong.zhang@unisoc.com>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
> ---
>  drivers/clk/sprd/gate.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/clk/sprd/gate.c b/drivers/clk/sprd/gate.c
> index 1491c00575fa..d8b480f852f3 100644
> --- a/drivers/clk/sprd/gate.c
> +++ b/drivers/clk/sprd/gate.c
> @@ -80,7 +80,7 @@ static int sprd_sc_gate_enable(struct clk_hw *hw)
>         return 0;
>  }
>
> -static int sprd_pll_sc_gate_enable(struct clk_hw *hw)
> +static int sprd_pll_sc_gate_prepare(struct clk_hw *hw)
>  {
>         struct sprd_gate *sg = hw_to_sprd_gate(hw);
>
> @@ -120,9 +120,11 @@ const struct clk_ops sprd_sc_gate_ops = {
>  };
>  EXPORT_SYMBOL_GPL(sprd_sc_gate_ops);
>
> +#define sprd_pll_sc_gate_unprepare sprd_sc_gate_disable
> +
>  const struct clk_ops sprd_pll_sc_gate_ops = {
> -       .disable        = sprd_sc_gate_disable,
> -       .enable         = sprd_pll_sc_gate_enable,
> +       .unprepare      = sprd_pll_sc_gate_unprepare,
> +       .prepare        = sprd_pll_sc_gate_prepare,
>         .is_enabled     = sprd_gate_is_enabled,
>  };
>  EXPORT_SYMBOL_GPL(sprd_pll_sc_gate_ops);
> --
> 2.20.1
>
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-24  5:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-16 10:44 [PATCH] clk: sprd: change to implement .prepare instead of .enable Chunyan Zhang
2019-10-24  5:27 ` Chunyan Zhang

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.