linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
@ 2018-10-02 12:29 Icenowy Zheng
  2018-10-04 13:09 ` [linux-sunxi] " Jagan Teki
  2018-10-04 16:20 ` Maxime Ripard
  0 siblings, 2 replies; 3+ messages in thread
From: Icenowy Zheng @ 2018-10-02 12:29 UTC (permalink / raw)
  To: Maxime Ripard, Chen-Yu Tsai
  Cc: linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi, Icenowy Zheng

In the user manual of A64 SoC, the bit 22 and 23 of pll-mipi control
register is called "LDO{1,2}_EN", and according to the BSP source code
from Allwinner , the LDOs are enabled during the clock's enabling
process.

The clock failed to generate output if the two LDOs are not enabled.

Add the two bits to the clock's gate bits, so that the LDOs are enabled
when the PLL is enabled.

Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
---
As PLL-MIPI is not used before 4.20~5.0, I decide not to target this patch
on stable/mainline kernels.

 drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
index 5f80eb018014..f7d297368eb2 100644
--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
+++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
@@ -162,7 +162,7 @@ static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_gpu_clk, "pll-gpu",
 #define SUN50I_A64_PLL_MIPI_REG		0x040
 
 static struct ccu_nkm pll_mipi_clk = {
-	.enable		= BIT(31),
+	.enable		= BIT(31) | BIT(23) | BIT(22),
 	.lock		= BIT(28),
 	.n		= _SUNXI_CCU_MULT(8, 4),
 	.k		= _SUNXI_CCU_MULT_MIN(4, 2, 2),
-- 
2.18.0


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

* Re: [linux-sunxi] [PATCH] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
  2018-10-02 12:29 [PATCH] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock Icenowy Zheng
@ 2018-10-04 13:09 ` Jagan Teki
  2018-10-04 16:20 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Jagan Teki @ 2018-10-04 13:09 UTC (permalink / raw)
  To: icenowy, Maxime Ripard, Chen-Yu Tsai
  Cc: linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi

On Tuesday 02 October 2018 05:59 PM, Icenowy Zheng wrote:
> In the user manual of A64 SoC, the bit 22 and 23 of pll-mipi control
> register is called "LDO{1,2}_EN", and according to the BSP source code
> from Allwinner , the LDOs are enabled during the clock's enabling
> process.
> 
> The clock failed to generate output if the two LDOs are not enabled.
> 
> Add the two bits to the clock's gate bits, so that the LDOs are enabled
> when the PLL is enabled.
> 
> Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---

Tested-by: Jagan Teki <jagan@amarulasolutions.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>


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

* Re: [PATCH] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock
  2018-10-02 12:29 [PATCH] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock Icenowy Zheng
  2018-10-04 13:09 ` [linux-sunxi] " Jagan Teki
@ 2018-10-04 16:20 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2018-10-04 16:20 UTC (permalink / raw)
  To: Icenowy Zheng
  Cc: Chen-Yu Tsai, linux-arm-kernel, linux-clk, linux-kernel, linux-sunxi

Hi!

On Tue, Oct 02, 2018 at 08:29:11PM +0800, Icenowy Zheng wrote:
> In the user manual of A64 SoC, the bit 22 and 23 of pll-mipi control
> register is called "LDO{1,2}_EN", and according to the BSP source code
> from Allwinner , the LDOs are enabled during the clock's enabling
> process.
> 
> The clock failed to generate output if the two LDOs are not enabled.
> 
> Add the two bits to the clock's gate bits, so that the LDOs are enabled
> when the PLL is enabled.
> 
> Fixes: c6a0637460c2 ("clk: sunxi-ng: Add A64 clocks")
> Signed-off-by: Icenowy Zheng <icenowy@aosc.io>
> ---
> As PLL-MIPI is not used before 4.20~5.0, I decide not to target this patch
> on stable/mainline kernels.
> 
>  drivers/clk/sunxi-ng/ccu-sun50i-a64.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
> index 5f80eb018014..f7d297368eb2 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c
> @@ -162,7 +162,7 @@ static SUNXI_CCU_NM_WITH_FRAC_GATE_LOCK(pll_gpu_clk, "pll-gpu",
>  #define SUN50I_A64_PLL_MIPI_REG		0x040
>  
>  static struct ccu_nkm pll_mipi_clk = {
> -	.enable		= BIT(31),
> +	.enable		= BIT(31) | BIT(23) | BIT(22),

Adding a comment on why those are needed in addition to the enable bit
would be great :)

Thanks!
Maxime

-- 
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2018-10-04 16:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-10-02 12:29 [PATCH] clk: sunxi-ng: enable so-said LDOs for A64 SoC's pll-mipi clock Icenowy Zheng
2018-10-04 13:09 ` [linux-sunxi] " Jagan Teki
2018-10-04 16:20 ` Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).