LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
@ 2021-08-11  5:09 Artem Lapkin
  2021-09-02 13:31 ` Neil Armstrong
  0 siblings, 1 reply; 13+ messages in thread
From: Artem Lapkin @ 2021-08-11  5:09 UTC (permalink / raw)
  To: narmstrong
  Cc: jbrunet, linux-arm-kernel, linux-amlogic, linux-kernel,
	christianshewitt, art, nick, gouwa

Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
 1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
index 3d8b1f4f2..1efdbb61e 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
@@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
 			status = "disabled";
 		};
 
+		spdifin: audio-controller@400 {
+			compatible = "amlogic,g12a-spdifin",
+			"amlogic,axg-spdifin";
+			reg = <0x0 0x400 0x0 0x30>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFIN";
+			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
+			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
+			clock-names = "pclk", "refclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
+			status = "disabled";
+		};
+
+		spdifout: audio-controller@480 {
+			compatible = "amlogic,g12a-spdifout",
+			"amlogic,axg-spdifout";
+			reg = <0x0 0x480 0x0 0x50>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFOUT";
+			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
+			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
+			clock-names = "pclk", "mclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
+			status = "disabled";
+		};
+
 		tdmout_a: audio-controller@500 {
 			compatible = "amlogic,sm1-tdmout";
 			reg = <0x0 0x500 0x0 0x40>;
@@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
 			status = "disabled";
 		};
 
+		spdifout_b: audio-controller@680 {
+			compatible = "amlogic,g12a-spdifout",
+			"amlogic,axg-spdifout";
+			reg = <0x0 0x680 0x0 0x50>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFOUT_B";
+			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
+			<&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
+			clock-names = "pclk", "mclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
+			status = "disabled";
+		};
+
 		toacodec: audio-controller@740 {
 			compatible = "amlogic,sm1-toacodec",
 				     "amlogic,g12a-toacodec";
-- 
2.25.1


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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-08-11  5:09 [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes Artem Lapkin
@ 2021-09-02 13:31 ` Neil Armstrong
  2021-09-06  9:25   ` Jerome Brunet
  0 siblings, 1 reply; 13+ messages in thread
From: Neil Armstrong @ 2021-09-02 13:31 UTC (permalink / raw)
  To: jbrunet
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, christianshewitt,
	art, nick, gouwa, Artem Lapkin

Hi,

On 11/08/2021 07:09, Artem Lapkin wrote:
> Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.
> 
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
>  1 file changed, 40 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> index 3d8b1f4f2..1efdbb61e 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>  			status = "disabled";
>  		};
>  
> +		spdifin: audio-controller@400 {
> +			compatible = "amlogic,g12a-spdifin",
> +			"amlogic,axg-spdifin";
> +			reg = <0x0 0x400 0x0 0x30>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFIN";
> +			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
> +			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
> +			clock-names = "pclk", "refclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
> +			status = "disabled";
> +		};
> +
> +		spdifout: audio-controller@480 {
> +			compatible = "amlogic,g12a-spdifout",
> +			"amlogic,axg-spdifout";
> +			reg = <0x0 0x480 0x0 0x50>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFOUT";
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
> +			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
> +			clock-names = "pclk", "mclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
> +			status = "disabled";
> +		};
> +
>  		tdmout_a: audio-controller@500 {
>  			compatible = "amlogic,sm1-tdmout";
>  			reg = <0x0 0x500 0x0 0x40>;
> @@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
>  			status = "disabled";
>  		};
>  
> +		spdifout_b: audio-controller@680 {
> +			compatible = "amlogic,g12a-spdifout",
> +			"amlogic,axg-spdifout";
> +			reg = <0x0 0x680 0x0 0x50>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFOUT_B";
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
> +			<&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
> +			clock-names = "pclk", "mclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
> +			status = "disabled";
> +		};
> +
>  		toacodec: audio-controller@740 {
>  			compatible = "amlogic,sm1-toacodec",
>  				     "amlogic,g12a-toacodec";
> 

Jerome could you quickly review this ?

Thanks,
Neil

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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-09-02 13:31 ` Neil Armstrong
@ 2021-09-06  9:25   ` Jerome Brunet
  2021-09-06 11:56     ` Art Nikpal
  0 siblings, 1 reply; 13+ messages in thread
From: Jerome Brunet @ 2021-09-06  9:25 UTC (permalink / raw)
  To: Neil Armstrong
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, christianshewitt,
	art, nick, gouwa, Artem Lapkin


On Thu 02 Sep 2021 at 15:31, Neil Armstrong <narmstrong@baylibre.com> wrote:

> Hi,
>
> On 11/08/2021 07:09, Artem Lapkin wrote:
>> Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.
>> 
>> Signed-off-by: Artem Lapkin <art@khadas.com>
>> ---
>>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
>>  1 file changed, 40 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> index 3d8b1f4f2..1efdbb61e 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>>  			status = "disabled";
>>  		};
>>  
>> +		spdifin: audio-controller@400 {
>> +			compatible = "amlogic,g12a-spdifin",
>> +			"amlogic,axg-spdifin";
>> +			reg = <0x0 0x400 0x0 0x30>;
>> +			#sound-dai-cells = <0>;
>> +			sound-name-prefix = "SPDIFIN";
>> +			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>> +			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
>> +			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>> +			clock-names = "pclk", "refclk";
>> +			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
>> +			status = "disabled";
>> +		};
>> +
>> +		spdifout: audio-controller@480 {
>> +			compatible = "amlogic,g12a-spdifout",
>> +			"amlogic,axg-spdifout";
>> +			reg = <0x0 0x480 0x0 0x50>;
>> +			#sound-dai-cells = <0>;
>> +			sound-name-prefix = "SPDIFOUT";
>> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
>> +			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>> +			clock-names = "pclk", "mclk";
>> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
>> +			status = "disabled";
>> +		};
>> +
>>  		tdmout_a: audio-controller@500 {
>>  			compatible = "amlogic,sm1-tdmout";
>>  			reg = <0x0 0x500 0x0 0x40>;
>> @@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
>>  			status = "disabled";
>>  		};
>>  
>> +		spdifout_b: audio-controller@680 {
>> +			compatible = "amlogic,g12a-spdifout",
>> +			"amlogic,axg-spdifout";
>> +			reg = <0x0 0x680 0x0 0x50>;
>> +			#sound-dai-cells = <0>;
>> +			sound-name-prefix = "SPDIFOUT_B";
>> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
>> +			<&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
>> +			clock-names = "pclk", "mclk";
>> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
>> +			status = "disabled";
>> +		};
>> +
>>  		toacodec: audio-controller@740 {
>>  			compatible = "amlogic,sm1-toacodec",
>>  				     "amlogic,g12a-toacodec";
>> 
>
> Jerome could you quickly review this ?
>

Just this, without the related card change is not usefull as it won't be
part of the card.

It would be nice to indicate how it was tested ?

AFAIK:
- spdifout b can only be routed to hdmi and dw-hdmi driver does not
  support that yet
- the VIM3 does not have connectors for the spdif (in or out). If it
  requires some extension card, it should be noted somewhere, at least


> Thanks,
> Neil


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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-09-06  9:25   ` Jerome Brunet
@ 2021-09-06 11:56     ` Art Nikpal
  2021-09-06 12:28       ` Neil Armstrong
  2021-10-04 13:46       ` Jerome Brunet
  0 siblings, 2 replies; 13+ messages in thread
From: Art Nikpal @ 2021-09-06 11:56 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Neil Armstrong, linux-arm-kernel, open list:ARM/Amlogic Meson...,
	LKML, Christian Hewitt, Artem Lapkin, Nick Xie, Gouwa Wang

> It would be nice to indicate how it was tested ?

https://github.com/khadas/khadas-linux-kernel/blob/master/patches/linux-5.14-rc5.sound/0001-arm64-dts-meson-khadas-vim3-remake-simple-sound-for-.patch

i have test it

i2s  and spdif output from gpio headers - works well

On Mon, Sep 6, 2021 at 5:29 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>
>
> On Thu 02 Sep 2021 at 15:31, Neil Armstrong <narmstrong@baylibre.com> wrote:
>
> > Hi,
> >
> > On 11/08/2021 07:09, Artem Lapkin wrote:
> >> Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.
> >>
> >> Signed-off-by: Artem Lapkin <art@khadas.com>
> >> ---
> >>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
> >>  1 file changed, 40 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> >> index 3d8b1f4f2..1efdbb61e 100644
> >> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> >> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> >> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
> >>                      status = "disabled";
> >>              };
> >>
> >> +            spdifin: audio-controller@400 {
> >> +                    compatible = "amlogic,g12a-spdifin",
> >> +                    "amlogic,axg-spdifin";
> >> +                    reg = <0x0 0x400 0x0 0x30>;
> >> +                    #sound-dai-cells = <0>;
> >> +                    sound-name-prefix = "SPDIFIN";
> >> +                    interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
> >> +                    <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
> >> +                    clock-names = "pclk", "refclk";
> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFIN>;
> >> +                    status = "disabled";
> >> +            };
> >> +
> >> +            spdifout: audio-controller@480 {
> >> +                    compatible = "amlogic,g12a-spdifout",
> >> +                    "amlogic,axg-spdifout";
> >> +                    reg = <0x0 0x480 0x0 0x50>;
> >> +                    #sound-dai-cells = <0>;
> >> +                    sound-name-prefix = "SPDIFOUT";
> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
> >> +                    clock-names = "pclk", "mclk";
> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
> >> +                    status = "disabled";
> >> +            };
> >> +
> >>              tdmout_a: audio-controller@500 {
> >>                      compatible = "amlogic,sm1-tdmout";
> >>                      reg = <0x0 0x500 0x0 0x40>;
> >> @@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
> >>                      status = "disabled";
> >>              };
> >>
> >> +            spdifout_b: audio-controller@680 {
> >> +                    compatible = "amlogic,g12a-spdifout",
> >> +                    "amlogic,axg-spdifout";
> >> +                    reg = <0x0 0x680 0x0 0x50>;
> >> +                    #sound-dai-cells = <0>;
> >> +                    sound-name-prefix = "SPDIFOUT_B";
> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
> >> +                    clock-names = "pclk", "mclk";
> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
> >> +                    status = "disabled";
> >> +            };
> >> +
> >>              toacodec: audio-controller@740 {
> >>                      compatible = "amlogic,sm1-toacodec",
> >>                                   "amlogic,g12a-toacodec";
> >>
> >
> > Jerome could you quickly review this ?
> >
>
> Just this, without the related card change is not usefull as it won't be
> part of the card.
>
> It would be nice to indicate how it was tested ?
>
> AFAIK:
> - spdifout b can only be routed to hdmi and dw-hdmi driver does not
>   support that yet
> - the VIM3 does not have connectors for the spdif (in or out). If it
>   requires some extension card, it should be noted somewhere, at least
>
>
> > Thanks,
> > Neil
>

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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-09-06 11:56     ` Art Nikpal
@ 2021-09-06 12:28       ` Neil Armstrong
  2021-10-04 13:46       ` Jerome Brunet
  1 sibling, 0 replies; 13+ messages in thread
From: Neil Armstrong @ 2021-09-06 12:28 UTC (permalink / raw)
  To: Art Nikpal, Jerome Brunet
  Cc: linux-arm-kernel, open list:ARM/Amlogic Meson...,
	LKML, Christian Hewitt, Artem Lapkin, Nick Xie, Gouwa Wang

On 06/09/2021 13:56, Art Nikpal wrote:
>> It would be nice to indicate how it was tested ?
> 
> https://github.com/khadas/khadas-linux-kernel/blob/master/patches/linux-5.14-rc5.sound/0001-arm64-dts-meson-khadas-vim3-remake-simple-sound-for-.patch
> 
> i have test it
> 
> i2s  and spdif output from gpio headers - works well
> 
> On Mon, Sep 6, 2021 at 5:29 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>>
>>
>> On Thu 02 Sep 2021 at 15:31, Neil Armstrong <narmstrong@baylibre.com> wrote:
>>
>>> Hi,
>>>
>>> On 11/08/2021 07:09, Artem Lapkin wrote:
>>>> Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.
>>>>
>>>> Signed-off-by: Artem Lapkin <art@khadas.com>
>>>> ---
>>>>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
>>>>  1 file changed, 40 insertions(+)
>>>>
>>>> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>>>> index 3d8b1f4f2..1efdbb61e 100644
>>>> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>>>> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>>>> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>>>>                      status = "disabled";
>>>>              };
>>>>
>>>> +            spdifin: audio-controller@400 {
>>>> +                    compatible = "amlogic,g12a-spdifin",
>>>> +                    "amlogic,axg-spdifin";
>>>> +                    reg = <0x0 0x400 0x0 0x30>;
>>>> +                    #sound-dai-cells = <0>;
>>>> +                    sound-name-prefix = "SPDIFIN";
>>>> +                    interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>>>> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
>>>> +                    <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>>>> +                    clock-names = "pclk", "refclk";
>>>> +                    resets = <&clkc_audio AUD_RESET_SPDIFIN>;
>>>> +                    status = "disabled";
>>>> +            };
>>>> +
>>>> +            spdifout: audio-controller@480 {
>>>> +                    compatible = "amlogic,g12a-spdifout",
>>>> +                    "amlogic,axg-spdifout";
>>>> +                    reg = <0x0 0x480 0x0 0x50>;
>>>> +                    #sound-dai-cells = <0>;
>>>> +                    sound-name-prefix = "SPDIFOUT";
>>>> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
>>>> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>>>> +                    clock-names = "pclk", "mclk";
>>>> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
>>>> +                    status = "disabled";
>>>> +            };
>>>> +
>>>>              tdmout_a: audio-controller@500 {
>>>>                      compatible = "amlogic,sm1-tdmout";
>>>>                      reg = <0x0 0x500 0x0 0x40>;
>>>> @@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
>>>>                      status = "disabled";
>>>>              };
>>>>
>>>> +            spdifout_b: audio-controller@680 {
>>>> +                    compatible = "amlogic,g12a-spdifout",
>>>> +                    "amlogic,axg-spdifout";
>>>> +                    reg = <0x0 0x680 0x0 0x50>;
>>>> +                    #sound-dai-cells = <0>;
>>>> +                    sound-name-prefix = "SPDIFOUT_B";
>>>> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
>>>> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
>>>> +                    clock-names = "pclk", "mclk";
>>>> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
>>>> +                    status = "disabled";
>>>> +            };
>>>> +
>>>>              toacodec: audio-controller@740 {
>>>>                      compatible = "amlogic,sm1-toacodec",
>>>>                                   "amlogic,g12a-toacodec";
>>>>
>>>
>>> Jerome could you quickly review this ?
>>>
>>
>> Just this, without the related card change is not usefull as it won't be
>> part of the card.
>>
>> It would be nice to indicate how it was tested ?
>>
>> AFAIK:
>> - spdifout b can only be routed to hdmi and dw-hdmi driver does not
>>   support that yet

It doesn't harm to have it described in DT, maybe one day the dw-hdmi driver will support SPDIF input.

Neil

>> - the VIM3 does not have connectors for the spdif (in or out). If it
>>   requires some extension card, it should be noted somewhere, at least
>>
>>
>>> Thanks,
>>> Neil
>>


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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-09-06 11:56     ` Art Nikpal
  2021-09-06 12:28       ` Neil Armstrong
@ 2021-10-04 13:46       ` Jerome Brunet
  2021-12-15  2:32         ` Art Nikpal
  1 sibling, 1 reply; 13+ messages in thread
From: Jerome Brunet @ 2021-10-04 13:46 UTC (permalink / raw)
  To: Art Nikpal
  Cc: Neil Armstrong, linux-arm-kernel, open list:ARM/Amlogic Meson...,
	LKML, Christian Hewitt, Artem Lapkin, Nick Xie, Gouwa Wang


On Mon 06 Sep 2021 at 19:56, Art Nikpal <email2tema@gmail.com> wrote:

>> It would be nice to indicate how it was tested ?
>
> https://github.com/khadas/khadas-linux-kernel/blob/master/patches/linux-5.14-rc5.sound/0001-arm64-dts-meson-khadas-vim3-remake-simple-sound-for-.patch
>
> i have test it
>
> i2s  and spdif output from gpio headers - works well

You have tested spdifout_a then.

Nothing says spdifin (which was only tested on the axg series so far) or
spdifout_b would actually work if enabled at a later point.

I would prefer if things could at least be tested once before being
added DT. 

>
> On Mon, Sep 6, 2021 at 5:29 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>>
>>
>> On Thu 02 Sep 2021 at 15:31, Neil Armstrong <narmstrong@baylibre.com> wrote:
>>
>> > Hi,
>> >
>> > On 11/08/2021 07:09, Artem Lapkin wrote:
>> >> Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.
>> >>
>> >> Signed-off-by: Artem Lapkin <art@khadas.com>
>> >> ---
>> >>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
>> >>  1 file changed, 40 insertions(+)
>> >>
>> >> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> >> index 3d8b1f4f2..1efdbb61e 100644
>> >> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> >> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> >> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>> >>                      status = "disabled";
>> >>              };
>> >>
>> >> +            spdifin: audio-controller@400 {
>> >> +                    compatible = "amlogic,g12a-spdifin",
>> >> +                    "amlogic,axg-spdifin";
>> >> +                    reg = <0x0 0x400 0x0 0x30>;
>> >> +                    #sound-dai-cells = <0>;
>> >> +                    sound-name-prefix = "SPDIFIN";
>> >> +                    interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
>> >> +                    <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>> >> +                    clock-names = "pclk", "refclk";
>> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFIN>;
>> >> +                    status = "disabled";
>> >> +            };
>> >> +
>> >> +            spdifout: audio-controller@480 {
>> >> +                    compatible = "amlogic,g12a-spdifout",
>> >> +                    "amlogic,axg-spdifout";
>> >> +                    reg = <0x0 0x480 0x0 0x50>;
>> >> +                    #sound-dai-cells = <0>;
>> >> +                    sound-name-prefix = "SPDIFOUT";
>> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
>> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>> >> +                    clock-names = "pclk", "mclk";
>> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
>> >> +                    status = "disabled";
>> >> +            };
>> >> +
>> >>              tdmout_a: audio-controller@500 {
>> >>                      compatible = "amlogic,sm1-tdmout";
>> >>                      reg = <0x0 0x500 0x0 0x40>;
>> >> @@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
>> >>                      status = "disabled";
>> >>              };
>> >>
>> >> +            spdifout_b: audio-controller@680 {
>> >> +                    compatible = "amlogic,g12a-spdifout",
>> >> +                    "amlogic,axg-spdifout";
>> >> +                    reg = <0x0 0x680 0x0 0x50>;
>> >> +                    #sound-dai-cells = <0>;
>> >> +                    sound-name-prefix = "SPDIFOUT_B";
>> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
>> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
>> >> +                    clock-names = "pclk", "mclk";
>> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
>> >> +                    status = "disabled";
>> >> +            };
>> >> +
>> >>              toacodec: audio-controller@740 {
>> >>                      compatible = "amlogic,sm1-toacodec",
>> >>                                   "amlogic,g12a-toacodec";
>> >>
>> >
>> > Jerome could you quickly review this ?
>> >
>>
>> Just this, without the related card change is not usefull as it won't be
>> part of the card.
>>
>> It would be nice to indicate how it was tested ?
>>
>> AFAIK:
>> - spdifout b can only be routed to hdmi and dw-hdmi driver does not
>>   support that yet
>> - the VIM3 does not have connectors for the spdif (in or out). If it
>>   requires some extension card, it should be noted somewhere, at least
>>
>>
>> > Thanks,
>> > Neil
>>


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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-10-04 13:46       ` Jerome Brunet
@ 2021-12-15  2:32         ` Art Nikpal
  2021-12-17  9:30           ` Jerome Brunet
  0 siblings, 1 reply; 13+ messages in thread
From: Art Nikpal @ 2021-12-15  2:32 UTC (permalink / raw)
  To: Jerome Brunet
  Cc: Neil Armstrong, linux-arm-kernel, open list:ARM/Amlogic Meson...,
	LKML, Christian Hewitt, Artem Lapkin, Nick Xie, Gouwa Wang

On Mon, Oct 4, 2021 at 9:51 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>
>
> On Mon 06 Sep 2021 at 19:56, Art Nikpal <email2tema@gmail.com> wrote:
>
> >> It would be nice to indicate how it was tested ?
> >
> > https://github.com/khadas/khadas-linux-kernel/blob/master/patches/linux-5.14-rc5.sound/0001-arm64-dts-meson-khadas-vim3-remake-simple-sound-for-.patch
> >
> > i have test it
> >
> > i2s  and spdif output from gpio headers - works well
>
> You have tested spdifout_a then.
>
> Nothing says spdifin (which was only tested on the axg series so far) or
> spdifout_b would actually work if enabled at a later point.
>
> I would prefer if things could at least be tested once before being
> added DT.
>
> >
> > On Mon, Sep 6, 2021 at 5:29 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
> >>
> >>
> >> On Thu 02 Sep 2021 at 15:31, Neil Armstrong <narmstrong@baylibre.com> wrote:
> >>
> >> > Hi,
> >> >
> >> > On 11/08/2021 07:09, Artem Lapkin wrote:
> >> >> Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.
> >> >>
> >> >> Signed-off-by: Artem Lapkin <art@khadas.com>
> >> >> ---
> >> >>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
> >> >>  1 file changed, 40 insertions(+)
> >> >>
> >> >> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> >> >> index 3d8b1f4f2..1efdbb61e 100644
> >> >> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> >> >> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> >> >> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
> >> >>                      status = "disabled";
> >> >>              };
> >> >>
> >> >> +            spdifin: audio-controller@400 {
> >> >> +                    compatible = "amlogic,g12a-spdifin",
> >> >> +                    "amlogic,axg-spdifin";
> >> >> +                    reg = <0x0 0x400 0x0 0x30>;
> >> >> +                    #sound-dai-cells = <0>;
> >> >> +                    sound-name-prefix = "SPDIFIN";
> >> >> +                    interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
> >> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
> >> >> +                    <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
> >> >> +                    clock-names = "pclk", "refclk";
> >> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFIN>;
> >> >> +                    status = "disabled";
> >> >> +            };
> >> >> +
> >> >> +            spdifout: audio-controller@480 {
> >> >> +                    compatible = "amlogic,g12a-spdifout",
> >> >> +                    "amlogic,axg-spdifout";
> >> >> +                    reg = <0x0 0x480 0x0 0x50>;
> >> >> +                    #sound-dai-cells = <0>;
> >> >> +                    sound-name-prefix = "SPDIFOUT";
> >> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
> >> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
> >> >> +                    clock-names = "pclk", "mclk";
> >> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
> >> >> +                    status = "disabled";
> >> >> +            };
> >> >> +
> >> >>              tdmout_a: audio-controller@500 {
> >> >>                      compatible = "amlogic,sm1-tdmout";
> >> >>                      reg = <0x0 0x500 0x0 0x40>;
> >> >> @@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
> >> >>                      status = "disabled";
> >> >>              };
> >> >>
> >> >> +            spdifout_b: audio-controller@680 {
> >> >> +                    compatible = "amlogic,g12a-spdifout",
> >> >> +                    "amlogic,axg-spdifout";
> >> >> +                    reg = <0x0 0x680 0x0 0x50>;
> >> >> +                    #sound-dai-cells = <0>;
> >> >> +                    sound-name-prefix = "SPDIFOUT_B";
> >> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
> >> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
> >> >> +                    clock-names = "pclk", "mclk";
> >> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
> >> >> +                    status = "disabled";
> >> >> +            };
> >> >> +
> >> >>              toacodec: audio-controller@740 {
> >> >>                      compatible = "amlogic,sm1-toacodec",
> >> >>                                   "amlogic,g12a-toacodec";
> >> >>
> >> >
> >> > Jerome could you quickly review this ?
> >> >
> >>
> >> Just this, without the related card change is not usefull as it won't be
> >> part of the card.

Current sound card dt configuration not configured for it, but we can
apply dt overlays anytime.

IMHO: current sound configuration is not ideal and for some tasks
better to use custom configuration.
but anyway i think meson-sm1.dtsi must be completed by missed spdif in/out nodes

> >>
> >> It would be nice to indicate how it was tested ?

> >>
> >> AFAIK:
> >> - spdifout b can only be routed to hdmi and dw-hdmi driver does not
> >>   support that yet

Ok! But why not accept it at this moment - next time will be easy to
improve dw-hdmi driver
+like options i can submit new patch without spdifout_b node

> >> - the VIM3 does not have connectors for the spdif (in or out). If it

we have test SPDIF in and SPDIF OUT both works fine on VIM3L meson-sm1

> >>   requires some extension card, it should be noted somewhere, at least

SPDIF in and SPDIF OUT both pins available via GPIO header ( SPDIF_OUT
PIN 13 and SPDIF_IN PIN 35 - same PWM_F )

> >>
> >>
> >> > Thanks,
> >> > Neil
> >>
>

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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-12-15  2:32         ` Art Nikpal
@ 2021-12-17  9:30           ` Jerome Brunet
  0 siblings, 0 replies; 13+ messages in thread
From: Jerome Brunet @ 2021-12-17  9:30 UTC (permalink / raw)
  To: Art Nikpal
  Cc: Neil Armstrong, linux-arm-kernel, open list:ARM/Amlogic Meson...,
	LKML, Christian Hewitt, Artem Lapkin, Nick Xie, Gouwa Wang


On Wed 15 Dec 2021 at 10:32, Art Nikpal <email2tema@gmail.com> wrote:

> On Mon, Oct 4, 2021 at 9:51 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>>
>>
>> On Mon 06 Sep 2021 at 19:56, Art Nikpal <email2tema@gmail.com> wrote:
>>
>> >> It would be nice to indicate how it was tested ?
>> >
>> > https://github.com/khadas/khadas-linux-kernel/blob/master/patches/linux-5.14-rc5.sound/0001-arm64-dts-meson-khadas-vim3-remake-simple-sound-for-.patch
>> >
>> > i have test it
>> >
>> > i2s  and spdif output from gpio headers - works well
>>
>> You have tested spdifout_a then.
>>
>> Nothing says spdifin (which was only tested on the axg series so far) or
>> spdifout_b would actually work if enabled at a later point.
>>
>> I would prefer if things could at least be tested once before being
>> added DT.
>>
>> >
>> > On Mon, Sep 6, 2021 at 5:29 PM Jerome Brunet <jbrunet@baylibre.com> wrote:
>> >>
>> >>
>> >> On Thu 02 Sep 2021 at 15:31, Neil Armstrong <narmstrong@baylibre.com> wrote:
>> >>
>> >> > Hi,
>> >> >
>> >> > On 11/08/2021 07:09, Artem Lapkin wrote:
>> >> >> Add spdifin spdifout spdifout_b nodes for Amlogic SM1 SoCs.
>> >> >>
>> >> >> Signed-off-by: Artem Lapkin <art@khadas.com>
>> >> >> ---
>> >> >>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 40 ++++++++++++++++++++++
>> >> >>  1 file changed, 40 insertions(+)
>> >> >>
>> >> >> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> >> >> index 3d8b1f4f2..1efdbb61e 100644
>> >> >> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> >> >> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> >> >> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>> >> >>                      status = "disabled";
>> >> >>              };
>> >> >>
>> >> >> +            spdifin: audio-controller@400 {
>> >> >> +                    compatible = "amlogic,g12a-spdifin",
>> >> >> +                    "amlogic,axg-spdifin";
>> >> >> +                    reg = <0x0 0x400 0x0 0x30>;
>> >> >> +                    #sound-dai-cells = <0>;
>> >> >> +                    sound-name-prefix = "SPDIFIN";
>> >> >> +                    interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>> >> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
>> >> >> +                    <&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>> >> >> +                    clock-names = "pclk", "refclk";
>> >> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFIN>;
>> >> >> +                    status = "disabled";
>> >> >> +            };
>> >> >> +
>> >> >> +            spdifout: audio-controller@480 {
>> >> >> +                    compatible = "amlogic,g12a-spdifout",
>> >> >> +                    "amlogic,axg-spdifout";
>> >> >> +                    reg = <0x0 0x480 0x0 0x50>;
>> >> >> +                    #sound-dai-cells = <0>;
>> >> >> +                    sound-name-prefix = "SPDIFOUT";
>> >> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
>> >> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>> >> >> +                    clock-names = "pclk", "mclk";
>> >> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
>> >> >> +                    status = "disabled";
>> >> >> +            };
>> >> >> +
>> >> >>              tdmout_a: audio-controller@500 {
>> >> >>                      compatible = "amlogic,sm1-tdmout";
>> >> >>                      reg = <0x0 0x500 0x0 0x40>;
>> >> >> @@ -401,6 +428,19 @@ tdmout_c: audio-controller@580 {
>> >> >>                      status = "disabled";
>> >> >>              };
>> >> >>
>> >> >> +            spdifout_b: audio-controller@680 {
>> >> >> +                    compatible = "amlogic,g12a-spdifout",
>> >> >> +                    "amlogic,axg-spdifout";
>> >> >> +                    reg = <0x0 0x680 0x0 0x50>;
>> >> >> +                    #sound-dai-cells = <0>;
>> >> >> +                    sound-name-prefix = "SPDIFOUT_B";
>> >> >> +                    clocks = <&clkc_audio AUD_CLKID_SPDIFOUT_B>,
>> >> >> +                    <&clkc_audio AUD_CLKID_SPDIFOUT_B_CLK>;
>> >> >> +                    clock-names = "pclk", "mclk";
>> >> >> +                    resets = <&clkc_audio AUD_RESET_SPDIFOUT_B>;
>> >> >> +                    status = "disabled";
>> >> >> +            };
>> >> >> +
>> >> >>              toacodec: audio-controller@740 {
>> >> >>                      compatible = "amlogic,sm1-toacodec",
>> >> >>                                   "amlogic,g12a-toacodec";
>> >> >>
>> >> >
>> >> > Jerome could you quickly review this ?
>> >> >
>> >>
>> >> Just this, without the related card change is not usefull as it won't be
>> >> part of the card.
>
> Current sound card dt configuration not configured for it, but we can
> apply dt overlays anytime.

Maybe you should do so

>
> IMHO: current sound configuration is not ideal and for some tasks
> better to use custom configuration.
> but anyway i think meson-sm1.dtsi must be completed by missed spdif in/out nodes
>

Tested ones, sure

>> >>
>> >> It would be nice to indicate how it was tested ?
>
>> >>
>> >> AFAIK:
>> >> - spdifout b can only be routed to hdmi and dw-hdmi driver does not
>> >>   support that yet
>
> Ok! But why not accept it at this moment - next time will be easy to
> improve dw-hdmi driver
> +like options i can submit new patch without spdifout_b node

Because as it stands, it is useless. No one tried it. What lands in the
kernel should work, or at least we should do our best to confirm it does.

We should not place code here hoping everything will be fine when someone
finally turns it on.

When dw-hdmi driver support spdif input and you can confirm it works with
your change, you are welcome to submit it again.

>
>> >> - the VIM3 does not have connectors for the spdif (in or out). If it
>
> we have test SPDIF in and SPDIF OUT both works fine on VIM3L meson-sm1

Then adding to spdifin and spdifout_a nodes is fine by me

>
>> >>   requires some extension card, it should be noted somewhere, at least
>
> SPDIF in and SPDIF OUT both pins available via GPIO header ( SPDIF_OUT
> PIN 13 and SPDIF_IN PIN 35 - same PWM_F )
>

Like other thing on those GPIO connectors, we don't enable them by
default.

Now that the kernel accepts overlays, it would be nice to submit one so
other can replicate your test setup, if you wish to.

>> >>
>> >>
>> >> > Thanks,
>> >> > Neil
>> >>
>>


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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2022-01-03 15:35 ` Jerome Brunet
@ 2022-01-12  8:57   ` Neil Armstrong
  0 siblings, 0 replies; 13+ messages in thread
From: Neil Armstrong @ 2022-01-12  8:57 UTC (permalink / raw)
  To: Jerome Brunet, Artem Lapkin
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, christianshewitt,
	art, nick, gouwa

On 03/01/2022 16:35, Jerome Brunet wrote:
> 
> On Wed 15 Dec 2021 at 11:02, Artem Lapkin <email2tema@gmail.com> wrote:
> 
>> Add spdifin spdifout nodes for Amlogic SM1 SoCs.
>              ^ add (same in the title)
> 
>>
>> Signed-off-by: Artem Lapkin <art@khadas.com>
>> ---
>>
>> SPDIF IN and SPDIF OUT both tested and works fine for VIM3L (meson-sm1)
>> same as for VIM3 (meson-g12)
>>
>> SPDIF in and SPDIF OUT both pins available via GPIO header (SPDIF_OUT PIN
>> 13 spdif_ao_out_pins and SPDIF_IN PIN 35 - same PWM_F spdif_in_h_pins)
>>
>> https://lore.kernel.org/linux-arm-kernel/1jtuhwvqxa.fsf@starbuckisacylon.baylibre.com/t/
>>
>> ALSA spdifin test example
>> =========================
>>
>> # arecord -fS16_LE -r48000 -c2 -Dplug:spdifin
>>
>> # cat .asoundrc
>> pcm.spdifin {
>> type iec958
>> slave {
>> pcm "hw:0,1"
>> format IEC958_SUBFRAME_LE
>> }
>> }
>>
>> DT sound card configs for testing
>> =================================
>>
>> &spdifout {
>>     pinctrl-0 = <&spdif_ao_out_pins>;
>>     pinctrl-names = "default";
>>     status = "okay";
>> };
>>
>> &spdifin {
>>     pinctrl-0 = <&spdif_in_h_pins>;
>>     pinctrl-names = "default";
>>     status = "okay";
>> };
>>
>> ...
>>     spdif_dit: audio-codec-1 {
>> 	#sound-dai-cells = <0>;
>> 	compatible = "linux,spdif-dit";
>> 	status = "okay";
>> 	sound-name-prefix = "DIT";
>>     };
>>
>>     spdif_dir: audio-codec-2 {
>> 	#sound-dai-cells = <0>;
>> 	compatible = "linux,spdif-dir";
>> 	status = "okay";
>> 	sound-name-prefix = "DIR";
>>     };
>> ...
>> 	audio-routing = ...
>> 		"TODDR_B IN 3", "SPDIFIN Capture",
>> 		"SPDIFOUT IN 0", "FRDDR_A OUT 3";
>>
>> ...
>> 	dai-link-10 {
>> 	    sound-dai = <&spdifout>;
>>
>> 	    codec-0 {
>> 		sound-dai = <&spdif_dit>;
>> 	    };
>> 	};
>>
>> 	/* spdif or toslink interface */
>> 	dai-link-11 {
>> 	    sound-dai = <&spdifin>;
>>
>> 	    codec-0 {
>> 		sound-dai = <&spdif_dir>;
>> 	    };
>> 	};
>> ...
>>
>> ---
>>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 27 ++++++++++++++++++++++
>>  1 file changed, 27 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> index 3d8b1f4f2001..1e0adf259d61 100644
>> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
>> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>>  			status = "disabled";
>>  		};
>>  
>> +		spdifin: audio-controller@400 {
>> +			compatible = "amlogic,g12a-spdifin",
>> +			"amlogic,axg-spdifin";
>> +			reg = <0x0 0x400 0x0 0x30>;
>> +			#sound-dai-cells = <0>;
>> +			sound-name-prefix = "SPDIFIN";
>> +			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
>> +			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
>> +			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
>> +			clock-names = "pclk", "refclk";
>> +			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
>> +			status = "disabled";
>> +		};
>> +
>> +		spdifout: audio-controller@480 {
> 
> Node should still be named spdifout_a, even if the spdifout_b is not added yet
> 
>> +			compatible = "amlogic,g12a-spdifout",
>> +			"amlogic,axg-spdifout";
>> +			reg = <0x0 0x480 0x0 0x50>;
>> +			#sound-dai-cells = <0>;
>> +			sound-name-prefix = "SPDIFOUT";
> 
> Same here
> 
>> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
>> +			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
>> +			clock-names = "pclk", "mclk";
>> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
>> +			status = "disabled";
>> +		};
>> +
>>  		tdmout_a: audio-controller@500 {
>>  			compatible = "amlogic,sm1-tdmout";
>>  			reg = <0x0 0x500 0x0 0x40>;
> 

All these fixed while applying, no need to send a new version.

Neil

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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-12-15  3:02 Artem Lapkin
  2022-01-03 15:18 ` Neil Armstrong
  2022-01-03 15:35 ` Jerome Brunet
@ 2022-01-12  8:28 ` Neil Armstrong
  2 siblings, 0 replies; 13+ messages in thread
From: Neil Armstrong @ 2022-01-12  8:28 UTC (permalink / raw)
  To: Artem Lapkin
  Cc: Neil Armstrong, christianshewitt, gouwa, linux-arm-kernel,
	linux-kernel, jbrunet, linux-amlogic, art, nick

Hi,

On Wed, 15 Dec 2021 11:02:36 +0800, Artem Lapkin wrote:
> Add spdifin spdifout nodes for Amlogic SM1 SoCs.
> 
> 

Thanks, Applied to https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux.git (v5.18/dt64)

[1/1] arm64: dts: meson-sm1: add spdifin spdifout nodes
      https://git.kernel.org/amlogic/c/86f2159468d55aca1793c1f0f3d95213501b32f3

-- 
Neil

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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-12-15  3:02 Artem Lapkin
  2022-01-03 15:18 ` Neil Armstrong
@ 2022-01-03 15:35 ` Jerome Brunet
  2022-01-12  8:57   ` Neil Armstrong
  2022-01-12  8:28 ` Neil Armstrong
  2 siblings, 1 reply; 13+ messages in thread
From: Jerome Brunet @ 2022-01-03 15:35 UTC (permalink / raw)
  To: Artem Lapkin, narmstrong
  Cc: linux-arm-kernel, linux-amlogic, linux-kernel, christianshewitt,
	art, nick, gouwa


On Wed 15 Dec 2021 at 11:02, Artem Lapkin <email2tema@gmail.com> wrote:

> Add spdifin spdifout nodes for Amlogic SM1 SoCs.
             ^ add (same in the title)

>
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>
> SPDIF IN and SPDIF OUT both tested and works fine for VIM3L (meson-sm1)
> same as for VIM3 (meson-g12)
>
> SPDIF in and SPDIF OUT both pins available via GPIO header (SPDIF_OUT PIN
> 13 spdif_ao_out_pins and SPDIF_IN PIN 35 - same PWM_F spdif_in_h_pins)
>
> https://lore.kernel.org/linux-arm-kernel/1jtuhwvqxa.fsf@starbuckisacylon.baylibre.com/t/
>
> ALSA spdifin test example
> =========================
>
> # arecord -fS16_LE -r48000 -c2 -Dplug:spdifin
>
> # cat .asoundrc
> pcm.spdifin {
> type iec958
> slave {
> pcm "hw:0,1"
> format IEC958_SUBFRAME_LE
> }
> }
>
> DT sound card configs for testing
> =================================
>
> &spdifout {
>     pinctrl-0 = <&spdif_ao_out_pins>;
>     pinctrl-names = "default";
>     status = "okay";
> };
>
> &spdifin {
>     pinctrl-0 = <&spdif_in_h_pins>;
>     pinctrl-names = "default";
>     status = "okay";
> };
>
> ...
>     spdif_dit: audio-codec-1 {
> 	#sound-dai-cells = <0>;
> 	compatible = "linux,spdif-dit";
> 	status = "okay";
> 	sound-name-prefix = "DIT";
>     };
>
>     spdif_dir: audio-codec-2 {
> 	#sound-dai-cells = <0>;
> 	compatible = "linux,spdif-dir";
> 	status = "okay";
> 	sound-name-prefix = "DIR";
>     };
> ...
> 	audio-routing = ...
> 		"TODDR_B IN 3", "SPDIFIN Capture",
> 		"SPDIFOUT IN 0", "FRDDR_A OUT 3";
>
> ...
> 	dai-link-10 {
> 	    sound-dai = <&spdifout>;
>
> 	    codec-0 {
> 		sound-dai = <&spdif_dit>;
> 	    };
> 	};
>
> 	/* spdif or toslink interface */
> 	dai-link-11 {
> 	    sound-dai = <&spdifin>;
>
> 	    codec-0 {
> 		sound-dai = <&spdif_dir>;
> 	    };
> 	};
> ...
>
> ---
>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 27 ++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> index 3d8b1f4f2001..1e0adf259d61 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>  			status = "disabled";
>  		};
>  
> +		spdifin: audio-controller@400 {
> +			compatible = "amlogic,g12a-spdifin",
> +			"amlogic,axg-spdifin";
> +			reg = <0x0 0x400 0x0 0x30>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFIN";
> +			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
> +			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
> +			clock-names = "pclk", "refclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
> +			status = "disabled";
> +		};
> +
> +		spdifout: audio-controller@480 {

Node should still be named spdifout_a, even if the spdifout_b is not added yet

> +			compatible = "amlogic,g12a-spdifout",
> +			"amlogic,axg-spdifout";
> +			reg = <0x0 0x480 0x0 0x50>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFOUT";

Same here

> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
> +			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
> +			clock-names = "pclk", "mclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
> +			status = "disabled";
> +		};
> +
>  		tdmout_a: audio-controller@500 {
>  			compatible = "amlogic,sm1-tdmout";
>  			reg = <0x0 0x500 0x0 0x40>;


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

* Re: [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
  2021-12-15  3:02 Artem Lapkin
@ 2022-01-03 15:18 ` Neil Armstrong
  2022-01-03 15:35 ` Jerome Brunet
  2022-01-12  8:28 ` Neil Armstrong
  2 siblings, 0 replies; 13+ messages in thread
From: Neil Armstrong @ 2022-01-03 15:18 UTC (permalink / raw)
  To: Artem Lapkin
  Cc: jbrunet, linux-arm-kernel, linux-amlogic, linux-kernel,
	christianshewitt, art, nick, gouwa

On 15/12/2021 04:02, Artem Lapkin wrote:
> Add spdifin spdifout nodes for Amlogic SM1 SoCs.
> 
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
> 
> SPDIF IN and SPDIF OUT both tested and works fine for VIM3L (meson-sm1)
> same as for VIM3 (meson-g12)
> 
> SPDIF in and SPDIF OUT both pins available via GPIO header (SPDIF_OUT PIN
> 13 spdif_ao_out_pins and SPDIF_IN PIN 35 - same PWM_F spdif_in_h_pins)
> 
> https://lore.kernel.org/linux-arm-kernel/1jtuhwvqxa.fsf@starbuckisacylon.baylibre.com/t/
> 
> ALSA spdifin test example
> =========================
> 
> # arecord -fS16_LE -r48000 -c2 -Dplug:spdifin
> 
> # cat .asoundrc
> pcm.spdifin {
> type iec958
> slave {
> pcm "hw:0,1"
> format IEC958_SUBFRAME_LE
> }
> }
> 
> DT sound card configs for testing
> =================================
> 
> &spdifout {
>     pinctrl-0 = <&spdif_ao_out_pins>;
>     pinctrl-names = "default";
>     status = "okay";
> };
> 
> &spdifin {
>     pinctrl-0 = <&spdif_in_h_pins>;
>     pinctrl-names = "default";
>     status = "okay";
> };
> 
> ...
>     spdif_dit: audio-codec-1 {
> 	#sound-dai-cells = <0>;
> 	compatible = "linux,spdif-dit";
> 	status = "okay";
> 	sound-name-prefix = "DIT";
>     };
> 
>     spdif_dir: audio-codec-2 {
> 	#sound-dai-cells = <0>;
> 	compatible = "linux,spdif-dir";
> 	status = "okay";
> 	sound-name-prefix = "DIR";
>     };
> ...
> 	audio-routing = ...
> 		"TODDR_B IN 3", "SPDIFIN Capture",
> 		"SPDIFOUT IN 0", "FRDDR_A OUT 3";
> 
> ...
> 	dai-link-10 {
> 	    sound-dai = <&spdifout>;
> 
> 	    codec-0 {
> 		sound-dai = <&spdif_dit>;
> 	    };
> 	};
> 
> 	/* spdif or toslink interface */
> 	dai-link-11 {
> 	    sound-dai = <&spdifin>;
> 
> 	    codec-0 {
> 		sound-dai = <&spdif_dir>;
> 	    };
> 	};
> ...
> 
> ---
>  arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 27 ++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> index 3d8b1f4f2001..1e0adf259d61 100644
> --- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> +++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
> @@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
>  			status = "disabled";
>  		};
>  
> +		spdifin: audio-controller@400 {
> +			compatible = "amlogic,g12a-spdifin",
> +			"amlogic,axg-spdifin";
> +			reg = <0x0 0x400 0x0 0x30>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFIN";
> +			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
> +			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
> +			clock-names = "pclk", "refclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
> +			status = "disabled";
> +		};
> +
> +		spdifout: audio-controller@480 {
> +			compatible = "amlogic,g12a-spdifout",
> +			"amlogic,axg-spdifout";
> +			reg = <0x0 0x480 0x0 0x50>;
> +			#sound-dai-cells = <0>;
> +			sound-name-prefix = "SPDIFOUT";
> +			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
> +			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
> +			clock-names = "pclk", "mclk";
> +			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
> +			status = "disabled";
> +		};
> +
>  		tdmout_a: audio-controller@500 {
>  			compatible = "amlogic,sm1-tdmout";
>  			reg = <0x0 0x500 0x0 0x40>;
> 

Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>

Thanks,
Neil

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

* [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes
@ 2021-12-15  3:02 Artem Lapkin
  2022-01-03 15:18 ` Neil Armstrong
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Artem Lapkin @ 2021-12-15  3:02 UTC (permalink / raw)
  To: narmstrong
  Cc: jbrunet, linux-arm-kernel, linux-amlogic, linux-kernel,
	christianshewitt, art, nick, gouwa

Add spdifin spdifout nodes for Amlogic SM1 SoCs.

Signed-off-by: Artem Lapkin <art@khadas.com>
---

SPDIF IN and SPDIF OUT both tested and works fine for VIM3L (meson-sm1)
same as for VIM3 (meson-g12)

SPDIF in and SPDIF OUT both pins available via GPIO header (SPDIF_OUT PIN
13 spdif_ao_out_pins and SPDIF_IN PIN 35 - same PWM_F spdif_in_h_pins)

https://lore.kernel.org/linux-arm-kernel/1jtuhwvqxa.fsf@starbuckisacylon.baylibre.com/t/

ALSA spdifin test example
=========================

# arecord -fS16_LE -r48000 -c2 -Dplug:spdifin

# cat .asoundrc
pcm.spdifin {
type iec958
slave {
pcm "hw:0,1"
format IEC958_SUBFRAME_LE
}
}

DT sound card configs for testing
=================================

&spdifout {
    pinctrl-0 = <&spdif_ao_out_pins>;
    pinctrl-names = "default";
    status = "okay";
};

&spdifin {
    pinctrl-0 = <&spdif_in_h_pins>;
    pinctrl-names = "default";
    status = "okay";
};

...
    spdif_dit: audio-codec-1 {
	#sound-dai-cells = <0>;
	compatible = "linux,spdif-dit";
	status = "okay";
	sound-name-prefix = "DIT";
    };

    spdif_dir: audio-codec-2 {
	#sound-dai-cells = <0>;
	compatible = "linux,spdif-dir";
	status = "okay";
	sound-name-prefix = "DIR";
    };
...
	audio-routing = ...
		"TODDR_B IN 3", "SPDIFIN Capture",
		"SPDIFOUT IN 0", "FRDDR_A OUT 3";

...
	dai-link-10 {
	    sound-dai = <&spdifout>;

	    codec-0 {
		sound-dai = <&spdif_dit>;
	    };
	};

	/* spdif or toslink interface */
	dai-link-11 {
	    sound-dai = <&spdifin>;

	    codec-0 {
		sound-dai = <&spdif_dir>;
	    };
	};
...

---
 arch/arm64/boot/dts/amlogic/meson-sm1.dtsi | 27 ++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
index 3d8b1f4f2001..1e0adf259d61 100644
--- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
@@ -356,6 +356,33 @@ tdmin_lb: audio-controller@3c0 {
 			status = "disabled";
 		};
 
+		spdifin: audio-controller@400 {
+			compatible = "amlogic,g12a-spdifin",
+			"amlogic,axg-spdifin";
+			reg = <0x0 0x400 0x0 0x30>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFIN";
+			interrupts = <GIC_SPI 151 IRQ_TYPE_EDGE_RISING>;
+			clocks = <&clkc_audio AUD_CLKID_SPDIFIN>,
+			<&clkc_audio AUD_CLKID_SPDIFIN_CLK>;
+			clock-names = "pclk", "refclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFIN>;
+			status = "disabled";
+		};
+
+		spdifout: audio-controller@480 {
+			compatible = "amlogic,g12a-spdifout",
+			"amlogic,axg-spdifout";
+			reg = <0x0 0x480 0x0 0x50>;
+			#sound-dai-cells = <0>;
+			sound-name-prefix = "SPDIFOUT";
+			clocks = <&clkc_audio AUD_CLKID_SPDIFOUT>,
+			<&clkc_audio AUD_CLKID_SPDIFOUT_CLK>;
+			clock-names = "pclk", "mclk";
+			resets = <&clkc_audio AUD_RESET_SPDIFOUT>;
+			status = "disabled";
+		};
+
 		tdmout_a: audio-controller@500 {
 			compatible = "amlogic,sm1-tdmout";
 			reg = <0x0 0x500 0x0 0x40>;
-- 
2.25.1


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

end of thread, other threads:[~2022-01-12  8:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11  5:09 [PATCH] arm64: dts: meson-sm1: add spdifin spdifout nodes Artem Lapkin
2021-09-02 13:31 ` Neil Armstrong
2021-09-06  9:25   ` Jerome Brunet
2021-09-06 11:56     ` Art Nikpal
2021-09-06 12:28       ` Neil Armstrong
2021-10-04 13:46       ` Jerome Brunet
2021-12-15  2:32         ` Art Nikpal
2021-12-17  9:30           ` Jerome Brunet
2021-12-15  3:02 Artem Lapkin
2022-01-03 15:18 ` Neil Armstrong
2022-01-03 15:35 ` Jerome Brunet
2022-01-12  8:57   ` Neil Armstrong
2022-01-12  8:28 ` Neil Armstrong

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).