diff mbox series

[12/13] arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem

Message ID 20230926-msm8916-modem-v1-12-398eec74bac9@gerhold.net (mailing list archive)
State Superseded
Headers show
Series arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6 | expand

Commit Message

Stephan Gerhold Sept. 26, 2023, 4:51 p.m. UTC
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(+)

Comments

Konrad Dybcio Sept. 26, 2023, 7:04 p.m. UTC | #1
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
Stephan Gerhold Sept. 26, 2023, 7:44 p.m. UTC | #2
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
diff mbox series

Patch

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 */
 };