Skip to content

Commit 0d4ed95

Browse files
bijudasgeertu
authored andcommitted
arm64: dts: renesas: r9a08g046l48-smarc: Enable audio
Enable audio on the RZ/G3L SMARC EVK by linking SSI0 with the DA7212 audio CODEC. The SSI0 signals are multiplexed with SD2 and are selected by switch SW_SD2_EN#. Add regulator nodes regulator-{1p8v,3p3v} to the SoM DTSI for reuse by eMMC. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Link: https://patch.msgid.link/20260528074615.91110-3-biju.das.jz@bp.renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 80e3232 commit 0d4ed95

2 files changed

Lines changed: 94 additions & 0 deletions

File tree

arch/arm64/boot/dts/renesas/r9a08g046l48-smarc.dts

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
/* Switch selection settings */
1111
#define RZ_BOOT_MODE3 1
12+
#define SW_SD2_EN 0
1213
#define SW_DPI_EN 0
1314
#define SW_GPIO4 1
1415
#define SW_I3C_EN 0
@@ -38,6 +39,32 @@
3839
i2c3 = &i2c3;
3940
serial3 = &scif0;
4041
};
42+
43+
#if !SW_SD2_EN && !SW_I3C_EN
44+
snd_rzg3l: sound {
45+
compatible = "simple-audio-card";
46+
simple-audio-card,name = "snd_rzg3l";
47+
#address-cells = <1>;
48+
#size-cells = <0>;
49+
50+
ssi_link_play: simple-audio-card,dai-link@0 {
51+
reg = <0>;
52+
format = "i2s";
53+
bitclock-master = <&cpu_dai>;
54+
frame-master = <&cpu_dai>;
55+
mclk-fs = <256>;
56+
57+
cpu_dai: cpu {
58+
sound-dai = <&ssi0>;
59+
};
60+
61+
codec_dai: codec {
62+
sound-dai = <&da7212>;
63+
clocks = <&versa3 1>;
64+
};
65+
};
66+
};
67+
#endif
4168
};
4269

4370
&i2c2 {
@@ -53,6 +80,27 @@
5380
pinctrl-names = "default";
5481

5582
status = "okay";
83+
84+
da7212: codec@1a {
85+
compatible = "dlg,da7212";
86+
reg = <0x1a>;
87+
88+
clocks = <&versa3 1>;
89+
clock-names = "mclk";
90+
91+
#sound-dai-cells = <0>;
92+
93+
dlg,micbias1-lvl = <2500>;
94+
dlg,micbias2-lvl = <2500>;
95+
dlg,dmic-data-sel = "lrise_rfall";
96+
dlg,dmic-samplephase = "between_clkedge";
97+
dlg,dmic-clkrate = <3000000>;
98+
99+
VDDA-supply = <&reg_1p8v>;
100+
VDDSP-supply = <&reg_3p3v>;
101+
VDDMIC-supply = <&reg_3p3v>;
102+
VDDIO-supply = <&reg_1p8v>;
103+
};
56104
};
57105
#endif
58106

@@ -71,6 +119,11 @@
71119
};
72120

73121
&pinctrl {
122+
audio_clk_pins: audio-clock {
123+
pinmux = <RZG3L_PORT_PINMUX(H, 4, 6)>, /* AUDIO_CLK_B */
124+
<RZG3L_PORT_PINMUX(H, 5, 6)>; /* AUDIO_CLK_C */
125+
};
126+
74127
i2c2_pins: i2c2 {
75128
pinmux = <RZG3L_PORT_PINMUX(A, 4, 4)>, /* RIIC2_SCL */
76129
<RZG3L_PORT_PINMUX(A, 5, 4)>; /* RIIC2_SDA */
@@ -85,9 +138,28 @@
85138
pins = "SCIF0_TXD", "SCIF0_RXD";
86139
power-source = <1800>;
87140
};
141+
142+
ssi0_pins: ssi0 {
143+
pinmux = <RZG3L_PORT_PINMUX(H, 0, 9)>, /* SSIF0_RXD */
144+
<RZG3L_PORT_PINMUX(H, 1, 9)>, /* SSIF0_BCK */
145+
<RZG3L_PORT_PINMUX(H, 2, 9)>, /* SSIF0_RCK */
146+
<RZG3L_PORT_PINMUX(H, 3, 9)>; /* SSIF0_TXD */
147+
};
88148
};
89149

90150
&scif0 {
91151
pinctrl-0 = <&scif0_pins>;
92152
pinctrl-names = "default";
93153
};
154+
155+
#if !SW_SD2_EN
156+
&ssi0 {
157+
clocks = <&cpg CPG_MOD R9A08G046_SSI0_PCLK2>,
158+
<&cpg CPG_MOD R9A08G046_SSI0_PCLK_SFR>,
159+
<&versa3 2>, <&versa3 3>;
160+
pinctrl-0 = <&audio_clk_pins>, <&ssi0_pins>;
161+
pinctrl-names = "default";
162+
163+
status = "okay";
164+
};
165+
#endif

arch/arm64/boot/dts/renesas/rzg3l-smarc-som.dtsi

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
* 0 - SMARC_I2C_GP is enabled
1414
* 1 - I3C is enabled
1515
*
16+
* Switch position SYS.4, Macro SW_SD2_EN:
17+
* 0 - Select I2S0
18+
* 1 - Select SD2
19+
*
1620
* Switch position SYS.5, Macro SW_DPI_EN:
1721
* 0 - Select multiple SMARC signals active
1822
* 1 - Select LCD
@@ -41,6 +45,24 @@
4145
reg = <0x0 0x48000000 0x0 0x78000000>;
4246
};
4347

48+
reg_1p8v: regulator-1p8v {
49+
compatible = "regulator-fixed";
50+
regulator-name = "fixed-1.8V";
51+
regulator-min-microvolt = <1800000>;
52+
regulator-max-microvolt = <1800000>;
53+
regulator-boot-on;
54+
regulator-always-on;
55+
};
56+
57+
reg_3p3v: regulator-3p3v {
58+
compatible = "regulator-fixed";
59+
regulator-name = "fixed-3.3V";
60+
regulator-min-microvolt = <3300000>;
61+
regulator-max-microvolt = <3300000>;
62+
regulator-boot-on;
63+
regulator-always-on;
64+
};
65+
4466
x2_clk: x2-clock {
4567
compatible = "fixed-clock";
4668
#clock-cells = <0>;

0 commit comments

Comments
 (0)