2023-04-02 09:52:11

by Cristian Ciocaltea

[permalink] [raw]
Subject: [PATCH v4 0/5] Enable I2S support for RK3588/RK3588S SoCs

There are five I2S/PCM/TDM controllers and two I2S/PCM controllers embedded in
the RK3588 and RK3588S SoCs. Furthermore, RK3588 provides four additional
I2S/PCM/TDM controllers.

This patch series adds the required device tree nodes to support all the above.

Additionally, it enables analog audio support for the Rock 5B SBC, which has
been used to test both audio playback and recording.

Also note the first two patches are not particularly related to I2S, they handle
a few clock issues identified while attempting to fix a DT binding warning.

Changes in v4:
- Updated patch v3 1/4 adding a missing clock assignment and adjusting the SCMI
assigned clock rates
- Added patch v4 2/5 to address an issue reported by Sebastian

Changes in v3:
- Rebased onto next-20230331 and dropped patches v2 01-06/10 already applied by Rob
- Ensured DT nodes are in alphabetical order in patch v3 4/4
- v2: https://lore.kernel.org/lkml/[email protected]/

Changes in v2:
- Rebased onto next-20230321 and drop patches 03-08/11 already applied by Mark
- Replaced patch 01/11 with v2 07/10
- Reworked patch 02/11 to v2 01-06/10
- v1: https://lore.kernel.org/lkml/[email protected]/

Cristian Ciocaltea (5):
arm64: dts: rockchip: rk3588s: Fix SCMI assigned clocks
arm64: dts: rockchip: rk3588s: Assign PLL_PPLL clock rate to 1.1 GHz
arm64: dts: rockchip: rk3588s: Add I2S nodes
arm64: dts: rockchip: rk3588: Add I2S nodes
arm64: dts: rockchip: rk3588-rock-5b: Add analog audio

.../boot/dts/rockchip/rk3588-rock-5b.dts | 62 +++++++
arch/arm64/boot/dts/rockchip/rk3588.dtsi | 68 ++++++++
arch/arm64/boot/dts/rockchip/rk3588s.dtsi | 160 +++++++++++++++++-
3 files changed, 285 insertions(+), 5 deletions(-)

--
2.40.0


2023-04-02 09:52:38

by Cristian Ciocaltea

[permalink] [raw]
Subject: [PATCH v4 5/5] arm64: dts: rockchip: rk3588-rock-5b: Add analog audio

Add the necessary DT nodes for the Rock 5B board to enable the analog
audio support provided by the Everest Semi ES8316 codec.

Signed-off-by: Cristian Ciocaltea <[email protected]>
---
.../boot/dts/rockchip/rk3588-rock-5b.dts | 62 +++++++++++++++++++
1 file changed, 62 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
index 95805cb0adfa..a9e12e098d48 100644
--- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
@@ -2,6 +2,7 @@

/dts-v1/;

+#include <dt-bindings/gpio/gpio.h>
#include "rk3588.dtsi"

/ {
@@ -17,6 +18,23 @@ chosen {
stdout-path = "serial2:1500000n8";
};

+ sound {
+ compatible = "audio-graph-card";
+ label = "Analog";
+
+ widgets = "Microphone", "Mic Jack",
+ "Headphone", "Headphones";
+
+ routing = "MIC2", "Mic Jack",
+ "Headphones", "HPOL",
+ "Headphones", "HPOR";
+
+ dais = <&i2s0_8ch_p0>;
+ hp-det-gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&hp_detect>;
+ };
+
vcc5v0_sys: vcc5v0-sys-regulator {
compatible = "regulator-fixed";
regulator-name = "vcc5v0_sys";
@@ -27,6 +45,50 @@ vcc5v0_sys: vcc5v0-sys-regulator {
};
};

+&i2c7 {
+ status = "okay";
+
+ es8316: es8316@11 {
+ compatible = "everest,es8316";
+ reg = <0x11>;
+ clocks = <&cru I2S0_8CH_MCLKOUT>;
+ clock-names = "mclk";
+ #sound-dai-cells = <0>;
+
+ port {
+ es8316_p0_0: endpoint {
+ remote-endpoint = <&i2s0_8ch_p0_0>;
+ };
+ };
+ };
+};
+
+&i2s0_8ch {
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2s0_lrck
+ &i2s0_mclk
+ &i2s0_sclk
+ &i2s0_sdi0
+ &i2s0_sdo0>;
+ status = "okay";
+
+ i2s0_8ch_p0: port {
+ i2s0_8ch_p0_0: endpoint {
+ dai-format = "i2s";
+ mclk-fs = <256>;
+ remote-endpoint = <&es8316_p0_0>;
+ };
+ };
+};
+
+&pinctrl {
+ sound {
+ hp_detect: hp-detect {
+ rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
+ };
+ };
+};
+
&sdhci {
bus-width = <8>;
no-sdio;
--
2.40.0

2023-04-04 09:17:20

by Christopher Obbard

[permalink] [raw]
Subject: Re: [PATCH v4 5/5] arm64: dts: rockchip: rk3588-rock-5b: Add analog audio

Hi Cristian,

On Sun, 2023-04-02 at 12:50 +0300, Cristian Ciocaltea wrote:
> Add the necessary DT nodes for the Rock 5B board to enable the analog
> audio support provided by the Everest Semi ES8316 codec.
>
> Signed-off-by: Cristian Ciocaltea <[email protected]>

Reviewed-by: Christopher Obbard <[email protected]>

> ---
>  .../boot/dts/rockchip/rk3588-rock-5b.dts      | 62 +++++++++++++++++++
>  1 file changed, 62 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
> index 95805cb0adfa..a9e12e098d48 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
> @@ -2,6 +2,7 @@
>  
>  /dts-v1/;
>  
> +#include <dt-bindings/gpio/gpio.h>
>  #include "rk3588.dtsi"
>  
>  / {
> @@ -17,6 +18,23 @@ chosen {
>                 stdout-path = "serial2:1500000n8";
>         };
>  
> +       sound {
> +               compatible = "audio-graph-card";
> +               label = "Analog";
> +
> +               widgets = "Microphone", "Mic Jack",
> +                         "Headphone", "Headphones";
> +
> +               routing = "MIC2", "Mic Jack",
> +                         "Headphones", "HPOL",
> +                         "Headphones", "HPOR";
> +
> +               dais = <&i2s0_8ch_p0>;
> +               hp-det-gpio = <&gpio1 RK_PD5 GPIO_ACTIVE_HIGH>;
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&hp_detect>;
> +       };
> +
>         vcc5v0_sys: vcc5v0-sys-regulator {
>                 compatible = "regulator-fixed";
>                 regulator-name = "vcc5v0_sys";
> @@ -27,6 +45,50 @@ vcc5v0_sys: vcc5v0-sys-regulator {
>         };
>  };
>  
> +&i2c7 {
> +       status = "okay";
> +
> +       es8316: es8316@11 {
> +               compatible = "everest,es8316";
> +               reg = <0x11>;
> +               clocks = <&cru I2S0_8CH_MCLKOUT>;
> +               clock-names = "mclk";
> +               #sound-dai-cells = <0>;
> +
> +               port {
> +                       es8316_p0_0: endpoint {
> +                               remote-endpoint = <&i2s0_8ch_p0_0>;
> +                       };
> +               };
> +       };
> +};
> +
> +&i2s0_8ch {
> +       pinctrl-names = "default";
> +       pinctrl-0 = <&i2s0_lrck
> +                    &i2s0_mclk
> +                    &i2s0_sclk
> +                    &i2s0_sdi0
> +                    &i2s0_sdo0>;
> +       status = "okay";
> +
> +       i2s0_8ch_p0: port {
> +               i2s0_8ch_p0_0: endpoint {
> +                       dai-format = "i2s";
> +                       mclk-fs = <256>;
> +                       remote-endpoint = <&es8316_p0_0>;
> +               };
> +       };
> +};
> +
> +&pinctrl {
> +       sound {
> +               hp_detect: hp-detect {
> +                       rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
> +               };
> +       };
> +};
> +
>  &sdhci {
>         bus-width = <8>;
>         no-sdio;
> --
> 2.40.0
>
>

2023-04-05 17:52:30

by Heiko Stübner

[permalink] [raw]
Subject: Re: [PATCH v4 0/5] Enable I2S support for RK3588/RK3588S SoCs

On Sun, 2 Apr 2023 12:50:49 +0300, Cristian Ciocaltea wrote:
> There are five I2S/PCM/TDM controllers and two I2S/PCM controllers embedded in
> the RK3588 and RK3588S SoCs. Furthermore, RK3588 provides four additional
> I2S/PCM/TDM controllers.
>
> This patch series adds the required device tree nodes to support all the above.
>
> Additionally, it enables analog audio support for the Rock 5B SBC, which has
> been used to test both audio playback and recording.
>
> [...]

Applied, thanks!

[1/5] arm64: dts: rockchip: rk3588s: Fix SCMI assigned clocks
commit: 87810bda8a8472a9a106c6de34a032fb6a4b425b
[2/5] arm64: dts: rockchip: rk3588s: Assign PLL_PPLL clock rate to 1.1 GHz
commit: b46a22dea7530cf530a45c6b84c03300083b813d
[3/5] arm64: dts: rockchip: rk3588s: Add I2S nodes
commit: 8ae112a5554fb1580fc5564f8610cef85f2e3f7b
[4/5] arm64: dts: rockchip: rk3588: Add I2S nodes
commit: 6f48c6f5859296eaf54a55f436db3a248f772e4d
[5/5] arm64: dts: rockchip: rk3588-rock-5b: Add analog audio
commit: 55529fe3f32d8c2fdb70981f2e151735e090a1e0

Best regards,
--
Heiko Stuebner <[email protected]>