From: Kuninori Morimoto Date: Thu, 17 Apr 2025 23:23:36 +0000 (+0000) Subject: arm64: dts: renesas: sparrow-hawk: Add MSIOF Sound support X-Git-Tag: v6.16-rc1~97^2~44^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ca764d5321a2cee7c4901b981bb0be06d8d9a9d7;p=thirdparty%2Flinux.git arm64: dts: renesas: sparrow-hawk: Add MSIOF Sound support Sparrow Hawk has Headset (CONN3) AUX_IN (CONN4) for Sound input/output which is using MSIOF. Support it. Signed-off-by: Kuninori Morimoto Reviewed-by: Geert Uytterhoeven Link: https://lore.kernel.org/87plha2wzr.wl-kuninori.morimoto.gx@renesas.com Link: https://lore.kernel.org/874ixxcg3w.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Geert Uytterhoeven --- diff --git a/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts b/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts index b109095a0d872..6955eafd8d6ab 100644 --- a/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts +++ b/arch/arm64/boot/dts/renesas/r8a779g3-sparrow-hawk.dts @@ -4,6 +4,37 @@ * * Copyright (C) 2025 Marek Vasut */ +/* + * DA7212 Codec settings + * + * for Playback + * > amixer set "Headphone" 40% + * > amixer set "Headphone" on + * > amixer set "Mixout Left DAC Left" on + * > amixer set "Mixout Right DAC Right" on + * > aplay xxx.wav + * + * for Capture (Aux/Mic) + * + * on/off (B) + * CONN3 (HeadSet) ---+----> MSIOF1 + * | + * CONN4 AUX ---------+ on/off (A) + * + * > amixer set "Mixin PGA" on + * > amixer set "Mixin PGA" 50% + * > amixer set "ADC" on + * > amixer set "ADC" 80% + * > amixer set "Aux" on ^ + * > amixer set "Aux" 80% | (A) + * > amixer set "Mixin Left Aux Left" on | + * > amixer set "Mixin Right Aux Right" on v + * > amixer set "Mic 1" on ^ + * > amixer set "Mic 1" 80% | (B) + * > amixer set "Mixin Left Mic 1" on | + * > amixer set "Mixin Right Mic 1" on v + * > arecord -f cd xxx.wav + */ /dts-v1/; #include @@ -133,6 +164,12 @@ clock-frequency = <38400000>; }; + /* Page 30 / Audio_Codec */ + sound_card: sound { + compatible = "audio-graph-card2"; + links = <&msiof1_snd>; + }; + /* Page 17 uSD-Slot */ vcc_sdhi: regulator-vcc-sdhi { compatible = "regulator-gpio"; @@ -145,6 +182,10 @@ }; }; +&audio_clkin { + clock-frequency = <24576000>; +}; + /* Page 22 / Ether_AVB0 */ &avb0 { pinctrl-0 = <&avb0_pins>; @@ -334,6 +375,29 @@ reg = <1>; #address-cells = <1>; #size-cells = <0>; + + /* Page 30 / Audio_Codec */ + codec@1a { + compatible = "dlg,da7212"; + + #sound-dai-cells = <0>; + reg = <0x1a>; + + clocks = <&rcar_sound>; + clock-names = "mclk"; + + VDDA-supply = <®_1p8v>; + VDDMIC-supply = <®_3p3v>; + VDDIO-supply = <®_3p3v>; + + port { + da7212_endpoint: endpoint { + bitclock-master; + frame-master; + remote-endpoint = <&msiof1_snd_endpoint>; + }; + }; + }; }; i2c0_mux2: i2c@2 { @@ -404,6 +468,23 @@ status = "okay"; }; +&msiof1 { + pinctrl-0 = <&msiof1_pins>; + pinctrl-names = "default"; + + status = "okay"; + + /* ignore DT warning */ + /delete-property/#address-cells; + /delete-property/#size-cells; + + msiof1_snd: port { + msiof1_snd_endpoint: endpoint { + remote-endpoint = <&da7212_endpoint>; + }; + }; +}; + /* Page 26 / 2230 Key M M.2 */ &pcie0_clkref { clock-frequency = <100000000>; @@ -584,6 +665,31 @@ function = "mmc"; power-source = <1800>; }; + + /* Page 30 / Audio_Codec */ + msiof1_pins: sound { + groups = "msiof1_clk", "msiof1_sync", "msiof1_txd", "msiof1_rxd"; + function = "msiof1"; + }; + + /* Page 30 / Audio_Codec */ + sound_clk_pins: sound-clk { + groups = "audio_clkin", "audio_clkout"; + function = "audio_clk"; + }; +}; + +/* Page 30 / Audio_Codec */ +&rcar_sound { + pinctrl-0 = <&sound_clk_pins>; + pinctrl-names = "default"; + + /* It is used for ADG output as DA7212_MCLK */ + + /* audio_clkout */ + clock-frequency = <12288000>; /* 48 kHz groups */ + + status = "okay"; }; /* Page 31 / FAN */