phone-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] Enable USB audio offloading on Fairphone 5
@ 2025-08-01 13:51 Luca Weiss
  2025-08-01 13:51 ` [PATCH 1/2] arm64: dts: qcom: sc7280: Add q6usbdai node Luca Weiss
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Luca Weiss @ 2025-08-01 13:51 UTC (permalink / raw)
  To: cros-qcom-dts-watchers, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, devicetree,
	linux-kernel, Luca Weiss

Similar to Fairphone 4, we can enable USB audio offloading quite easily
on the QCM6490-based Fairphone 5 smartphone.

This allows 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>
---
Luca Weiss (2):
      arm64: dts: qcom: sc7280: Add q6usbdai node
      arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support

 arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 16 ++++++++++++++++
 arch/arm64/boot/dts/qcom/sc7280.dtsi               |  8 ++++++++
 2 files changed, 24 insertions(+)
---
base-commit: 0b90c3b6d76ea512dc3dac8fb30215e175b0019a
change-id: 20250801-fp5-usb-audio-offload-2a9058e19e1d

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


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

* [PATCH 1/2] arm64: dts: qcom: sc7280: Add q6usbdai node
  2025-08-01 13:51 [PATCH 0/2] Enable USB audio offloading on Fairphone 5 Luca Weiss
@ 2025-08-01 13:51 ` Luca Weiss
  2025-08-01 14:02   ` Konrad Dybcio
  2025-08-01 13:51 ` [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support Luca Weiss
  2025-08-11 18:40 ` [PATCH 0/2] Enable USB audio offloading on Fairphone 5 Bjorn Andersson
  2 siblings, 1 reply; 7+ messages in thread
From: Luca Weiss @ 2025-08-01 13:51 UTC (permalink / raw)
  To: cros-qcom-dts-watchers, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, devicetree,
	linux-kernel, 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.

We also need to set num-hc-interrupters for the dwc3 for the q6usb to be
able to use its sideband interrupter.

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

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index 64a2abd3010018e94eb50c534a509d6b4cf2473b..c019f58d2f438f23b4be2e879ecd78850e3df1ef 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -3862,6 +3862,13 @@ q6afecc: clock-controller {
 							compatible = "qcom,q6afe-clocks";
 							#clock-cells = <2>;
 						};
+
+						q6usbdai: usbd {
+							compatible = "qcom,q6usb";
+							iommus = <&apps_smmu 0x180f 0x0>;
+							#sound-dai-cells = <1>;
+							qcom,usb-audio-intr-idx = /bits/ 16 <2>;
+						};
 					};
 
 					q6asm: service@7 {
@@ -4303,6 +4310,7 @@ usb_1_dwc3: usb@a600000 {
 				reg = <0 0x0a600000 0 0xe000>;
 				interrupts = <GIC_SPI 133 IRQ_TYPE_LEVEL_HIGH>;
 				iommus = <&apps_smmu 0xe0 0x0>;
+				num-hc-interrupters = /bits/ 16 <3>;
 				snps,dis_u2_susphy_quirk;
 				snps,dis_enblslpm_quirk;
 				snps,parkmode-disable-ss-quirk;

-- 
2.50.1


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

* [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support
  2025-08-01 13:51 [PATCH 0/2] Enable USB audio offloading on Fairphone 5 Luca Weiss
  2025-08-01 13:51 ` [PATCH 1/2] arm64: dts: qcom: sc7280: Add q6usbdai node Luca Weiss
@ 2025-08-01 13:51 ` Luca Weiss
  2025-08-01 14:03   ` Konrad Dybcio
  2025-08-11 18:40 ` [PATCH 0/2] Enable USB audio offloading on Fairphone 5 Bjorn Andersson
  2 siblings, 1 reply; 7+ messages in thread
From: Luca Weiss @ 2025-08-01 13:51 UTC (permalink / raw)
  To: cros-qcom-dts-watchers, Bjorn Andersson, Konrad Dybcio,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, Wesley Cheng,
	Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, devicetree,
	linux-kernel, 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 xhci-hcd
interrupts appear during playback, instead the ADSP will be handling the
USB transfers.

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

diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index e115b6a52b299ef663ccfb614785f8f89091f39d..d30912f952db271aa4fbc2570ca04b771ffef3ca 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -1176,6 +1176,22 @@ platform {
 			sound-dai = <&q6routing>;
 		};
 	};
+
+	usb-dai-link {
+		link-name = "USB Playback";
+
+		codec {
+			sound-dai = <&q6usbdai USB_RX>;
+		};
+
+		cpu {
+			sound-dai = <&q6afedai USB_RX>;
+		};
+
+		platform {
+			sound-dai = <&q6routing>;
+		};
+	};
 };
 
 &spi13 {

-- 
2.50.1


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

* Re: [PATCH 1/2] arm64: dts: qcom: sc7280: Add q6usbdai node
  2025-08-01 13:51 ` [PATCH 1/2] arm64: dts: qcom: sc7280: Add q6usbdai node Luca Weiss
@ 2025-08-01 14:02   ` Konrad Dybcio
  0 siblings, 0 replies; 7+ messages in thread
From: Konrad Dybcio @ 2025-08-01 14:02 UTC (permalink / raw)
  To: Luca Weiss, cros-qcom-dts-watchers, Bjorn Andersson,
	Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, devicetree,
	linux-kernel

On 8/1/25 3:51 PM, 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.
> 
> We also need to set num-hc-interrupters for the dwc3 for the q6usb to be
> able to use its sideband interrupter.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support
  2025-08-01 13:51 ` [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support Luca Weiss
@ 2025-08-01 14:03   ` Konrad Dybcio
  2025-08-01 14:07     ` Luca Weiss
  0 siblings, 1 reply; 7+ messages in thread
From: Konrad Dybcio @ 2025-08-01 14:03 UTC (permalink / raw)
  To: Luca Weiss, cros-qcom-dts-watchers, Bjorn Andersson,
	Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, devicetree,
	linux-kernel

On 8/1/25 3:51 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 xhci-hcd
> interrupts appear during playback, instead the ADSP will be handling the
> USB transfers.
> 
> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
> ---
>  arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> index e115b6a52b299ef663ccfb614785f8f89091f39d..d30912f952db271aa4fbc2570ca04b771ffef3ca 100644
> --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> @@ -1176,6 +1176,22 @@ platform {
>  			sound-dai = <&q6routing>;
>  		};
>  	};
> +
> +	usb-dai-link {
> +		link-name = "USB Playback";
> +
> +		codec {
> +			sound-dai = <&q6usbdai USB_RX>;
> +		};
> +
> +		cpu {
> +			sound-dai = <&q6afedai USB_RX>;
> +		};
> +
> +		platform {
> +			sound-dai = <&q6routing>;
> +		};

Because this is SoC component <-> SoC component mapping, this could live
in the SoC dtsi.. but then 7280 is a glorious mess with the firmware
flavors, so I suppose it should stay here..

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Konrad

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

* Re: [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support
  2025-08-01 14:03   ` Konrad Dybcio
@ 2025-08-01 14:07     ` Luca Weiss
  0 siblings, 0 replies; 7+ messages in thread
From: Luca Weiss @ 2025-08-01 14:07 UTC (permalink / raw)
  To: Konrad Dybcio, cros-qcom-dts-watchers, Bjorn Andersson,
	Konrad Dybcio, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Wesley Cheng, Stephan Gerhold
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, devicetree,
	linux-kernel

On Fri Aug 1, 2025 at 4:03 PM CEST, Konrad Dybcio wrote:
> On 8/1/25 3:51 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 xhci-hcd
>> interrupts appear during playback, instead the ADSP will be handling the
>> USB transfers.
>> 
>> Signed-off-by: Luca Weiss <luca.weiss@fairphone.com>
>> ---
>>  arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 16 ++++++++++++++++
>>  1 file changed, 16 insertions(+)
>> 
>> diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
>> index e115b6a52b299ef663ccfb614785f8f89091f39d..d30912f952db271aa4fbc2570ca04b771ffef3ca 100644
>> --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
>> +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
>> @@ -1176,6 +1176,22 @@ platform {
>>  			sound-dai = <&q6routing>;
>>  		};
>>  	};
>> +
>> +	usb-dai-link {
>> +		link-name = "USB Playback";
>> +
>> +		codec {
>> +			sound-dai = <&q6usbdai USB_RX>;
>> +		};
>> +
>> +		cpu {
>> +			sound-dai = <&q6afedai USB_RX>;
>> +		};
>> +
>> +		platform {
>> +			sound-dai = <&q6routing>;
>> +		};
>
> Because this is SoC component <-> SoC component mapping, this could live
> in the SoC dtsi.. but then 7280 is a glorious mess with the firmware
> flavors, so I suppose it should stay here..

q6afe definitely doesn't exist on the RB3Gen2 for example with
AudioReach, so yeah... I guess also the sound setup on other (simpler)
platforms can be simplified quite a bit, but it's (unfortunately) not
yet a major concern given the limited number of boards with good and
complete audio support.

>
> Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>

Thanks!

Regards
Luca

>
> Konrad


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

* Re: [PATCH 0/2] Enable USB audio offloading on Fairphone 5
  2025-08-01 13:51 [PATCH 0/2] Enable USB audio offloading on Fairphone 5 Luca Weiss
  2025-08-01 13:51 ` [PATCH 1/2] arm64: dts: qcom: sc7280: Add q6usbdai node Luca Weiss
  2025-08-01 13:51 ` [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support Luca Weiss
@ 2025-08-11 18:40 ` Bjorn Andersson
  2 siblings, 0 replies; 7+ messages in thread
From: Bjorn Andersson @ 2025-08-11 18:40 UTC (permalink / raw)
  To: cros-qcom-dts-watchers, Konrad Dybcio, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Wesley Cheng, Stephan Gerhold,
	Luca Weiss
  Cc: ~postmarketos/upstreaming, phone-devel, linux-arm-msm, devicetree,
	linux-kernel


On Fri, 01 Aug 2025 15:51:04 +0200, Luca Weiss wrote:
> Similar to Fairphone 4, we can enable USB audio offloading quite easily
> on the QCM6490-based Fairphone 5 smartphone.
> 
> This allows to play audio via a USB-C headset with lower power
> consumption and enabling some other features.
> 
> 
> [...]

Applied, thanks!

[1/2] arm64: dts: qcom: sc7280: Add q6usbdai node
      commit: bcfe09571350d24843920aef60edf4e2bab62d67
[2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support
      commit: 073f2c9b77065390e6c36c1c4fb29b409712808b

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2025-08-11 18:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 13:51 [PATCH 0/2] Enable USB audio offloading on Fairphone 5 Luca Weiss
2025-08-01 13:51 ` [PATCH 1/2] arm64: dts: qcom: sc7280: Add q6usbdai node Luca Weiss
2025-08-01 14:02   ` Konrad Dybcio
2025-08-01 13:51 ` [PATCH 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Enable USB audio offload support Luca Weiss
2025-08-01 14:03   ` Konrad Dybcio
2025-08-01 14:07     ` Luca Weiss
2025-08-11 18:40 ` [PATCH 0/2] Enable USB audio offloading on Fairphone 5 Bjorn Andersson

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).