2018-02-02 14:03:53

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 0/3] Allwinner V3s audio codec device tree changes

Here's the Allwinner V3s audio codec device tree changes, which used to
be blocked by the DMA engine code.

The first patch adds the DMA engine device tree node, and the second
adds the codec nodes (digital and analog).

The thrid patch is for Lichee Pi Zero with Dock board to enable the
audio jack and on-board mic.

Icenowy Zheng (3):
ARM: dts: sun8i: add DMA engine in V3s DTSI
ARM: dts: sun8i: add audio codec support into V3s DTSI
ARM: sun8i: v3s: enable audio on Lichee Pi Zero Dock board

arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts | 9 +++++++
arch/arm/boot/dts/sun8i-v3s.dtsi | 28 ++++++++++++++++++++++
2 files changed, 37 insertions(+)

--
2.15.1



2018-02-02 14:04:24

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 1/3] ARM: dts: sun8i: add DMA engine in V3s DTSI

Allwinner V3s SoC features a DMA engine.

Add it in the DTSI file.

Signed-off-by: Icenowy Zheng <[email protected]>
---
arch/arm/boot/dts/sun8i-v3s.dtsi | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 443b083c6adc..20edebd983f0 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -178,6 +178,15 @@
};


+ dma: dma-controller@01c02000 {
+ compatible = "allwinner,sun8i-v3s-dma";
+ reg = <0x01c02000 0x1000>;
+ interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_DMA>;
+ resets = <&ccu RST_BUS_DMA>;
+ #dma-cells = <1>;
+ };
+
mmc0: mmc@1c0f000 {
compatible = "allwinner,sun7i-a20-mmc";
reg = <0x01c0f000 0x1000>;
--
2.15.1


2018-02-02 14:05:16

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 2/3] ARM: dts: sun8i: add audio codec support into V3s DTSI

Allwinner V3s SoC features an internal audio codec like the one in H3,
and a analog codec like the one in H3/A23 (but much simpler).

Add them in the DTSI file.

Signed-off-by: Icenowy Zheng <[email protected]>
---
arch/arm/boot/dts/sun8i-v3s.dtsi | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 20edebd983f0..f6c534efaef9 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -354,6 +354,25 @@
status = "disabled";
};

+ codec: codec@01c22c00 {
+ #sound-dai-cells = <0>;
+ compatible = "allwinner,sun8i-v3s-codec";
+ reg = <0x01c22c00 0x400>;
+ interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
+ clock-names = "apb", "codec";
+ resets = <&ccu RST_BUS_CODEC>;
+ dmas = <&dma 15>, <&dma 15>;
+ dma-names = "rx", "tx";
+ allwinner,codec-analog-controls = <&codec_analog>;
+ status = "disabled";
+ };
+
+ codec_analog: codec-analog@01c23000 {
+ compatible = "allwinner,sun8i-v3s-codec-analog";
+ reg = <0x01c23000 0x4>;
+ };
+
uart0: serial@1c28000 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28000 0x400>;
--
2.15.1


2018-02-02 14:05:27

by Icenowy Zheng

[permalink] [raw]
Subject: [PATCH 3/3] ARM: sun8i: v3s: enable audio on Lichee Pi Zero Dock board

The Lichee Pi Zero Dock board has an audio jack and an onboard MIC.

Enable them.

Signed-off-by: Icenowy Zheng <[email protected]>
---
arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts | 9 +++++++++
1 file changed, 9 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
index d1311098ea45..80f477738668 100644
--- a/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
+++ b/arch/arm/boot/dts/sun8i-v3s-licheepi-zero-dock.dts
@@ -55,6 +55,15 @@
};
};

+&codec {
+ allwinner,audio-routing =
+ "Headphone", "HP",
+ "Headphone", "HPCOM",
+ "MIC1", "Mic",
+ "Mic", "HBIAS";
+ status = "okay";
+};
+
&mmc1 {
broken-cd;
bus-width = <4>;
--
2.15.1


2018-02-02 22:13:03

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 1/3] ARM: dts: sun8i: add DMA engine in V3s DTSI

Hi,

On Fri, Feb 02, 2018 at 10:01:51PM +0800, Icenowy Zheng wrote:
> Allwinner V3s SoC features a DMA engine.
>
> Add it in the DTSI file.
>
> Signed-off-by: Icenowy Zheng <[email protected]>
> ---
> arch/arm/boot/dts/sun8i-v3s.dtsi | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
> index 443b083c6adc..20edebd983f0 100644
> --- a/arch/arm/boot/dts/sun8i-v3s.dtsi
> +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
> @@ -178,6 +178,15 @@
> };
>
>

You have on extra line here

> + dma: dma-controller@01c02000 {

The leading 0 will generate a DT warning

> + compatible = "allwinner,sun8i-v3s-dma";
> + reg = <0x01c02000 0x1000>;
> + interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&ccu CLK_BUS_DMA>;
> + resets = <&ccu RST_BUS_DMA>;
> + #dma-cells = <1>;
> + };
> +

Since you have that extra line above, you can just drop this new line
here.

Thanks!
Maxime

--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com


Attachments:
(No filename) (1.10 kB)
signature.asc (849.00 B)
Download all attachments

2018-02-02 22:13:33

by Maxime Ripard

[permalink] [raw]
Subject: Re: [PATCH 2/3] ARM: dts: sun8i: add audio codec support into V3s DTSI

On Fri, Feb 02, 2018 at 10:01:52PM +0800, Icenowy Zheng wrote:
> Allwinner V3s SoC features an internal audio codec like the one in H3,
> and a analog codec like the one in H3/A23 (but much simpler).
>
> Add them in the DTSI file.
>
> Signed-off-by: Icenowy Zheng <[email protected]>
> ---
> arch/arm/boot/dts/sun8i-v3s.dtsi | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
> index 20edebd983f0..f6c534efaef9 100644
> --- a/arch/arm/boot/dts/sun8i-v3s.dtsi
> +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
> @@ -354,6 +354,25 @@
> status = "disabled";
> };
>
> + codec: codec@01c22c00 {
> + #sound-dai-cells = <0>;
> + compatible = "allwinner,sun8i-v3s-codec";
> + reg = <0x01c22c00 0x400>;
> + interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
> + clock-names = "apb", "codec";
> + resets = <&ccu RST_BUS_CODEC>;
> + dmas = <&dma 15>, <&dma 15>;
> + dma-names = "rx", "tx";
> + allwinner,codec-analog-controls = <&codec_analog>;
> + status = "disabled";
> + };
> +
> + codec_analog: codec-analog@01c23000 {
> + compatible = "allwinner,sun8i-v3s-codec-analog";
> + reg = <0x01c23000 0x4>;

This should be the whole size of the memory region.

Maxime

--
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com


Attachments:
(No filename) (1.45 kB)
signature.asc (849.00 B)
Download all attachments

2018-02-06 02:44:58

by Icenowy Zheng

[permalink] [raw]
Subject: Re: [PATCH 2/3] ARM: dts: sun8i: add audio codec support into V3s DTSI



于 2018年2月3日 GMT+08:00 上午3:49:35, Maxime Ripard <[email protected]> 写到:
>On Fri, Feb 02, 2018 at 10:01:52PM +0800, Icenowy Zheng wrote:
>> Allwinner V3s SoC features an internal audio codec like the one in
>H3,
>> and a analog codec like the one in H3/A23 (but much simpler).
>>
>> Add them in the DTSI file.
>>
>> Signed-off-by: Icenowy Zheng <[email protected]>
>> ---
>> arch/arm/boot/dts/sun8i-v3s.dtsi | 19 +++++++++++++++++++
>> 1 file changed, 19 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi
>b/arch/arm/boot/dts/sun8i-v3s.dtsi
>> index 20edebd983f0..f6c534efaef9 100644
>> --- a/arch/arm/boot/dts/sun8i-v3s.dtsi
>> +++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
>> @@ -354,6 +354,25 @@
>> status = "disabled";
>> };
>>
>> + codec: codec@01c22c00 {
>> + #sound-dai-cells = <0>;
>> + compatible = "allwinner,sun8i-v3s-codec";
>> + reg = <0x01c22c00 0x400>;
>> + interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
>> + clocks = <&ccu CLK_BUS_CODEC>, <&ccu CLK_AC_DIG>;
>> + clock-names = "apb", "codec";
>> + resets = <&ccu RST_BUS_CODEC>;
>> + dmas = <&dma 15>, <&dma 15>;
>> + dma-names = "rx", "tx";
>> + allwinner,codec-analog-controls = <&codec_analog>;
>> + status = "disabled";
>> + };
>> +
>> + codec_analog: codec-analog@01c23000 {
>> + compatible = "allwinner,sun8i-v3s-codec-analog";
>> + reg = <0x01c23000 0x4>;
>
>This should be the whole size of the memory region.

OK. (Although on the datasheet digital part and analog
part is listed as one region.)

>
>Maxime