Skip to content

Commit d8872b9

Browse files
alcharkmmind
authored andcommitted
arm64: dts: rockchip: Enable analog sound on RK3576 EVB1
Rockchip RK3576 EVB1 board uses the typical configuration with an ES8388 analog codec driven from built-in SAI I2S. Add device tree nodes for it. Signed-off-by: Alexey Charkov <alchark@gmail.com> Link: https://patch.msgid.link/20251229-rk3576-sound-v1-7-2f59ef0d19b1@gmail.com Signed-off-by: Heiko Stuebner <heiko@sntech.de>
1 parent f5c9549 commit d8872b9

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

arch/arm64/boot/dts/rockchip/rk3576-evb1-v10.dts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,63 @@
246246
regulator-max-microvolt = <1800000>;
247247
vin-supply = <&vcc_1v8_s3>;
248248
};
249+
250+
sound {
251+
compatible = "simple-audio-card";
252+
pinctrl-names = "default";
253+
pinctrl-0 = <&hp_det>;
254+
simple-audio-card,name = "On-board Analog ES8388";
255+
simple-audio-card,aux-devs = <&hp_power>, <&spk_power>;
256+
simple-audio-card,bitclock-master = <&masterdai>;
257+
simple-audio-card,format = "i2s";
258+
simple-audio-card,frame-master = <&masterdai>;
259+
simple-audio-card,hp-det-gpios = <&gpio0 RK_PD3 GPIO_ACTIVE_LOW>;
260+
simple-audio-card,mclk-fs = <256>;
261+
simple-audio-card,routing =
262+
"Headphone Power INL", "LOUT1",
263+
"Headphone Power INR", "ROUT1",
264+
"Speaker Power INL", "LOUT2",
265+
"Speaker Power INR", "ROUT2",
266+
"Headphones", "Headphone Power OUTL",
267+
"Headphones", "Headphone Power OUTR",
268+
"Speaker", "Speaker Power OUTL",
269+
"Speaker", "Speaker Power OUTR",
270+
"LINPUT1", "Main Mic",
271+
"LINPUT2", "Main Mic",
272+
"RINPUT1", "Headset Mic",
273+
"RINPUT2", "Headset Mic";
274+
simple-audio-card,widgets =
275+
"Microphone", "Main Mic",
276+
"Microphone", "Headset Mic",
277+
"Headphone", "Headphones",
278+
"Speaker", "Speaker";
279+
280+
simple-audio-card,cpu {
281+
sound-dai = <&sai1>;
282+
};
283+
284+
masterdai: simple-audio-card,codec {
285+
sound-dai = <&es8388>;
286+
system-clock-frequency = <12288000>;
287+
};
288+
};
289+
290+
hp_power: headphone-amplifier {
291+
compatible = "simple-audio-amplifier";
292+
enable-gpios = <&gpio3 RK_PD6 GPIO_ACTIVE_HIGH>;
293+
pinctrl-names = "default";
294+
pinctrl-0 = <&hp_ctl>;
295+
sound-name-prefix = "Headphone Power";
296+
};
297+
298+
spk_power: speaker-amplifier {
299+
compatible = "simple-audio-amplifier";
300+
enable-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_HIGH>;
301+
pinctrl-names = "default";
302+
pinctrl-0 = <&spk_ctl>;
303+
sound-name-prefix = "Speaker Power";
304+
VCC-supply = <&vcc5v0_device>;
305+
};
249306
};
250307

251308
&cpu_l0 {
@@ -712,6 +769,25 @@
712769
};
713770
};
714771

772+
&i2c3 {
773+
status = "okay";
774+
775+
es8388: audio-codec@10 {
776+
compatible = "everest,es8388", "everest,es8328";
777+
reg = <0x10>;
778+
AVDD-supply = <&vcca_3v3_s0>;
779+
DVDD-supply = <&vcc_1v8_s0>;
780+
HPVDD-supply = <&vcca_3v3_s0>;
781+
PVDD-supply = <&vcc_1v8_s0>;
782+
assigned-clocks = <&cru CLK_SAI1_MCLKOUT_TO_IO>;
783+
assigned-clock-rates = <12288000>;
784+
clocks = <&cru CLK_SAI1_MCLKOUT_TO_IO>;
785+
pinctrl-names = "default";
786+
pinctrl-0 = <&sai1m0_mclk>;
787+
#sound-dai-cells = <0>;
788+
};
789+
};
790+
715791
&mdio0 {
716792
rgmii_phy0: ethernet-phy@1 {
717793
compatible = "ethernet-phy-id001c.c916";
@@ -778,6 +854,20 @@
778854
};
779855

780856
&pinctrl {
857+
audio {
858+
hp_det: hp-det {
859+
rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;
860+
};
861+
862+
hp_ctl: hp-ctl {
863+
rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_down>;
864+
};
865+
866+
spk_ctl: spk-ctl {
867+
rockchip,pins = <2 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
868+
};
869+
};
870+
781871
bluetooth {
782872
bt_reg_on: bt-reg-on {
783873
rockchip,pins = <1 RK_PC7 RK_FUNC_GPIO &pcfg_pull_up>;
@@ -839,6 +929,15 @@
839929
};
840930
};
841931

932+
&sai1 {
933+
pinctrl-names = "default";
934+
pinctrl-0 = <&sai1m0_lrck
935+
&sai1m0_sclk
936+
&sai1m0_sdi0
937+
&sai1m0_sdo0>;
938+
status = "okay";
939+
};
940+
842941
&sai6 {
843942
status = "okay";
844943
};

0 commit comments

Comments
 (0)