]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: allwinner: h313/h616/h618/h700: Enable audio codec for all supported...
authorRyan Walklin <ryan@testtoast.com>
Wed, 23 Oct 2024 07:57:03 +0000 (20:57 +1300)
committerChen-Yu Tsai <wens@csie.org>
Fri, 25 Oct 2024 15:21:51 +0000 (23:21 +0800)
Now that the H616 (and variants) audio codec is supported, enable it for
boards with a mainline DTS. The Tanix TX1, Transpeed 8K618-T and X-96
Mate have all been tested with the onboard 3.5mm audio jack and the
Orange Pi Zero 3 with a 3.5mm jack connected to the audio header.

The RG35XX (2024, -H, -Plus and -SP variants) are also tested working
but have a separate mux and GPIO-controlled (PI5) power amplifier to
support both a headphone jack and onboard speakers.

The headphone jack has a GPIO for jack detection, but this is not
currently supported by the driver, so audio is heard both via the
headphone jack and speakers when the speaker amp is powered (by the
CLDO1 regulator, defined as always-on until proper jack detection is
implemented).

Define the audio codec and routing for all supported H616 and variant
boards, and power and speaker amp enablement where present on boards and
known.

Signed-off-by: Ryan Walklin <ryan@testtoast.com>
Tested-by: Philippe Simons <simons.philippe@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Tested-by: Andre Przywara <andre.przywara@arm.com>
Link: https://patch.msgid.link/20241023075917.186835-8-ryan@testtoast.com
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
arch/arm64/boot/dts/allwinner/sun50i-h313-tanix-tx1.dts
arch/arm64/boot/dts/allwinner/sun50i-h616-orangepi-zero.dtsi
arch/arm64/boot/dts/allwinner/sun50i-h616-x96-mate.dts
arch/arm64/boot/dts/allwinner/sun50i-h618-orangepi-zero2w.dts
arch/arm64/boot/dts/allwinner/sun50i-h618-transpeed-8k618-t.dts
arch/arm64/boot/dts/allwinner/sun50i-h700-anbernic-rg35xx-2024.dts

index bb2cde59bd0338a1348a2b67f8422ab472f3f0ec..bafd3e803106b7d017f3c065d27a8a28725a453a 100644 (file)
        };
 };
 
+&codec {
+       allwinner,audio-routing = "Line Out", "LINEOUT";
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdc2>;
 };
index fc7315b9440659d820ca1bb6b57fb5a92aefe41d..19c5cf75f3f7d68147bac23217ec08c66f37de50 100644 (file)
        };
 };
 
+&codec {
+       allwinner,audio-routing = "Line Out", "LINEOUT";
+       status = "okay";
+};
+
 &ehci1 {
        status = "okay";
 };
index 26d25b5b59e0f89360799404d9998ca612887aa7..6dfe4eab91f6ab4f4d7ca0f8c0fb534776c05b8f 100644 (file)
        };
 };
 
+&codec {
+       allwinner,audio-routing = "Line Out", "LINEOUT";
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdca>;
 };
index 6a4f0da9723303968c64710e5a700d6d681e9ea3..a0fe7a9afb77c246d846ef10e6c483d57b268287 100644 (file)
        };
 };
 
+&codec {
+       allwinner,audio-routing = "Line Out", "LINEOUT";
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdc2>;
 };
index d6631bfe629fa3b602fe1ec4ce08cc48f383e65c..59ee2b253ea4bbcb1568b3d86c116ce54554ae14 100644 (file)
        };
 };
 
+&codec {
+       allwinner,audio-routing = "Line Out", "LINEOUT";
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdc2>;
 };
index 80ccab7b5ba750b72019b0bcb73f7dc95115e0ea..a231abf1684ad6cdae0f0d8f39869017dd0dc470 100644 (file)
        };
 };
 
+&codec {
+       allwinner,audio-routing = "Line Out", "LINEOUT";
+       allwinner,pa-gpios = <&pio 8 5 GPIO_ACTIVE_HIGH>; // PI5
+       status = "okay";
+};
+
 &cpu0 {
        cpu-supply = <&reg_dcdc1>;
 };
                        reg_aldo4: aldo4 {
                                regulator-min-microvolt = <1800000>;
                                regulator-max-microvolt = <1800000>;
-                               regulator-name = "vcc-pg";
+                               regulator-name = "avcc";
                        };
 
                        reg_bldo1: bldo1 {
                        };
 
                        reg_cldo1: cldo1 {
-                               /* 3.3v - audio codec - not yet implemented */
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc-spkr-amp";
                        };
 
                        reg_cldo2: cldo2 {