arm64: dts: rockchip: add interrupt and headphone-detection for Rock Pi4's audio...
authorAlex Bee <knaerzche@gmail.com>
Wed, 27 Oct 2021 14:37:26 +0000 (16:37 +0200)
committerHeiko Stuebner <heiko@sntech.de>
Sun, 21 Nov 2021 17:38:19 +0000 (18:38 +0100)
As schematics at [1] and [2] show C- and plus-revisions have interrupt and
headphone detection lines of ES8316 codec connected.

Add them to the respective device trees.

[1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf
[2] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4b_plus_v16_sch_20200628.pdf

Signed-off-by: Alex Bee <knaerzche@gmail.com>
Link: https://lore.kernel.org/r/20211027143726.165809-2-knaerzche@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts

index 98136c8..54f5957 100644 (file)
@@ -36,7 +36,7 @@
                reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
        };
 
-       sound {
+       sound: sound {
                compatible = "audio-graph-card";
                label = "Analog";
                dais = <&i2s0_p0>;
                };
        };
 
+       es8316 {
+               hp_detect: hp-detect {
+                       rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
+               };
+
+               hp_int: hp-int {
+                       rockchip,pins = <1 RK_PA1 RK_FUNC_GPIO &pcfg_pull_up>;
+               };
+       };
+
        pcie {
                pcie_pwr_en: pcie-pwr-en {
                        rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
index 281a04b..f5a68d8 100644 (file)
        model = "Radxa ROCK Pi 4A+";
        compatible = "radxa,rockpi4a-plus", "radxa,rockpi4", "rockchip,rk3399";
 };
+
+&es8316 {
+       pinctrl-0 = <&hp_detect &hp_int>;
+       pinctrl-names = "default";
+       interrupt-parent = <&gpio1>;
+       interrupts = <RK_PA1 IRQ_TYPE_LEVEL_HIGH>;
+};
+
+&sound {
+       hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
+};
index dfad13d..81bea95 100644 (file)
        };
 };
 
+&es8316 {
+       pinctrl-0 = <&hp_detect &hp_int>;
+       pinctrl-names = "default";
+       interrupt-parent = <&gpio1>;
+       interrupts = <RK_PA1 IRQ_TYPE_LEVEL_HIGH>;
+};
+
 &sdio0 {
        status = "okay";
 
        };
 };
 
+&sound {
+       hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
+};
+
 &uart0 {
        status = "okay";
 
index 99169bc..0ad7b6e 100644 (file)
        };
 };
 
+&es8316 {
+       pinctrl-0 = <&hp_detect &hp_int>;
+       pinctrl-names = "default";
+       interrupt-parent = <&gpio1>;
+       interrupts = <RK_PA1 IRQ_TYPE_LEVEL_HIGH>;
+};
+
 &sdio0 {
        status = "okay";
 
        };
 };
 
+&sound {
+       hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
+};
+
 &uart0 {
        status = "okay";