From cf2568888768ab363e0ea647b0d443cc8ee21b44 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 5 Feb 2020 23:14:27 -0600 Subject: [PATCH 206/478] arm64: dts: allwinner: pinephone: Add support for modem audio The PinePhone has a Quectel EG25-G modem (a variant of the EC25) with its PCM interface connected to AIF2. Add the DAI link so call audio can be routed in hardware. The modem supports two fixed sample rates, and one fixed word size, with a variable BCLK frequency. Use the minimum supported BCLK frequency, which corresponds to a slot width of 32 bits. Signed-off-by: Samuel Holland --- .../dts/allwinner/sun50i-a64-pinephone.dtsi | 25 ++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi index 889ed4767475..79bbd0462b90 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi @@ -186,6 +186,12 @@ chosen { stdout-path = "serial0:115200n8"; }; + ec25_codec: ec25-codec { + #sound-dai-cells = <1>; + compatible = "quectel,ec25"; + sound-name-prefix = "Modem"; + }; + i2c_csi: i2c-csi { compatible = "i2c-gpio"; sda-gpios = <&pio 4 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE13 */ @@ -304,7 +310,7 @@ vibrator { &codec { pinctrl-names = "default"; - pinctrl-0 = <&aif3_pins>; + pinctrl-0 = <&aif2_pins>, <&aif3_pins>; status = "okay"; }; @@ -769,6 +775,23 @@ &sound { "Headset Microphone", "HBIAS", "MIC2", "Headset Microphone"; + simple-audio-card,dai-link@1 { + format = "dsp_a"; + frame-master = <&link1_codec>; + bitclock-master = <&link1_codec>; + bitclock-inversion; + + link1_cpu: cpu { + sound-dai = <&ec25_codec 0>; + }; + + link1_codec: codec { + sound-dai = <&codec 1>; + dai-tdm-slot-num = <1>; + dai-tdm-slot-width = <32>; + }; + }; + simple-audio-card,dai-link@2 { format = "dsp_a"; frame-master = <&link2_codec>; -- 2.35.3