diff mbox

[1/2] arm64: renesas: salvator-x: add 12288000 for sound ADG

Message ID 87d1azovg1.wl%kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit 4981f1e506cffd68bf249b22db0baf43f7da29fd
Delegated to: Simon Horman
Headers show

Commit Message

Kuninori Morimoto May 24, 2017, 2:16 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Current rcar_sound only has 11289600 (= for 44.1kHz) clock-frequency,
but it needs 12288000 for 48kHz too.
Otherwise, 48kHz based sound can't handle correctly.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 arch/arm64/boot/dts/renesas/salvator-x.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Geert Uytterhoeven May 24, 2017, 7:44 a.m. UTC | #1
Hi Morimoto-san,

On Wed, May 24, 2017 at 4:16 AM, Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> Current rcar_sound only has 11289600 (= for 44.1kHz) clock-frequency,
> but it needs 12288000 for 48kHz too.
> Otherwise, 48kHz based sound can't handle correctly.
>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  arch/arm64/boot/dts/renesas/salvator-x.dtsi | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/renesas/salvator-x.dtsi b/arch/arm64/boot/dts/renesas/salvator-x.dtsi
> index 1f6b9fb..37f70bd 100644
> --- a/arch/arm64/boot/dts/renesas/salvator-x.dtsi
> +++ b/arch/arm64/boot/dts/renesas/salvator-x.dtsi
> @@ -540,7 +540,7 @@
>
>         /* audio_clkout0/1/2/3 */
>         #clock-cells = <1>;
> -       clock-frequency = <11289600>;
> +       clock-frequency = <11289600 12288000>;

Your change has the following impact on /sys/kernel/debug/clk/clk_summary:

@@ -12,6 +12,9 @@
  x21-clock                                0            0    33000000
        0 0
  x12                                      1            1    24576000
        0 0
     clk_multiplier                        1            1    24576000
        0 0
+       audio_clkout3                      0            0    11289600
        0 0
+       audio_clkout2                      0            0    11289600
        0 0
+       audio_clkout1                      0            0    11289600
        0 0
  audio_clkout                             0            0    11289600
        0 0
  pcie_bus                                 2            2   100000000
        0 0
  scif                                     1            1    14745600
        0 0
@@ -19,9 +22,6 @@
  audio_clk_c                              1            1           0
        0 0
  audio_clk_b                              0            0           0
        0 0
  audio_clk_a                              1            1    22579200
        0 0
-    audio_clkout3                         0            0    11289600
        0 0
-    audio_clkout2                         0            0    11289600
        0 0
-    audio_clkout1                         0            0    11289600
        0 0
  extalr                                   1            1       32768
        0 0
     r                                     1            1       32768
        0 0
        rwdt                               1            1       32768
        0 0

However, no 12288000 to be seen.

Does this depend on a recent driver change?
My tree is based on last renesas-drivers release.

Thanks!

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
Kuninori Morimoto May 24, 2017, 7:56 a.m. UTC | #2
Hi Geert

Thank you for your check

> @@ -12,6 +12,9 @@
>   x21-clock                                0            0    33000000
>         0 0
>   x12                                      1            1    24576000
>         0 0
>      clk_multiplier                        1            1    24576000
>         0 0
> +       audio_clkout3                      0            0    11289600
>         0 0
> +       audio_clkout2                      0            0    11289600
>         0 0
> +       audio_clkout1                      0            0    11289600
>         0 0
>   audio_clkout                             0            0    11289600
>         0 0
>   pcie_bus                                 2            2   100000000
>         0 0
>   scif                                     1            1    14745600
>         0 0
> @@ -19,9 +22,6 @@
>   audio_clk_c                              1            1           0
>         0 0
>   audio_clk_b                              0            0           0
>         0 0
>   audio_clk_a                              1            1    22579200
>         0 0
> -    audio_clkout3                         0            0    11289600
>         0 0
> -    audio_clkout2                         0            0    11289600
>         0 0
> -    audio_clkout1                         0            0    11289600
>         0 0
>   extalr                                   1            1       32768
>         0 0
>      r                                     1            1       32768
>         0 0
>         rwdt                               1            1       32768
>         0 0
> 
> However, no 12288000 to be seen.
> 
> Does this depend on a recent driver change?
> My tree is based on last renesas-drivers release.

Hmm.. ?
yes, 12288000 will be used under new feature, but I think it can compatible...
I will check it

Best regards
---
Kuninori Morimoto
Kuninori Morimoto May 26, 2017, 1:38 a.m. UTC | #3
Hi Geert

> >      clk_multiplier                        1            1    24576000
> >         0 0
> > +       audio_clkout3                      0            0    11289600
> >         0 0
> > +       audio_clkout2                      0            0    11289600
> >         0 0
> > +       audio_clkout1                      0            0    11289600
(snip)
> >   audio_clk_a                              1            1    22579200
> >         0 0
> > -    audio_clkout3                         0            0    11289600
> >         0 0
> > -    audio_clkout2                         0            0    11289600
> >         0 0
> > -    audio_clkout1                         0            0    11289600
(snip)
> > Does this depend on a recent driver change?
> > My tree is based on last renesas-drivers release.

Thank you for pointing it.
This patch (= "arm64: renesas: salvator-x: add 12288000 for sound ADG") was fine,
but driver side had bug.
I will post this fixup patch to ALSA side

About audio_clkoutX, all these output same clock rate which is
11289600 or 12288000 base clock. Basically this is fixed rate.
But in Salvator-X case, because of clock master/slave relation,
codec spec, and clock generator connection, we need to
switch audio_clkoutX in runtime, otherwise, sound gets noise.
For me, this is exception case, and this patch enables it

Best regards
---
Kuninori Morimoto
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/renesas/salvator-x.dtsi b/arch/arm64/boot/dts/renesas/salvator-x.dtsi
index 1f6b9fb..37f70bd 100644
--- a/arch/arm64/boot/dts/renesas/salvator-x.dtsi
+++ b/arch/arm64/boot/dts/renesas/salvator-x.dtsi
@@ -540,7 +540,7 @@ 
 
 	/* audio_clkout0/1/2/3 */
 	#clock-cells = <1>;
-	clock-frequency = <11289600>;
+	clock-frequency = <11289600 12288000>;
 
 	status = "okay";