linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone
@ 2025-04-25 10:44 Luca Weiss
  2025-04-25 10:44 ` [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property Luca Weiss
                   ` (5 more replies)
  0 siblings, 6 replies; 19+ messages in thread
From: Luca Weiss @ 2025-04-25 10:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound,
	Luca Weiss

Since the series for the USB sound offloading driver was finally merged,
we can add the sm6350 dts and enable it on Fairphone 4.

A few devicetree binding bits have also been missing in that series, so
there's some extra patches for the basics in this series.

Depends on:
- For qcom,sm8250.yaml & sm8250.c:
  https://lore.kernel.org/linux-arm-msm/20250425-fp5-dp-sound-v3-0-7cb45180091b@fairphone.com/T/
- For dts:
  https://lore.kernel.org/linux-arm-msm/20250321-sm6350-apr-v1-1-7805ce7b4dcf@fairphone.com/

Devicetree patches go through qcom

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
Luca Weiss (6):
      dt-bindings: usb: dwc3: Document usb-soc-be property
      ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode
      ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card
      ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible
      arm64: dts: qcom: sm6350: Add q6usbdai node
      arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support

 .../devicetree/bindings/sound/qcom,q6afe.yaml      | 13 ++++++++
 .../devicetree/bindings/sound/qcom,sm8250.yaml     |  1 +
 .../devicetree/bindings/usb/snps,dwc3-common.yaml  |  4 +++
 arch/arm64/boot/dts/qcom/sm6350.dtsi               | 11 +++++++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts  | 37 ++++++++++++++++++++++
 sound/soc/qcom/sm8250.c                            |  1 +
 6 files changed, 67 insertions(+)
---
base-commit: 393d0c54cae31317deaa9043320c5fd9454deabc
change-id: 20250425-fp4-usb-audio-offload-e5d7fb55d283
prerequisite-change-id: 20250321-sm6350-apr-15f3e7e4e5ca:v1
prerequisite-patch-id: 69859554c94de52068406dab0d2869ca26072c78
prerequisite-change-id: 20240809-fp5-dp-sound-b3768f3019bd:v3
prerequisite-patch-id: 2d8997a2be02cfddf3a054c79e7eb308a6d06710
prerequisite-patch-id: 1b7c8f00ab50ae71c0221868578b9c1dfe939e4d
prerequisite-patch-id: 4fd0673c4d35c1fefce63ec5785ff5ea67cc3d3a
prerequisite-patch-id: f5ec3a893de19900f62dc691d83986f1104914b0
prerequisite-patch-id: fce7573c39e768f7a09c002064b6159b8e91161a

Best regards,
-- 
Luca Weiss <luca.weiss@fairphone.com>


^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property
  2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
@ 2025-04-25 10:44 ` Luca Weiss
  2025-04-25 21:39   ` Wesley Cheng
  2025-04-25 10:44 ` [PATCH 2/6] ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode Luca Weiss
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Luca Weiss @ 2025-04-25 10:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound,
	Luca Weiss

The property usb-soc-be is used by the new SoC USB layer which is used
for USB audio offloading on Qualcomm SoCs.

Cc: Wesley Cheng <quic_wcheng@quicinc.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
index 6c0b8b6538246adf746fe7ccd6df936131c61444..07549dec0f74234465fa9b6ab21871762a2f5127 100644
--- a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
+++ b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
@@ -38,6 +38,10 @@ properties:
       - description: USB2/HS PHY
       - description: USB3/SS PHY
 
+  usb-soc-be:
+    $ref: /schemas/types.yaml#/definitions/phandle
+    description: Link to the USB SoC sound backend
+
   phys:
     minItems: 1
     maxItems: 19

-- 
2.49.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 2/6] ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode
  2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
  2025-04-25 10:44 ` [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property Luca Weiss
@ 2025-04-25 10:44 ` Luca Weiss
  2025-04-25 10:44 ` [PATCH 3/6] ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card Luca Weiss
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 19+ messages in thread
From: Luca Weiss @ 2025-04-25 10:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound,
	Luca Weiss

Document the subnode for Q6USB, used for USB audio offloading.

Cc: Wesley Cheng <quic_wcheng@quicinc.com>
Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 Documentation/devicetree/bindings/sound/qcom,q6afe.yaml | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,q6afe.yaml b/Documentation/devicetree/bindings/sound/qcom,q6afe.yaml
index 297aa362aa54ab41a956b3ceda73d4c7027d72a7..268f7073d7972da2ef46d36264c0f7d8f648071b 100644
--- a/Documentation/devicetree/bindings/sound/qcom,q6afe.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,q6afe.yaml
@@ -29,6 +29,12 @@ properties:
     unevaluatedProperties: false
     description: Qualcomm DSP audio ports
 
+  usbd:
+    type: object
+    $ref: /schemas/sound/qcom,q6usb.yaml#
+    unevaluatedProperties: false
+    description: Qualcomm DSP USB audio ports
+
 required:
   - compatible
   - dais
@@ -64,5 +70,12 @@ examples:
                     qcom,sd-lines = <0 1 2 3>;
                 };
             };
+
+            usbd {
+                compatible = "qcom,q6usb";
+                #sound-dai-cells = <1>;
+                iommus = <&apps_smmu 0x180f 0x0>;
+                qcom,usb-audio-intr-idx = /bits/ 16 <2>;
+            };
         };
     };

-- 
2.49.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 3/6] ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card
  2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
  2025-04-25 10:44 ` [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property Luca Weiss
  2025-04-25 10:44 ` [PATCH 2/6] ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode Luca Weiss
@ 2025-04-25 10:44 ` Luca Weiss
  2025-04-28  8:31   ` Krzysztof Kozlowski
  2025-04-25 10:44 ` [PATCH 4/6] ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible Luca Weiss
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 19+ messages in thread
From: Luca Weiss @ 2025-04-25 10:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound,
	Luca Weiss

Document the bindings for the sound card on Fairphone 4 which uses the
older non-audioreach audio architecture.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
index 57f62a228c262f38e703816efdcf443355052619..6f82e5cf6df30e021692015df9ad7b09d4b2c7c6 100644
--- a/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
+++ b/Documentation/devicetree/bindings/sound/qcom,sm8250.yaml
@@ -28,6 +28,7 @@ properties:
               - qcom,sm8750-sndcard
           - const: qcom,sm8450-sndcard
       - enum:
+          - fairphone,fp4-sndcard
           - fairphone,fp5-sndcard
           - qcom,apq8096-sndcard
           - qcom,qcm6490-idp-sndcard

-- 
2.49.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 4/6] ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible
  2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
                   ` (2 preceding siblings ...)
  2025-04-25 10:44 ` [PATCH 3/6] ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card Luca Weiss
@ 2025-04-25 10:44 ` Luca Weiss
  2025-04-25 19:02   ` Dmitry Baryshkov
  2025-04-25 10:44 ` [PATCH 5/6] arm64: dts: qcom: sm6350: Add q6usbdai node Luca Weiss
  2025-04-25 10:44 ` [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support Luca Weiss
  5 siblings, 1 reply; 19+ messages in thread
From: Luca Weiss @ 2025-04-25 10:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound,
	Luca Weiss

Add a compatible for the SM7225-based Fairphone 4 which can use this
machine driver.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 sound/soc/qcom/sm8250.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/qcom/sm8250.c b/sound/soc/qcom/sm8250.c
index 43c93e24d77259f232062c7e4182a39151111c59..0025c8957abddf54d0aab6eb68acc79f031917f9 100644
--- a/sound/soc/qcom/sm8250.c
+++ b/sound/soc/qcom/sm8250.c
@@ -208,6 +208,7 @@ static int sm8250_platform_probe(struct platform_device *pdev)
 }
 
 static const struct of_device_id snd_sm8250_dt_match[] = {
+	{ .compatible = "fairphone,fp4-sndcard", .data = "sm7225" },
 	{ .compatible = "fairphone,fp5-sndcard", .data = "qcm6490" },
 	{ .compatible = "qcom,qrb4210-rb2-sndcard", .data = "sm8250" },
 	{ .compatible = "qcom,qrb5165-rb5-sndcard", .data = "sm8250" },

-- 
2.49.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 5/6] arm64: dts: qcom: sm6350: Add q6usbdai node
  2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
                   ` (3 preceding siblings ...)
  2025-04-25 10:44 ` [PATCH 4/6] ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible Luca Weiss
@ 2025-04-25 10:44 ` Luca Weiss
  2025-04-25 19:03   ` Dmitry Baryshkov
  2025-04-25 10:44 ` [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support Luca Weiss
  5 siblings, 1 reply; 19+ messages in thread
From: Luca Weiss @ 2025-04-25 10:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound,
	Luca Weiss

Add a node for q6usb which handles USB audio offloading, allowing to
play audio via a USB-C headset with lower power consumption and enabling
some other features.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 375f964e793626115609996aa25ea4e0fefe6c5e..9a1b9f02282a0cf2e39bf2ade21989dbf4362bc1 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -1351,6 +1351,13 @@ q6afecc: clock-controller {
 							compatible = "qcom,q6afe-clocks";
 							#clock-cells = <2>;
 						};
+
+						q6usbdai: usbd {
+							compatible = "qcom,q6usb";
+							iommus = <&apps_smmu 0x100f 0x0>;
+							#sound-dai-cells = <1>;
+							qcom,usb-audio-intr-idx = /bits/ 16 <2>;
+						};
 					};
 
 					q6asm: service@7 {
@@ -1988,6 +1995,7 @@ usb_1_dwc3: usb@a600000 {
 				snps,dis-u2-entry-quirk;
 				phys = <&usb_1_hsphy>, <&usb_1_qmpphy QMP_USB43DP_USB3_PHY>;
 				phy-names = "usb2-phy", "usb3-phy";
+				usb-soc-be = <&q6usbdai>;
 				usb-role-switch;
 
 				ports {

-- 
2.49.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
                   ` (4 preceding siblings ...)
  2025-04-25 10:44 ` [PATCH 5/6] arm64: dts: qcom: sm6350: Add q6usbdai node Luca Weiss
@ 2025-04-25 10:44 ` Luca Weiss
  2025-04-25 19:04   ` Dmitry Baryshkov
  2025-04-25 21:06   ` Konrad Dybcio
  5 siblings, 2 replies; 19+ messages in thread
From: Luca Weiss @ 2025-04-25 10:44 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound,
	Luca Weiss

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 interrupts should
appear on the xhci-hcd interrupts during playback, instead the ADSP will
be handling the playback.

Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
---
 arch/arm64/boot/dts/qcom/sm6350.dtsi              |  3 ++
 arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 37 +++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sm6350.dtsi b/arch/arm64/boot/dts/qcom/sm6350.dtsi
index 9a1b9f02282a0cf2e39bf2ade21989dbf4362bc1..ade69296cbc99eab3ee6dc020f2064d102a3b115 100644
--- a/arch/arm64/boot/dts/qcom/sm6350.dtsi
+++ b/arch/arm64/boot/dts/qcom/sm6350.dtsi
@@ -2956,6 +2956,9 @@ wifi: wifi@18800000 {
 		};
 	};
 
+	sound: sound {
+	};
+
 	thermal-zones {
 		aoss0-thermal {
 			thermal-sensors = <&tsens0 0>;
diff --git a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
index 71e87ab929551b339216a5fa583833ed8661a606..0f8e0a988db0d32384f39537731c77344ec50cf2 100644
--- a/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
+++ b/arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts
@@ -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"
@@ -955,6 +956,12 @@ channel@644 {
 	};
 };
 
+&q6asmdai {
+	dai@0 {
+		reg = <MSM_FRONTEND_DAI_MULTIMEDIA1>;
+	};
+};
+
 &qup_uart1_cts {
 	/*
 	 * Configure a bias-bus-hold on CTS to lower power
@@ -1023,6 +1030,35 @@ &sdhc_2 {
 	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";
+
+		cpu {
+			sound-dai = <&q6afedai USB_RX>;
+		};
+
+		codec {
+			sound-dai = <&q6usbdai USB_RX>;
+		};
+
+		platform {
+			sound-dai = <&q6routing>;
+		};
+	};
+};
+
 &tlmm {
 	gpio-reserved-ranges = <13 4>, <56 2>;
 
@@ -1178,6 +1214,7 @@ &usb_1 {
 &usb_1_dwc3 {
 	maximum-speed = "super-speed";
 	dr_mode = "otg";
+	num-hc-interrupters = /bits/ 16 <3>;
 };
 
 &usb_1_dwc3_hs_out {

-- 
2.49.0


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH 4/6] ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible
  2025-04-25 10:44 ` [PATCH 4/6] ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible Luca Weiss
@ 2025-04-25 19:02   ` Dmitry Baryshkov
  0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-04-25 19:02 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold,
	~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On Fri, Apr 25, 2025 at 12:44:54PM +0200, Luca Weiss wrote:
> Add a compatible for the SM7225-based Fairphone 4 which can use this
> machine driver.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  sound/soc/qcom/sm8250.c | 1 +
>  1 file changed, 1 insertion(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 5/6] arm64: dts: qcom: sm6350: Add q6usbdai node
  2025-04-25 10:44 ` [PATCH 5/6] arm64: dts: qcom: sm6350: Add q6usbdai node Luca Weiss
@ 2025-04-25 19:03   ` Dmitry Baryshkov
  0 siblings, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-04-25 19:03 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold,
	~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On Fri, Apr 25, 2025 at 12:44:55PM +0200, Luca Weiss wrote:
> Add a node for q6usb which handles USB audio offloading, allowing to
> play audio via a USB-C headset with lower power consumption and enabling
> some other features.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  arch/arm64/boot/dts/qcom/sm6350.dtsi | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-25 10:44 ` [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support Luca Weiss
@ 2025-04-25 19:04   ` Dmitry Baryshkov
  2025-04-25 21:06   ` Konrad Dybcio
  1 sibling, 0 replies; 19+ messages in thread
From: Dmitry Baryshkov @ 2025-04-25 19:04 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold,
	~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On Fri, Apr 25, 2025 at 12:44:56PM +0200, Luca Weiss wrote:
> 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 interrupts should
> appear on the xhci-hcd interrupts during playback, instead the ADSP will
> be handling the playback.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  arch/arm64/boot/dts/qcom/sm6350.dtsi              |  3 ++
>  arch/arm64/boot/dts/qcom/sm7225-fairphone-fp4.dts | 37 +++++++++++++++++++++++
>  2 files changed, 40 insertions(+)
> 

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>

-- 
With best wishes
Dmitry

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-25 10:44 ` [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support Luca Weiss
  2025-04-25 19:04   ` Dmitry Baryshkov
@ 2025-04-25 21:06   ` Konrad Dybcio
  2025-04-28  7:41     ` Luca Weiss
  1 sibling, 1 reply; 19+ messages in thread
From: Konrad Dybcio @ 2025-04-25 21:06 UTC (permalink / raw)
  To: Luca Weiss, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On 4/25/25 12:44 PM, Luca Weiss wrote:
> 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 interrupts should
> appear on the xhci-hcd interrupts during playback, instead the ADSP will
> be handling the playback.

"should" isn't very optimistic - I assume this works for you? > 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
[...]

> +&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";
> +
> +		cpu {
> +			sound-dai = <&q6afedai USB_RX>;
> +		};
> +
> +		codec {
> +			sound-dai = <&q6usbdai USB_RX>;
> +		};

'co'dec < 'cp'u> +
> +		platform {
> +			sound-dai = <&q6routing>;
> +		};
> +	};
> +};
> +
>  &tlmm {
>  	gpio-reserved-ranges = <13 4>, <56 2>;
>  
> @@ -1178,6 +1214,7 @@ &usb_1 {
>  &usb_1_dwc3 {
>  	maximum-speed = "super-speed";
>  	dr_mode = "otg";
> +	num-hc-interrupters = /bits/ 16 <3>;
Where does this number come from?

Konrad

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property
  2025-04-25 10:44 ` [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property Luca Weiss
@ 2025-04-25 21:39   ` Wesley Cheng
  2025-04-28  7:34     ` Luca Weiss
  0 siblings, 1 reply; 19+ messages in thread
From: Wesley Cheng @ 2025-04-25 21:39 UTC (permalink / raw)
  To: Luca Weiss, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound



On 4/25/2025 3:44 AM, Luca Weiss wrote:
> The property usb-soc-be is used by the new SoC USB layer which is used
> for USB audio offloading on Qualcomm SoCs.

Hi Luca,

This property can be dropped now, as in the latest revision I added
utilizing the auxiliary device/bus now between the Q6USB backend DAI and
the vendor USB offload driver.  Reduces the need to add more properties.

Thanks
Wesley Cheng

> 
> Cc: Wesley Cheng <quic_wcheng@quicinc.com>
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
> index 6c0b8b6538246adf746fe7ccd6df936131c61444..07549dec0f74234465fa9b6ab21871762a2f5127 100644
> --- a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
> @@ -38,6 +38,10 @@ properties:
>        - description: USB2/HS PHY
>        - description: USB3/SS PHY
>  
> +  usb-soc-be:
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +    description: Link to the USB SoC sound backend
> +
>    phys:
>      minItems: 1
>      maxItems: 19
> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property
  2025-04-25 21:39   ` Wesley Cheng
@ 2025-04-28  7:34     ` Luca Weiss
  0 siblings, 0 replies; 19+ messages in thread
From: Luca Weiss @ 2025-04-28  7:34 UTC (permalink / raw)
  To: Wesley Cheng, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Felipe Balbi,
	Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On Fri Apr 25, 2025 at 11:39 PM CEST, Wesley Cheng wrote:
>
>
> On 4/25/2025 3:44 AM, Luca Weiss wrote:
>> The property usb-soc-be is used by the new SoC USB layer which is used
>> for USB audio offloading on Qualcomm SoCs.
>
> Hi Luca,
>
> This property can be dropped now, as in the latest revision I added
> utilizing the auxiliary device/bus now between the Q6USB backend DAI and
> the vendor USB offload driver.  Reduces the need to add more properties.

Great, thanks for letting me know! Will remove it in v2.

I see the code in sound/soc/soc-usb.c is still parsing 'usb-soc-be', is
that now kept for other use cases or should that be removed as well?

Regards
Luca

>
> Thanks
> Wesley Cheng
>
>> 
>> Cc: Wesley Cheng <quic_wcheng@quicinc.com>
>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>> ---
>>  Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml | 4 ++++
>>  1 file changed, 4 insertions(+)
>> 
>> diff --git a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
>> index 6c0b8b6538246adf746fe7ccd6df936131c61444..07549dec0f74234465fa9b6ab21871762a2f5127 100644
>> --- a/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
>> +++ b/Documentation/devicetree/bindings/usb/snps,dwc3-common.yaml
>> @@ -38,6 +38,10 @@ properties:
>>        - description: USB2/HS PHY
>>        - description: USB3/SS PHY
>>  
>> +  usb-soc-be:
>> +    $ref: /schemas/types.yaml#/definitions/phandle
>> +    description: Link to the USB SoC sound backend
>> +
>>    phys:
>>      minItems: 1
>>      maxItems: 19
>> 


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-25 21:06   ` Konrad Dybcio
@ 2025-04-28  7:41     ` Luca Weiss
  2025-04-28 21:20       ` Konrad Dybcio
  2025-04-28 21:43       ` Konrad Dybcio
  0 siblings, 2 replies; 19+ messages in thread
From: Luca Weiss @ 2025-04-28  7:41 UTC (permalink / raw)
  To: Konrad Dybcio, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Felipe Balbi,
	Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio, Wesley Cheng,
	Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On Fri Apr 25, 2025 at 11:06 PM CEST, Konrad Dybcio wrote:
> On 4/25/25 12:44 PM, Luca Weiss wrote:
>> 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 interrupts should
>> appear on the xhci-hcd interrupts during playback, instead the ADSP will
>> be handling the playback.
>
> "should" isn't very optimistic - I assume this works for you? > 

Yes it does!

With 'should' I meant to describe the expected behavior from using this
since most people are probably not familiar with how this works.

>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>> ---
> [...]
>
>> +&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";
>> +
>> +		cpu {
>> +			sound-dai = <&q6afedai USB_RX>;
>> +		};
>> +
>> +		codec {
>> +			sound-dai = <&q6usbdai USB_RX>;
>> +		};
>
> 'co'dec < 'cp'u> +

Aah, I thought I checked for that already. Will fix.

>> +		platform {
>> +			sound-dai = <&q6routing>;
>> +		};
>> +	};
>> +};
>> +
>>  &tlmm {
>>  	gpio-reserved-ranges = <13 4>, <56 2>;
>>  
>> @@ -1178,6 +1214,7 @@ &usb_1 {
>>  &usb_1_dwc3 {
>>  	maximum-speed = "super-speed";
>>  	dr_mode = "otg";
>> +	num-hc-interrupters = /bits/ 16 <3>;
> Where does this number come from?

I'm honestly not 100% sure. As far as I understand it, with
'qcom,usb-audio-intr-idx = /bits/ 16 <2>;' in the qcom,q6usb node (which
I've checked against downstream) we declare which "XHCI interrupter
number to use". Without the num-hc-interrupters property we get an error
that not enough interrupters are available (I assume only 1 is then), so
this value practically needs to be higher than the <2> from earlier.

Why it's this value and not a higher value e.g. 4 I'm not really sure.
Downstream code looks somewhat different and "max_interrupters" in
drivers/usb/ doesn't come from a dt property. I'd need to check more in
details what this code does - or maybe Wesley can help.

Regards
Luca

>
> Konrad


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 3/6] ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card
  2025-04-25 10:44 ` [PATCH 3/6] ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card Luca Weiss
@ 2025-04-28  8:31   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 19+ messages in thread
From: Krzysztof Kozlowski @ 2025-04-28  8:31 UTC (permalink / raw)
  To: Luca Weiss
  Cc: Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold,
	~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, linux-arm-msm, linux-sound

On Fri, Apr 25, 2025 at 12:44:53PM GMT, Luca Weiss wrote:
> Document the bindings for the sound card on Fairphone 4 which uses the
> older non-audioreach audio architecture.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  Documentation/devicetree/bindings/sound/qcom,sm8250.yaml | 1 +
>  1 file changed, 1 insertion(+)

Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-28  7:41     ` Luca Weiss
@ 2025-04-28 21:20       ` Konrad Dybcio
  2025-04-28 21:43       ` Konrad Dybcio
  1 sibling, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2025-04-28 21:20 UTC (permalink / raw)
  To: Luca Weiss, Konrad Dybcio, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Felipe Balbi,
	Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio, Wesley Cheng,
	Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On 4/28/25 9:41 AM, Luca Weiss wrote:
> On Fri Apr 25, 2025 at 11:06 PM CEST, Konrad Dybcio wrote:
>> On 4/25/25 12:44 PM, Luca Weiss wrote:
>>> 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 interrupts should
>>> appear on the xhci-hcd interrupts during playback, instead the ADSP will
>>> be handling the playback.
>>
>> "should" isn't very optimistic - I assume this works for you? > 
> 
> Yes it does!
> 
> With 'should' I meant to describe the expected behavior from using this
> since most people are probably not familiar with how this works.

ah, ok!

Konrad

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-28  7:41     ` Luca Weiss
  2025-04-28 21:20       ` Konrad Dybcio
@ 2025-04-28 21:43       ` Konrad Dybcio
  2025-04-29  8:55         ` Luca Weiss
  1 sibling, 1 reply; 19+ messages in thread
From: Konrad Dybcio @ 2025-04-28 21:43 UTC (permalink / raw)
  To: Luca Weiss, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On 4/28/25 9:41 AM, Luca Weiss wrote:
> On Fri Apr 25, 2025 at 11:06 PM CEST, Konrad Dybcio wrote:
>> On 4/25/25 12:44 PM, Luca Weiss wrote:
>>> 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 interrupts should
>>> appear on the xhci-hcd interrupts during playback, instead the ADSP will
>>> be handling the playback.
>>
>> "should" isn't very optimistic - I assume this works for you? > 
> 
> Yes it does!
> 
> With 'should' I meant to describe the expected behavior from using this
> since most people are probably not familiar with how this works.
> 
>>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>>> ---

[...]

>>>  &usb_1_dwc3 {
>>>  	maximum-speed = "super-speed";
>>>  	dr_mode = "otg";
>>> +	num-hc-interrupters = /bits/ 16 <3>;
>> Where does this number come from?
> 
> I'm honestly not 100% sure. As far as I understand it, with
> 'qcom,usb-audio-intr-idx = /bits/ 16 <2>;' in the qcom,q6usb node (which
> I've checked against downstream) we declare which "XHCI interrupter
> number to use". Without the num-hc-interrupters property we get an error
> that not enough interrupters are available (I assume only 1 is then), so
> this value practically needs to be higher than the <2> from earlier.
> 
> Why it's this value and not a higher value e.g. 4 I'm not really sure.
> Downstream code looks somewhat different and "max_interrupters" in
> drivers/usb/ doesn't come from a dt property. I'd need to check more in
> details what this code does - or maybe Wesley can help.

I got word that it's simply hw specific - please move it over to the
soc dt with the value of 3

Konrad

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-28 21:43       ` Konrad Dybcio
@ 2025-04-29  8:55         ` Luca Weiss
  2025-04-29  9:00           ` Konrad Dybcio
  0 siblings, 1 reply; 19+ messages in thread
From: Luca Weiss @ 2025-04-29  8:55 UTC (permalink / raw)
  To: Konrad Dybcio, Greg Kroah-Hartman, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Felipe Balbi,
	Srinivas Kandagatla, Liam Girdwood, Mark Brown, Jaroslav Kysela,
	Takashi Iwai, Bjorn Andersson, Konrad Dybcio, Wesley Cheng,
	Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On Mon Apr 28, 2025 at 11:43 PM CEST, Konrad Dybcio wrote:
> On 4/28/25 9:41 AM, Luca Weiss wrote:
>> On Fri Apr 25, 2025 at 11:06 PM CEST, Konrad Dybcio wrote:
>>> On 4/25/25 12:44 PM, Luca Weiss wrote:
>>>> 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 interrupts should
>>>> appear on the xhci-hcd interrupts during playback, instead the ADSP will
>>>> be handling the playback.
>>>
>>> "should" isn't very optimistic - I assume this works for you? > 
>> 
>> Yes it does!
>> 
>> With 'should' I meant to describe the expected behavior from using this
>> since most people are probably not familiar with how this works.
>> 
>>>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>>>> ---
>
> [...]
>
>>>>  &usb_1_dwc3 {
>>>>  	maximum-speed = "super-speed";
>>>>  	dr_mode = "otg";
>>>> +	num-hc-interrupters = /bits/ 16 <3>;
>>> Where does this number come from?
>> 
>> I'm honestly not 100% sure. As far as I understand it, with
>> 'qcom,usb-audio-intr-idx = /bits/ 16 <2>;' in the qcom,q6usb node (which
>> I've checked against downstream) we declare which "XHCI interrupter
>> number to use". Without the num-hc-interrupters property we get an error
>> that not enough interrupters are available (I assume only 1 is then), so
>> this value practically needs to be higher than the <2> from earlier.
>> 
>> Why it's this value and not a higher value e.g. 4 I'm not really sure.
>> Downstream code looks somewhat different and "max_interrupters" in
>> drivers/usb/ doesn't come from a dt property. I'd need to check more in
>> details what this code does - or maybe Wesley can help.
>
> I got word that it's simply hw specific - please move it over to the
> soc dt with the value of 3

Will do, thanks for checking!

Would you have a reference how to get the correct value for it based on
downstream or the running kernel on the hw?

Regards
Luca

>
> Konrad


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support
  2025-04-29  8:55         ` Luca Weiss
@ 2025-04-29  9:00           ` Konrad Dybcio
  0 siblings, 0 replies; 19+ messages in thread
From: Konrad Dybcio @ 2025-04-29  9:00 UTC (permalink / raw)
  To: Luca Weiss, Greg Kroah-Hartman, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Felipe Balbi, Srinivas Kandagatla, Liam Girdwood,
	Mark Brown, Jaroslav Kysela, Takashi Iwai, Bjorn Andersson,
	Konrad Dybcio, Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-usb, devicetree,
	linux-kernel, Krzysztof Kozlowski, linux-arm-msm, linux-sound

On 4/29/25 10:55 AM, Luca Weiss wrote:
> On Mon Apr 28, 2025 at 11:43 PM CEST, Konrad Dybcio wrote:
>> On 4/28/25 9:41 AM, Luca Weiss wrote:
>>> On Fri Apr 25, 2025 at 11:06 PM CEST, Konrad Dybcio wrote:
>>>> On 4/25/25 12:44 PM, Luca Weiss wrote:
>>>>> 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 interrupts should
>>>>> appear on the xhci-hcd interrupts during playback, instead the ADSP will
>>>>> be handling the playback.
>>>>
>>>> "should" isn't very optimistic - I assume this works for you? > 
>>>
>>> Yes it does!
>>>
>>> With 'should' I meant to describe the expected behavior from using this
>>> since most people are probably not familiar with how this works.
>>>
>>>>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>>>>> ---
>>
>> [...]
>>
>>>>>  &usb_1_dwc3 {
>>>>>  	maximum-speed = "super-speed";
>>>>>  	dr_mode = "otg";
>>>>> +	num-hc-interrupters = /bits/ 16 <3>;
>>>> Where does this number come from?
>>>
>>> I'm honestly not 100% sure. As far as I understand it, with
>>> 'qcom,usb-audio-intr-idx = /bits/ 16 <2>;' in the qcom,q6usb node (which
>>> I've checked against downstream) we declare which "XHCI interrupter
>>> number to use". Without the num-hc-interrupters property we get an error
>>> that not enough interrupters are available (I assume only 1 is then), so
>>> this value practically needs to be higher than the <2> from earlier.
>>>
>>> Why it's this value and not a higher value e.g. 4 I'm not really sure.
>>> Downstream code looks somewhat different and "max_interrupters" in
>>> drivers/usb/ doesn't come from a dt property. I'd need to check more in
>>> details what this code does - or maybe Wesley can help.
>>
>> I got word that it's simply hw specific - please move it over to the
>> soc dt with the value of 3
> 
> Will do, thanks for checking!
> 
> Would you have a reference how to get the correct value for it based on
> downstream or the running kernel on the hw?

3 should be reasonable for most platforms, but I don't think there's
a clear value defined downstream

Konrad

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-04-29  9:00 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-25 10:44 [PATCH 0/6] Enable USB audio offloading on Fairphone 4 smartphone Luca Weiss
2025-04-25 10:44 ` [PATCH 1/6] dt-bindings: usb: dwc3: Document usb-soc-be property Luca Weiss
2025-04-25 21:39   ` Wesley Cheng
2025-04-28  7:34     ` Luca Weiss
2025-04-25 10:44 ` [PATCH 2/6] ASoC: dt-bindings: qcom,q6afe: Document q6usb subnode Luca Weiss
2025-04-25 10:44 ` [PATCH 3/6] ASoC: dt-bindings: qcom,sm8250: Add Fairphone 4 sound card Luca Weiss
2025-04-28  8:31   ` Krzysztof Kozlowski
2025-04-25 10:44 ` [PATCH 4/6] ASoC: qcom: sm8250: Add Fairphone 4 soundcard compatible Luca Weiss
2025-04-25 19:02   ` Dmitry Baryshkov
2025-04-25 10:44 ` [PATCH 5/6] arm64: dts: qcom: sm6350: Add q6usbdai node Luca Weiss
2025-04-25 19:03   ` Dmitry Baryshkov
2025-04-25 10:44 ` [PATCH 6/6] arm64: dts: qcom: sm7225-fairphone-fp4: Enable USB audio offload support Luca Weiss
2025-04-25 19:04   ` Dmitry Baryshkov
2025-04-25 21:06   ` Konrad Dybcio
2025-04-28  7:41     ` Luca Weiss
2025-04-28 21:20       ` Konrad Dybcio
2025-04-28 21:43       ` Konrad Dybcio
2025-04-29  8:55         ` Luca Weiss
2025-04-29  9:00           ` Konrad Dybcio

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).