Skip to content

Commit 513cea2

Browse files
morimotogeertu
authored andcommitted
arm64: dts: renesas: r8a77995: draak: Add R-Car Sound support
This patch adds R-Car Sound support for D3 draak. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Link: https://lore.kernel.org/r/87czrdx3z5.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
1 parent 5d78c97 commit 513cea2

1 file changed

Lines changed: 121 additions & 0 deletions

File tree

‎arch/arm64/boot/dts/renesas/r8a77995-draak.dts‎

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@
2020
ethernet0 = &avb;
2121
};
2222

23+
audio_clkout: audio-clkout {
24+
/*
25+
* This is same as <&rcar_sound 0>
26+
* but needed to avoid cs2000/rcar_sound probe dead-lock
27+
*/
28+
compatible = "fixed-clock";
29+
#clock-cells = <0>;
30+
clock-frequency = <12288000>;
31+
};
32+
2333
backlight: backlight {
2434
compatible = "pwm-backlight";
2535
pwms = <&pwm1 0 50000>;
@@ -161,6 +171,14 @@
161171
regulator-always-on;
162172
};
163173

174+
sound_card: sound {
175+
compatible = "audio-graph-card";
176+
177+
dais = <&rsnd_port0 /* ak4613 */
178+
/* HDMI is not yet supported */
179+
>;
180+
};
181+
164182
vga {
165183
compatible = "vga-connector";
166184

@@ -198,6 +216,25 @@
198216
#clock-cells = <0>;
199217
clock-frequency = <74250000>;
200218
};
219+
220+
x19_clk: x19 {
221+
compatible = "fixed-clock";
222+
#clock-cells = <0>;
223+
clock-frequency = <24576000>;
224+
};
225+
};
226+
227+
&audio_clk_b {
228+
/*
229+
* X11 is connected to VI4_FIELD/SCIF_CLK/AUDIO_CLKB,
230+
* and R-Car Sound uses AUDIO_CLKB.
231+
* Note is that schematic indicates VI4_FIELD conection only
232+
* not AUDIO_CLKB at SoC page.
233+
* And this VI4_FIELD/SCIF_CLK/AUDIO_CLKB is connected to SW60.
234+
* SW60 should be 1-2.
235+
*/
236+
237+
clock-frequency = <22579200>;
201238
};
202239

203240
&avb {
@@ -273,6 +310,28 @@
273310
pinctrl-names = "default";
274311
status = "okay";
275312

313+
ak4613: codec@10 {
314+
compatible = "asahi-kasei,ak4613";
315+
#sound-dai-cells = <0>;
316+
reg = <0x10>;
317+
clocks = <&rcar_sound 0>; /* audio_clkout */
318+
319+
asahi-kasei,in1-single-end;
320+
asahi-kasei,in2-single-end;
321+
asahi-kasei,out1-single-end;
322+
asahi-kasei,out2-single-end;
323+
asahi-kasei,out3-single-end;
324+
asahi-kasei,out4-single-end;
325+
asahi-kasei,out5-single-end;
326+
asahi-kasei,out6-single-end;
327+
328+
port {
329+
ak4613_endpoint: endpoint {
330+
remote-endpoint = <&rsnd_for_ak4613>;
331+
};
332+
};
333+
};
334+
276335
composite-in@20 {
277336
compatible = "adi,adv7180cp";
278337
reg = <0x20>;
@@ -375,6 +434,17 @@
375434
};
376435
};
377436

437+
cs2000: clk-multiplier@4f {
438+
#clock-cells = <0>;
439+
compatible = "cirrus,cs2000-cp";
440+
reg = <0x4f>;
441+
clocks = <&audio_clkout>, <&x19_clk>; /* audio_clkout_1, x19 */
442+
clock-names = "clk_in", "ref_clk";
443+
444+
assigned-clocks = <&cs2000>;
445+
assigned-clock-rates = <24576000>; /* 1/1 divide */
446+
};
447+
378448
eeprom@50 {
379449
compatible = "rohm,br24t01", "atmel,24c01";
380450
reg = <0x50>;
@@ -487,6 +557,17 @@
487557
power-source = <1800>;
488558
};
489559

560+
sound_pins: sound {
561+
groups = "ssi34_ctrl", "ssi3_data", "ssi4_data_a";
562+
function = "ssi";
563+
};
564+
565+
sound_clk_pins: sound-clk {
566+
groups = "audio_clk_a", "audio_clk_b",
567+
"audio_clkout", "audio_clkout1";
568+
function = "audio_clk";
569+
};
570+
490571
usb0_pins: usb0 {
491572
groups = "usb0";
492573
function = "usb0";
@@ -512,6 +593,42 @@
512593
status = "okay";
513594
};
514595

596+
&rcar_sound {
597+
pinctrl-0 = <&sound_pins>, <&sound_clk_pins>;
598+
pinctrl-names = "default";
599+
600+
/* Single DAI */
601+
#sound-dai-cells = <0>;
602+
603+
/* audio_clkout0/1 */
604+
#clock-cells = <1>;
605+
clock-frequency = <12288000 11289600>;
606+
607+
status = "okay";
608+
609+
clocks = <&cpg CPG_MOD 1005>,
610+
<&cpg CPG_MOD 1011>, <&cpg CPG_MOD 1012>,
611+
<&cpg CPG_MOD 1025>, <&cpg CPG_MOD 1026>,
612+
<&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
613+
<&cpg CPG_MOD 1020>, <&cpg CPG_MOD 1021>,
614+
<&cpg CPG_MOD 1019>, <&cpg CPG_MOD 1018>,
615+
<&cs2000>, <&audio_clk_b>,
616+
<&cpg CPG_CORE R8A77995_CLK_ZA2>;
617+
618+
ports {
619+
rsnd_port0: port {
620+
rsnd_for_ak4613: endpoint {
621+
remote-endpoint = <&ak4613_endpoint>;
622+
dai-format = "left_j";
623+
bitclock-master = <&rsnd_for_ak4613>;
624+
frame-master = <&rsnd_for_ak4613>;
625+
playback = <&ssi3>, <&src5>, <&dvc0>;
626+
capture = <&ssi4>, <&src6>, <&dvc1>;
627+
};
628+
};
629+
};
630+
};
631+
515632
&rwdt {
516633
timeout-sec = <60>;
517634
status = "okay";
@@ -540,6 +657,10 @@
540657
status = "okay";
541658
};
542659

660+
&ssi4 {
661+
shared-pin;
662+
};
663+
543664
&usb2_phy0 {
544665
pinctrl-0 = <&usb0_pins>;
545666
pinctrl-names = "default";

0 commit comments

Comments
 (0)