arm64: dts: rockchip: analog audio on Orange Pi 5

Analog audio using es8388 codec via the headset jack and onboard mic

Signed-off-by: Jimmy Hon <honyuenkwun@gmail.com>
Link: https://lore.kernel.org/r/20241008031429.2410-1-honyuenkwun@gmail.com
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
This commit is contained in:
Jimmy Hon 2024-10-07 22:14:29 -05:00 committed by Heiko Stuebner
parent f7f8ec7d8c
commit ae46756faf

View File

@ -48,6 +48,39 @@ hdmi0_con_in: endpoint {
};
};
analog-sound {
compatible = "simple-audio-card";
pinctrl-names = "default";
pinctrl-0 = <&hp_detect>;
simple-audio-card,name = "rockchip,es8388";
simple-audio-card,bitclock-master = <&masterdai>;
simple-audio-card,format = "i2s";
simple-audio-card,frame-master = <&masterdai>;
simple-audio-card,hp-det-gpios = <&gpio1 RK_PD5 GPIO_ACTIVE_LOW>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,pin-switches = "Headphones";
simple-audio-card,routing =
"Headphones", "LOUT1",
"Headphones", "ROUT1",
"LINPUT1", "Microphone Jack",
"RINPUT1", "Microphone Jack",
"LINPUT2", "Onboard Microphone",
"RINPUT2", "Onboard Microphone";
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Microphone", "Onboard Microphone",
"Headphone", "Headphones";
simple-audio-card,cpu {
sound-dai = <&i2s1_8ch>;
};
masterdai: simple-audio-card,codec {
sound-dai = <&es8388>;
system-clock-frequency = <12288000>;
};
};
leds {
compatible = "gpio-leds";
pinctrl-names = "default";
@ -250,6 +283,19 @@ &i2c6 {
pinctrl-0 = <&i2c6m3_xfer>;
status = "okay";
es8388: audio-codec@10 {
compatible = "everest,es8388";
reg = <0x10>;
clocks = <&cru I2S1_8CH_MCLKOUT>;
AVDD-supply = <&vcc_3v3_s0>;
DVDD-supply = <&vcc_1v8_s0>;
HPVDD-supply = <&vcc_3v3_s0>;
PVDD-supply = <&vcc_3v3_s0>;
assigned-clocks = <&cru I2S1_8CH_MCLKOUT>;
assigned-clock-rates = <12288000>;
#sound-dai-cells = <0>;
};
usbc0: usb-typec@22 {
compatible = "fcs,fusb302";
reg = <0x22>;
@ -313,6 +359,18 @@ hym8563: rtc@51 {
};
};
&i2s1_8ch {
rockchip,i2s-tx-route = <3 2 1 0>;
rockchip,i2s-rx-route = <1 3 2 0>;
pinctrl-names = "default";
pinctrl-0 = <&i2s1m0_sclk
&i2s1m0_mclk
&i2s1m0_lrck
&i2s1m0_sdi1
&i2s1m0_sdo3>;
status = "okay";
};
&mdio1 {
rgmii_phy1: ethernet-phy@1 {
compatible = "ethernet-phy-ieee802.3-c22";
@ -342,6 +400,12 @@ hym8563_int: hym8563-int {
};
};
sound {
hp_detect: hp-detect {
rockchip,pins = <1 RK_PD5 RK_FUNC_GPIO &pcfg_pull_none>;
};
};
usb-typec {
usbc0_int: usbc0-int {
rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;