From eea5891db79222a2c982442d630394b023240ccb Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Fri, 22 Oct 2021 13:51:07 +0200 Subject: [PATCH] Rockchip: linux: add anlog sound for Rock Pi4 (backport from 5.15) --- .../linux-0004-rockchip-from-next.patch | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch b/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch index d505f26bfd..db890c1c7b 100644 --- a/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch +++ b/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch @@ -259,3 +259,73 @@ index d582ef3a3aeb..f3f49cf3731b 100644 di->slew_mask = CTL_SLEW_MASK; di->slew_shift = CTL_SLEW_SHIFT; di->vsel_count = FAN53555_NVOLTAGES; + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alex Bee +Date: Fri, 18 Jun 2021 20:12:55 +0200 +Subject: [PATCH] arm64: dts: rockchip: add ES8316 codec for ROCK Pi 4 + +ROCK Pi 4 boards have the codec connected to i2s0 and it is accessible +via i2c1 address 0x11. +Add an audio-graph-card for it. + +Signed-off-by: Alex Bee +Link: https://lore.kernel.org/r/20210618181256.27992-5-knaerzche@gmail.com +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 28 +++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +index fb7599f07af4..619471a1fb46 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +@@ -31,6 +31,12 @@ sdio_pwrseq: sdio-pwrseq { + reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; + }; + ++ sound { ++ compatible = "audio-graph-card"; ++ label = "Analog"; ++ dais = <&i2s0_p0>; ++ }; ++ + vcc12v_dcin: dc-12v { + compatible = "regulator-fixed"; + regulator-name = "vcc12v_dcin"; +@@ -417,6 +423,20 @@ &i2c1 { + i2c-scl-rising-time-ns = <300>; + i2c-scl-falling-time-ns = <15>; + status = "okay"; ++ ++ es8316: codec@11 { ++ compatible = "everest,es8316"; ++ reg = <0x11>; ++ clocks = <&cru SCLK_I2S_8CH_OUT>; ++ clock-names = "mclk"; ++ #sound-dai-cells = <0>; ++ ++ port { ++ es8316_p0_0: endpoint { ++ remote-endpoint = <&i2s0_p0_0>; ++ }; ++ }; ++ }; + }; + + &i2c3 { +@@ -436,6 +456,14 @@ &i2s0 { + rockchip,capture-channels = <2>; + rockchip,playback-channels = <2>; + status = "okay"; ++ ++ i2s0_p0: port { ++ i2s0_p0_0: endpoint { ++ dai-format = "i2s"; ++ mclk-fs = <256>; ++ remote-endpoint = <&es8316_p0_0>; ++ }; ++ }; + }; + + &i2s1 {