2024-05-10 12:27:36

by Luca Weiss

[permalink] [raw]
Subject: [PATCH 0/2] Add basic APR sound support for SC7280 SoC

Validated on Fairphone 5 (QCM6490) smartphone by using DisplayPort over
USB-C audio, connected to a TV, with a basic UCM to enable
'DISPLAY_PORT_RX Audio Mixer MultiMedia1':
https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/device-fairphone-fp5/ucm

Unfortunately all the device-specific things can't be enabled yet
upstream as detailed in the second patch, but the SoC parts should be
good to go.

As an extra note, I'm not sure how this will behave on SC7280 devices
that seem to use GPR (q6apm + q6prm) / "audioreach" as added in this
series from mid 2023 which was never applied:
https://lore.kernel.org/linux-arm-msm/[email protected]/

Signed-off-by: Luca Weiss <[email protected]>
---
Luca Weiss (2):
arm64: dts: qcom: sc7280: Add APR nodes for sound
[DNM] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound support

arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 +++++++++++
arch/arm64/boot/dts/qcom/sc7280.dtsi | 73 ++++++++++++++++++++++
2 files changed, 109 insertions(+)
---
base-commit: 940d65ef852b4a58c9115eb82b07844c999b8356
change-id: 20240510-sc7280-apr-c6d10ac2c331

Best regards,
--
Luca Weiss <[email protected]>



2024-05-10 12:27:42

by Luca Weiss

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: qcom: sc7280: Add APR nodes for sound

Add the different services found on APR on some devices with SC7280 SoC.
Additionally add an empty sound node in the root node as is seen on
other SoC dtsi files so device dt's can easily use that.

Signed-off-by: Luca Weiss <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7280.dtsi | 73 ++++++++++++++++++++++++++++++++++++
1 file changed, 73 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7280.dtsi b/arch/arm64/boot/dts/qcom/sc7280.dtsi
index fc9ec367e3a5..659212bb38c1 100644
--- a/arch/arm64/boot/dts/qcom/sc7280.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280.dtsi
@@ -24,6 +24,7 @@
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/reset/qcom,sdm845-aoss.h>
#include <dt-bindings/reset/qcom,sdm845-pdc.h>
+#include <dt-bindings/soc/qcom,apr.h>
#include <dt-bindings/soc/qcom,rpmh-rsc.h>
#include <dt-bindings/sound/qcom,lpass.h>
#include <dt-bindings/thermal/thermal.h>
@@ -3762,6 +3763,75 @@ IPCC_MPROC_SIGNAL_GLINK_QMP
label = "lpass";
qcom,remote-pid = <2>;

+ apr {
+ compatible = "qcom,apr-v2";
+ qcom,glink-channels = "apr_audio_svc";
+ qcom,domain = <APR_DOMAIN_ADSP>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ service@3 {
+ reg = <APR_SVC_ADSP_CORE>;
+ compatible = "qcom,q6core";
+ qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
+ };
+
+ q6afe: service@4 {
+ compatible = "qcom,q6afe";
+ reg = <APR_SVC_AFE>;
+ qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
+
+ q6afedai: dais {
+ compatible = "qcom,q6afe-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ };
+
+ q6afecc: clock-controller {
+ compatible = "qcom,q6afe-clocks";
+ #clock-cells = <2>;
+ };
+ };
+
+ q6asm: service@7 {
+ compatible = "qcom,q6asm";
+ reg = <APR_SVC_ASM>;
+ qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
+
+ q6asmdai: dais {
+ compatible = "qcom,q6asm-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ iommus = <&apps_smmu 0x1801 0x0>;
+
+ dai@0 {
+ reg = <0>;
+ };
+
+ dai@1 {
+ reg = <1>;
+ };
+
+ dai@2 {
+ reg = <2>;
+ };
+ };
+ };
+
+ q6adm: service@8 {
+ compatible = "qcom,q6adm";
+ reg = <APR_SVC_ADM>;
+ qcom,protection-domain = "avs/audio", "msm/adsp/audio_pd";
+
+ q6routing: routing {
+ compatible = "qcom,q6adm-routing";
+ #sound-dai-cells = <0>;
+ };
+ };
+ };
+
fastrpc {
compatible = "qcom,fastrpc";
qcom,glink-channels = "fastrpcglink-apps-dsp";
@@ -5991,6 +6061,9 @@ cpufreq_hw: cpufreq@18591000 {
};
};

+ sound: sound {
+ };
+
thermal_zones: thermal-zones {
cpu0-thermal {
polling-delay-passive = <250>;

--
2.45.0


2024-05-10 12:27:51

by Luca Weiss

[permalink] [raw]
Subject: [PATCH DNM 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound support

Add the required nodes for sound playback via a connected external
display (DisplayPort over USB-C).

Signed-off-by: Luca Weiss <[email protected]>
---
Depends on a bunch of patches upstream doing bringup of Display (DSI),
DisplayPort, GPU, and then finally audio could land. But we're blocked
on DPU 1:1:1 topology for all of that unfortunately.

And also machine driver for sound just exists a bit hackily.
---
arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
index 05bbf1da5cb8..2bbbcaeff95e 100644
--- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
+++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
@@ -14,6 +14,8 @@
#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,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
#include "sc7280.dtsi"
#include "pm7250b.dtsi"
#include "pm7325.dtsi"
@@ -774,6 +776,12 @@ &pon_resin {
status = "okay";
};

+&q6afedai {
+ dai@104 {
+ reg = <DISPLAY_PORT_RX>;
+ };
+};
+
&qup_spi13_cs {
drive-strength = <6>;
bias-disable;
@@ -847,6 +855,34 @@ &sdhc_2 {
status = "okay";
};

+&sound {
+ compatible = "fairphone,fp5-sndcard";
+ model = "Fairphone 5";
+
+ mm1-dai-link {
+ link-name = "MultiMedia1";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
+ };
+ };
+
+ displayport-rx-dai-link {
+ link-name = "DisplayPort Playback";
+
+ cpu {
+ sound-dai = <&q6afedai DISPLAY_PORT_RX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+
+ codec {
+ sound-dai = <&mdss_dp>;
+ };
+ };
+};
+
&spi13 {
status = "okay";


--
2.45.0


2024-05-10 13:53:37

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 0/2] Add basic APR sound support for SC7280 SoC


On Fri, 10 May 2024 14:27:07 +0200, Luca Weiss wrote:
> Validated on Fairphone 5 (QCM6490) smartphone by using DisplayPort over
> USB-C audio, connected to a TV, with a basic UCM to enable
> 'DISPLAY_PORT_RX Audio Mixer MultiMedia1':
> https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/device-fairphone-fp5/ucm
>
> Unfortunately all the device-specific things can't be enabled yet
> upstream as detailed in the second patch, but the SoC parts should be
> good to go.
>
> As an extra note, I'm not sure how this will behave on SC7280 devices
> that seem to use GPR (q6apm + q6prm) / "audioreach" as added in this
> series from mid 2023 which was never applied:
> https://lore.kernel.org/linux-arm-msm/[email protected]/
>
> Signed-off-by: Luca Weiss <[email protected]>
> ---
> Luca Weiss (2):
> arm64: dts: qcom: sc7280: Add APR nodes for sound
> [DNM] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound support
>
> arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 +++++++++++
> arch/arm64/boot/dts/qcom/sc7280.dtsi | 73 ++++++++++++++++++++++
> 2 files changed, 109 insertions(+)
> ---
> base-commit: 940d65ef852b4a58c9115eb82b07844c999b8356
> change-id: 20240510-sc7280-apr-c6d10ac2c331
>
> Best regards,
> --
> Luca Weiss <[email protected]>
>
>
>


My bot found new DTB warnings on the .dts files added or changed in this
series.

Some warnings may be from an existing SoC .dtsi. Or perhaps the warnings
are fixed by another series. Ultimately, it is up to the platform
maintainer whether these warnings are acceptable or not. No need to reply
unless the platform maintainer has comments.

If you already ran DT checks and didn't see these error(s), then
make sure dt-schema is up to date:

pip3 install dtschema --upgrade


New warnings running 'make CHECK_DTBS=y qcom/qcm6490-fairphone-fp5.dtb' for [email protected]:

arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dtb: /sound: failed to match any schema with compatible: ['fairphone,fp5-sndcard']






2024-05-28 03:36:20

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH 0/2] Add basic APR sound support for SC7280 SoC


On Fri, 10 May 2024 14:27:07 +0200, Luca Weiss wrote:
> Validated on Fairphone 5 (QCM6490) smartphone by using DisplayPort over
> USB-C audio, connected to a TV, with a basic UCM to enable
> 'DISPLAY_PORT_RX Audio Mixer MultiMedia1':
> https://gitlab.com/postmarketOS/pmaports/-/tree/master/device/testing/device-fairphone-fp5/ucm
>
> Unfortunately all the device-specific things can't be enabled yet
> upstream as detailed in the second patch, but the SoC parts should be
> good to go.
>
> [...]

Applied, thanks!

[1/2] arm64: dts: qcom: sc7280: Add APR nodes for sound
commit: f44da5d8722de348ff2eb8b206c69b52809c1772

Best regards,
--
Bjorn Andersson <[email protected]>

2024-05-28 21:35:28

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH DNM 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound support

On Fri, May 10, 2024 at 02:27:09PM GMT, Luca Weiss wrote:
> Add the required nodes for sound playback via a connected external
> display (DisplayPort over USB-C).
>
> Signed-off-by: Luca Weiss <[email protected]>
> ---
> Depends on a bunch of patches upstream doing bringup of Display (DSI),
> DisplayPort, GPU, and then finally audio could land. But we're blocked
> on DPU 1:1:1 topology for all of that unfortunately.
>
> And also machine driver for sound just exists a bit hackily.

Thanks for sharing this, Luca. Can you please resubmit this once it's
ready to be merged, so that I don't need to keep track of it?

Regards,
Bjorn

> ---
> arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 ++++++++++++++++++++++
> 1 file changed, 36 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> index 05bbf1da5cb8..2bbbcaeff95e 100644
> --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> @@ -14,6 +14,8 @@
> #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,q6afe.h>
> +#include <dt-bindings/sound/qcom,q6asm.h>
> #include "sc7280.dtsi"
> #include "pm7250b.dtsi"
> #include "pm7325.dtsi"
> @@ -774,6 +776,12 @@ &pon_resin {
> status = "okay";
> };
>
> +&q6afedai {
> + dai@104 {
> + reg = <DISPLAY_PORT_RX>;
> + };
> +};
> +
> &qup_spi13_cs {
> drive-strength = <6>;
> bias-disable;
> @@ -847,6 +855,34 @@ &sdhc_2 {
> status = "okay";
> };
>
> +&sound {
> + compatible = "fairphone,fp5-sndcard";
> + model = "Fairphone 5";
> +
> + mm1-dai-link {
> + link-name = "MultiMedia1";
> + cpu {
> + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
> + };
> + };
> +
> + displayport-rx-dai-link {
> + link-name = "DisplayPort Playback";
> +
> + cpu {
> + sound-dai = <&q6afedai DISPLAY_PORT_RX>;
> + };
> +
> + platform {
> + sound-dai = <&q6routing>;
> + };
> +
> + codec {
> + sound-dai = <&mdss_dp>;
> + };
> + };
> +};
> +
> &spi13 {
> status = "okay";
>
>
> --
> 2.45.0
>

2024-05-29 06:19:22

by Luca Weiss

[permalink] [raw]
Subject: Re: [PATCH DNM 2/2] arm64: dts: qcom: qcm6490-fairphone-fp5: Add DisplayPort sound support

On Tue May 28, 2024 at 11:35 PM CEST, Bjorn Andersson wrote:
> On Fri, May 10, 2024 at 02:27:09PM GMT, Luca Weiss wrote:
> > Add the required nodes for sound playback via a connected external
> > display (DisplayPort over USB-C).
> >
> > Signed-off-by: Luca Weiss <[email protected]>
> > ---
> > Depends on a bunch of patches upstream doing bringup of Display (DSI),
> > DisplayPort, GPU, and then finally audio could land. But we're blocked
> > on DPU 1:1:1 topology for all of that unfortunately.
> >
> > And also machine driver for sound just exists a bit hackily.
>
> Thanks for sharing this, Luca. Can you please resubmit this once it's
> ready to be merged, so that I don't need to keep track of it?

Definitely, though I don't expect it to be soon unfortunately, maybe you
can ask your colleagues though to fix that DPU 1:1:1 topology ;)

>
> Regards,
> Bjorn
>
> > ---
> > arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts | 36 ++++++++++++++++++++++
> > 1 file changed, 36 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> > index 05bbf1da5cb8..2bbbcaeff95e 100644
> > --- a/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> > +++ b/arch/arm64/boot/dts/qcom/qcm6490-fairphone-fp5.dts
> > @@ -14,6 +14,8 @@
> > #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,q6afe.h>
> > +#include <dt-bindings/sound/qcom,q6asm.h>
> > #include "sc7280.dtsi"
> > #include "pm7250b.dtsi"
> > #include "pm7325.dtsi"
> > @@ -774,6 +776,12 @@ &pon_resin {
> > status = "okay";
> > };
> >
> > +&q6afedai {
> > + dai@104 {
> > + reg = <DISPLAY_PORT_RX>;
> > + };
> > +};
> > +
> > &qup_spi13_cs {
> > drive-strength = <6>;
> > bias-disable;
> > @@ -847,6 +855,34 @@ &sdhc_2 {
> > status = "okay";
> > };
> >
> > +&sound {
> > + compatible = "fairphone,fp5-sndcard";
> > + model = "Fairphone 5";
> > +
> > + mm1-dai-link {
> > + link-name = "MultiMedia1";
> > + cpu {
> > + sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
> > + };
> > + };
> > +
> > + displayport-rx-dai-link {
> > + link-name = "DisplayPort Playback";
> > +
> > + cpu {
> > + sound-dai = <&q6afedai DISPLAY_PORT_RX>;
> > + };
> > +
> > + platform {
> > + sound-dai = <&q6routing>;
> > + };
> > +
> > + codec {
> > + sound-dai = <&mdss_dp>;
> > + };
> > + };
> > +};
> > +
> > &spi13 {
> > status = "okay";
> >
> >
> > --
> > 2.45.0
> >