overlays: Add ugreen-dabboard overlay
authorChristoph <c.orth@ugreen.eu>
Wed, 28 Apr 2021 18:30:44 +0000 (20:30 +0200)
committerPhil Elwell <phil@raspberrypi.com>
Wed, 28 Apr 2021 18:56:59 +0000 (19:56 +0100)
This is a simple overlay based on the simple-audio-card and the dmic
codec. It has the speciality that it is configured to use the codec
as a master I2S device. It works for example with the Si468x DAB
receiver on the uGreen DABBoard.

See: https://github.com/raspberrypi/linux/issues/4304

Signed-off-by: Christoph Orth <c.orth@ugreen.eu>
arch/arm/boot/dts/overlays/Makefile
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/ugreen-dabboard-overlay.dts [new file with mode: 0644]

index 611cb43..823f14e 100644 (file)
@@ -209,6 +209,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        uart4.dtbo \
        uart5.dtbo \
        udrc.dtbo \
+       ugreen-dabboard.dtbo \
        upstream.dtbo \
        upstream-pi4.dtbo \
        vc4-fkms-v3d.dtbo \
index 79878f4..a0e28b8 100644 (file)
@@ -3130,6 +3130,16 @@ Load:   dtoverlay=udrc,<param>=<val>
 Params: alsaname                Name of the ALSA audio device (default "udrc")
 
 
+Name:   ugreen-dabboard
+Info:   Configures the ugreen-dabboard I2S overlay
+        This is a simple overlay based on the simple-audio-card and the dmic
+        codec. It has the speciality that it is configured to use the codec
+        as a master I2S device. It works for example with the Si468x DAB
+        receiver on the uGreen DABBoard.
+Load:   dtoverlay=ugreen-dabboard,<param>=<val>
+Params: card-name               Override the default, "dabboard", card name.
+
+
 Name:   upstream
 Info:   Allow usage of downstream .dtb with upstream kernel. Comprises the
         vc4-kms-v3d and dwc2 overlays.
diff --git a/arch/arm/boot/dts/overlays/ugreen-dabboard-overlay.dts b/arch/arm/boot/dts/overlays/ugreen-dabboard-overlay.dts
new file mode 100644 (file)
index 0000000..fc8d9b1
--- /dev/null
@@ -0,0 +1,49 @@
+// Definitions for the ugreen dabboard I2S
+/dts-v1/;
+/plugin/;
+
+/ {
+       compatible = "brcm,bcm2835";
+
+       fragment@0 {
+               target = <&i2s>;
+               __overlay__ {
+                       status = "okay";
+               };
+       };
+
+       fragment@1 {
+               target-path = "/";
+               __overlay__ {
+                       dmic_codec: dmic-codec {
+                               #sound-dai-cells = <0>;
+                               compatible = "dmic-codec";
+                               status = "okay";
+                       };
+               };
+       };
+
+       fragment@2 {
+               target = <&sound>;
+               sound_overlay: __overlay__ {
+                       compatible = "simple-audio-card";
+                       simple-audio-card,format = "i2s";
+                       simple-audio-card,name = "dabboard";
+                       simple-audio-card,bitclock-master = <&dailink0_slave>;
+                       simple-audio-card,frame-master = <&dailink0_slave>;
+                       simple-audio-card,widgets = "Microphone", "Microphone Jack";
+                       status = "okay";
+                       simple-audio-card,cpu {
+                               sound-dai = <&i2s>;
+                       };
+                       dailink0_slave: simple-audio-card,codec {
+                               #sound-dai-cells = <0>;
+                               sound-dai = <&dmic_codec>;
+                       };
+               };
+       };
+
+       __overrides__ {
+               card-name = <&sound_overlay>,"simple-audio-card,name";
+       };
+};