arm64: dts: rockchip: fix audio-supply for Rock Pi 4
Subsystems (2)
PATCH 1/2 arm64: dts: rockchip: fix audio-supply for Rock Pi 4
As stated in the schematics [1] and [2] P5 the APIO5 domain is supplied by RK808-D Buck4, which in our case vcc1v8_codec - i.e. a 1.8 V regulator.
Currently only white noise comes from the ES8316's output, which - for whatever reason - came up only after the the correct switch from i2s0_8ch_bus to i2s0_2ch_bus for i2s0's pinctrl was done.
Fix this by setting the correct regulator for audio-supply.
[1] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi4_v13_sch_20181112.pdf
[2] https://dl.radxa.com/rockpi4/docs/hw/rockpi4/rockpi_4c_v12_sch_20200620.pdf
--- arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +1 -1
@@ -502,7 +502,7 @@ &io_domains { status = "okay"; bt656-supply = <&vcc_3v0>; - audio-supply = <&vcc_3v0>; + audio-supply = <&vcc1v8_codec>; sdmmc-supply = <&vcc_sdio>; gpio1830-supply = <&vcc_3v0>; };
Signature · 1 line
2.30.2
PATCH 2/2 arm64: dts: rockchip: add interrupt and headphone-detection for Rock Pi4's audio codec
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
--- arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 12 +++++++++++- .../boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts | 11 +++++++++++ .../boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts | 11 +++++++++++ arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts | 11 +++++++++++ 4 files changed, 44 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +11 -1
@@ -36,7 +36,7 @@ sdio_pwrseq: sdio-pwrseq { reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; }; - sound { + sound: sound { compatible = "audio-graph-card"; label = "Analog"; dais = <&i2s0_p0>;
@@ -543,6 +543,16 @@ bt_wake_l: bt-wake-l { }; }; + 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>;
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4a-plus.dts +11 -0
@@ -12,3 +12,14 @@ / { 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>; +};
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4b-plus.dts +11 -0
@@ -17,6 +17,13 @@ aliases { }; }; +&es8316 { + pinctrl-0 = <&hp_detect &hp_int>; + pinctrl-names = "default"; + interrupt-parent = <&gpio1>; + interrupts = <RK_PA1 IRQ_TYPE_LEVEL_HIGH>; +}; + &sdio0 { status = "okay";
@@ -31,6 +38,10 @@ brcmf: wifi@1 { }; }; +&sound { + hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; +}; + &uart0 { status = "okay";
arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4c.dts +11 -0
@@ -17,6 +17,13 @@ aliases { }; }; +&es8316 { + pinctrl-0 = <&hp_detect &hp_int>; + pinctrl-names = "default"; + interrupt-parent = <&gpio1>; + interrupts = <RK_PA1 IRQ_TYPE_LEVEL_HIGH>; +}; + &sdio0 { status = "okay";
@@ -31,6 +38,10 @@ brcmf: wifi@1 { }; }; +&sound { + hp-det-gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>; +}; + &uart0 { status = "okay";
Signature · 1 line
2.30.2
Quoted 8 lines · Alex Bee
As stated in the schematics [1] and [2] P5 the APIO5 domain is supplied by RK808-D Buck4, which in our case
vcc1v8_codec- i.e. a 1.8 V regulator.Currently only white noise comes from the ES8316's output, which - for whatever reason - came up only after the the correct switch from
i2s0_8ch_bustoi2s0_2ch_busfor i2s0's pinctrl was done.[...]
Applied, thanks!
[1/2] arm64: dts: rockchip: fix audio-supply for Rock Pi 4
commit: 8240e87f16d17a9592c9d67857a3dcdbcb98f10d
[2/2] arm64: dts: rockchip: add interrupt and headphone-detection for Rock Pi4's audio codec
commit: c681c6fcc5ddfa0492ca015b0bf325cd4881ce07Best regards,
Signature · 1 line
Heiko Stuebner <[email protected]>