* [PATCH 01/13] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:43 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6 Stephan Gerhold
` (11 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Vincent Knecht
From: Vincent Knecht <vincent.knecht@mailoo.org>
BAM DMUX is used as the network interface to the modem. This is copied
as-is from msm8916.dtsi.
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
arch/arm64/boot/dts/qcom/msm8939.dtsi | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi
index 324b5d26db40..65c68e0e88d5 100644
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
@@ -1537,6 +1537,20 @@ spmi_bus: spmi@200f000 {
#interrupt-cells = <4>;
};
+ bam_dmux_dma: dma-controller@4044000 {
+ compatible = "qcom,bam-v1.7.0";
+ reg = <0x04044000 0x19000>;
+ interrupts = <GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>;
+ #dma-cells = <1>;
+ qcom,ee = <0>;
+
+ num-channels = <6>;
+ qcom,num-ees = <1>;
+ qcom,powered-remotely;
+
+ status = "disabled";
+ };
+
mpss: remoteproc@4080000 {
compatible = "qcom,msm8916-mss-pil";
reg = <0x04080000 0x100>, <0x04020000 0x040>;
@@ -1569,6 +1583,22 @@ mpss: remoteproc@4080000 {
qcom,halt-regs = <&tcsr 0x18000 0x19000 0x1a000>;
status = "disabled";
+ bam_dmux: bam-dmux {
+ compatible = "qcom,bam-dmux";
+
+ interrupt-parent = <&hexagon_smsm>;
+ interrupts = <1 IRQ_TYPE_EDGE_BOTH>, <11 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-names = "pc", "pc-ack";
+
+ qcom,smem-states = <&apps_smsm 1>, <&apps_smsm 11>;
+ qcom,smem-state-names = "pc", "pc-ack";
+
+ dmas = <&bam_dmux_dma 4>, <&bam_dmux_dma 5>;
+ dma-names = "tx", "rx";
+
+ status = "disabled";
+ };
+
mba {
memory-region = <&mba_mem>;
};
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 01/13] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN
2023-09-26 16:51 ` [PATCH 01/13] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN Stephan Gerhold
@ 2023-09-26 18:43 ` Konrad Dybcio
0 siblings, 0 replies; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:43 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue, Vincent Knecht
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: Vincent Knecht <vincent.knecht@mailoo.org>
>
> BAM DMUX is used as the network interface to the modem. This is copied
> as-is from msm8916.dtsi.
>
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
2023-09-26 16:51 ` [PATCH 01/13] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:46 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi Stephan Gerhold
` (10 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold
MSM8916 and MSM8939 do not have a dedicated ADSP. Instead, the audio
services via APR are also implemented by the modem DSP. Audio can be
either routed via the modem DSP (necessary for voice call audio etc)
or directly sent to the LPASS hardware (currently used by DB410c).
Bypassing QDSP6 audio is only possible with special firmware
(on DB410c) or when the modem DSP is completely disabled.
Add the typical nodes for QDSP6 audio to msm8916.dtsi and msm8939.dtsi.
The apr node is disabled by default to avoid changing behavior for
devices like DB410c that use the bypassed audio path.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
arch/arm64/boot/dts/qcom/msm8916.dtsi | 49 +++++++++++++++++++++++++++++++++++
arch/arm64/boot/dts/qcom/msm8939.dtsi | 49 +++++++++++++++++++++++++++++++++++
2 files changed, 98 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi
index 4f799b536a92..e8a14dd7e7c2 100644
--- a/arch/arm64/boot/dts/qcom/msm8916.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi
@@ -10,6 +10,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/reset/qcom,gcc-msm8916.h>
+#include <dt-bindings/soc/qcom,apr.h>
#include <dt-bindings/thermal/thermal.h>
/ {
@@ -1989,6 +1990,54 @@ smd-edge {
label = "hexagon";
+ apr: apr {
+ compatible = "qcom,apr-v2";
+ qcom,smd-channels = "apr_audio_svc";
+ qcom,domain = <APR_DOMAIN_ADSP>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ q6core: service@3 {
+ compatible = "qcom,q6core";
+ reg = <APR_SVC_ADSP_CORE>;
+ };
+
+ q6afe: service@4 {
+ compatible = "qcom,q6afe";
+ reg = <APR_SVC_AFE>;
+
+ q6afedai: dais {
+ compatible = "qcom,q6afe-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ };
+ };
+
+ q6asm: service@7 {
+ compatible = "qcom,q6asm";
+ reg = <APR_SVC_ASM>;
+
+ q6asmdai: dais {
+ compatible = "qcom,q6asm-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ };
+ };
+
+ q6adm: service@8 {
+ compatible = "qcom,q6adm";
+ reg = <APR_SVC_ADM>;
+
+ q6routing: routing {
+ compatible = "qcom,q6adm-routing";
+ #sound-dai-cells = <0>;
+ };
+ };
+ };
+
fastrpc {
compatible = "qcom,fastrpc";
qcom,smd-channels = "fastrpcsmd-apps-dsp";
diff --git a/arch/arm64/boot/dts/qcom/msm8939.dtsi b/arch/arm64/boot/dts/qcom/msm8939.dtsi
index 65c68e0e88d5..95610a32750a 100644
--- a/arch/arm64/boot/dts/qcom/msm8939.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8939.dtsi
@@ -10,6 +10,7 @@
#include <dt-bindings/interrupt-controller/arm-gic.h>
#include <dt-bindings/power/qcom-rpmpd.h>
#include <dt-bindings/reset/qcom,gcc-msm8939.h>
+#include <dt-bindings/soc/qcom,apr.h>
#include <dt-bindings/thermal/thermal.h>
/ {
@@ -1615,6 +1616,54 @@ smd-edge {
qcom,remote-pid = <1>;
label = "hexagon";
+
+ apr: apr {
+ compatible = "qcom,apr-v2";
+ qcom,smd-channels = "apr_audio_svc";
+ qcom,domain = <APR_DOMAIN_ADSP>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+ status = "disabled";
+
+ q6core: service@3 {
+ compatible = "qcom,q6core";
+ reg = <APR_SVC_ADSP_CORE>;
+ };
+
+ q6afe: service@4 {
+ compatible = "qcom,q6afe";
+ reg = <APR_SVC_AFE>;
+
+ q6afedai: dais {
+ compatible = "qcom,q6afe-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ };
+ };
+
+ q6asm: service@7 {
+ compatible = "qcom,q6asm";
+ reg = <APR_SVC_ASM>;
+
+ q6asmdai: dais {
+ compatible = "qcom,q6asm-dais";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ #sound-dai-cells = <1>;
+ };
+ };
+
+ q6adm: service@8 {
+ compatible = "qcom,q6adm";
+ reg = <APR_SVC_ADM>;
+
+ q6routing: routing {
+ compatible = "qcom,q6adm-routing";
+ #sound-dai-cells = <0>;
+ };
+ };
+ };
};
};
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6
2023-09-26 16:51 ` [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6 Stephan Gerhold
@ 2023-09-26 18:46 ` Konrad Dybcio
2023-09-26 18:54 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:46 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue
On 26.09.2023 18:51, Stephan Gerhold wrote:
> MSM8916 and MSM8939 do not have a dedicated ADSP. Instead, the audio
> services via APR are also implemented by the modem DSP. Audio can be
> either routed via the modem DSP (necessary for voice call audio etc)
> or directly sent to the LPASS hardware (currently used by DB410c).
> Bypassing QDSP6 audio is only possible with special firmware
> (on DB410c) or when the modem DSP is completely disabled.
>
> Add the typical nodes for QDSP6 audio to msm8916.dtsi and msm8939.dtsi.
> The apr node is disabled by default to avoid changing behavior for
> devices like DB410c that use the bypassed audio path.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
I'm generally grumpy with regards to multi-soc changes that
have no need to be multi-soc..
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6
2023-09-26 18:46 ` Konrad Dybcio
@ 2023-09-26 18:54 ` Stephan Gerhold
2023-09-26 19:05 ` Konrad Dybcio
0 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 18:54 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On Tue, Sep 26, 2023 at 08:46:36PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > MSM8916 and MSM8939 do not have a dedicated ADSP. Instead, the audio
> > services via APR are also implemented by the modem DSP. Audio can be
> > either routed via the modem DSP (necessary for voice call audio etc)
> > or directly sent to the LPASS hardware (currently used by DB410c).
> > Bypassing QDSP6 audio is only possible with special firmware
> > (on DB410c) or when the modem DSP is completely disabled.
> >
> > Add the typical nodes for QDSP6 audio to msm8916.dtsi and msm8939.dtsi.
> > The apr node is disabled by default to avoid changing behavior for
> > devices like DB410c that use the bypassed audio path.
> >
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> I'm generally grumpy with regards to multi-soc changes that
> have no need to be multi-soc..
>
Well it's 100% the same diff so reviewing it separately doesn't really
make sense IMHO. When I do "msm8916/39" patches these are generally the
changes where strictly speaking there is no need to duplicate at all.
It could go into a common include between both. We just haven't found
a good solution/agreement yet how sharing SoC components could work.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6
2023-09-26 18:54 ` Stephan Gerhold
@ 2023-09-26 19:05 ` Konrad Dybcio
2023-09-26 19:07 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 19:05 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On 26.09.2023 20:54, Stephan Gerhold wrote:
> On Tue, Sep 26, 2023 at 08:46:36PM +0200, Konrad Dybcio wrote:
>> On 26.09.2023 18:51, Stephan Gerhold wrote:
>>> MSM8916 and MSM8939 do not have a dedicated ADSP. Instead, the audio
>>> services via APR are also implemented by the modem DSP. Audio can be
>>> either routed via the modem DSP (necessary for voice call audio etc)
>>> or directly sent to the LPASS hardware (currently used by DB410c).
>>> Bypassing QDSP6 audio is only possible with special firmware
>>> (on DB410c) or when the modem DSP is completely disabled.
>>>
>>> Add the typical nodes for QDSP6 audio to msm8916.dtsi and msm8939.dtsi.
>>> The apr node is disabled by default to avoid changing behavior for
>>> devices like DB410c that use the bypassed audio path.
>>>
>>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
>>> ---
>> I'm generally grumpy with regards to multi-soc changes that
>> have no need to be multi-soc..
>>
>
> Well it's 100% the same diff so reviewing it separately doesn't really
> make sense IMHO. When I do "msm8916/39" patches these are generally the
> changes where strictly speaking there is no need to duplicate at all.
> It could go into a common include between both. We just haven't found
> a good solution/agreement yet how sharing SoC components could work.
My bottom line is that, somebody trying to track down an issue on
one may need to unnecessarily resolve 2 merge conflicts when reverting :/
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6
2023-09-26 19:05 ` Konrad Dybcio
@ 2023-09-26 19:07 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:07 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On Tue, Sep 26, 2023 at 09:05:24PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 20:54, Stephan Gerhold wrote:
> > On Tue, Sep 26, 2023 at 08:46:36PM +0200, Konrad Dybcio wrote:
> >> On 26.09.2023 18:51, Stephan Gerhold wrote:
> >>> MSM8916 and MSM8939 do not have a dedicated ADSP. Instead, the audio
> >>> services via APR are also implemented by the modem DSP. Audio can be
> >>> either routed via the modem DSP (necessary for voice call audio etc)
> >>> or directly sent to the LPASS hardware (currently used by DB410c).
> >>> Bypassing QDSP6 audio is only possible with special firmware
> >>> (on DB410c) or when the modem DSP is completely disabled.
> >>>
> >>> Add the typical nodes for QDSP6 audio to msm8916.dtsi and msm8939.dtsi.
> >>> The apr node is disabled by default to avoid changing behavior for
> >>> devices like DB410c that use the bypassed audio path.
> >>>
> >>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> >>> ---
> >> I'm generally grumpy with regards to multi-soc changes that
> >> have no need to be multi-soc..
> >>
> >
> > Well it's 100% the same diff so reviewing it separately doesn't really
> > make sense IMHO. When I do "msm8916/39" patches these are generally the
> > changes where strictly speaking there is no need to duplicate at all.
> > It could go into a common include between both. We just haven't found
> > a good solution/agreement yet how sharing SoC components could work.
> My bottom line is that, somebody trying to track down an issue on
> one may need to unnecessarily resolve 2 merge conflicts when reverting :/
>
I mean you could easily discard the changes in the other .dtsi. Probably
a single shell command if one knows enough "Git-fu".
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
2023-09-26 16:51 ` [PATCH 01/13] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN Stephan Gerhold
2023-09-26 16:51 ` [PATCH 02/13] arm64: dts: qcom: msm8916/39: Add QDSP6 Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:49 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem Stephan Gerhold
` (9 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold
Most MSM8916/MSM8939 devices use very similar setups for the modem,
because most of the device-specific details are abstracted by the modem
firmware. There are several definitions (status switches, DAI links
etc) that will be exactly the same for every board.
Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to
simplify enabling the modem for such devices. By default the
digital/analog codec in the SoC/PMIC is used, but boards can define
additional codecs using the templates for Secondary and Quaternary
MI2S.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi | 163 ++++++++++++++++++++++
1 file changed, 163 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi
new file mode 100644
index 000000000000..ddd74d428406
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi
@@ -0,0 +1,163 @@
+// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
+/*
+ * msm8916-modem-qdsp6.dtsi describes the typical modem setup on MSM8916 devices
+ * (or similar SoCs) with audio routed via the QDSP6 services provided by the
+ * modem firmware. The digital/analog codec in the SoC/PMIC is used by default,
+ * but boards can define additional codecs using the templates for Secondary and
+ * Quaternary MI2S.
+ */
+
+#include <dt-bindings/sound/qcom,q6afe.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
+
+&apr {
+ status = "okay";
+};
+
+&bam_dmux {
+ status = "okay";
+};
+
+&bam_dmux_dma {
+ status = "okay";
+};
+
+&lpass {
+ status = "reserved"; /* Controlled by QDSP6 */
+};
+
+&lpass_codec {
+ status = "okay";
+};
+
+&mba_mem {
+ status = "okay";
+};
+
+&mpss {
+ status = "okay";
+};
+
+&mpss_mem {
+ status = "okay";
+};
+
+&pm8916_codec {
+ status = "okay";
+};
+
+&q6afedai {
+ dai@16 {
+ reg = <PRIMARY_MI2S_RX>;
+ qcom,sd-lines = <0 1>;
+ };
+ dai@20 {
+ reg = <TERTIARY_MI2S_TX>;
+ qcom,sd-lines = <0 1>;
+ };
+};
+
+&q6asmdai {
+ dai@0 {
+ reg = <0>;
+ direction = <Q6ASM_DAI_RX>;
+ };
+ dai@1 {
+ reg = <1>;
+ direction = <Q6ASM_DAI_TX>;
+ };
+ dai@2 {
+ reg = <2>;
+ direction = <Q6ASM_DAI_RX>;
+ };
+ dai@3 {
+ reg = <3>;
+ direction = <Q6ASM_DAI_RX>;
+ is-compress-dai;
+ };
+};
+
+&sound {
+ compatible = "qcom,msm8916-qdsp6-sndcard";
+ model = "msm8916";
+
+ pinctrl-0 = <&cdc_pdm_default>;
+ pinctrl-1 = <&cdc_pdm_sleep>;
+ pinctrl-names = "default", "sleep";
+
+ multimedia1-dai-link {
+ link-name = "MultiMedia1";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
+ };
+ };
+
+ multimedia2-dai-link {
+ link-name = "MultiMedia2";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
+ };
+ };
+
+ multimedia3-dai-link {
+ link-name = "MultiMedia3";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
+ };
+ };
+
+ multimedia4-dai-link {
+ link-name = "MultiMedia4";
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA4>;
+ };
+ };
+
+ sound_dai_primary: mi2s-primary-dai-link {
+ link-name = "Primary MI2S";
+ cpu {
+ sound-dai = <&q6afedai PRIMARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ codec {
+ sound-dai = <&lpass_codec 0>, <&pm8916_codec 0>;
+ };
+ };
+
+ sound_dai_secondary: mi2s-secondary-dai-link {
+ link-name = "Secondary MI2S";
+ status = "disabled"; /* Needs extra codec configuration */
+ cpu {
+ sound-dai = <&q6afedai SECONDARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ };
+
+ sound_dai_tertiary: mi2s-tertiary-dai-link {
+ link-name = "Tertiary MI2S";
+ cpu {
+ sound-dai = <&q6afedai TERTIARY_MI2S_TX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ codec {
+ sound-dai = <&lpass_codec 1>, <&pm8916_codec 1>;
+ };
+ };
+
+ sound_dai_quaternary: mi2s-quaternary-dai-link {
+ link-name = "Quaternary MI2S";
+ status = "disabled"; /* Needs extra codec configuration */
+ cpu {
+ sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ };
+};
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
2023-09-26 16:51 ` [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi Stephan Gerhold
@ 2023-09-26 18:49 ` Konrad Dybcio
2023-09-26 19:06 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:49 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue
On 26.09.2023 18:51, Stephan Gerhold wrote:
> Most MSM8916/MSM8939 devices use very similar setups for the modem,
> because most of the device-specific details are abstracted by the modem
> firmware. There are several definitions (status switches, DAI links
> etc) that will be exactly the same for every board.
>
> Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to
> simplify enabling the modem for such devices. By default the
> digital/analog codec in the SoC/PMIC is used, but boards can define
> additional codecs using the templates for Secondary and Quaternary
> MI2S.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
I'd rather see at least one usage so that you aren't introducing
effectively non-compiled code..
> arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi | 163 ++++++++++++++++++++++
> 1 file changed, 163 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi
> new file mode 100644
> index 000000000000..ddd74d428406
> --- /dev/null
> +++ b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi
> @@ -0,0 +1,163 @@
> +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
> +/*
> + * msm8916-modem-qdsp6.dtsi describes the typical modem setup on MSM8916 devices
> + * (or similar SoCs) with audio routed via the QDSP6 services provided by the
> + * modem firmware. The digital/analog codec in the SoC/PMIC is used by default,
> + * but boards can define additional codecs using the templates for Secondary and
> + * Quaternary MI2S.
> + */
> +
> +#include <dt-bindings/sound/qcom,q6afe.h>
> +#include <dt-bindings/sound/qcom,q6asm.h>
> +
> +&apr {
> + status = "okay";
> +};
> +
> +&bam_dmux {
> + status = "okay";
> +};
> +
> +&bam_dmux_dma {
> + status = "okay";
> +};
> +
> +&lpass {
> + status = "reserved"; /* Controlled by QDSP6 */
> +};
> +
> +&lpass_codec {
> + status = "okay";
> +};
Any reason for it to stay disabled?
> +
> +&mba_mem {
> + status = "okay";
> +};
> +
> +&mpss {
> + status = "okay";
> +};
> +
> +&mpss_mem {
> + status = "okay";
> +};
> +
> +&pm8916_codec {
> + status = "okay";
> +};
Ditto
[...]
> + multimedia1-dai-link {
> + link-name = "MultiMedia1";
Newline before last property and subnodes, please
[...]
> + sound_dai_secondary: mi2s-secondary-dai-link {
> + link-name = "Secondary MI2S";
> + status = "disabled"; /* Needs extra codec configuration */
Hmm.. Potential good user of /omit-if-no-ref/?
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
2023-09-26 18:49 ` Konrad Dybcio
@ 2023-09-26 19:06 ` Stephan Gerhold
2023-09-26 20:01 ` Konrad Dybcio
0 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:06 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On Tue, Sep 26, 2023 at 08:49:24PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > Most MSM8916/MSM8939 devices use very similar setups for the modem,
> > because most of the device-specific details are abstracted by the modem
> > firmware. There are several definitions (status switches, DAI links
> > etc) that will be exactly the same for every board.
> >
> > Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to
> > simplify enabling the modem for such devices. By default the
> > digital/analog codec in the SoC/PMIC is used, but boards can define
> > additional codecs using the templates for Secondary and Quaternary
> > MI2S.
> >
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> I'd rather see at least one usage so that you aren't introducing
> effectively non-compiled code..
>
There are 10 usages in the rest of the patch series.
Is that enough? :D
IMHO it doesn't make sense to squash this with one of the device
patches, especially considering several of them are primarily authored
by others.
> > arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi | 163 ++++++++++++++++++++++
> > 1 file changed, 163 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi
> > new file mode 100644
> > index 000000000000..ddd74d428406
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi
> > @@ -0,0 +1,163 @@
> > +// SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
> > +/*
> > + * msm8916-modem-qdsp6.dtsi describes the typical modem setup on MSM8916 devices
> > + * (or similar SoCs) with audio routed via the QDSP6 services provided by the
> > + * modem firmware. The digital/analog codec in the SoC/PMIC is used by default,
> > + * but boards can define additional codecs using the templates for Secondary and
> > + * Quaternary MI2S.
> > + */
> > +
> > +#include <dt-bindings/sound/qcom,q6afe.h>
> > +#include <dt-bindings/sound/qcom,q6asm.h>
> > +
> > +&apr {
> > + status = "okay";
> > +};
> > +
> > +&bam_dmux {
> > + status = "okay";
> > +};
> > +
> > +&bam_dmux_dma {
> > + status = "okay";
> > +};
> > +
> > +&lpass {
> > + status = "reserved"; /* Controlled by QDSP6 */
> > +};
> > +
> > +&lpass_codec {
> > + status = "okay";
> > +};
> Any reason for it to stay disabled?
>
You mean in msm8916.dtsi? For the SoC dtsi we don't make assumptions
what devices use or not. There could be devices that ignore the internal
codec entirely. If there is nothing connected to the codec lpass_codec
should not be enabled (e.g. the msm8916-ufi.dtsi devices).
This include is a bit more "opinionated", to reduce duplication for
the most common setup. But it's separate and optional to use. The SoC
dtsi is included by everyone.
> > +
> > +&mba_mem {
> > + status = "okay";
> > +};
> > +
> > +&mpss {
> > + status = "okay";
> > +};
> > +
> > +&mpss_mem {
> > + status = "okay";
> > +};
> > +
> > +&pm8916_codec {
> > + status = "okay";
> > +};
> Ditto
>
Same as above.
> > + multimedia1-dai-link {
> > + link-name = "MultiMedia1";
> Newline before last property and subnodes, please
>
Thanks, will change this!
>
> > + sound_dai_secondary: mi2s-secondary-dai-link {
> > + link-name = "Secondary MI2S";
> > + status = "disabled"; /* Needs extra codec configuration */
> Hmm.. Potential good user of /omit-if-no-ref/?
>
AFAICT /omit-if-no-ref/ is for phandle references only. Basically it
would only work if you would somewhere reference the phandle:
list-of-sound-dais = <&sound_dai_primary &sound_dai_secondary>;
But this doesn't exist so /omit-if-no-ref/ cannot be used here.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
2023-09-26 19:06 ` Stephan Gerhold
@ 2023-09-26 20:01 ` Konrad Dybcio
2023-09-26 20:17 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 20:01 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On 26.09.2023 21:06, Stephan Gerhold wrote:
> On Tue, Sep 26, 2023 at 08:49:24PM +0200, Konrad Dybcio wrote:
>> On 26.09.2023 18:51, Stephan Gerhold wrote:
>>> Most MSM8916/MSM8939 devices use very similar setups for the modem,
>>> because most of the device-specific details are abstracted by the modem
>>> firmware. There are several definitions (status switches, DAI links
>>> etc) that will be exactly the same for every board.
>>>
>>> Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to
>>> simplify enabling the modem for such devices. By default the
>>> digital/analog codec in the SoC/PMIC is used, but boards can define
>>> additional codecs using the templates for Secondary and Quaternary
>>> MI2S.
>>>
>>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
>>> ---
>> I'd rather see at least one usage so that you aren't introducing
>> effectively non-compiled code..
>>
>
> There are 10 usages in the rest of the patch series.
> Is that enough? :D
>
> IMHO it doesn't make sense to squash this with one of the device
> patches, especially considering several of them are primarily authored
> by others.
I see..
Well, I guess I don't have better counter-arguments, but please
consider this the next time around.
[...]
>>> +&lpass_codec {
>>> + status = "okay";
>>> +};
>> Any reason for it to stay disabled?
>>
>
> You mean in msm8916.dtsi?
Yes
> For the SoC dtsi we don't make assumptions
> what devices use or not. There could be devices that ignore the internal
> codec entirely. If there is nothing connected to the codec lpass_codec
> should not be enabled (e.g. the msm8916-ufi.dtsi devices).
See my reply to patch 5
[...]
>>> + sound_dai_secondary: mi2s-secondary-dai-link {
>>> + link-name = "Secondary MI2S";
>>> + status = "disabled"; /* Needs extra codec configuration */
>> Hmm.. Potential good user of /omit-if-no-ref/?
>>
>
> AFAICT /omit-if-no-ref/ is for phandle references only. Basically it
> would only work if you would somewhere reference the phandle:
>
> list-of-sound-dais = <&sound_dai_primary &sound_dai_secondary>;
>
> But this doesn't exist so /omit-if-no-ref/ cannot be used here.
Ahh right, this is the one we don't reference.. Too bad,
would be a nice fit :/
I only see one usage of it though (patch 7), perhaps it could
be kept local to that one?
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
2023-09-26 20:01 ` Konrad Dybcio
@ 2023-09-26 20:17 ` Stephan Gerhold
2023-10-02 9:59 ` Konrad Dybcio
0 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 20:17 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On Tue, Sep 26, 2023 at 10:01:21PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 21:06, Stephan Gerhold wrote:
> > On Tue, Sep 26, 2023 at 08:49:24PM +0200, Konrad Dybcio wrote:
> >> On 26.09.2023 18:51, Stephan Gerhold wrote:
> >>> Most MSM8916/MSM8939 devices use very similar setups for the modem,
> >>> because most of the device-specific details are abstracted by the modem
> >>> firmware. There are several definitions (status switches, DAI links
> >>> etc) that will be exactly the same for every board.
> >>>
> >>> Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to
> >>> simplify enabling the modem for such devices. By default the
> >>> digital/analog codec in the SoC/PMIC is used, but boards can define
> >>> additional codecs using the templates for Secondary and Quaternary
> >>> MI2S.
> >>>
> >>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> >>> ---
> >> I'd rather see at least one usage so that you aren't introducing
> >> effectively non-compiled code..
> >>
> >
> > There are 10 usages in the rest of the patch series.
> > Is that enough? :D
> >
> > IMHO it doesn't make sense to squash this with one of the device
> > patches, especially considering several of them are primarily authored
> > by others.
> I see..
>
> Well, I guess I don't have better counter-arguments, but please
> consider this the next time around.
>
Will do!
> [...]
>
> >>> +&lpass_codec {
> >>> + status = "okay";
> >>> +};
> >> Any reason for it to stay disabled?
> >>
> >
> > You mean in msm8916.dtsi?
> Yes
>
> > For the SoC dtsi we don't make assumptions
> > what devices use or not. There could be devices that ignore the internal
> > codec entirely. If there is nothing connected to the codec lpass_codec
> > should not be enabled (e.g. the msm8916-ufi.dtsi devices).
> See my reply to patch 5
>
> [...]
>
Let's continue discussing that there I guess. :D
> >>> + sound_dai_secondary: mi2s-secondary-dai-link {
> >>> + link-name = "Secondary MI2S";
> >>> + status = "disabled"; /* Needs extra codec configuration */
> >> Hmm.. Potential good user of /omit-if-no-ref/?
> >>
> >
> > AFAICT /omit-if-no-ref/ is for phandle references only. Basically it
> > would only work if you would somewhere reference the phandle:
> >
> > list-of-sound-dais = <&sound_dai_primary &sound_dai_secondary>;
> >
> > But this doesn't exist so /omit-if-no-ref/ cannot be used here.
> Ahh right, this is the one we don't reference.. Too bad,
> would be a nice fit :/
>
> I only see one usage of it though (patch 7), perhaps it could
> be kept local to that one?
>
This patch series just contains the initial set of
msm8916-modem-qdsp6.dtsi users (for devices which are already upstream).
We probably have like 20 more that still need to be upstreamed. :D
sound_dai_secondary is fairly rare, but there is at least one more user
that will probably end up upstream soon.
I think the overhead of these template notes is absolutely negligible
compared to all the (potentially) unused SoC nodes we have. :D
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
2023-09-26 20:17 ` Stephan Gerhold
@ 2023-10-02 9:59 ` Konrad Dybcio
2023-10-02 16:33 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-10-02 9:59 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On 9/26/23 22:17, Stephan Gerhold wrote:
> On Tue, Sep 26, 2023 at 10:01:21PM +0200, Konrad Dybcio wrote:
>> On 26.09.2023 21:06, Stephan Gerhold wrote:
>>> On Tue, Sep 26, 2023 at 08:49:24PM +0200, Konrad Dybcio wrote:
>>>> On 26.09.2023 18:51, Stephan Gerhold wrote:
>>>>> Most MSM8916/MSM8939 devices use very similar setups for the modem,
>>>>> because most of the device-specific details are abstracted by the modem
>>>>> firmware. There are several definitions (status switches, DAI links
>>>>> etc) that will be exactly the same for every board.
>>>>>
>>>>> Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to
>>>>> simplify enabling the modem for such devices. By default the
>>>>> digital/analog codec in the SoC/PMIC is used, but boards can define
>>>>> additional codecs using the templates for Secondary and Quaternary
>>>>> MI2S.
>>>>>
>>>>> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
>>>>> ---
>>>> I'd rather see at least one usage so that you aren't introducing
>>>> effectively non-compiled code..
>>>>
>>>
>>> There are 10 usages in the rest of the patch series.
>>> Is that enough? :D
>>>
>>> IMHO it doesn't make sense to squash this with one of the device
>>> patches, especially considering several of them are primarily authored
>>> by others.
>> I see..
>>
>> Well, I guess I don't have better counter-arguments, but please
>> consider this the next time around.
>>
>
> Will do!
>
>> [...]
>>
>>>>> +&lpass_codec {
>>>>> + status = "okay";
>>>>> +};
>>>> Any reason for it to stay disabled?
>>>>
>>>
>>> You mean in msm8916.dtsi?
>> Yes
>>
>>> For the SoC dtsi we don't make assumptions
>>> what devices use or not. There could be devices that ignore the internal
>>> codec entirely. If there is nothing connected to the codec lpass_codec
>>> should not be enabled (e.g. the msm8916-ufi.dtsi devices).
>> See my reply to patch 5
>>
>> [...]
>>
>
> Let's continue discussing that there I guess. :D
>
>>>>> + sound_dai_secondary: mi2s-secondary-dai-link {
>>>>> + link-name = "Secondary MI2S";
>>>>> + status = "disabled"; /* Needs extra codec configuration */
>>>> Hmm.. Potential good user of /omit-if-no-ref/?
>>>>
>>>
>>> AFAICT /omit-if-no-ref/ is for phandle references only. Basically it
>>> would only work if you would somewhere reference the phandle:
>>>
>>> list-of-sound-dais = <&sound_dai_primary &sound_dai_secondary>;
>>>
>>> But this doesn't exist so /omit-if-no-ref/ cannot be used here.
>> Ahh right, this is the one we don't reference.. Too bad,
>> would be a nice fit :/
>>
>> I only see one usage of it though (patch 7), perhaps it could
>> be kept local to that one?
>>
>
> This patch series just contains the initial set of
> msm8916-modem-qdsp6.dtsi users (for devices which are already upstream).
> We probably have like 20 more that still need to be upstreamed. :D
>
> sound_dai_secondary is fairly rare, but there is at least one more user
> that will probably end up upstream soon.
2 users don't sound particularly great in a devicetree included by 20
other non-users
> I think the overhead of these template notes is absolutely negligible
> compared to all the (potentially) unused SoC nodes we have. :D
Yes, however the unused SoC nodes are mostly standardized and could be
used as-they-are on a vast majority of devices
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
2023-10-02 9:59 ` Konrad Dybcio
@ 2023-10-02 16:33 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-10-02 16:33 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On Mon, Oct 02, 2023 at 11:59:21AM +0200, Konrad Dybcio wrote:
>
>
> On 9/26/23 22:17, Stephan Gerhold wrote:
> > On Tue, Sep 26, 2023 at 10:01:21PM +0200, Konrad Dybcio wrote:
> > > On 26.09.2023 21:06, Stephan Gerhold wrote:
> > > > On Tue, Sep 26, 2023 at 08:49:24PM +0200, Konrad Dybcio wrote:
> > > > > On 26.09.2023 18:51, Stephan Gerhold wrote:
> > > > > > Most MSM8916/MSM8939 devices use very similar setups for the modem,
> > > > > > because most of the device-specific details are abstracted by the modem
> > > > > > firmware. There are several definitions (status switches, DAI links
> > > > > > etc) that will be exactly the same for every board.
> > > > > >
> > > > > > Introduce a common msm8916-modem-qdsp6.dtsi include that can be used to
> > > > > > simplify enabling the modem for such devices. By default the
> > > > > > digital/analog codec in the SoC/PMIC is used, but boards can define
> > > > > > additional codecs using the templates for Secondary and Quaternary
> > > > > > MI2S.
> > > > > >
> > > > > > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > > > > > ---
> > > > > I'd rather see at least one usage so that you aren't introducing
> > > > > effectively non-compiled code..
> > > > >
> > > >
> > > > There are 10 usages in the rest of the patch series.
> > > > Is that enough? :D
> > > >
> > > > IMHO it doesn't make sense to squash this with one of the device
> > > > patches, especially considering several of them are primarily authored
> > > > by others.
> > > I see..
> > >
> > > Well, I guess I don't have better counter-arguments, but please
> > > consider this the next time around.
> > >
> >
> > Will do!
> >
> > > [...]
> > >
> > > > > > +&lpass_codec {
> > > > > > + status = "okay";
> > > > > > +};
> > > > > Any reason for it to stay disabled?
> > > > >
> > > >
> > > > You mean in msm8916.dtsi?
> > > Yes
> > >
> > > > For the SoC dtsi we don't make assumptions
> > > > what devices use or not. There could be devices that ignore the internal
> > > > codec entirely. If there is nothing connected to the codec lpass_codec
> > > > should not be enabled (e.g. the msm8916-ufi.dtsi devices).
> > > See my reply to patch 5
> > >
> > > [...]
> > >
> >
> > Let's continue discussing that there I guess. :D
> >
> > > > > > + sound_dai_secondary: mi2s-secondary-dai-link {
> > > > > > + link-name = "Secondary MI2S";
> > > > > > + status = "disabled"; /* Needs extra codec configuration */
> > > > > Hmm.. Potential good user of /omit-if-no-ref/?
> > > > >
> > > >
> > > > AFAICT /omit-if-no-ref/ is for phandle references only. Basically it
> > > > would only work if you would somewhere reference the phandle:
> > > >
> > > > list-of-sound-dais = <&sound_dai_primary &sound_dai_secondary>;
> > > >
> > > > But this doesn't exist so /omit-if-no-ref/ cannot be used here.
> > > Ahh right, this is the one we don't reference.. Too bad,
> > > would be a nice fit :/
> > >
> > > I only see one usage of it though (patch 7), perhaps it could
> > > be kept local to that one?
> > >
> >
> > This patch series just contains the initial set of
> > msm8916-modem-qdsp6.dtsi users (for devices which are already upstream).
> > We probably have like 20 more that still need to be upstreamed. :D
> >
> > sound_dai_secondary is fairly rare, but there is at least one more user
> > that will probably end up upstream soon.
> 2 users don't sound particularly great in a devicetree included by 20 other
> non-users
>
> > I think the overhead of these template notes is absolutely negligible
> > compared to all the (potentially) unused SoC nodes we have. :D
> Yes, however the unused SoC nodes are mostly standardized and could be used
> as-they-are on a vast majority of devices
>
To be fair we're talking about 152 bytes difference here, in a DTB that
is like 60,000 bytes total. But I can't think of enough compelling
arguments for my "template node" approach, so I will try to rework this
in v2. Let's see if I can get rid of the unused nodes without too much
mess. :)
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (2 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 03/13] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:54 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: " Stephan Gerhold
` (8 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Lin, Meng-Bo
Enable sound and modem for the Samsung A2015 based devices (A3, A5, E5,
E7, Grand Max). The setup is similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Earpiece/headphones/microphones via digital/analog codec in
MSM8916/PM8916
- WWAN Internet via BAM-DMUX
except:
- NXP TFA9895 codec for speaker on Quaternary MI2S
- Samsung-specific audio jack detection (not supported yet)
[Lin: Add e2015 and grandmax]
Co-developed-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../dts/qcom/msm8916-samsung-a2015-common.dtsi | 55 ++++++++++++++++++++++
.../dts/qcom/msm8916-samsung-e2015-common.dtsi | 4 ++
.../boot/dts/qcom/msm8916-samsung-grandmax.dts | 4 ++
3 files changed, 63 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
index 0b29132b74e1..f71b18d89bf9 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
@@ -1,10 +1,13 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
+#include <dt-bindings/sound/apq8016-lpass.h>
/ {
aliases {
@@ -196,6 +199,18 @@ vibrator: vibrator {
};
};
+&blsp_i2c1 {
+ status = "okay";
+
+ speaker_codec: audio-codec@34 {
+ compatible = "nxp,tfa9895";
+ reg = <0x34>;
+ vddd-supply = <&pm8916_l5>;
+ sound-name-prefix = "Speaker";
+ #sound-dai-cells = <0>;
+ };
+};
+
&blsp_i2c2 {
status = "okay";
@@ -243,6 +258,13 @@ &gpu {
status = "okay";
};
+&lpass {
+ dai-link@3 {
+ reg = <MI2S_QUATERNARY>;
+ qcom,playback-sd-lines = <1>;
+ };
+};
+
&mdss {
status = "okay";
};
@@ -253,6 +275,10 @@ &mdss_dsi0 {
pinctrl-1 = <&mdss_sleep>;
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5400000>;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -265,6 +291,13 @@ pm8916_l17: l17 {
};
};
+&q6afedai {
+ dai@22 {
+ reg = <QUATERNARY_MI2S_RX>;
+ qcom,sd-lines = <1>;
+ };
+};
+
&sdhc_1 {
status = "okay";
};
@@ -279,6 +312,28 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};
+&sound {
+ status = "okay";
+
+ model = "samsung-a2015";
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+
+ pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>;
+ pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>;
+ pinctrl-names = "default", "sleep";
+};
+
+&sound_dai_quaternary {
+ status = "okay";
+
+ codec {
+ sound-dai = <&speaker_codec>;
+ };
+};
+
&usb {
status = "okay";
extcon = <&muic>, <&muic>;
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi
index 0824ab041d80..3c49dac92d2d 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-e2015-common.dtsi
@@ -65,6 +65,10 @@ accelerometer@1d {
};
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5a00000>;
+};
+
®_motor_vdd {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts
index 3f145dde4059..5882b3a593b8 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-grandmax.dts
@@ -49,6 +49,10 @@ ®_touch_key {
status = "disabled";
};
+&sound {
+ model = "samsung-gmax"; /* No secondary microphone */
+};
+
&tlmm {
gpio_leds_default: gpio-led-default-state {
pins = "gpio60";
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 16:51 ` [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem Stephan Gerhold
@ 2023-09-26 18:54 ` Konrad Dybcio
2023-09-26 19:26 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:54 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue, Lin, Meng-Bo
On 26.09.2023 18:51, Stephan Gerhold wrote:
> Enable sound and modem for the Samsung A2015 based devices (A3, A5, E5,
> E7, Grand Max). The setup is similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Earpiece/headphones/microphones via digital/analog codec in
> MSM8916/PM8916
> - WWAN Internet via BAM-DMUX
>
> except:
>
> - NXP TFA9895 codec for speaker on Quaternary MI2S
> - Samsung-specific audio jack detection (not supported yet)
>
> [Lin: Add e2015 and grandmax]
> Co-developed-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> .../dts/qcom/msm8916-samsung-a2015-common.dtsi | 55 ++++++++++++++++++++++
> .../dts/qcom/msm8916-samsung-e2015-common.dtsi | 4 ++
> .../boot/dts/qcom/msm8916-samsung-grandmax.dts | 4 ++
> 3 files changed, 63 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> index 0b29132b74e1..f71b18d89bf9 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> @@ -1,10 +1,13 @@
> // SPDX-License-Identifier: GPL-2.0-only
>
> #include "msm8916-pm8916.dtsi"
> +#include "msm8916-modem-qdsp6.dtsi"
> +
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> #include <dt-bindings/interrupt-controller/irq.h>
> #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
> +#include <dt-bindings/sound/apq8016-lpass.h>
>
> / {
> aliases {
> @@ -196,6 +199,18 @@ vibrator: vibrator {
> };
> };
>
> +&blsp_i2c1 {
> + status = "okay";
> +
> + speaker_codec: audio-codec@34 {
> + compatible = "nxp,tfa9895";
> + reg = <0x34>;
> + vddd-supply = <&pm8916_l5>;
> + sound-name-prefix = "Speaker";
> + #sound-dai-cells = <0>;
> + };
> +};
> +
> &blsp_i2c2 {
> status = "okay";
>
> @@ -243,6 +258,13 @@ &gpu {
> status = "okay";
> };
>
> +&lpass {
> + dai-link@3 {
> + reg = <MI2S_QUATERNARY>;
> + qcom,playback-sd-lines = <1>;
> + };
> +};
Is that not status = reserved?
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 18:54 ` Konrad Dybcio
@ 2023-09-26 19:26 ` Stephan Gerhold
2023-09-26 19:56 ` Konrad Dybcio
0 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:26 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
On Tue, Sep 26, 2023 at 08:54:29PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > Enable sound and modem for the Samsung A2015 based devices (A3, A5, E5,
> > E7, Grand Max). The setup is similar to most MSM8916 devices, i.e.:
> >
> > - QDSP6 audio
> > - Earpiece/headphones/microphones via digital/analog codec in
> > MSM8916/PM8916
> > - WWAN Internet via BAM-DMUX
> >
> > except:
> >
> > - NXP TFA9895 codec for speaker on Quaternary MI2S
> > - Samsung-specific audio jack detection (not supported yet)
> >
> > [Lin: Add e2015 and grandmax]
> > Co-developed-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> > Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> > .../dts/qcom/msm8916-samsung-a2015-common.dtsi | 55 ++++++++++++++++++++++
> > .../dts/qcom/msm8916-samsung-e2015-common.dtsi | 4 ++
> > .../boot/dts/qcom/msm8916-samsung-grandmax.dts | 4 ++
> > 3 files changed, 63 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> > index 0b29132b74e1..f71b18d89bf9 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi
> > @@ -1,10 +1,13 @@
> > // SPDX-License-Identifier: GPL-2.0-only
> >
> > #include "msm8916-pm8916.dtsi"
> > +#include "msm8916-modem-qdsp6.dtsi"
> > +
> > #include <dt-bindings/gpio/gpio.h>
> > #include <dt-bindings/input/input.h>
> > #include <dt-bindings/interrupt-controller/irq.h>
> > #include <dt-bindings/pinctrl/qcom,pmic-gpio.h>
> > +#include <dt-bindings/sound/apq8016-lpass.h>
> >
> > / {
> > aliases {
> > @@ -196,6 +199,18 @@ vibrator: vibrator {
> > };
> > };
> >
> > +&blsp_i2c1 {
> > + status = "okay";
> > +
> > + speaker_codec: audio-codec@34 {
> > + compatible = "nxp,tfa9895";
> > + reg = <0x34>;
> > + vddd-supply = <&pm8916_l5>;
> > + sound-name-prefix = "Speaker";
> > + #sound-dai-cells = <0>;
> > + };
> > +};
> > +
> > &blsp_i2c2 {
> > status = "okay";
> >
> > @@ -243,6 +258,13 @@ &gpu {
> > status = "okay";
> > };
> >
> > +&lpass {
> > + dai-link@3 {
> > + reg = <MI2S_QUATERNARY>;
> > + qcom,playback-sd-lines = <1>;
> > + };
> > +};
> Is that not status = reserved?
>
Correct. This is here to simplify switching to the modem-bypass audio
routing if someone does not need (or want) the modem. The direct audio
path with the LPASS drivers tends to be more reliable and configurable
(especially wrt bit formats, sampling rates, latency, channels etc).
I know that at some point this helped someone who tried to use an old
phone as some kind of portable musical instrument / synthesizer.
It's not too obvious that these definitions would be needed when making
those changes (because devices using the standard SD lines (i.e <0>) do
not need it). If you forget about this you get non-functional audio with
no error or any hint what could be wrong.
To simplify switching between the different audio routing options, the
lk2nd bootloader actually has an option to do this transformation in the
DTB automagically during boot. It's sort of like a DTB overlay that
disables the QDSP6 audio path and enables this node instead. The DAI
links are also adjusted where necessary.
Do you think a comment would help here?
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 19:26 ` Stephan Gerhold
@ 2023-09-26 19:56 ` Konrad Dybcio
2023-09-26 20:09 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 19:56 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
[...]
>>> +
>>> &blsp_i2c2 {
>>> status = "okay";
>>>
>>> @@ -243,6 +258,13 @@ &gpu {
>>> status = "okay";
>>> };
>>>
>>> +&lpass {
>>> + dai-link@3 {
>>> + reg = <MI2S_QUATERNARY>;
>>> + qcom,playback-sd-lines = <1>;
>>> + };
>>> +};
>> Is that not status = reserved?
>>
>
> Correct. This is here to simplify switching to the modem-bypass audio
> routing if someone does not need (or want) the modem. The direct audio
> path with the LPASS drivers tends to be more reliable and configurable
> (especially wrt bit formats, sampling rates, latency, channels etc).
> I know that at some point this helped someone who tried to use an old
> phone as some kind of portable musical instrument / synthesizer.
>
> It's not too obvious that these definitions would be needed when making
> those changes (because devices using the standard SD lines (i.e <0>) do
> not need it). If you forget about this you get non-functional audio with
> no error or any hint what could be wrong.
>
> To simplify switching between the different audio routing options, the
> lk2nd bootloader actually has an option to do this transformation in the
> DTB automagically during boot. It's sort of like a DTB overlay that
> disables the QDSP6 audio path and enables this node instead. The DAI
> links are also adjusted where necessary.
>
> Do you think a comment would help here?
I'd say a comment would be necessary here :D
While I understand this use-case, I believe this is better suited
for an actual DTBO or something entirely kept inside lk2nd.
Otherwise this looks very confusing to an outside reader.
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 19:56 ` Konrad Dybcio
@ 2023-09-26 20:09 ` Stephan Gerhold
2023-09-26 20:18 ` Konrad Dybcio
0 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 20:09 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
On Tue, Sep 26, 2023 at 09:56:12PM +0200, Konrad Dybcio wrote:
> [...]
>
> >>> +
> >>> &blsp_i2c2 {
> >>> status = "okay";
> >>>
> >>> @@ -243,6 +258,13 @@ &gpu {
> >>> status = "okay";
> >>> };
> >>>
> >>> +&lpass {
> >>> + dai-link@3 {
> >>> + reg = <MI2S_QUATERNARY>;
> >>> + qcom,playback-sd-lines = <1>;
> >>> + };
> >>> +};
> >> Is that not status = reserved?
> >>
> >
> > Correct. This is here to simplify switching to the modem-bypass audio
> > routing if someone does not need (or want) the modem. The direct audio
> > path with the LPASS drivers tends to be more reliable and configurable
> > (especially wrt bit formats, sampling rates, latency, channels etc).
> > I know that at some point this helped someone who tried to use an old
> > phone as some kind of portable musical instrument / synthesizer.
> >
> > It's not too obvious that these definitions would be needed when making
> > those changes (because devices using the standard SD lines (i.e <0>) do
> > not need it). If you forget about this you get non-functional audio with
> > no error or any hint what could be wrong.
> >
> > To simplify switching between the different audio routing options, the
> > lk2nd bootloader actually has an option to do this transformation in the
> > DTB automagically during boot. It's sort of like a DTB overlay that
> > disables the QDSP6 audio path and enables this node instead. The DAI
> > links are also adjusted where necessary.
> >
> > Do you think a comment would help here?
> I'd say a comment would be necessary here :D
>
No problem, I will try to add something simple.
> While I understand this use-case, I believe this is better suited
> for an actual DTBO or something entirely kept inside lk2nd.
> Otherwise this looks very confusing to an outside reader.
>
Translating from the QDSP6 audio setup to the LPASS one is mostly simple
but not entirely trivial (especially the patching needed for the DAI
links). Main blocker for DTBOs is that you can only add or change, but
AFAIK there is no mechanism to _delete_ or fully recreate nodes.
I guess I could maybe derive this from the QDSP6 definitions using
custom magic code, but the code complexity for that is much higher than
adding these nodes here for completeness.
Let me try to add some comment first.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 20:09 ` Stephan Gerhold
@ 2023-09-26 20:18 ` Konrad Dybcio
2023-09-26 20:27 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 20:18 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
On 26.09.2023 22:09, Stephan Gerhold wrote:
> On Tue, Sep 26, 2023 at 09:56:12PM +0200, Konrad Dybcio wrote:
>> [...]
>>
>>>>> +
>>>>> &blsp_i2c2 {
>>>>> status = "okay";
>>>>>
>>>>> @@ -243,6 +258,13 @@ &gpu {
>>>>> status = "okay";
>>>>> };
>>>>>
>>>>> +&lpass {
>>>>> + dai-link@3 {
>>>>> + reg = <MI2S_QUATERNARY>;
>>>>> + qcom,playback-sd-lines = <1>;
>>>>> + };
>>>>> +};
>>>> Is that not status = reserved?
>>>>
>>>
>>> Correct. This is here to simplify switching to the modem-bypass audio
>>> routing if someone does not need (or want) the modem. The direct audio
>>> path with the LPASS drivers tends to be more reliable and configurable
>>> (especially wrt bit formats, sampling rates, latency, channels etc).
>>> I know that at some point this helped someone who tried to use an old
>>> phone as some kind of portable musical instrument / synthesizer.
>>>
>>> It's not too obvious that these definitions would be needed when making
>>> those changes (because devices using the standard SD lines (i.e <0>) do
>>> not need it). If you forget about this you get non-functional audio with
>>> no error or any hint what could be wrong.
>>>
>>> To simplify switching between the different audio routing options, the
>>> lk2nd bootloader actually has an option to do this transformation in the
>>> DTB automagically during boot. It's sort of like a DTB overlay that
>>> disables the QDSP6 audio path and enables this node instead. The DAI
>>> links are also adjusted where necessary.
>>>
>>> Do you think a comment would help here?
>> I'd say a comment would be necessary here :D
>>
>
> No problem, I will try to add something simple.
>
>> While I understand this use-case, I believe this is better suited
>> for an actual DTBO or something entirely kept inside lk2nd.
>> Otherwise this looks very confusing to an outside reader.
>>
>
> Translating from the QDSP6 audio setup to the LPASS one is mostly simple
> but not entirely trivial (especially the patching needed for the DAI
> links). Main blocker for DTBOs is that you can only add or change, but
> AFAIK there is no mechanism to _delete_ or fully recreate nodes.
Correct.
>
> I guess I could maybe derive this from the QDSP6 definitions using
> custom magic code, but the code complexity for that is much higher than
> adding these nodes here for completeness.
I hate to be the bearer of bad news, but this is probably more
of a "do we reasonably want this upstream" type question, as
you'll probably get some grumpy emails about upstream not caring
about what's outside the mainline tree..
>
> Let me try to add some comment first.
Please try to explicitly explain the reasoning of why one would
want this change and what are the drawbacks etc.
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 20:18 ` Konrad Dybcio
@ 2023-09-26 20:27 ` Stephan Gerhold
2023-09-26 20:29 ` Konrad Dybcio
0 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 20:27 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
On Tue, Sep 26, 2023 at 10:18:22PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 22:09, Stephan Gerhold wrote:
> > On Tue, Sep 26, 2023 at 09:56:12PM +0200, Konrad Dybcio wrote:
> >> [...]
> >>
> >>>>> +
> >>>>> &blsp_i2c2 {
> >>>>> status = "okay";
> >>>>>
> >>>>> @@ -243,6 +258,13 @@ &gpu {
> >>>>> status = "okay";
> >>>>> };
> >>>>>
> >>>>> +&lpass {
> >>>>> + dai-link@3 {
> >>>>> + reg = <MI2S_QUATERNARY>;
> >>>>> + qcom,playback-sd-lines = <1>;
> >>>>> + };
> >>>>> +};
> >>>> Is that not status = reserved?
> >>>>
> >>>
> >>> Correct. This is here to simplify switching to the modem-bypass audio
> >>> routing if someone does not need (or want) the modem. The direct audio
> >>> path with the LPASS drivers tends to be more reliable and configurable
> >>> (especially wrt bit formats, sampling rates, latency, channels etc).
> >>> I know that at some point this helped someone who tried to use an old
> >>> phone as some kind of portable musical instrument / synthesizer.
> >>>
> >>> It's not too obvious that these definitions would be needed when making
> >>> those changes (because devices using the standard SD lines (i.e <0>) do
> >>> not need it). If you forget about this you get non-functional audio with
> >>> no error or any hint what could be wrong.
> >>>
> >>> To simplify switching between the different audio routing options, the
> >>> lk2nd bootloader actually has an option to do this transformation in the
> >>> DTB automagically during boot. It's sort of like a DTB overlay that
> >>> disables the QDSP6 audio path and enables this node instead. The DAI
> >>> links are also adjusted where necessary.
> >>>
> >>> Do you think a comment would help here?
> >> I'd say a comment would be necessary here :D
> >>
> >
> > No problem, I will try to add something simple.
> >
> >> While I understand this use-case, I believe this is better suited
> >> for an actual DTBO or something entirely kept inside lk2nd.
> >> Otherwise this looks very confusing to an outside reader.
> >>
> >
> > Translating from the QDSP6 audio setup to the LPASS one is mostly simple
> > but not entirely trivial (especially the patching needed for the DAI
> > links). Main blocker for DTBOs is that you can only add or change, but
> > AFAIK there is no mechanism to _delete_ or fully recreate nodes.
> Correct.
>
> >
> > I guess I could maybe derive this from the QDSP6 definitions using
> > custom magic code, but the code complexity for that is much higher than
> > adding these nodes here for completeness.
> I hate to be the bearer of bad news, but this is probably more
> of a "do we reasonably want this upstream" type question, as
> you'll probably get some grumpy emails about upstream not caring
> about what's outside the mainline tree..
>
IMHO this is hardly a "downstream" type of situation. The whole point of
the magic in lk2nd is to make the life for the mainline code base easier
and simpler, while still allowing the "bypass modem audio" feature with
an unmodified kernel.
Before implementing it like this I used to have this directly in the
kernel tree, by duplicating each device into a normal XYZ.dts and
"XYZ-no-modem.dts". If you apply this to the total of ~45 different
MSM8916/MSM8939 DTBs I would like to get upstream this options gets
extremely ugly. :'D
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 20:27 ` Stephan Gerhold
@ 2023-09-26 20:29 ` Konrad Dybcio
2023-09-26 20:36 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 20:29 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
On 26.09.2023 22:27, Stephan Gerhold wrote:
> On Tue, Sep 26, 2023 at 10:18:22PM +0200, Konrad Dybcio wrote:
>> On 26.09.2023 22:09, Stephan Gerhold wrote:
>>> On Tue, Sep 26, 2023 at 09:56:12PM +0200, Konrad Dybcio wrote:
>>>> [...]
>>>>
>>>>>>> +
>>>>>>> &blsp_i2c2 {
>>>>>>> status = "okay";
>>>>>>>
>>>>>>> @@ -243,6 +258,13 @@ &gpu {
>>>>>>> status = "okay";
>>>>>>> };
>>>>>>>
>>>>>>> +&lpass {
>>>>>>> + dai-link@3 {
>>>>>>> + reg = <MI2S_QUATERNARY>;
>>>>>>> + qcom,playback-sd-lines = <1>;
>>>>>>> + };
>>>>>>> +};
>>>>>> Is that not status = reserved?
>>>>>>
>>>>>
>>>>> Correct. This is here to simplify switching to the modem-bypass audio
>>>>> routing if someone does not need (or want) the modem. The direct audio
>>>>> path with the LPASS drivers tends to be more reliable and configurable
>>>>> (especially wrt bit formats, sampling rates, latency, channels etc).
>>>>> I know that at some point this helped someone who tried to use an old
>>>>> phone as some kind of portable musical instrument / synthesizer.
>>>>>
>>>>> It's not too obvious that these definitions would be needed when making
>>>>> those changes (because devices using the standard SD lines (i.e <0>) do
>>>>> not need it). If you forget about this you get non-functional audio with
>>>>> no error or any hint what could be wrong.
>>>>>
>>>>> To simplify switching between the different audio routing options, the
>>>>> lk2nd bootloader actually has an option to do this transformation in the
>>>>> DTB automagically during boot. It's sort of like a DTB overlay that
>>>>> disables the QDSP6 audio path and enables this node instead. The DAI
>>>>> links are also adjusted where necessary.
>>>>>
>>>>> Do you think a comment would help here?
>>>> I'd say a comment would be necessary here :D
>>>>
>>>
>>> No problem, I will try to add something simple.
>>>
>>>> While I understand this use-case, I believe this is better suited
>>>> for an actual DTBO or something entirely kept inside lk2nd.
>>>> Otherwise this looks very confusing to an outside reader.
>>>>
>>>
>>> Translating from the QDSP6 audio setup to the LPASS one is mostly simple
>>> but not entirely trivial (especially the patching needed for the DAI
>>> links). Main blocker for DTBOs is that you can only add or change, but
>>> AFAIK there is no mechanism to _delete_ or fully recreate nodes.
>> Correct.
>>
>>>
>>> I guess I could maybe derive this from the QDSP6 definitions using
>>> custom magic code, but the code complexity for that is much higher than
>>> adding these nodes here for completeness.
>> I hate to be the bearer of bad news, but this is probably more
>> of a "do we reasonably want this upstream" type question, as
>> you'll probably get some grumpy emails about upstream not caring
>> about what's outside the mainline tree..
>>
>
> IMHO this is hardly a "downstream" type of situation. The whole point of
> the magic in lk2nd is to make the life for the mainline code base easier
> and simpler, while still allowing the "bypass modem audio" feature with
> an unmodified kernel.
>
> Before implementing it like this I used to have this directly in the
> kernel tree, by duplicating each device into a normal XYZ.dts and
> "XYZ-no-modem.dts". If you apply this to the total of ~45 different
> MSM8916/MSM8939 DTBs I would like to get upstream this options gets
> extremely ugly. :'D
Maybe a kernel module parameter could be somehow useful here?
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
2023-09-26 20:29 ` Konrad Dybcio
@ 2023-09-26 20:36 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 20:36 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
On Tue, Sep 26, 2023 at 10:29:29PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 22:27, Stephan Gerhold wrote:
> > On Tue, Sep 26, 2023 at 10:18:22PM +0200, Konrad Dybcio wrote:
> >> On 26.09.2023 22:09, Stephan Gerhold wrote:
> >>> On Tue, Sep 26, 2023 at 09:56:12PM +0200, Konrad Dybcio wrote:
> >>>> [...]
> >>>>
> >>>>>>> +
> >>>>>>> &blsp_i2c2 {
> >>>>>>> status = "okay";
> >>>>>>>
> >>>>>>> @@ -243,6 +258,13 @@ &gpu {
> >>>>>>> status = "okay";
> >>>>>>> };
> >>>>>>>
> >>>>>>> +&lpass {
> >>>>>>> + dai-link@3 {
> >>>>>>> + reg = <MI2S_QUATERNARY>;
> >>>>>>> + qcom,playback-sd-lines = <1>;
> >>>>>>> + };
> >>>>>>> +};
> >>>>>> Is that not status = reserved?
> >>>>>>
> >>>>>
> >>>>> Correct. This is here to simplify switching to the modem-bypass audio
> >>>>> routing if someone does not need (or want) the modem. The direct audio
> >>>>> path with the LPASS drivers tends to be more reliable and configurable
> >>>>> (especially wrt bit formats, sampling rates, latency, channels etc).
> >>>>> I know that at some point this helped someone who tried to use an old
> >>>>> phone as some kind of portable musical instrument / synthesizer.
> >>>>>
> >>>>> It's not too obvious that these definitions would be needed when making
> >>>>> those changes (because devices using the standard SD lines (i.e <0>) do
> >>>>> not need it). If you forget about this you get non-functional audio with
> >>>>> no error or any hint what could be wrong.
> >>>>>
> >>>>> To simplify switching between the different audio routing options, the
> >>>>> lk2nd bootloader actually has an option to do this transformation in the
> >>>>> DTB automagically during boot. It's sort of like a DTB overlay that
> >>>>> disables the QDSP6 audio path and enables this node instead. The DAI
> >>>>> links are also adjusted where necessary.
> >>>>>
> >>>>> Do you think a comment would help here?
> >>>> I'd say a comment would be necessary here :D
> >>>>
> >>>
> >>> No problem, I will try to add something simple.
> >>>
> >>>> While I understand this use-case, I believe this is better suited
> >>>> for an actual DTBO or something entirely kept inside lk2nd.
> >>>> Otherwise this looks very confusing to an outside reader.
> >>>>
> >>>
> >>> Translating from the QDSP6 audio setup to the LPASS one is mostly simple
> >>> but not entirely trivial (especially the patching needed for the DAI
> >>> links). Main blocker for DTBOs is that you can only add or change, but
> >>> AFAIK there is no mechanism to _delete_ or fully recreate nodes.
> >> Correct.
> >>
> >>>
> >>> I guess I could maybe derive this from the QDSP6 definitions using
> >>> custom magic code, but the code complexity for that is much higher than
> >>> adding these nodes here for completeness.
> >> I hate to be the bearer of bad news, but this is probably more
> >> of a "do we reasonably want this upstream" type question, as
> >> you'll probably get some grumpy emails about upstream not caring
> >> about what's outside the mainline tree..
> >>
> >
> > IMHO this is hardly a "downstream" type of situation. The whole point of
> > the magic in lk2nd is to make the life for the mainline code base easier
> > and simpler, while still allowing the "bypass modem audio" feature with
> > an unmodified kernel.
> >
> > Before implementing it like this I used to have this directly in the
> > kernel tree, by duplicating each device into a normal XYZ.dts and
> > "XYZ-no-modem.dts". If you apply this to the total of ~45 different
> > MSM8916/MSM8939 DTBs I would like to get upstream this options gets
> > extremely ugly. :'D
> Maybe a kernel module parameter could be somehow useful here?
>
Maybe, but ultimately this affecs multiple modules that do not
necessarily know about each other. You need to enable the &lpass node
but also adjust the DAI links in the &sound node to refer to the lpass
DAIs instead of q6afe/q6routing. Implementing this in the kernel would
be complexity everyone would have to carry, while in lk2nd it's local to
the devices that can actually make use of it.
With the device tree we have the flexibility to adjust it based on
device-specifics (RAM size, display panels, broken CPU cores, ...).
I think it's perfectly fine if the bootloader makes good use of this
capability to keep Linux code simple and focused.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (3 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 04/13] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:55 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 06/13] arm64: dts: qcom: msm8916-wingtech-wt88047: " Stephan Gerhold
` (7 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold
Enable sound and modem for the Samsung S4 Mini Value Edition. The setup
is similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Speaker/earpiece/headphones/microphones via digital/analog codec in
MSM8916/PM8916
- WWAN Internet via BAM-DMUX
except:
- Samsung-specific audio jack detection (not supported yet)
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
index 68da2a2d3077..5f33aa0ad7b5 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
@@ -6,6 +6,8 @@
/dts-v1/;
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
@@ -319,6 +321,10 @@ &blsp_uart2 {
status = "okay";
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5a00000>;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -350,6 +356,14 @@ &sdhc_2 {
no-1-8-v;
};
+&sound {
+ status = "okay";
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+};
+
&usb {
status = "okay";
extcon = <&muic>, <&muic>;
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem
2023-09-26 16:51 ` [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: " Stephan Gerhold
@ 2023-09-26 18:55 ` Konrad Dybcio
2023-09-26 19:29 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:55 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue
On 26.09.2023 18:51, Stephan Gerhold wrote:
> Enable sound and modem for the Samsung S4 Mini Value Edition. The setup
> is similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Speaker/earpiece/headphones/microphones via digital/analog codec in
> MSM8916/PM8916
> - WWAN Internet via BAM-DMUX
>
> except:
>
> - Samsung-specific audio jack detection (not supported yet)
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts | 14 ++++++++++++++
> 1 file changed, 14 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
> index 68da2a2d3077..5f33aa0ad7b5 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
> @@ -6,6 +6,8 @@
> /dts-v1/;
>
> #include "msm8916-pm8916.dtsi"
> +#include "msm8916-modem-qdsp6.dtsi"
> +
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> #include <dt-bindings/interrupt-controller/irq.h>
> @@ -319,6 +321,10 @@ &blsp_uart2 {
> status = "okay";
> };
>
> +&mpss_mem {
> + reg = <0x0 0x86800000 0x0 0x5a00000>;
> +};
> +
> &pm8916_resin {
> status = "okay";
> linux,code = <KEY_VOLUMEDOWN>;
> @@ -350,6 +356,14 @@ &sdhc_2 {
> no-1-8-v;
> };
>
> +&sound {
> + status = "okay";
> + audio-routing =
> + "AMIC1", "MIC BIAS External1",
> + "AMIC2", "MIC BIAS Internal2",
> + "AMIC3", "MIC BIAS External1";
> +};
I *think* we should be able to harmlessly enable &audio globally?
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem
2023-09-26 18:55 ` Konrad Dybcio
@ 2023-09-26 19:29 ` Stephan Gerhold
2023-09-26 19:57 ` Konrad Dybcio
0 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:29 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On Tue, Sep 26, 2023 at 08:55:14PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > Enable sound and modem for the Samsung S4 Mini Value Edition. The setup
> > is similar to most MSM8916 devices, i.e.:
> >
> > - QDSP6 audio
> > - Speaker/earpiece/headphones/microphones via digital/analog codec in
> > MSM8916/PM8916
> > - WWAN Internet via BAM-DMUX
> >
> > except:
> >
> > - Samsung-specific audio jack detection (not supported yet)
> >
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> > arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts | 14 ++++++++++++++
> > 1 file changed, 14 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
> > index 68da2a2d3077..5f33aa0ad7b5 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
> > +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts
> > @@ -6,6 +6,8 @@
> > /dts-v1/;
> >
> > #include "msm8916-pm8916.dtsi"
> > +#include "msm8916-modem-qdsp6.dtsi"
> > +
> > #include <dt-bindings/gpio/gpio.h>
> > #include <dt-bindings/input/input.h>
> > #include <dt-bindings/interrupt-controller/irq.h>
> > @@ -319,6 +321,10 @@ &blsp_uart2 {
> > status = "okay";
> > };
> >
> > +&mpss_mem {
> > + reg = <0x0 0x86800000 0x0 0x5a00000>;
> > +};
> > +
> > &pm8916_resin {
> > status = "okay";
> > linux,code = <KEY_VOLUMEDOWN>;
> > @@ -350,6 +356,14 @@ &sdhc_2 {
> > no-1-8-v;
> > };
> >
> > +&sound {
> > + status = "okay";
> > + audio-routing =
> > + "AMIC1", "MIC BIAS External1",
> > + "AMIC2", "MIC BIAS Internal2",
> > + "AMIC3", "MIC BIAS External1";
> > +};
> I *think* we should be able to harmlessly enable &audio globally?
>
What about boards that do not have/use audio at all? (see
msm8916-ufi.dtsi). We don't even want to load the kernel modules on
those.
IMO the SoC dtsi should always be minimal by default. This also
guarantees that you don't run into trouble because of half- or
incorrectly configured components during early bring-up, especially if
you don't have serial and are hoping to get the device booting far
enough to debug it.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem
2023-09-26 19:29 ` Stephan Gerhold
@ 2023-09-26 19:57 ` Konrad Dybcio
2023-09-26 20:04 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 19:57 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
[...]
>>>
>>> +&sound {
>>> + status = "okay";
>>> + audio-routing =
>>> + "AMIC1", "MIC BIAS External1",
>>> + "AMIC2", "MIC BIAS Internal2",
>>> + "AMIC3", "MIC BIAS External1";
>>> +};
>> I *think* we should be able to harmlessly enable &audio globally?
>>
>
> What about boards that do not have/use audio at all? (see
> msm8916-ufi.dtsi). We don't even want to load the kernel modules on
> those.
Is it really an issue other than losing a few kb of memory?
>
> IMO the SoC dtsi should always be minimal by default. This also
> guarantees that you don't run into trouble because of half- or
> incorrectly configured components during early bring-up, especially if
> you don't have serial and are hoping to get the device booting far
> enough to debug it.
Generally I'd agree, but if the audio machine driver cannot NOP
successfully without a topology configuration, that's a problem.
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem
2023-09-26 19:57 ` Konrad Dybcio
@ 2023-09-26 20:04 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 20:04 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue
On Tue, Sep 26, 2023 at 09:57:51PM +0200, Konrad Dybcio wrote:
> [...]
>
> >>>
> >>> +&sound {
> >>> + status = "okay";
> >>> + audio-routing =
> >>> + "AMIC1", "MIC BIAS External1",
> >>> + "AMIC2", "MIC BIAS Internal2",
> >>> + "AMIC3", "MIC BIAS External1";
> >>> +};
> >> I *think* we should be able to harmlessly enable &audio globally?
> >>
> >
> > What about boards that do not have/use audio at all? (see
> > msm8916-ufi.dtsi). We don't even want to load the kernel modules on
> > those.
> Is it really an issue other than losing a few kb of memory?
>
Well, the msm8916-ufi.dtsi boards (basically USB modem/WiFi sticks)
have 512 MiB of RAM, with 85 MiB reserved for modem firmware, plus more
for TZ, HYP etc etc. That's not too much :D
> >
> > IMO the SoC dtsi should always be minimal by default. This also
> > guarantees that you don't run into trouble because of half- or
> > incorrectly configured components during early bring-up, especially if
> > you don't have serial and are hoping to get the device booting far
> > enough to debug it.
> Generally I'd agree, but if the audio machine driver cannot NOP
> successfully without a topology configuration, that's a problem.
>
I think it will effectively fail to probe because there are no DAI links
and no "model". I guess you could consider this to be a NOP but it's
confusing and takes away the attention from the actual errors in dmesg.
I would say it's disabled by default for the same reason that WiFi,
SDHCI, UFS etc etc are disabled by default. They simply don't do
anything useful without additional configuration & hardware support.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 06/13] arm64: dts: qcom: msm8916-wingtech-wt88047: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (4 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 05/13] arm64: dts: qcom: msm8916-samsung-serranove: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:56 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 07/13] arm64: dts: qcom: msm8916-alcatel-idol347: " Stephan Gerhold
` (6 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold
Enable sound and modem for the Xiaomi Redmi 2. The setup
is similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Earpiece/headphones/microphones via digital/analog codec in
MSM8916/PM8916
- Audio jack detection via analog codec in PM8916
- WWAN Internet via BAM-DMUX
except:
- Speaker amplifier is connected to HPH_R (headphones) output of the
analog codec. There is a separate analog switch that allows disabling
playback via the headphone jack.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../boot/dts/qcom/msm8916-wingtech-wt88047.dts | 76 ++++++++++++++++++++++
1 file changed, 76 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts b/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
index 419f35c1fc92..600c225a2568 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
@@ -6,6 +6,8 @@
/dts-v1/;
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
@@ -25,6 +27,28 @@ chosen {
stdout-path = "serial0";
};
+ speaker_amp: audio-amplifier {
+ compatible = "simple-audio-amplifier";
+ enable-gpios = <&tlmm 117 GPIO_ACTIVE_HIGH>;
+ sound-name-prefix = "Speaker Amp";
+ pinctrl-0 = <&speaker_amp_default>;
+ pinctrl-names = "default";
+ };
+
+ /*
+ * This seems to be actually an analog switch that either routes audio
+ * to the headphone jack or nowhere. Given that we need to enable a GPIO
+ * to get sound on headphones, modelling it as simple-audio-amplifier
+ * works just fine.
+ */
+ headphones_switch: audio-switch {
+ compatible = "simple-audio-amplifier";
+ enable-gpios = <&tlmm 8 GPIO_ACTIVE_HIGH>;
+ sound-name-prefix = "Headphones Switch";
+ pinctrl-0 = <&headphones_switch_default>;
+ pinctrl-names = "default";
+ };
+
flash-led-controller {
compatible = "ocs,ocp8110";
enable-gpios = <&tlmm 31 GPIO_ACTIVE_HIGH>;
@@ -146,6 +170,18 @@ &blsp_uart2 {
status = "okay";
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5100000>;
+};
+
+&pm8916_codec {
+ qcom,micbias1-ext-cap;
+ qcom,micbias-lvl = <2800>;
+ qcom,mbhc-vthreshold-low = <75 100 120 180 500>;
+ qcom,mbhc-vthreshold-high = <75 100 120 180 500>;
+ qcom,hphl-jack-type-normally-open;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -180,6 +216,32 @@ &sdhc_2 {
non-removable;
};
+&sound {
+ status = "okay";
+
+ /*
+ * Provide widgets/pin-switches to allow enabling speaker and headphones
+ * separately. Both are routed via the HPH_L/HPH_R pins of the codec.
+ */
+ model = "wt88047";
+ widgets =
+ "Speaker", "Speaker",
+ "Headphone", "Headphones";
+ pin-switches = "Speaker", "Headphones";
+ audio-routing =
+ "Speaker", "Speaker Amp OUTL",
+ "Speaker", "Speaker Amp OUTR",
+ "Speaker Amp INL", "HPH_R",
+ "Speaker Amp INR", "HPH_R",
+ "Headphones", "Headphones Switch OUTL",
+ "Headphones", "Headphones Switch OUTR",
+ "Headphones Switch INL", "HPH_L",
+ "Headphones Switch INR", "HPH_R",
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2";
+ aux-devs = <&speaker_amp>, <&headphones_switch>;
+};
+
&usb {
status = "okay";
extcon = <&usb_id>, <&usb_id>;
@@ -226,6 +288,13 @@ gpio_keys_default: gpio-keys-default-state {
bias-pull-up;
};
+ headphones_switch_default: headphones-switch-default-state {
+ pins = "gpio8";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
imu_default: imu-default-state {
pins = "gpio115";
function = "gpio";
@@ -234,6 +303,13 @@ imu_default: imu-default-state {
bias-disable;
};
+ speaker_amp_default: speaker-amp-default-state {
+ pins = "gpio117";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
touchscreen_default: touchscreen-default-state {
touchscreen-pins {
pins = "gpio13";
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 06/13] arm64: dts: qcom: msm8916-wingtech-wt88047: Add sound and modem
2023-09-26 16:51 ` [PATCH 06/13] arm64: dts: qcom: msm8916-wingtech-wt88047: " Stephan Gerhold
@ 2023-09-26 18:56 ` Konrad Dybcio
0 siblings, 0 replies; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:56 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue
On 26.09.2023 18:51, Stephan Gerhold wrote:
> Enable sound and modem for the Xiaomi Redmi 2. The setup
> is similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Earpiece/headphones/microphones via digital/analog codec in
> MSM8916/PM8916
> - Audio jack detection via analog codec in PM8916
> - WWAN Internet via BAM-DMUX
>
> except:
>
> - Speaker amplifier is connected to HPH_R (headphones) output of the
> analog codec. There is a separate analog switch that allows disabling
> playback via the headphone jack.
>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> .../boot/dts/qcom/msm8916-wingtech-wt88047.dts | 76 ++++++++++++++++++++++
> 1 file changed, 76 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts b/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
> index 419f35c1fc92..600c225a2568 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-wingtech-wt88047.dts
> @@ -6,6 +6,8 @@
> /dts-v1/;
>
> #include "msm8916-pm8916.dtsi"
> +#include "msm8916-modem-qdsp6.dtsi"
> +
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> #include <dt-bindings/leds/common.h>
> @@ -25,6 +27,28 @@ chosen {
> stdout-path = "serial0";
> };
>
> + speaker_amp: audio-amplifier {
> + compatible = "simple-audio-amplifier";
> + enable-gpios = <&tlmm 117 GPIO_ACTIVE_HIGH>;
> + sound-name-prefix = "Speaker Amp";
> + pinctrl-0 = <&speaker_amp_default>;
> + pinctrl-names = "default";
> + };
> +
> + /*
> + * This seems to be actually an analog switch that either routes audio
> + * to the headphone jack or nowhere. Given that we need to enable a GPIO
> + * to get sound on headphones, modelling it as simple-audio-amplifier
> + * works just fine.
> + */
Funny phones, as always
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 07/13] arm64: dts: qcom: msm8916-alcatel-idol347: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (5 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 06/13] arm64: dts: qcom: msm8916-wingtech-wt88047: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:58 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 08/13] arm64: dts: qcom: msm8916-asus-z00l: " Stephan Gerhold
` (5 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Vincent Knecht
From: Vincent Knecht <vincent.knecht@mailoo.org>
Enable sound and modem for the Alcatel Idol 3 (4.7"). The setup is
similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Microphones via digital/analog codec in MSM8916/PM8916
- WWAN Internet via BAM-DMUX
except:
- Stereo NXP TFA9890 codecs for speakers on Quaternary MI2S
- These are also used as earpieces at the top/bottom.
- Asahi Kasei AK4375 headphone codec on Secondary MI2S
-> Primary MI2S is not used for playback
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
[Stephan: minor cleanup, add consistent commit message]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
There are some trivial conflicts unless
https://lore.kernel.org/linux-arm-msm/20230921-msm8916-rmem-fixups-v1-3-34d2b6e721cf@gerhold.net/
is applied first. But given that there are important fixups for the
dynamic reserved memory changes in that series it should preferably
get applied before this one anyway.
---
.../boot/dts/qcom/msm8916-alcatel-idol347.dts | 164 +++++++++++++++++++++
1 file changed, 164 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
index fade93c55299..ef5fc9289754 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
@@ -3,6 +3,8 @@
/dts-v1/;
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
@@ -22,6 +24,19 @@ chosen {
stdout-path = "serial0";
};
+ reserved-memory {
+ /delete-node/ reserved@86680000;
+ /delete-node/ rmtfs@86700000;
+
+ rmtfs: rmtfs@86680000 {
+ compatible = "qcom,rmtfs-mem";
+ reg = <0x0 0x86680000 0x0 0x160000>;
+ no-map;
+
+ qcom,client-id = <1>;
+ };
+ };
+
gpio-keys {
compatible = "gpio-keys";
@@ -50,6 +65,17 @@ led-0 {
};
};
+ reg_headphones_avdd: regulator-headphones-avdd {
+ compatible = "regulator-fixed";
+ regulator-name = "headphones_avdd";
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ gpio = <&tlmm 121 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ pinctrl-0 = <&headphones_avdd_default>;
+ pinctrl-names = "default";
+ };
+
usb_id: usb-id {
compatible = "linux,extcon-usb-gpio";
id-gpios = <&tlmm 69 GPIO_ACTIVE_HIGH>;
@@ -58,6 +84,43 @@ usb_id: usb-id {
};
};
+&blsp_i2c3 {
+ status = "okay";
+
+ headphones: audio-codec@10 {
+ compatible = "asahi-kasei,ak4375";
+ reg = <0x10>;
+ avdd-supply = <®_headphones_avdd>;
+ tvdd-supply = <&pm8916_l6>;
+ pdn-gpios = <&tlmm 114 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&headphones_pdn_default>;
+ pinctrl-names = "default";
+ #sound-dai-cells = <0>;
+ };
+
+ speaker_codec_top: audio-codec@34 {
+ compatible = "nxp,tfa9897";
+ reg = <0x34>;
+ vddd-supply = <&pm8916_l6>;
+ rcv-gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&speaker_top_default>;
+ pinctrl-names = "default";
+ sound-name-prefix = "Speaker Top";
+ #sound-dai-cells = <0>;
+ };
+
+ speaker_codec_bottom: audio-codec@36 {
+ compatible = "nxp,tfa9897";
+ reg = <0x36>;
+ vddd-supply = <&pm8916_l6>;
+ rcv-gpios = <&tlmm 111 GPIO_ACTIVE_HIGH>;
+ pinctrl-0 = <&speaker_bottom_default>;
+ pinctrl-names = "default";
+ sound-name-prefix = "Speaker Bottom";
+ #sound-dai-cells = <0>;
+ };
+};
+
&blsp_i2c4 {
status = "okay";
@@ -153,6 +216,18 @@ &blsp_uart2 {
status = "okay";
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5000000>;
+};
+
+&pm8916_codec {
+ qcom,micbias1-ext-cap;
+ qcom,micbias-lvl = <2800>;
+ qcom,mbhc-vthreshold-low = <75 100 120 180 500>;
+ qcom,mbhc-vthreshold-high = <75 100 120 180 500>;
+ qcom,hphl-jack-type-normally-open;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -169,6 +244,17 @@ &pm8916_vib {
status = "okay";
};
+&q6afedai {
+ dai@18 {
+ reg = <SECONDARY_MI2S_RX>;
+ qcom,sd-lines = <0>;
+ };
+ dai@22 {
+ reg = <QUATERNARY_MI2S_RX>;
+ qcom,sd-lines = <0>;
+ };
+};
+
&sdhc_1 {
status = "okay";
};
@@ -183,6 +269,47 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};
+&sound {
+ status = "okay";
+
+ /* Add pin switches for speakers to allow disabling them individually */
+ model = "alcatel-idol3";
+ widgets =
+ "Speaker", "Speaker Top",
+ "Speaker", "Speaker Bottom";
+ pin-switches = "Speaker Top", "Speaker Bottom";
+ audio-routing =
+ "Speaker Top", "Speaker Top OUT",
+ "Speaker Bottom", "Speaker Bottom OUT",
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+
+ pinctrl-0 = <&cdc_pdm_default &pri_mi2s_default &pri_mi2s_ws_default &sec_mi2s_default>;
+ pinctrl-1 = <&cdc_pdm_sleep &pri_mi2s_sleep &pri_mi2s_ws_sleep &sec_mi2s_sleep>;
+ pinctrl-names = "default", "sleep";
+};
+
+&sound_dai_primary {
+ status = "disabled";
+};
+
+&sound_dai_quaternary {
+ status = "okay";
+
+ codec {
+ sound-dai = <&speaker_codec_top>, <&speaker_codec_bottom>;
+ };
+};
+
+&sound_dai_secondary {
+ status = "okay";
+
+ codec {
+ sound-dai = <&headphones>;
+ };
+};
+
&usb {
status = "okay";
extcon = <&usb_id>, <&usb_id>;
@@ -212,6 +339,15 @@ &wcnss_mem {
status = "okay";
};
+/* Only some of the pins are used */
+&pri_mi2s_default {
+ pins = "gpio113", "gpio115";
+};
+
+&pri_mi2s_sleep {
+ pins = "gpio113", "gpio115";
+};
+
&tlmm {
accel_int_default: accel-int-default-state {
pins = "gpio31";
@@ -245,6 +381,20 @@ gyro_int_default: gyro-int-default-state {
bias-disable;
};
+ headphones_avdd_default: headphones-avdd-default-state {
+ pins = "gpio121";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ headphones_pdn_default: headphones-pdn-default-state {
+ pins = "gpio114";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
/*
* The OEM wired an additional GPIO to be asserted so that
* the si-en,sn3190 LED IC works. Since this GPIO is not
@@ -291,6 +441,20 @@ sdc2_cd_default: sdc2-cd-default-state {
bias-disable;
};
+ speaker_bottom_default: speaker-bottom-default-state {
+ pins = "gpio111";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ speaker_top_default: speaker-top-default-state {
+ pins = "gpio50";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
ts_int_reset_default: ts-int-reset-default-state {
pins = "gpio13", "gpio100";
function = "gpio";
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 07/13] arm64: dts: qcom: msm8916-alcatel-idol347: Add sound and modem
2023-09-26 16:51 ` [PATCH 07/13] arm64: dts: qcom: msm8916-alcatel-idol347: " Stephan Gerhold
@ 2023-09-26 18:58 ` Konrad Dybcio
2023-09-26 19:35 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:58 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue, Vincent Knecht
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: Vincent Knecht <vincent.knecht@mailoo.org>
>
> Enable sound and modem for the Alcatel Idol 3 (4.7"). The setup is
> similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Microphones via digital/analog codec in MSM8916/PM8916
> - WWAN Internet via BAM-DMUX
>
> except:
>
> - Stereo NXP TFA9890 codecs for speakers on Quaternary MI2S
> - These are also used as earpieces at the top/bottom.
> - Asahi Kasei AK4375 headphone codec on Secondary MI2S
> -> Primary MI2S is not used for playback
>
> Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> [Stephan: minor cleanup, add consistent commit message]
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> There are some trivial conflicts unless
> https://lore.kernel.org/linux-arm-msm/20230921-msm8916-rmem-fixups-v1-3-34d2b6e721cf@gerhold.net/
> is applied first. But given that there are important fixups for the
> dynamic reserved memory changes in that series it should preferably
> get applied before this one anyway.
> ---
> .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 164 +++++++++++++++++++++
> 1 file changed, 164 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> index fade93c55299..ef5fc9289754 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> @@ -3,6 +3,8 @@
> /dts-v1/;
>
> #include "msm8916-pm8916.dtsi"
> +#include "msm8916-modem-qdsp6.dtsi"
> +
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> #include <dt-bindings/leds/common.h>
> @@ -22,6 +24,19 @@ chosen {
> stdout-path = "serial0";
> };
>
> + reserved-memory {
> + /delete-node/ reserved@86680000;
> + /delete-node/ rmtfs@86700000;
Deleting with a label reference is strongly preferred to avoid
mistakes.
[...]
>
> +&q6afedai {
> + dai@18 {
> + reg = <SECONDARY_MI2S_RX>;
> + qcom,sd-lines = <0>;
> + };
> + dai@22 {
Missing newline above
[...]
> +
> +&sound_dai_primary {
> + status = "disabled";
> +};
> +
Hm, gives me an idea to sprinkle a bit more /omit-if-no-ref/ in
patch 3..
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 07/13] arm64: dts: qcom: msm8916-alcatel-idol347: Add sound and modem
2023-09-26 18:58 ` Konrad Dybcio
@ 2023-09-26 19:35 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:35 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Vincent Knecht
On Tue, Sep 26, 2023 at 08:58:12PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > From: Vincent Knecht <vincent.knecht@mailoo.org>
> >
> > Enable sound and modem for the Alcatel Idol 3 (4.7"). The setup is
> > similar to most MSM8916 devices, i.e.:
> >
> > - QDSP6 audio
> > - Microphones via digital/analog codec in MSM8916/PM8916
> > - WWAN Internet via BAM-DMUX
> >
> > except:
> >
> > - Stereo NXP TFA9890 codecs for speakers on Quaternary MI2S
> > - These are also used as earpieces at the top/bottom.
> > - Asahi Kasei AK4375 headphone codec on Secondary MI2S
> > -> Primary MI2S is not used for playback
> >
> > Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
> > [Stephan: minor cleanup, add consistent commit message]
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> > There are some trivial conflicts unless
> > https://lore.kernel.org/linux-arm-msm/20230921-msm8916-rmem-fixups-v1-3-34d2b6e721cf@gerhold.net/
> > is applied first. But given that there are important fixups for the
> > dynamic reserved memory changes in that series it should preferably
> > get applied before this one anyway.
> > ---
> > .../boot/dts/qcom/msm8916-alcatel-idol347.dts | 164 +++++++++++++++++++++
> > 1 file changed, 164 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> > index fade93c55299..ef5fc9289754 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> > +++ b/arch/arm64/boot/dts/qcom/msm8916-alcatel-idol347.dts
> > @@ -3,6 +3,8 @@
> > /dts-v1/;
> >
> > #include "msm8916-pm8916.dtsi"
> > +#include "msm8916-modem-qdsp6.dtsi"
> > +
> > #include <dt-bindings/gpio/gpio.h>
> > #include <dt-bindings/input/input.h>
> > #include <dt-bindings/leds/common.h>
> > @@ -22,6 +24,19 @@ chosen {
> > stdout-path = "serial0";
> > };
> >
> > + reserved-memory {
> > + /delete-node/ reserved@86680000;
> > + /delete-node/ rmtfs@86700000;
> Deleting with a label reference is strongly preferred to avoid
> mistakes.
>
I would say the opposite applies here. The deletions are based on the
assumption that the nodes are at the address that are listed here. If
you would move rmtfs somewhere else the adjustments made here must be
re-evaulated.
/delete-node/ throws an error if the referenced name does not exist,
so it's exactly the indication we need if someone makes changes to the
original node in the SoC dtsi.
Note that this is different from property assignments, i.e.
/ {
reserved-memory {
rmtfs@86700000 {
status = "disabled";
};
};
};
instead of
&rmtfs {
status = "disabled";
};
because here there would not be an error if the node is renamed.
> [...]
>
> >
> > +&q6afedai {
> > + dai@18 {
> > + reg = <SECONDARY_MI2S_RX>;
> > + qcom,sd-lines = <0>;
> > + };
> > + dai@22 {
> Missing newline above
>
Thanks, will fix this!
>
> > +
> > +&sound_dai_primary {
> > + status = "disabled";
> > +};
> > +
> Hm, gives me an idea to sprinkle a bit more /omit-if-no-ref/ in
> patch 3..
>
(See reply in patch 3, /omit-if-no-ref/ sadly only works for phandle
references...)
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 08/13] arm64: dts: qcom: msm8916-asus-z00l: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (6 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 07/13] arm64: dts: qcom: msm8916-alcatel-idol347: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:58 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: " Stephan Gerhold
` (4 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, J.R. Divya Antony
From: "J.R. Divya Antony" <d.antony.jr@gmail.com>
Enable sound and modem for the ASUS Zenfone 2 Laser. The setup is
similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Speakear/earpiece/headphones/microphones via digital/analog codec
in MSM8916/PM8916
- Audio jack detection via analog codec in PM8916
- WWAN Internet via BAM-DMUX
Signed-off-by: J.R. Divya Antony <d.antony.jr@gmail.com>
[Stephan: rebase and simplify, add consistent commit message]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts b/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts
index a8be6ff66893..ff8eb0a94795 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts
@@ -3,6 +3,8 @@
/dts-v1/;
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
@@ -130,6 +132,18 @@ &blsp_uart2 {
status = "okay";
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5500000>;
+};
+
+&pm8916_codec {
+ qcom,micbias-lvl = <2800>;
+ qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
+ qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
+ qcom,micbias1-ext-cap;
+ qcom,hphl-jack-type-normally-open;
+};
+
&pm8916_rpm_regulators {
pm8916_l17: l17 {
regulator-min-microvolt = <2850000>;
@@ -151,6 +165,14 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};
+&sound {
+ status = "okay";
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+};
+
&usb {
status = "okay";
extcon = <&usb_id>, <&usb_id>;
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 08/13] arm64: dts: qcom: msm8916-asus-z00l: Add sound and modem
2023-09-26 16:51 ` [PATCH 08/13] arm64: dts: qcom: msm8916-asus-z00l: " Stephan Gerhold
@ 2023-09-26 18:58 ` Konrad Dybcio
0 siblings, 0 replies; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:58 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue,
J.R. Divya Antony
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: "J.R. Divya Antony" <d.antony.jr@gmail.com>
>
> Enable sound and modem for the ASUS Zenfone 2 Laser. The setup is
> similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Speakear/earpiece/headphones/microphones via digital/analog codec
> in MSM8916/PM8916
> - Audio jack detection via analog codec in PM8916
> - WWAN Internet via BAM-DMUX
>
> Signed-off-by: J.R. Divya Antony <d.antony.jr@gmail.com>
> [Stephan: rebase and simplify, add consistent commit message]
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (7 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 08/13] arm64: dts: qcom: msm8916-asus-z00l: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 18:59 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 10/13] arm64: dts: qcom: msm8916-longcheer-l8910: " Stephan Gerhold
` (3 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Nikita Travkin
From: Nikita Travkin <nikita@trvn.ru>
Enable sound and modem for the Longcheer L8150 (e.g. Wileyfox Swift).
The setup is similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Speaker/earpiece/headphones/microphones via digital/analog codec
in MSM8916/PM8916
- Audio jack detection via analog codec in PM8916
- WWAN Internet via BAM-DMUX
except:
- The mpss firmware region must be relocated to a different address.
This is because the wcnss firmware is not relocatable for some
reason. The mpss firmware is too large to avoid overlap with wcnss
when placed at the default address (0x86800000).
Surprisingly the vendor kernel does not handle this. The firmware
regions end up overlapping there and somehow this does not explode.
We try to handle this more safely by relocating the mpss region to
the first higher address that is working correctly: 0x8e800000.
Signed-off-by: Nikita Travkin <nikita@trvn.ru>
Co-developed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../boot/dts/qcom/msm8916-longcheer-l8150.dts | 32 ++++++++++++++++++++--
1 file changed, 29 insertions(+), 3 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
index 47d1c5cb13f4..78f08254b287 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts
@@ -3,6 +3,8 @@
/dts-v1/;
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
@@ -25,17 +27,26 @@ chosen {
/*
* For some reason, the signed wcnss firmware is not relocatable.
- * It must be loaded at 0x8b600000. All other firmware is relocatable,
- * so place wcnss at the fixed address and then all other firmware
- * regions will be automatically allocated at a fitting place.
+ * It must be loaded at 0x8b600000. Unfortunately, this also means that
+ * mpss_mem does not fit when loaded to the typical address at 0x86800000.
+ *
+ * Load wcnss_mem to the fixed address and relocate mpss_mem to the next
+ * working higher address. For some reason the modem firmware does not
+ * boot when placed at 0x8a800000 to 0x8e800000.
*/
reserved-memory {
+ /delete-node/ mpss@86800000;
/delete-node/ wcnss;
wcnss_mem: wcnss@8b600000 {
reg = <0x0 0x8b600000 0x0 0x600000>;
no-map;
};
+
+ mpss_mem: mpss@8e800000 {
+ reg = <0x0 0x8e800000 0x0 0x5000000>;
+ no-map;
+ };
};
gpio-keys {
@@ -225,6 +236,13 @@ &blsp_uart2 {
status = "okay";
};
+&pm8916_codec {
+ qcom,micbias-lvl = <2800>;
+ qcom,mbhc-vthreshold-low = <75 150 237 450 500>;
+ qcom,mbhc-vthreshold-high = <75 150 237 450 500>;
+ qcom,hphl-jack-type-normally-open;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -254,6 +272,14 @@ &sdhc_2 {
non-removable;
};
+&sound {
+ status = "okay";
+ audio-routing =
+ "AMIC1", "MIC BIAS Internal1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS Internal3";
+};
+
&usb {
status = "okay";
dr_mode = "peripheral";
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem
2023-09-26 16:51 ` [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: " Stephan Gerhold
@ 2023-09-26 18:59 ` Konrad Dybcio
2023-09-26 19:36 ` Stephan Gerhold
2023-09-30 16:59 ` Stephan Gerhold
0 siblings, 2 replies; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 18:59 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue, Nikita Travkin
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: Nikita Travkin <nikita@trvn.ru>
>
> Enable sound and modem for the Longcheer L8150 (e.g. Wileyfox Swift).
e.g. -> i.e., or is that thing sold under many labels?
[...]
> reserved-memory {
> + /delete-node/ mpss@86800000;
> /delete-node/ wcnss;
delete by label, please
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem
2023-09-26 18:59 ` Konrad Dybcio
@ 2023-09-26 19:36 ` Stephan Gerhold
2023-09-30 16:59 ` Stephan Gerhold
1 sibling, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:36 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Nikita Travkin
On Tue, Sep 26, 2023 at 08:59:52PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > From: Nikita Travkin <nikita@trvn.ru>
> >
> > Enable sound and modem for the Longcheer L8150 (e.g. Wileyfox Swift).
> e.g. -> i.e., or is that thing sold under many labels?
>
> [...]
>
> > reserved-memory {
> > + /delete-node/ mpss@86800000;
> > /delete-node/ wcnss;
> delete by label, please
>
I would say the same as on PATCH 07/13 here:
https://lore.kernel.org/linux-arm-msm/ZRMye1HeiUno5N_p@gerhold.net/
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem
2023-09-26 18:59 ` Konrad Dybcio
2023-09-26 19:36 ` Stephan Gerhold
@ 2023-09-30 16:59 ` Stephan Gerhold
2023-10-02 9:59 ` Konrad Dybcio
1 sibling, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-30 16:59 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Nikita Travkin
On Tue, Sep 26, 2023 at 08:59:52PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > From: Nikita Travkin <nikita@trvn.ru>
> >
> > Enable sound and modem for the Longcheer L8150 (e.g. Wileyfox Swift).
> e.g. -> i.e., or is that thing sold under many labels?
>
Yes, "e.g." is indeed correct here. AFAIK the MSM8916-based Android One
devices (aka "google-seed") are also based on the Longcheer L8150. They
are available under names like "Cherry Mobile One G1", "i-mobile IQ II",
and "General Mobile 4G". They are also covered by this device tree.
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem
2023-09-30 16:59 ` Stephan Gerhold
@ 2023-10-02 9:59 ` Konrad Dybcio
0 siblings, 0 replies; 52+ messages in thread
From: Konrad Dybcio @ 2023-10-02 9:59 UTC (permalink / raw)
To: Stephan Gerhold
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Nikita Travkin
On 9/30/23 18:59, Stephan Gerhold wrote:
> On Tue, Sep 26, 2023 at 08:59:52PM +0200, Konrad Dybcio wrote:
>> On 26.09.2023 18:51, Stephan Gerhold wrote:
>>> From: Nikita Travkin <nikita@trvn.ru>
>>>
>>> Enable sound and modem for the Longcheer L8150 (e.g. Wileyfox Swift).
>> e.g. -> i.e., or is that thing sold under many labels?
>>
>
> Yes, "e.g." is indeed correct here. AFAIK the MSM8916-based Android One
> devices (aka "google-seed") are also based on the Longcheer L8150. They
> are available under names like "Cherry Mobile One G1", "i-mobile IQ II",
> and "General Mobile 4G". They are also covered by this device tree.
Oh wow.. That's surely fun
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 10/13] arm64: dts: qcom: msm8916-longcheer-l8910: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (8 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 09/13] arm64: dts: qcom: msm8916-longcheer-l8150: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 19:00 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 11/13] arm64: dts: qcom: msm8916-samsung-gt5: " Stephan Gerhold
` (2 subsequent siblings)
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Jonathan Albrieux
From: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Enable sound and modem for the Longcheer L8910 (BQ Aquaris X5).
The setup is similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Earpiece/headphones/microphones via digital/analog codec in
MSM8916/PM8916
- Audio jack detection via analog codec in PM8916
- WWAN Internet via BAM-DMUX
except:
- Awinic AW8738 connected to HPH_R (headphones) output of the analog
codec. Note that unlike for wingtech-wt88047 there is no analog
switch that would allow disabling output via the headphone jack
when the speaker is enabled.
Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Co-developed-by: Stephan Gerhold <stephan@gerhold.net>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../boot/dts/qcom/msm8916-longcheer-l8910.dts | 54 ++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
index 41cadb906b98..c0dc9a3bbac4 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8910.dts
@@ -3,6 +3,8 @@
/dts-v1/;
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
@@ -22,6 +24,16 @@ chosen {
stdout-path = "serial0";
};
+ speaker_amp: audio-amplifier {
+ compatible = "awinic,aw8738";
+ mode-gpios = <&tlmm 114 GPIO_ACTIVE_HIGH>;
+ awinic,mode = <5>;
+ sound-name-prefix = "Speaker Amp";
+
+ pinctrl-0 = <&spk_ext_pa_default>;
+ pinctrl-names = "default";
+ };
+
flash-led-controller {
compatible = "ocs,ocp8110";
enable-gpios = <&tlmm 49 GPIO_ACTIVE_HIGH>;
@@ -107,6 +119,17 @@ &blsp_uart2 {
status = "okay";
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5000000>;
+};
+
+&pm8916_codec {
+ qcom,micbias-lvl = <2800>;
+ qcom,mbhc-vthreshold-low = <75 100 120 180 500>;
+ qcom,mbhc-vthreshold-high = <75 100 120 180 500>;
+ qcom,hphl-jack-type-normally-open;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -137,6 +160,30 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};
+&sound {
+ status = "okay";
+
+ /*
+ * Provide widgets/pin-switches to allow enabling speaker separately.
+ * The hardware does not provide a way to disable the output via the
+ * headphone jack when the speaker is enabled.
+ */
+ model = "bq-paella";
+ widgets =
+ "Speaker", "Speaker",
+ "Headphone", "Headphones";
+ pin-switches = "Speaker";
+ audio-routing =
+ "Speaker", "Speaker Amp OUT",
+ "Speaker Amp IN", "HPH_R",
+ "Headphones", "HPH_L",
+ "Headphones", "HPH_R",
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+ aux-devs = <&speaker_amp>;
+};
+
&usb {
status = "okay";
extcon = <&usb_id>, <&usb_id>;
@@ -205,6 +252,13 @@ sdc2_cd_default: sdc2-cd-default-state {
bias-disable;
};
+ spk_ext_pa_default: spk-ext-pa-default-state {
+ pins = "gpio114";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
usb_id_default: usb-id-default-state {
pins = "gpio110";
function = "gpio";
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 10/13] arm64: dts: qcom: msm8916-longcheer-l8910: Add sound and modem
2023-09-26 16:51 ` [PATCH 10/13] arm64: dts: qcom: msm8916-longcheer-l8910: " Stephan Gerhold
@ 2023-09-26 19:00 ` Konrad Dybcio
0 siblings, 0 replies; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 19:00 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue,
Jonathan Albrieux
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: Jonathan Albrieux <jonathan.albrieux@gmail.com>
>
> Enable sound and modem for the Longcheer L8910 (BQ Aquaris X5).
> The setup is similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Earpiece/headphones/microphones via digital/analog codec in
> MSM8916/PM8916
> - Audio jack detection via analog codec in PM8916
> - WWAN Internet via BAM-DMUX
>
> except:
>
> - Awinic AW8738 connected to HPH_R (headphones) output of the analog
> codec. Note that unlike for wingtech-wt88047 there is no analog
> switch that would allow disabling output via the headphone jack
> when the speaker is enabled.
>
> Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
> Co-developed-by: Stephan Gerhold <stephan@gerhold.net>
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 11/13] arm64: dts: qcom: msm8916-samsung-gt5: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (9 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 10/13] arm64: dts: qcom: msm8916-longcheer-l8910: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 19:03 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 12/13] arm64: dts: qcom: msm8916-samsung-j5: " Stephan Gerhold
2023-09-26 16:51 ` [PATCH 13/13] arm64: dts: qcom: msm8939-samsung-a7: " Stephan Gerhold
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Jasper Korten,
Siddharth Manthan, Nikita Travkin
From: Jasper Korten <jja2000@gmail.com>
Enable sound and modem for the Samsung Galaxy Tab A 2015 tablets.
The setup is similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Headphones/microphones via digital/analog codec in
MSM8916/PM8916. Earpiece exists on samsung-gt58 only.
- WWAN Internet via BAM-DMUX
except:
- gt510: Stereo Maxim MAX98357A codecs for speaker on Quaternary MI2S
- gt58: Mono NXP TFA9895 codec for speaker on Quaternary MI2S
- For some reason connected to GPIOs where no hardware I2C
controller is available -> need to use i2c-gpio
- Samsung-specific audio jack detection (not supported yet)
Signed-off-by: Jasper Korten <jja2000@gmail.com>
Co-developed-by: Siddharth Manthan <siddharth.manthan@gmail.com>
Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
Co-developed-by: Nikita Travkin <nikita@trvn.ru>
Signed-off-by: Nikita Travkin <nikita@trvn.ru>
[Stephan: Add consistent commit message]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
.../boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 36 ++++++++++++++++++
arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts | 23 ++++++++++++
arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts | 43 ++++++++++++++++++++++
3 files changed, 102 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
index 6a16eb5ce07b..396853fcece5 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
@@ -3,9 +3,12 @@
/dts-v1/;
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/sound/apq8016-lpass.h>
/ {
aliases {
@@ -116,6 +119,17 @@ &blsp_uart2 {
status = "okay";
};
+&lpass {
+ dai-link@3 {
+ reg = <MI2S_QUATERNARY>;
+ qcom,playback-sd-lines = <1>;
+ };
+};
+
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5400000>;
+};
+
&pm8916_resin {
linux,code = <KEY_VOLUMEDOWN>;
status = "okay";
@@ -133,6 +147,13 @@ &pm8916_usbin {
status = "okay";
};
+&q6afedai {
+ dai@22 {
+ reg = <QUATERNARY_MI2S_RX>;
+ qcom,sd-lines = <1>;
+ };
+};
+
&sdhc_1 {
status = "okay";
};
@@ -147,6 +168,21 @@ &sdhc_2 {
status = "okay";
};
+&sound {
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+};
+
+&sound_dai_quaternary {
+ status = "okay";
+
+ codec {
+ sound-dai = <&speaker_codec>;
+ };
+};
+
&usb {
dr_mode = "peripheral";
extcon = <&pm8916_usbin>;
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts
index c3f1acc55078..f393e9efa72c 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts
@@ -9,6 +9,14 @@ / {
compatible = "samsung,gt510", "qcom,msm8916";
chassis-type = "tablet";
+ speaker_codec: audio-codec {
+ compatible = "maxim,max98357a";
+ sdmode-gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>;
+ #sound-dai-cells = <0>;
+ pinctrl-0 = <&audio_sdmode_default>;
+ pinctrl-names = "default";
+ };
+
clk_pwm: pwm {
compatible = "clk-pwm";
#pwm-cells = <2>;
@@ -146,7 +154,22 @@ &mdss_dsi0_out {
remote-endpoint = <&panel_in>;
};
+&sound {
+ model = "samsung-gt510";
+ pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>;
+ pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>;
+ pinctrl-names = "default", "sleep";
+ status = "okay";
+};
+
&tlmm {
+ audio_sdmode_default: audio-sdmode-default-state {
+ pins = "gpio55";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
buckbooster_en_default: buckbooster-en-default-state {
pins = "gpio51";
function = "gpio";
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts
index 998625abd409..3f2165556986 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts
@@ -35,6 +35,26 @@ reg_vdd_tsp: regulator-vdd-tsp {
pinctrl-names = "default";
};
+ i2c-amplifier {
+ compatible = "i2c-gpio";
+ sda-gpios = <&tlmm 55 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+ scl-gpios = <&tlmm 56 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+
+ pinctrl-0 = <&_i2c_default>;
+ pinctrl-names = "default";
+
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ speaker_codec: audio-codec@34 {
+ compatible = "nxp,tfa9895";
+ reg = <0x34>;
+ vddd-supply = <&pm8916_l5>;
+ sound-name-prefix = "Speaker";
+ #sound-dai-cells = <0>;
+ };
+ };
+
vibrator {
compatible = "gpio-vibrator";
enable-gpios = <&tlmm 76 GPIO_ACTIVE_HIGH>;
@@ -98,7 +118,22 @@ &mdss_dsi0_out {
remote-endpoint = <&panel_in>;
};
+&sound {
+ model = "samsung-a2015";
+ pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default &secondary_mic_default>;
+ pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep &secondary_mic_default>;
+ pinctrl-names = "default", "sleep";
+ status = "okay";
+};
+
&tlmm {
+ amp_i2c_default: amp-i2c-default-state {
+ pins = "gpio55", "gpio56";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
buckbooster_en_default: buckbooster-en-default-state {
pins = "gpio8";
function = "gpio";
@@ -127,6 +162,14 @@ reg_tsp_en_default: reg-tsp-en-default-state {
bias-disable;
};
+ secondary_mic_default: secondary-mic-default-state {
+ pins = "gpio98";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-disable;
+ output-high;
+ };
+
tsp_int_default: tsp-int-default-state {
pins = "gpio13";
function = "gpio";
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 11/13] arm64: dts: qcom: msm8916-samsung-gt5: Add sound and modem
2023-09-26 16:51 ` [PATCH 11/13] arm64: dts: qcom: msm8916-samsung-gt5: " Stephan Gerhold
@ 2023-09-26 19:03 ` Konrad Dybcio
2023-09-26 19:37 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 19:03 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue, Jasper Korten,
Siddharth Manthan, Nikita Travkin
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: Jasper Korten <jja2000@gmail.com>
>
> Enable sound and modem for the Samsung Galaxy Tab A 2015 tablets.
> The setup is similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Headphones/microphones via digital/analog codec in
> MSM8916/PM8916. Earpiece exists on samsung-gt58 only.
> - WWAN Internet via BAM-DMUX
>
> except:
>
> - gt510: Stereo Maxim MAX98357A codecs for speaker on Quaternary MI2S
> - gt58: Mono NXP TFA9895 codec for speaker on Quaternary MI2S
> - For some reason connected to GPIOs where no hardware I2C
> controller is available -> need to use i2c-gpio
> - Samsung-specific audio jack detection (not supported yet)
>
> Signed-off-by: Jasper Korten <jja2000@gmail.com>
> Co-developed-by: Siddharth Manthan <siddharth.manthan@gmail.com>
> Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
> Co-developed-by: Nikita Travkin <nikita@trvn.ru>
> Signed-off-by: Nikita Travkin <nikita@trvn.ru>
> [Stephan: Add consistent commit message]
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> .../boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 36 ++++++++++++++++++
> arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts | 23 ++++++++++++
> arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts | 43 ++++++++++++++++++++++
> 3 files changed, 102 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
> index 6a16eb5ce07b..396853fcece5 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
> @@ -3,9 +3,12 @@
> /dts-v1/;
>
> #include "msm8916-pm8916.dtsi"
> +#include "msm8916-modem-qdsp6.dtsi"
> +
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> #include <dt-bindings/interrupt-controller/irq.h>
> +#include <dt-bindings/sound/apq8016-lpass.h>
>
> / {
> aliases {
> @@ -116,6 +119,17 @@ &blsp_uart2 {
> status = "okay";
> };
>
> +&lpass {
> + dai-link@3 {
> + reg = <MI2S_QUATERNARY>;
> + qcom,playback-sd-lines = <1>;
> + };
> +};
status = reserved?
[...]
>
> + i2c-amplifier {
> + compatible = "i2c-gpio";
> + sda-gpios = <&tlmm 55 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
> + scl-gpios = <&tlmm 56 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
non-msm8916 files have a space around the OR operator, hm
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 11/13] arm64: dts: qcom: msm8916-samsung-gt5: Add sound and modem
2023-09-26 19:03 ` Konrad Dybcio
@ 2023-09-26 19:37 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:37 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Jasper Korten, Siddharth Manthan,
Nikita Travkin
On Tue, Sep 26, 2023 at 09:03:14PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > From: Jasper Korten <jja2000@gmail.com>
> >
> > Enable sound and modem for the Samsung Galaxy Tab A 2015 tablets.
> > The setup is similar to most MSM8916 devices, i.e.:
> >
> > - QDSP6 audio
> > - Headphones/microphones via digital/analog codec in
> > MSM8916/PM8916. Earpiece exists on samsung-gt58 only.
> > - WWAN Internet via BAM-DMUX
> >
> > except:
> >
> > - gt510: Stereo Maxim MAX98357A codecs for speaker on Quaternary MI2S
> > - gt58: Mono NXP TFA9895 codec for speaker on Quaternary MI2S
> > - For some reason connected to GPIOs where no hardware I2C
> > controller is available -> need to use i2c-gpio
> > - Samsung-specific audio jack detection (not supported yet)
> >
> > Signed-off-by: Jasper Korten <jja2000@gmail.com>
> > Co-developed-by: Siddharth Manthan <siddharth.manthan@gmail.com>
> > Signed-off-by: Siddharth Manthan <siddharth.manthan@gmail.com>
> > Co-developed-by: Nikita Travkin <nikita@trvn.ru>
> > Signed-off-by: Nikita Travkin <nikita@trvn.ru>
> > [Stephan: Add consistent commit message]
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> > .../boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 36 ++++++++++++++++++
> > arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts | 23 ++++++++++++
> > arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts | 43 ++++++++++++++++++++++
> > 3 files changed, 102 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
> > index 6a16eb5ce07b..396853fcece5 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-gt5-common.dtsi
> > @@ -3,9 +3,12 @@
> > /dts-v1/;
> >
> > #include "msm8916-pm8916.dtsi"
> > +#include "msm8916-modem-qdsp6.dtsi"
> > +
> > #include <dt-bindings/gpio/gpio.h>
> > #include <dt-bindings/input/input.h>
> > #include <dt-bindings/interrupt-controller/irq.h>
> > +#include <dt-bindings/sound/apq8016-lpass.h>
> >
> > / {
> > aliases {
> > @@ -116,6 +119,17 @@ &blsp_uart2 {
> > status = "okay";
> > };
> >
> > +&lpass {
> > + dai-link@3 {
> > + reg = <MI2S_QUATERNARY>;
> > + qcom,playback-sd-lines = <1>;
> > + };
> > +};
> status = reserved?
>
For reference:
https://lore.kernel.org/linux-arm-msm/ZRMwdRo9hAm4BO5E@gerhold.net/
> [...]
> >
> > + i2c-amplifier {
> > + compatible = "i2c-gpio";
> > + sda-gpios = <&tlmm 55 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
> > + scl-gpios = <&tlmm 56 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
> non-msm8916 files have a space around the OR operator, hm
>
Hm I can add a space if you think it looks better. :D
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 12/13] arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (10 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 11/13] arm64: dts: qcom: msm8916-samsung-gt5: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 19:04 ` Konrad Dybcio
2023-09-26 16:51 ` [PATCH 13/13] arm64: dts: qcom: msm8939-samsung-a7: " Stephan Gerhold
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Lin, Meng-Bo,
Markuss Broks
From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Enable sound and modem for the Samsung J5 smartphones. The setup is
similar to most MSM8916 devices, i.e.:
- QDSP6 audio
- Speaker/earpiece/headphones/microphones via digital/analog codec
in MSM8916/PM8916
- WWAN Internet via BAM-DMUX
except:
- There is no secondary microphone, so a different "model" is used to
differentiate that in the UCM configuration.
- Samsung-specific audio jack detection (not supported yet)
Co-developed-by: Markuss Broks <markuss.broks@gmail.com>
Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
[Stephan: Add consistent commit message]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 15 +++++++++++++++
arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 4 ++++
2 files changed, 19 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
index fe59be3505fe..2caa820b0c26 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
@@ -1,6 +1,8 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "msm8916-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
+
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
@@ -135,6 +137,10 @@ &blsp_uart2 {
status = "okay";
};
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5800000>;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -154,6 +160,15 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};
+&sound {
+ model = "msm8916-1mic";
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+ status = "okay";
+};
+
&usb {
extcon = <&muic>, <&muic>;
status = "okay";
diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
index 58c2f5a70e78..ba8650971d6a 100644
--- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
+++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts
@@ -19,6 +19,10 @@ &blsp_i2c5 {
status = "disabled";
};
+&pm8916_codec {
+ qcom,micbias1-ext-cap;
+};
+
&touchscreen {
/* FIXME: Missing sm5703-mfd driver to power up vdd-supply */
};
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 12/13] arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem
2023-09-26 16:51 ` [PATCH 12/13] arm64: dts: qcom: msm8916-samsung-j5: " Stephan Gerhold
@ 2023-09-26 19:04 ` Konrad Dybcio
2023-09-26 19:44 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 19:04 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue, Lin, Meng-Bo,
Markuss Broks
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
>
> Enable sound and modem for the Samsung J5 smartphones. The setup is
> similar to most MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Speaker/earpiece/headphones/microphones via digital/analog codec
> in MSM8916/PM8916
> - WWAN Internet via BAM-DMUX
>
> except:
>
> - There is no secondary microphone, so a different "model" is used to
> differentiate that in the UCM configuration.
> - Samsung-specific audio jack detection (not supported yet)
>
> Co-developed-by: Markuss Broks <markuss.broks@gmail.com>
> Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> [Stephan: Add consistent commit message]
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
> arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 15 +++++++++++++++
> arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 4 ++++
> 2 files changed, 19 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
> index fe59be3505fe..2caa820b0c26 100644
> --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
> @@ -1,6 +1,8 @@
> // SPDX-License-Identifier: GPL-2.0-only
>
> #include "msm8916-pm8916.dtsi"
> +#include "msm8916-modem-qdsp6.dtsi"
> +
> #include <dt-bindings/gpio/gpio.h>
> #include <dt-bindings/input/input.h>
> #include <dt-bindings/interrupt-controller/irq.h>
> @@ -135,6 +137,10 @@ &blsp_uart2 {
> status = "okay";
> };
>
> +&mpss_mem {
> + reg = <0x0 0x86800000 0x0 0x5800000>;
> +};
> +
> &pm8916_resin {
> status = "okay";
> linux,code = <KEY_VOLUMEDOWN>;
> @@ -154,6 +160,15 @@ &sdhc_2 {
> cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
> };
>
> +&sound {
> + model = "msm8916-1mic";
That's.. vague.. Is that intended?
I also noticed only now that random patches have status
at random places in the property tree.. Removing the disablement
would aid that as well (wink wink)!
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 12/13] arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem
2023-09-26 19:04 ` Konrad Dybcio
@ 2023-09-26 19:44 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:44 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo, Markuss Broks
On Tue, Sep 26, 2023 at 09:04:22PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> >
> > Enable sound and modem for the Samsung J5 smartphones. The setup is
> > similar to most MSM8916 devices, i.e.:
> >
> > - QDSP6 audio
> > - Speaker/earpiece/headphones/microphones via digital/analog codec
> > in MSM8916/PM8916
> > - WWAN Internet via BAM-DMUX
> >
> > except:
> >
> > - There is no secondary microphone, so a different "model" is used to
> > differentiate that in the UCM configuration.
> > - Samsung-specific audio jack detection (not supported yet)
> >
> > Co-developed-by: Markuss Broks <markuss.broks@gmail.com>
> > Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
> > Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> > [Stephan: Add consistent commit message]
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> > arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 15 +++++++++++++++
> > arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 4 ++++
> > 2 files changed, 19 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
> > index fe59be3505fe..2caa820b0c26 100644
> > --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
> > +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi
> > @@ -1,6 +1,8 @@
> > // SPDX-License-Identifier: GPL-2.0-only
> >
> > #include "msm8916-pm8916.dtsi"
> > +#include "msm8916-modem-qdsp6.dtsi"
> > +
> > #include <dt-bindings/gpio/gpio.h>
> > #include <dt-bindings/input/input.h>
> > #include <dt-bindings/interrupt-controller/irq.h>
> > @@ -135,6 +137,10 @@ &blsp_uart2 {
> > status = "okay";
> > };
> >
> > +&mpss_mem {
> > + reg = <0x0 0x86800000 0x0 0x5800000>;
> > +};
> > +
> > &pm8916_resin {
> > status = "okay";
> > linux,code = <KEY_VOLUMEDOWN>;
> > @@ -154,6 +160,15 @@ &sdhc_2 {
> > cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
> > };
> >
> > +&sound {
> > + model = "msm8916-1mic";
> That's.. vague.. Is that intended?
>
msm8916-modem-qdsp6.dtsi defines model = "msm8916" by default since we
have a standard UCM configuration that configures the typical audio
mixer setup when all outputs/inputs are connected to the digital/analog
codec of the SoC/PMIC. "msm8916-1mic" is exactly the same just with the
SecondaryMic disabled.
Unfortunately these names are effectively limited to 15 chars
(everything after will be cut off), so there is extremely limited
potential for more expressive names. :(
> I also noticed only now that random patches have status
> at random places in the property tree.. Removing the disablement
> would aid that as well (wink wink)!
>
Hm, I think I could do the status = "okay" in msm8916-modem-qdsp6.dtsi.
I don't think it should be enabled by default in the SoC dtsi but there
it would probably be fine. :)
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread
* [PATCH 13/13] arm64: dts: qcom: msm8939-samsung-a7: Add sound and modem
2023-09-26 16:51 [PATCH 00/13] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 Stephan Gerhold
` (11 preceding siblings ...)
2023-09-26 16:51 ` [PATCH 12/13] arm64: dts: qcom: msm8916-samsung-j5: " Stephan Gerhold
@ 2023-09-26 16:51 ` Stephan Gerhold
2023-09-26 19:04 ` Konrad Dybcio
12 siblings, 1 reply; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 16:51 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Andy Gross, Konrad Dybcio, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Stephan Gerhold, Lin, Meng-Bo
From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
Enable sound and modem for the Samsung A7. The setup is similar to most
MSM8916 devices, i.e.:
- QDSP6 audio
- Earpiece/headphones/microphones via digital/analog codec in
MSM8916/PM8916
- WWAN Internet via BAM-DMUX
except for the same differences as the MSM8916-based Samsung A2015
devices:
- NXP TFA9895 codec for speaker on Quaternary MI2S
- Samsung-specific audio jack detection (not supported yet)
Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
[Stephan: Add consistent commit message]
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
---
arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts | 54 +++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
index fccd8fec8b8f..4951b3e265d2 100644
--- a/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
+++ b/arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts
@@ -3,10 +3,12 @@
/dts-v1/;
#include "msm8939-pm8916.dtsi"
+#include "msm8916-modem-qdsp6.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/sound/apq8016-lpass.h>
/ {
model = "Samsung Galaxy A7 (2015)";
@@ -287,6 +289,18 @@ muic: extcon@25 {
};
};
+&blsp_i2c2 {
+ status = "okay";
+
+ speaker_codec: audio-codec@34 {
+ compatible = "nxp,tfa9895";
+ reg = <0x34>;
+ vddd-supply = <&pm8916_l5>;
+ sound-name-prefix = "Speaker";
+ #sound-dai-cells = <0>;
+ };
+};
+
&blsp_i2c5 {
status = "okay";
@@ -309,6 +323,17 @@ &blsp_uart2 {
status = "okay";
};
+&lpass {
+ dai-link@3 {
+ reg = <MI2S_QUATERNARY>;
+ qcom,playback-sd-lines = <1>;
+ };
+};
+
+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5800000>;
+};
+
&pm8916_resin {
linux,code = <KEY_VOLUMEDOWN>;
status = "okay";
@@ -321,6 +346,13 @@ pm8916_l17: l17 {
};
};
+&q6afedai {
+ dai@22 {
+ reg = <QUATERNARY_MI2S_RX>;
+ qcom,sd-lines = <1>;
+ };
+};
+
&sdhc_1 {
status = "okay";
};
@@ -335,6 +367,28 @@ &sdhc_2 {
status = "okay";
};
+&sound {
+ model = "samsung-a2015";
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+
+ pinctrl-0 = <&cdc_pdm_default &sec_mi2s_default>;
+ pinctrl-1 = <&cdc_pdm_sleep &sec_mi2s_sleep>;
+ pinctrl-names = "default", "sleep";
+
+ status = "okay";
+};
+
+&sound_dai_quaternary {
+ status = "okay";
+
+ codec {
+ sound-dai = <&speaker_codec>;
+ };
+};
+
&usb {
extcon = <&muic>, <&muic>;
status = "okay";
--
2.42.0
^ permalink raw reply related [flat|nested] 52+ messages in thread
* Re: [PATCH 13/13] arm64: dts: qcom: msm8939-samsung-a7: Add sound and modem
2023-09-26 16:51 ` [PATCH 13/13] arm64: dts: qcom: msm8939-samsung-a7: " Stephan Gerhold
@ 2023-09-26 19:04 ` Konrad Dybcio
2023-09-26 19:45 ` Stephan Gerhold
0 siblings, 1 reply; 52+ messages in thread
From: Konrad Dybcio @ 2023-09-26 19:04 UTC (permalink / raw)
To: Stephan Gerhold, Bjorn Andersson
Cc: Andy Gross, linux-arm-msm, devicetree, linux-kernel, phone-devel,
~postmarketos/upstreaming, Bryan O'Donoghue, Lin, Meng-Bo
On 26.09.2023 18:51, Stephan Gerhold wrote:
> From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
>
> Enable sound and modem for the Samsung A7. The setup is similar to most
> MSM8916 devices, i.e.:
>
> - QDSP6 audio
> - Earpiece/headphones/microphones via digital/analog codec in
> MSM8916/PM8916
> - WWAN Internet via BAM-DMUX
>
> except for the same differences as the MSM8916-based Samsung A2015
> devices:
>
> - NXP TFA9895 codec for speaker on Quaternary MI2S
> - Samsung-specific audio jack detection (not supported yet)
>
> Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> [Stephan: Add consistent commit message]
> Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> ---
[...]
>
> +&lpass {
> + dai-link@3 {
> + reg = <MI2S_QUATERNARY>;
> + qcom,playback-sd-lines = <1>;
> + };
> +};
reserved hw?
Konrad
^ permalink raw reply [flat|nested] 52+ messages in thread
* Re: [PATCH 13/13] arm64: dts: qcom: msm8939-samsung-a7: Add sound and modem
2023-09-26 19:04 ` Konrad Dybcio
@ 2023-09-26 19:45 ` Stephan Gerhold
0 siblings, 0 replies; 52+ messages in thread
From: Stephan Gerhold @ 2023-09-26 19:45 UTC (permalink / raw)
To: Konrad Dybcio
Cc: Bjorn Andersson, Andy Gross, linux-arm-msm, devicetree,
linux-kernel, phone-devel, ~postmarketos/upstreaming,
Bryan O'Donoghue, Lin, Meng-Bo
On Tue, Sep 26, 2023 at 09:04:47PM +0200, Konrad Dybcio wrote:
> On 26.09.2023 18:51, Stephan Gerhold wrote:
> > From: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> >
> > Enable sound and modem for the Samsung A7. The setup is similar to most
> > MSM8916 devices, i.e.:
> >
> > - QDSP6 audio
> > - Earpiece/headphones/microphones via digital/analog codec in
> > MSM8916/PM8916
> > - WWAN Internet via BAM-DMUX
> >
> > except for the same differences as the MSM8916-based Samsung A2015
> > devices:
> >
> > - NXP TFA9895 codec for speaker on Quaternary MI2S
> > - Samsung-specific audio jack detection (not supported yet)
> >
> > Signed-off-by: "Lin, Meng-Bo" <linmengbo0689@protonmail.com>
> > [Stephan: Add consistent commit message]
> > Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
> > ---
> [...]
>
> >
> > +&lpass {
> > + dai-link@3 {
> > + reg = <MI2S_QUATERNARY>;
> > + qcom,playback-sd-lines = <1>;
> > + };
> > +};
> reserved hw?
>
My previous reply for reference:
https://lore.kernel.org/linux-arm-msm/ZRMwdRo9hAm4BO5E@gerhold.net/
Thanks,
Stephan
^ permalink raw reply [flat|nested] 52+ messages in thread