]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
authorLuca Weiss <luca.weiss@fairphone.com>
Thu, 1 May 2025 06:48:51 +0000 (08:48 +0200)
committerBjorn Andersson <andersson@kernel.org>
Mon, 11 Aug 2025 18:22:43 +0000 (13:22 -0500)
Enable USB audio offloading which allows to play audio via a USB-C
headset with lower power consumption and enabling some other features.

This can be used like the following:

  $ amixer -c0 cset name='USB_RX Audio Mixer MultiMedia1' On
  $ aplay --device=plughw:0,0 test.wav

Compared to regular playback to the USB sound card no xhci-hcd
interrupts appear during playback, instead the ADSP will be handling the
USB transfers.

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Link: https://lore.kernel.org/r/20250501-fp4-usb-audio-offload-v2-5-30f4596281cd@fairphone.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
arch/arm64/boot/dts/qcom/sm6350.dtsi
arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts

index c7230cdcf7142ebd002904151ff9aa85a98923fa..2d891a5640dead6b60386006bcbbb9aad40a660b 100644 (file)
                };
        };
 
+       sound: sound {
+       };
+
        thermal-zones {
                aoss0-thermal {
                        thermal-sensors = <&tsens0 0>;
index 52b16a4fdc43212e1ca1986361b01f47d36445d0..4afbab570ca15f472dac420fb6dc82443e628d26 100644 (file)
@@ -19,6 +19,7 @@
 #include <dt-bindings/leds/common.h>
 #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
 #include <dt-bindings/regulator/qcom,rpmh-regulator.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
 #include <dt-bindings/usb/pd.h>
 #include "sm7225.dtsi"
 #include "pm6150l.dtsi"
        };
 };
 
+&q6asmdai {
+       dai@0 {
+               reg = <MSM_FRONTEND_DAI_MULTIMEDIA1>;
+       };
+};
+
 &qup_uart1_cts {
        /*
         * Configure a bias-bus-hold on CTS to lower power
        status = "okay";
 };
 
+&sound {
+       compatible = "fairphone,fp4-sndcard";
+       model = "Fairphone 4";
+
+       mm1-dai-link {
+               link-name = "MultiMedia1";
+
+               cpu {
+                       sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
+               };
+       };
+
+       usb-dai-link {
+               link-name = "USB Playback";
+
+               codec {
+                       sound-dai = <&q6usbdai USB_RX>;
+               };
+
+               cpu {
+                       sound-dai = <&q6afedai USB_RX>;
+               };
+
+               platform {
+                       sound-dai = <&q6routing>;
+               };
+       };
+};
+
 &tlmm {
        gpio-reserved-ranges = <13 4>, <56 2>;