From 19086ddd5b295d7ee6cda2e0d2fab6d452a65dd4 Mon Sep 17 00:00:00 2001 From: Samuel Holland Date: Wed, 5 Feb 2020 23:14:27 -0600 Subject: [PATCH 112/351] 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 | 24 ++++++++++++++++++- 1 file changed, 23 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 92e1a2892fe8..dee606370203 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi @@ -183,6 +183,11 @@ chosen { stdout-path = "serial0:115200n8"; }; + ec25_codec: ec25-codec { + #sound-dai-cells = <1>; + compatible = "quectel,ec25"; + }; + i2c_csi: i2c-csi { compatible = "i2c-gpio"; sda-gpios = <&pio 4 13 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; /* PE13 */ @@ -293,7 +298,7 @@ sgm3140_flash: led { &codec { pinctrl-names = "default"; - pinctrl-0 = <&aif3_pins>; + pinctrl-0 = <&aif2_pins>, <&aif3_pins>; status = "okay"; }; @@ -767,6 +772,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.34.0