2020-10-02 14:35:19

by Christian Hewitt

[permalink] [raw]
Subject: [PATCH v2 00/10] arm64: dts: meson: add more GX soundcards

This series adds basic support for LPCM audio over HDMI and S/PDIF
interfaces to GXBB/GXL/GXM devices without support. I'm sure audio
support can be extended in places (some devices have internal DACs
and headphone hardware) but this gets the basics working.

I have personally tested with the khadas-vim2, odroid-c2, and both
wetek devices as I have them, and there are positive forum reports
from users with vega-s95 and some no-name P20X box devices.

Changes from v1
- Drop nexbox-a1 and rbox-pro changes - the regulator changes are
needed to get the dts to compile, but I do not have schematics to
validate the changes or the hardware to test with.

Christian Hewitt (10):
arm64: dts: meson: add audio playback to a95x
arm64: dts: meson: add audio playback to khadas-vim2
arm64: dts: meson: add audio playback to nanopi-k2
arm64: dts: meson: add audio playback to odroid-c2
arm64: dts: meson: add audio playback to p201
arm64: dts: meson: add audio playback to p200
arm64: dts: meson: add audio playback to p212-s905x dtsi
arm64: dts: meson: add audio playback to vega-s95 dtsi
arm64: dts: meson: add audio playback to wetek-hub
arm64: dts: meson: add audio playback to wetek-play2

.../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 40 ++++++++++++
.../dts/amlogic/meson-gxbb-nexbox-a95x.dts | 40 ++++++++++++
.../boot/dts/amlogic/meson-gxbb-odroidc2.dts | 40 ++++++++++++
.../boot/dts/amlogic/meson-gxbb-p200.dts | 61 +++++++++++++++++++
.../boot/dts/amlogic/meson-gxbb-p201.dts | 40 ++++++++++++
.../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 61 +++++++++++++++++++
.../boot/dts/amlogic/meson-gxbb-wetek-hub.dts | 40 ++++++++++++
.../dts/amlogic/meson-gxbb-wetek-play2.dts | 61 +++++++++++++++++++
.../dts/amlogic/meson-gxl-s905x-p212.dtsi | 40 ++++++++++++
.../dts/amlogic/meson-gxm-khadas-vim2.dts | 44 ++++++++++++-
10 files changed, 464 insertions(+), 3 deletions(-)

--
2.17.1


2020-10-02 14:37:02

by Christian Hewitt

[permalink] [raw]
Subject: [PATCH v2 09/10] arm64: dts: meson: add audio playback to wetek-hub

Add initial audio support limited to HDMI i2s.

Signed-off-by: Christian Hewitt <[email protected]>
---
.../boot/dts/amlogic/meson-gxbb-wetek-hub.dts | 40 +++++++++++++++++++
1 file changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
index 83b985bb015e..0c1570153842 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-hub.dts
@@ -7,10 +7,50 @@
/dts-v1/;

#include "meson-gxbb-wetek.dtsi"
+#include <dt-bindings/sound/meson-aiu.h>

/ {
compatible = "wetek,hub", "amlogic,meson-gxbb";
model = "WeTek Hub";
+
+ sound {
+ compatible = "amlogic,gx-sound-card";
+ model = "GXBB-WETEK-HUB";
+ assigned-clocks = <&clkc CLKID_MPLL0>,
+ <&clkc CLKID_MPLL1>,
+ <&clkc CLKID_MPLL2>;
+ assigned-clock-parents = <0>, <0>, <0>;
+ assigned-clock-rates = <294912000>,
+ <270950400>,
+ <393216000>;
+ status = "okay";
+
+ dai-link-0 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+ };
+
+ dai-link-1 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+ dai-format = "i2s";
+ mclk-fs = <256>;
+
+ codec-0 {
+ sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+ };
+ };
+
+ dai-link-2 {
+ sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+ codec-0 {
+ sound-dai = <&hdmi_tx>;
+ };
+ };
+ };
+};
+
+&aiu {
+ status = "okay";
};

&ir {
--
2.17.1

2020-10-02 14:37:21

by Christian Hewitt

[permalink] [raw]
Subject: [PATCH v2 10/10] arm64: dts: meson: add audio playback to wetek-play2

Add initial support limited to HDMI i2s and SPDIF (LPCM).

Signed-off-by: Christian Hewitt <[email protected]>
---
.../dts/amlogic/meson-gxbb-wetek-play2.dts | 61 +++++++++++++++++++
1 file changed, 61 insertions(+)

diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
index 2ab8a3d10079..f2562c7de67c 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek-play2.dts
@@ -8,11 +8,19 @@

#include "meson-gxbb-wetek.dtsi"
#include <dt-bindings/input/input.h>
+#include <dt-bindings/sound/meson-aiu.h>

/ {
compatible = "wetek,play2", "amlogic,meson-gxbb";
model = "WeTek Play 2";

+ spdif_dit: audio-codec-0 {
+ #sound-dai-cells = <0>;
+ compatible = "linux,spdif-dit";
+ status = "okay";
+ sound-name-prefix = "DIT";
+ };
+
leds {
led-wifi {
label = "wetek-play:wifi-status";
@@ -39,6 +47,59 @@
gpios = <&gpio_ao GPIOAO_3 GPIO_ACTIVE_LOW>;
};
};
+
+ sound {
+ compatible = "amlogic,gx-sound-card";
+ model = "GXBB-WETEK-PLAY2";
+ assigned-clocks = <&clkc CLKID_MPLL0>,
+ <&clkc CLKID_MPLL1>,
+ <&clkc CLKID_MPLL2>;
+ assigned-clock-parents = <0>, <0>, <0>;
+ assigned-clock-rates = <294912000>,
+ <270950400>,
+ <393216000>;
+ status = "okay";
+
+ dai-link-0 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_FIFO>;
+ };
+
+ dai-link-1 {
+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_FIFO>;
+ };
+
+ dai-link-2 {
+ sound-dai = <&aiu AIU_CPU CPU_I2S_ENCODER>;
+ dai-format = "i2s";
+ mclk-fs = <256>;
+
+ codec-0 {
+ sound-dai = <&aiu AIU_HDMI CTRL_I2S>;
+ };
+ };
+
+ dai-link-3 {
+ sound-dai = <&aiu AIU_CPU CPU_SPDIF_ENCODER>;
+
+ codec-0 {
+ sound-dai = <&spdif_dit>;
+ };
+ };
+
+ dai-link-4 {
+ sound-dai = <&aiu AIU_HDMI CTRL_OUT>;
+
+ codec-0 {
+ sound-dai = <&hdmi_tx>;
+ };
+ };
+ };
+};
+
+&aiu {
+ status = "okay";
+ pinctrl-0 = <&spdif_out_y_pins>;
+ pinctrl-names = "default";
};

&i2c_A {
--
2.17.1

2020-10-02 14:56:56

by Jerome Brunet

[permalink] [raw]
Subject: Re: [PATCH v2 00/10] arm64: dts: meson: add more GX soundcards


On Fri 02 Oct 2020 at 16:31, Christian Hewitt <[email protected]> wrote:

> This series adds basic support for LPCM audio over HDMI and S/PDIF
> interfaces to GXBB/GXL/GXM devices without support. I'm sure audio
> support can be extended in places (some devices have internal DACs
> and headphone hardware) but this gets the basics working.
>
> I have personally tested with the khadas-vim2, odroid-c2, and both
> wetek devices as I have them, and there are positive forum reports
> from users with vega-s95 and some no-name P20X box devices.

It is fine to add what you have tested but I'm not confortable adding
untested stuff which will later give the false idea that they are
supposed to work.

Amplifiers and codec may require different settings and ressources
(such as GPIO and regulators) to actually operate properly.

As far the p200 and p201, like the g12 u200, those are reference design
with various sound card possibilities which usually don't apply to end
products.

For example the p200 is missing both input and output codecs, the sound
amplifier and, as it stands, is likely to be muted.

>
> Changes from v1
> - Drop nexbox-a1 and rbox-pro changes - the regulator changes are
> needed to get the dts to compile, but I do not have schematics to
> validate the changes or the hardware to test with.
>
> Christian Hewitt (10):
> arm64: dts: meson: add audio playback to a95x
> arm64: dts: meson: add audio playback to khadas-vim2
> arm64: dts: meson: add audio playback to nanopi-k2
> arm64: dts: meson: add audio playback to odroid-c2
> arm64: dts: meson: add audio playback to p201
> arm64: dts: meson: add audio playback to p200
> arm64: dts: meson: add audio playback to p212-s905x dtsi
> arm64: dts: meson: add audio playback to vega-s95 dtsi
> arm64: dts: meson: add audio playback to wetek-hub
> arm64: dts: meson: add audio playback to wetek-play2
>
> .../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 40 ++++++++++++
> .../dts/amlogic/meson-gxbb-nexbox-a95x.dts | 40 ++++++++++++
> .../boot/dts/amlogic/meson-gxbb-odroidc2.dts | 40 ++++++++++++
> .../boot/dts/amlogic/meson-gxbb-p200.dts | 61 +++++++++++++++++++
> .../boot/dts/amlogic/meson-gxbb-p201.dts | 40 ++++++++++++
> .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 61 +++++++++++++++++++
> .../boot/dts/amlogic/meson-gxbb-wetek-hub.dts | 40 ++++++++++++
> .../dts/amlogic/meson-gxbb-wetek-play2.dts | 61 +++++++++++++++++++
> .../dts/amlogic/meson-gxl-s905x-p212.dtsi | 40 ++++++++++++
> .../dts/amlogic/meson-gxm-khadas-vim2.dts | 44 ++++++++++++-
> 10 files changed, 464 insertions(+), 3 deletions(-)