[linux-sunxi][PATCH 0/5] Add tested digital audio blocks to A64

116 views
Skip to first unread message

codek...@gmail.com

unread,
Jan 24, 2018, 5:39:47 AM1/24/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Hi All,

this patch series adds the digital audio blocks to the A64 SoC. No block
changes are necessary.

BR,
CK

Marcus Cooper (5):
arm64: allwinner: a64: Add the SPDIF block
arm64: allwinner: a64: Add SPDIF TX pin to the A64
arm64: allwinner: a64: Add SPDIF to the A64
arm64: allwinner: a64: Add SPDIF to the Pine64
arm64: allwinner: a64: Add DAI nodes

.../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 7 +++
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 63 ++++++++++++++++++++++
2 files changed, 70 insertions(+)

--
2.16.0

codek...@gmail.com

unread,
Jan 24, 2018, 5:39:48 AM1/24/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the SPDIF TX pin to the A64 dtsi.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index c82979038b0b..db1694ec3ee4 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -336,6 +336,11 @@
drive-strength = <40>;
};

+ spdif_tx_pins_a: spdif@0 {
+ pins = "PH8";
+ function = "spdif";
+ };
+
spi0_pins: spi0 {
pins = "PC0", "PC1", "PC2", "PC3";
function = "spi0";
--
2.16.0

codek...@gmail.com

unread,
Jan 24, 2018, 5:39:49 AM1/24/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the SPDIF transceiver controller block to the A64 dtsi.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index d783d164b9c3..c82979038b0b 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -382,6 +382,19 @@
};
};

+ spdif: spdif@1c21000 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun8i-h3-spdif";
+ reg = <0x01c21000 0x400>;
+ interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
+ resets = <&ccu RST_BUS_SPDIF>;
+ clock-names = "apb", "spdif";
+ dmas = <&dma 2>;
+ dma-names = "tx";
+ status = "disabled";
+ };
+
uart0: serial@1c28000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28000 0x400>;
--
2.16.0

codek...@gmail.com

unread,
Jan 24, 2018, 5:39:50 AM1/24/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

---
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 604cdaedac38..70e8ff9a1f38 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -230,6 +230,13 @@
regulator-name = "vcc-rtc";
};

+/* On Euler connector */
+&spdif {
+ pinctrl-names = "default";
+ pinctrl-0 = <&spdif_tx_pins_a>;
+ status = "disabled";
+};
+
/* On Exp and Euler connectors */
&uart0 {
pinctrl-names = "default";
--
2.16.0

codek...@gmail.com

unread,
Jan 24, 2018, 5:39:52 AM1/24/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the DAI blocks to the device tree. I2S0 and I2S1 are for
connecting to an external codec.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 ++++++++++++++++++++++++++
1 file changed, 26 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index f060a58f374c..f3354f8c2026 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -419,6 +419,32 @@
status = "disabled";
};

+ i2s0: i2s@1c22000 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun8i-h3-i2s";
+ reg = <0x01c22000 0x400>;
+ interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_I2S0>, <&ccu CLK_I2S0>;
+ clock-names = "apb", "mod";
+ resets = <&ccu RST_BUS_I2S0>;
+ dma-names = "rx", "tx";
+ dmas = <&dma 3>, <&dma 3>;
+ status = "disabled";
+ };
+
+ i2s1: i2s@1c22400 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun8i-h3-i2s";
+ reg = <0x01c22400 0x400>;
+ interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_I2S1>, <&ccu CLK_I2S1>;
+ clock-names = "apb", "mod";
+ resets = <&ccu RST_BUS_I2S1>;
+ dma-names = "rx", "tx";
+ dmas = <&dma 4>, <&dma 4>;
+ status = "disabled";
+ };
+

codek...@gmail.com

unread,
Jan 24, 2018, 5:39:52 AM1/24/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the device tree sound bindings for the S/PDIF block.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index db1694ec3ee4..f060a58f374c 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -112,6 +112,25 @@
method = "smc";
};

+
+ sound_spdif {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "On-board SPDIF";
+
+ simple-audio-card,cpu {
+ sound-dai = <&spdif>;
+ };
+
+ simple-audio-card,codec {
+ sound-dai = <&spdif_out>;
+ };
+ };
+
+ spdif_out: spdif-out {
+ #sound-dai-cells = <0>;
+ compatible = "linux,spdif-dit";
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 13
--
2.16.0

Maxime Ripard

unread,
Jan 24, 2018, 5:59:38 AM1/24/18
to codek...@gmail.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com
Hi,

On Wed, Jan 24, 2018 at 11:39:39AM +0100, codek...@gmail.com wrote:
> From: Marcus Cooper <codek...@gmail.com>
>
> Add the SPDIF transceiver controller block to the A64 dtsi.
>
> Signed-off-by: Marcus Cooper <codek...@gmail.com>
> ---
> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index d783d164b9c3..c82979038b0b 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -382,6 +382,19 @@
> };
> };
>
> + spdif: spdif@1c21000 {
> + #sound-dai-cells = <0>;
> + compatible = "allwinner,sun8i-h3-spdif";

Please add a SoC-specific compatible here, in addition the H3.

Thanks!
Maxime

--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
signature.asc

Maxime Ripard

unread,
Jan 24, 2018, 6:00:44 AM1/24/18
to codek...@gmail.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com
On Wed, Jan 24, 2018 at 11:39:40AM +0100, codek...@gmail.com wrote:
> From: Marcus Cooper <codek...@gmail.com>
>
> Add the SPDIF TX pin to the A64 dtsi.
>
> Signed-off-by: Marcus Cooper <codek...@gmail.com>
> ---
> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index c82979038b0b..db1694ec3ee4 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -336,6 +336,11 @@
> drive-strength = <40>;
> };
>
> + spdif_tx_pins_a: spdif@0 {

This will generate a dtc warning, you should use a syntax similar to
the other nodes there (ie. spdif if that's the only muxing option, or
spdif-0).
signature.asc

Maxime Ripard

unread,
Jan 24, 2018, 6:01:37 AM1/24/18
to codek...@gmail.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com
On Wed, Jan 24, 2018 at 11:39:41AM +0100, codek...@gmail.com wrote:
> From: Marcus Cooper <codek...@gmail.com>
>
> Add the device tree sound bindings for the S/PDIF block.
>
> Signed-off-by: Marcus Cooper <codek...@gmail.com>
> ---
> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index db1694ec3ee4..f060a58f374c 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -112,6 +112,25 @@
> method = "smc";
> };
>
> +
> + sound_spdif {

Nit: You should drop the extra blank line here.
signature.asc

Chen-Yu Tsai

unread,
Jan 24, 2018, 6:02:32 AM1/24/18
to Maxime Ripard, Code Kipper, linux-arm-kernel, devicetree, linux-sunxi
On Wed, Jan 24, 2018 at 7:00 PM, Maxime Ripard
<maxime...@free-electrons.com> wrote:
> On Wed, Jan 24, 2018 at 11:39:40AM +0100, codek...@gmail.com wrote:
>> From: Marcus Cooper <codek...@gmail.com>
>>
>> Add the SPDIF TX pin to the A64 dtsi.
>>
>> Signed-off-by: Marcus Cooper <codek...@gmail.com>
>> ---
>> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> index c82979038b0b..db1694ec3ee4 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> @@ -336,6 +336,11 @@
>> drive-strength = <40>;
>> };
>>
>> + spdif_tx_pins_a: spdif@0 {
>
> This will generate a dtc warning, you should use a syntax similar to
> the other nodes there (ie. spdif if that's the only muxing option, or
> spdif-0).

Furthermore, if this is the only option, you should set it as the
default in the .dtsi, so boards don't have to, and possibly squash
this patch into the first one.

ChenYu

Maxime Ripard

unread,
Jan 24, 2018, 6:02:34 AM1/24/18
to codek...@gmail.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com
Hi,

On Wed, Jan 24, 2018 at 11:39:43AM +0100, codek...@gmail.com wrote:
> From: Marcus Cooper <codek...@gmail.com>
>
> Add the DAI blocks to the device tree. I2S0 and I2S1 are for
> connecting to an external codec.
>
> Signed-off-by: Marcus Cooper <codek...@gmail.com>
> ---
> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index f060a58f374c..f3354f8c2026 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -419,6 +419,32 @@
> status = "disabled";
> };
>
> + i2s0: i2s@1c22000 {
> + #sound-dai-cells = <0>;
> + compatible = "allwinner,sun8i-h3-i2s";

Same remark than for the spdif, please add a soc-specific compatible.

Thanks!
signature.asc

Code Kipper

unread,
Jan 24, 2018, 6:39:34 AM1/24/18
to Maxime Ripard, linux-arm-kernel, devicetree, linux-sunxi
On 24 January 2018 at 12:02, Maxime Ripard
<maxime...@free-electrons.com> wrote:
> Hi,
>
> On Wed, Jan 24, 2018 at 11:39:43AM +0100, codek...@gmail.com wrote:
>> From: Marcus Cooper <codek...@gmail.com>
>>
>> Add the DAI blocks to the device tree. I2S0 and I2S1 are for
>> connecting to an external codec.
>>
>> Signed-off-by: Marcus Cooper <codek...@gmail.com>
>> ---
>> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 ++++++++++++++++++++++++++
>> 1 file changed, 26 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> index f060a58f374c..f3354f8c2026 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> @@ -419,6 +419,32 @@
>> status = "disabled";
>> };
>>
>> + i2s0: i2s@1c22000 {
>> + #sound-dai-cells = <0>;
>> + compatible = "allwinner,sun8i-h3-i2s";
>
> Same remark than for the spdif, please add a soc-specific compatible.

Is that really necessary?..for example on the a20 the functionality of
the i2s is the same as the a10 so it is down as
"allwinner,sun4i-a10-i2s", likewise here it's the same as the changes
required for the H3. I was planning on using the compatible
"allwinner,sun50i-a64-i2s" for the audio codec as there are some
quirks that need to be addressed.

Thanks,
CK

Code Kipper

unread,
Jan 24, 2018, 6:40:13 AM1/24/18
to Maxime Ripard, linux-arm-kernel, devicetree, linux-sunxi
On 24 January 2018 at 12:01, Maxime Ripard
<maxime...@free-electrons.com> wrote:
> On Wed, Jan 24, 2018 at 11:39:41AM +0100, codek...@gmail.com wrote:
>> From: Marcus Cooper <codek...@gmail.com>
>>
>> Add the device tree sound bindings for the S/PDIF block.
>>
>> Signed-off-by: Marcus Cooper <codek...@gmail.com>
>> ---
>> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19 +++++++++++++++++++
>> 1 file changed, 19 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> index db1694ec3ee4..f060a58f374c 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> @@ -112,6 +112,25 @@
>> method = "smc";
>> };
>>
>> +
>> + sound_spdif {
>
> Nit: You should drop the extra blank line here.
ACK
Thanks,
CK

Code Kipper

unread,
Jan 24, 2018, 6:40:39 AM1/24/18
to Chen-Yu Tsai, Maxime Ripard, linux-arm-kernel, devicetree, linux-sunxi
ACK
Thanks,
CK
>
> ChenYu

Code Kipper

unread,
Jan 24, 2018, 7:11:01 AM1/24/18
to Maxime Ripard, linux-arm-kernel, devicetree, linux-sunxi, Marcus Cooper
On 24 January 2018 at 11:39, <codek...@gmail.com> wrote:
> From: Marcus Cooper <codek...@gmail.com>
>
NACK.....just noticed the lack of commit message...mmmm
BR,
CK

Maxime Ripard

unread,
Jan 25, 2018, 3:29:34 AM1/25/18
to Code Kipper, linux-arm-kernel, devicetree, linux-sunxi
On Wed, Jan 24, 2018 at 12:39:31PM +0100, Code Kipper wrote:
> On 24 January 2018 at 12:02, Maxime Ripard
> <maxime...@free-electrons.com> wrote:
> > Hi,
> >
> > On Wed, Jan 24, 2018 at 11:39:43AM +0100, codek...@gmail.com wrote:
> >> From: Marcus Cooper <codek...@gmail.com>
> >>
> >> Add the DAI blocks to the device tree. I2S0 and I2S1 are for
> >> connecting to an external codec.
> >>
> >> Signed-off-by: Marcus Cooper <codek...@gmail.com>
> >> ---
> >> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 ++++++++++++++++++++++++++
> >> 1 file changed, 26 insertions(+)
> >>
> >> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> >> index f060a58f374c..f3354f8c2026 100644
> >> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> >> @@ -419,6 +419,32 @@
> >> status = "disabled";
> >> };
> >>
> >> + i2s0: i2s@1c22000 {
> >> + #sound-dai-cells = <0>;
> >> + compatible = "allwinner,sun8i-h3-i2s";
> >
> > Same remark than for the spdif, please add a soc-specific compatible.
>
> Is that really necessary?..

Yes.

> for example on the a20 the functionality of the i2s is the same as
> the a10 so it is down as "allwinner,sun4i-a10-i2s", likewise here
> it's the same as the changes required for the H3. I was planning on
> using the compatible "allwinner,sun50i-a64-i2s" for the audio codec
> as there are some quirks that need to be addressed.

And this is exactly why it is necessary. If we ever find a quirk in
the future, supporting that quirk will be smooth if we already have a
compatible for that SoC in the DT, and a pain if we don't.
signature.asc

Code Kipper

unread,
Jan 25, 2018, 4:07:49 AM1/25/18
to Maxime Ripard, linux-arm-kernel, devicetree, linux-sunxi
On 25 January 2018 at 09:29, Maxime Ripard
ACK, but is there any reason why we're not doing this for i2c?
BR,
CK

Code Kipper

unread,
Jan 25, 2018, 4:46:17 AM1/25/18
to Maxime Ripard, linux-arm-kernel, devicetree, linux-sunxi
On 25 January 2018 at 09:29, Maxime Ripard
<maxime...@free-electrons.com> wrote:
Hi Maxime,
so just to comfirm. I'll make this change
compatible = "allwinner,sun50i-a64-i2s", "allwinner,sun8i-h3-i2s"; to the dtsi
and later will add to the i2s driver the compatible
"allwinner,sun50i-a64-i2s-audio-codec"(or something other than
allwinner,sun50i-a64-i2s) for the quirks required for the i2s block
used for the audio codec.
BR,
CK

Maxime Ripard

unread,
Jan 25, 2018, 10:13:52 AM1/25/18
to Code Kipper, linux-arm-kernel, devicetree, linux-sunxi
We try to do that for all the IPs, but some fell through the cracks.
signature.asc

Maxime Ripard

unread,
Jan 25, 2018, 10:31:56 AM1/25/18
to Code Kipper, linux-arm-kernel, devicetree, linux-sunxi
That looks reasonable yes.
signature.asc

codek...@gmail.com

unread,
Jan 29, 2018, 4:19:07 AM1/29/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Hi All,

this patch series adds the digital audio blocks to the A64 SoC. No block
changes are necessary.

BR,
CK

---
v2 changes compared to v1 are:
- Added SoC specific compatiables
- moved spdif default pins to dtsi
- Added i2s2 block for HDMI as it has now been tested.
---
Marcus Cooper (5):
arm64: allwinner: a64: Add the SPDIF block and pin
arm64: allwinner: a64: Add SPDIF to the A64
arm64: allwinner: a64: Add SPDIF to the Pine64
arm64: allwinner: a64: Add DAI nodes
arm64: allwinner: a64: Add DAI node for HDMI

.../arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 5 ++
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 81 ++++++++++++++++++++++
2 files changed, 86 insertions(+)

--
2.16.1

codek...@gmail.com

unread,
Jan 29, 2018, 4:19:08 AM1/29/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the SPDIF transceiver controller block and pin to the A64 dtsi.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index d783d164b9c3..43c54a2133f0 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -336,6 +336,11 @@
drive-strength = <40>;
};

+ spdif_tx_pin: spdif {
+ pins = "PH8";
+ function = "spdif";
+ };
+
spi0_pins: spi0 {
pins = "PC0", "PC1", "PC2", "PC3";
function = "spi0";
@@ -382,6 +387,22 @@
};
};

+ spdif: spdif@1c21000 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun50i-a64-spdif",
+ "allwinner,sun8i-h3-spdif";
+ reg = <0x01c21000 0x400>;
+ interrupts = <GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_SPDIF>, <&ccu CLK_SPDIF>;
+ resets = <&ccu RST_BUS_SPDIF>;
+ clock-names = "apb", "spdif";
+ dmas = <&dma 2>;
+ dma-names = "tx";
+ pinctrl-names = "default";
+ pinctrl-0 = <&spdif_tx_pin>;
+ status = "disabled";
+ };
+
uart0: serial@1c28000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28000 0x400>;
--
2.16.1

codek...@gmail.com

unread,
Jan 29, 2018, 4:19:09 AM1/29/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the device tree sound bindings for the S/PDIF block.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 43c54a2133f0..b9e69657a2e8 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -112,6 +112,24 @@
method = "smc";
};

+ sound_spdif {
+ compatible = "simple-audio-card";
+ simple-audio-card,name = "On-board SPDIF";
+
+ simple-audio-card,cpu {
+ sound-dai = <&spdif>;
+ };
+
+ simple-audio-card,codec {
+ sound-dai = <&spdif_out>;
+ };
+ };
+
+ spdif_out: spdif-out {
+ #sound-dai-cells = <0>;
+ compatible = "linux,spdif-dit";
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 13
--
2.16.1

codek...@gmail.com

unread,
Jan 29, 2018, 4:19:10 AM1/29/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

The S/PDIF transmitter can be reached on the Euler connector.
But as this is a GPIO then leave it disabled so that an overlay
can override the status property.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
index 604cdaedac38..d1161069af9e 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
@@ -230,6 +230,11 @@
regulator-name = "vcc-rtc";
};

+/* On Euler connector */
+&spdif {
+ status = "disabled";
+};
+
/* On Exp and Euler connectors */
&uart0 {
pinctrl-names = "default";
--
2.16.1

codek...@gmail.com

unread,
Jan 29, 2018, 4:19:11 AM1/29/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the DAI blocks to the device tree. I2S0 and I2S1 are for
connecting to an external codec.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 28 +++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index b9e69657a2e8..1b6dc31e7d91 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -421,6 +421,34 @@
status = "disabled";
};

+ i2s0: i2s@1c22000 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun50i-a64-i2s",
+ "allwinner,sun8i-h3-i2s";
+ reg = <0x01c22000 0x400>;
+ interrupts = <GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_I2S0>, <&ccu CLK_I2S0>;
+ clock-names = "apb", "mod";
+ resets = <&ccu RST_BUS_I2S0>;
+ dma-names = "rx", "tx";
+ dmas = <&dma 3>, <&dma 3>;
+ status = "disabled";
+ };
+
+ i2s1: i2s@1c22400 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun50i-a64-i2s",
+ "allwinner,sun8i-h3-i2s";
+ reg = <0x01c22400 0x400>;
+ interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_I2S1>, <&ccu CLK_I2S1>;
+ clock-names = "apb", "mod";
+ resets = <&ccu RST_BUS_I2S1>;
+ dma-names = "rx", "tx";
+ dmas = <&dma 4>, <&dma 4>;
+ status = "disabled";
+ };
+

codek...@gmail.com

unread,
Jan 29, 2018, 4:19:12 AM1/29/18
to maxime...@free-electrons.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com, Marcus Cooper
From: Marcus Cooper <codek...@gmail.com>

Add the new DAI block for I2S2 which is used for HDMI audio.

Signed-off-by: Marcus Cooper <codek...@gmail.com>
---
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 14 ++++++++++++++
1 file changed, 14 insertions(+)

diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
index 1b6dc31e7d91..c913dada7653 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
@@ -449,6 +449,20 @@
status = "disabled";
};

+ i2s2: i2s@1c22800 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun50i-a64-i2s",
+ "allwinner,sun8i-h3-i2s";
+ reg = <0x01c22800 0x400>;
+ interrupts = <GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_I2S2>, <&ccu CLK_I2S2>;
+ clock-names = "apb", "mod";
+ resets = <&ccu RST_BUS_I2S2>;
+ dma-names = "tx";
+ dmas = <&dma 27>;

Maxime Ripard

unread,
Jan 29, 2018, 5:09:38 AM1/29/18
to codek...@gmail.com, linux-ar...@lists.infradead.org, devic...@vger.kernel.org, linux...@googlegroups.com
On Mon, Jan 29, 2018 at 10:18:58AM +0100, codek...@gmail.com wrote:
> From: Marcus Cooper <codek...@gmail.com>
>
> Hi All,
>
> this patch series adds the digital audio blocks to the A64 SoC. No block
> changes are necessary.

queued all of these changes for 4.17. Thanks!
signature.asc
Reply all
Reply to author
Forward
0 new messages