2023-10-03 13:18:53

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 00/14] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6

Enable sound and modem on most of the MSM8916/MSM8939
smartphones/tablets supported upstream by:

- Adding the BAM-DMUX DT nodes to msm8939.dtsi for WWAN Internet
- Adding the QDSP6 DT nodes to both msm8916.dtsi and msm8939.dtsi.
This is needed because audio must be routed through the QDSP6
services provided by the modem firmware when the modem is active.
- Setting up the sound/codec related nodes for all the devices.

Most of the sound/modem setup is very similar on all MSM8916/MSM8939
devices because the device-specific details are abstracted by the modem
firmware. Reduce duplication by adding "msm8916-modem-qdsp6.dtsi" which
contains most of the common definitions. The board-specific DT part is
limited to extra codecs or board-specific sound setup.

With this patch set, the following functionality works on most
MSM8916/MSM8939 devices supported upstream:

- Sound: Speaker/earpiece/headphones/microphones
- Modem: Calls, SMS, WWAN Internet (e.g. with ModemManager)

And with extra pending patches also:

- Voice call audio
- GPS

These patches have been contributed by different people and have been
used/tested in postmarketOS for several years. Until now they had to
wait for other changes to be upstreamed (QDSP6 audio support for
MSM8916, dynamic reserved memory, ...).

Signed-off-by: Stephan Gerhold <[email protected]>
---
Changes in v2:
- msm8916-modem-qdsp6.dtsi: Add some missing new lines (Konrad)
- msm8916-modem-qdsp6.dtsi: Avoid unused template nodes (Konrad)
- Refactored/cleaned up dai-link nodes a bit to fix this
- Split up msm8916.dtsi and msm8939.dtsi QDSP6 patch (Konrad)
- Clarify purpose of &lpass node with a comment (Konrad)
- Move around status properties a bit for more clarity (Konrad)
- Link to v1: https://lore.kernel.org/r/[email protected]

---
J.R. Divya Antony (1):
arm64: dts: qcom: msm8916-asus-z00l: Add sound and modem

Jasper Korten (1):
arm64: dts: qcom: msm8916-samsung-gt5: Add sound and modem

Jonathan Albrieux (1):
arm64: dts: qcom: msm8916-longcheer-l8910: Add sound and modem

Lin, Meng-Bo (2):
arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem
arm64: dts: qcom: msm8939-samsung-a7: Add sound and modem

Nikita Travkin (1):
arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem

Stephan Gerhold (6):
arm64: dts: qcom: msm8916: Add QDSP6
arm64: dts: qcom: msm8939: Add QDSP6
arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem
arm64: dts: qcom: msm8916-wingtech-wt88047: Add sound and modem

Vincent Knecht (2):
arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN
arm64: dts: qcom: msm8916-alcatel-idol347: Add sound and modem

.../boot/dts/qcom/msm8916-alcatel-idol347.dts | 171 +++++++++++++++++++++
arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts | 21 +++
.../boot/dts/qcom/msm8916-longcheer-l8150.dts | 31 +++-
.../boot/dts/qcom/msm8916-longcheer-l8910.dts | 52 +++++++
arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi | 148 ++++++++++++++++++
.../dts/qcom/msm8916-samsung-a2015-common.dtsi | 71 +++++++++
.../dts/qcom/msm8916-samsung-e2015-common.dtsi | 4 +
.../boot/dts/qcom/msm8916-samsung-grandmax.dts | 4 +
.../boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 54 +++++++
arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts | 22 +++
arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts | 42 +++++
.../boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 14 ++
arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 4 +
.../boot/dts/qcom/msm8916-samsung-serranove.dts | 13 ++
.../boot/dts/qcom/msm8916-wingtech-wt88047.dts | 74 +++++++++
arch/arm64/boot/dts/qcom/msm8916.dtsi | 49 ++++++
arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts | 70 +++++++++
arch/arm64/boot/dts/qcom/msm8939.dtsi | 79 ++++++++++
18 files changed, 920 insertions(+), 3 deletions(-)
---
change-id: 20230922-msm8916-modem-0d8b6c8abf76

Best regards,
--
Stephan Gerhold <[email protected]>


2023-10-03 13:18:57

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 01/14] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN

From: Vincent Knecht <[email protected]>

BAM DMUX is used as the network interface to the modem. This is copied
as-is from msm8916.dtsi.

Signed-off-by: Vincent Knecht <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Stephan Gerhold <[email protected]>
---
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

2023-10-03 13:19:04

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 02/14] arm64: dts: qcom: msm8916: Add QDSP6

MSM8916 does 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. 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 <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8916.dtsi | 49 +++++++++++++++++++++++++++++++++++
1 file changed, 49 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";

--
2.42.0

2023-10-03 13:19:06

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 04/14] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi

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 by adding additional backend DAI links.

Signed-off-by: Stephan Gerhold <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi | 148 ++++++++++++++++++++++
1 file changed, 148 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..039961622633
--- /dev/null
+++ b/arch/arm64/boot/dts/qcom/msm8916-modem-qdsp6.dtsi
@@ -0,0 +1,148 @@
+// 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 by adding additional backend DAI links.
+ */
+
+#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";
+
+ status = "okay";
+
+ frontend0-dai-link {
+ link-name = "MultiMedia1";
+
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA1>;
+ };
+ };
+
+ frontend1-dai-link {
+ link-name = "MultiMedia2";
+
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA2>;
+ };
+ };
+
+ frontend2-dai-link {
+ link-name = "MultiMedia3";
+
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA3>;
+ };
+ };
+
+ frontend3-dai-link {
+ link-name = "MultiMedia4";
+
+ cpu {
+ sound-dai = <&q6asmdai MSM_FRONTEND_DAI_MULTIMEDIA4>;
+ };
+ };
+
+ sound_link_backend0: backend0-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_link_backend1: backend1-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>;
+ };
+ };
+};

--
2.42.0

2023-10-03 13:19:10

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 06/14] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem

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 <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8916-samsung-serranove.dts | 13 +++++++++++++
1 file changed, 13 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..5ce8f1350abc 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,13 @@ &sdhc_2 {
no-1-8-v;
};

+&sound {
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+};
+
&usb {
status = "okay";
extcon = <&muic>, <&muic>;

--
2.42.0

2023-10-03 13:19:16

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 07/14] arm64: dts: qcom: msm8916-wingtech-wt88047: Add sound and modem

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.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Stephan Gerhold <[email protected]>
---
.../boot/dts/qcom/msm8916-wingtech-wt88047.dts | 74 ++++++++++++++++++++++
1 file changed, 74 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..d4b88c787e59 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,30 @@ &sdhc_2 {
non-removable;
};

+&sound {
+ /*
+ * 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 +286,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 +301,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

2023-10-03 13:19:21

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 10/14] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem

From: Nikita Travkin <[email protected]>

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 <[email protected]>
Co-developed-by: Stephan Gerhold <[email protected]>
Signed-off-by: Stephan Gerhold <[email protected]>
---
.../boot/dts/qcom/msm8916-longcheer-l8150.dts | 31 +++++++++++++++++++---
1 file changed, 28 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..37fa55166918 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,13 @@ &sdhc_2 {
non-removable;
};

+&sound {
+ audio-routing =
+ "AMIC1", "MIC BIAS Internal1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS Internal3";
+};
+
&usb {
status = "okay";
dr_mode = "peripheral";

--
2.42.0

2023-10-03 13:19:25

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 08/14] arm64: dts: qcom: msm8916-alcatel-idol347: Add sound and modem

From: Vincent Knecht <[email protected]>

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 <[email protected]>
[Stephan: Minor refactoring, add consistent commit message]
Signed-off-by: Stephan Gerhold <[email protected]>
---
There are some trivial conflicts unless
https://lore.kernel.org/linux-arm-msm/[email protected]/
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 | 171 +++++++++++++++++++++
1 file changed, 171 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..3459145516a1 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 = <&reg_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,54 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};

+&sound {
+ /* 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_link_backend2: backend2-dai-link {
+ link-name = "Quaternary MI2S";
+
+ cpu {
+ sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ codec {
+ sound-dai = <&speaker_codec_top>, <&speaker_codec_bottom>;
+ };
+ };
+};
+
+&sound_link_backend0 {
+ /* Primary MI2S is not used, replace with Secondary MI2S for headphones */
+ link-name = "Secondary MI2S";
+
+ cpu {
+ sound-dai = <&q6afedai SECONDARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ codec {
+ sound-dai = <&headphones>;
+ };
+};
+
&usb {
status = "okay";
extcon = <&usb_id>, <&usb_id>;
@@ -212,6 +346,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 +388,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 +448,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

2023-10-03 13:19:42

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 12/14] arm64: dts: qcom: msm8916-samsung-gt5: Add sound and modem

From: Jasper Korten <[email protected]>

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 <[email protected]>
Co-developed-by: Siddharth Manthan <[email protected]>
Signed-off-by: Siddharth Manthan <[email protected]>
Co-developed-by: Nikita Travkin <[email protected]>
Signed-off-by: Nikita Travkin <[email protected]>
[Stephan: Add consistent commit message, minor refactoring]
Signed-off-by: Stephan Gerhold <[email protected]>
---
.../boot/dts/qcom/msm8916-samsung-gt5-common.dtsi | 54 ++++++++++++++++++++++
arch/arm64/boot/dts/qcom/msm8916-samsung-gt510.dts | 22 +++++++++
arch/arm64/boot/dts/qcom/msm8916-samsung-gt58.dts | 42 +++++++++++++++++
3 files changed, 118 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..fbd2caf405d5 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,29 @@ &blsp_uart2 {
status = "okay";
};

+/*
+ * For some reason the speaker amplifier is connected to the second SD line
+ * (MI2S_2_D1) instead of the first (MI2S_2_D0). This must be configured in the
+ * device tree, otherwise audio will seemingly play fine on the wrong SD line
+ * but the speaker stays silent.
+ *
+ * When routing audio via QDSP6 (the default) the &lpass node is reserved and
+ * the definitions from &q6afedai are used. When the modem is disabled audio can
+ * be alternatively routed directly to the LPASS hardware with reduced latency.
+ * The definitions for &lpass are here for completeness to simplify changing the
+ * setup with minor changes to the DT (either manually or with DT overlays).
+ */
+&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 +159,13 @@ &pm8916_usbin {
status = "okay";
};

+&q6afedai {
+ dai@22 {
+ reg = <QUATERNARY_MI2S_RX>;
+ qcom,sd-lines = <1>;
+ };
+};
+
&sdhc_1 {
status = "okay";
};
@@ -147,6 +180,27 @@ &sdhc_2 {
status = "okay";
};

+&sound {
+ audio-routing =
+ "AMIC1", "MIC BIAS External1",
+ "AMIC2", "MIC BIAS Internal2",
+ "AMIC3", "MIC BIAS External1";
+
+ sound_link_backend2: backend2-dai-link {
+ link-name = "Quaternary MI2S";
+
+ cpu {
+ sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ 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..5b34529b816c 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,21 @@ &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";
+};
+
&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..579312ed53ce 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 = <&amp_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,21 @@ &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";
+};
+
&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 +161,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

2023-10-03 13:19:43

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 03/14] arm64: dts: qcom: msm8939: Add QDSP6

MSM8939 does 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 msm8939.dtsi. The apr node is
disabled by default to avoid changing behavior for devices like
apq8039-t2 that use the bypassed audio path.

Signed-off-by: Stephan Gerhold <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8939.dtsi | 49 +++++++++++++++++++++++++++++++++++
1 file changed, 49 insertions(+)

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

2023-10-03 13:19:52

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 05/14] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem

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" <[email protected]>
Signed-off-by: "Lin, Meng-Bo" <[email protected]>
Signed-off-by: Stephan Gerhold <[email protected]>
---
.../dts/qcom/msm8916-samsung-a2015-common.dtsi | 71 ++++++++++++++++++++++
.../dts/qcom/msm8916-samsung-e2015-common.dtsi | 4 ++
.../boot/dts/qcom/msm8916-samsung-grandmax.dts | 4 ++
3 files changed, 79 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..2937495940ea 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,25 @@ &gpu {
status = "okay";
};

+/*
+ * For some reason the speaker amplifier is connected to the second SD line
+ * (MI2S_2_D1) instead of the first (MI2S_2_D0). This must be configured in the
+ * device tree, otherwise audio will seemingly play fine on the wrong SD line
+ * but the speaker stays silent.
+ *
+ * When routing audio via QDSP6 (the default) the &lpass node is reserved and
+ * the definitions from &q6afedai are used. When the modem is disabled audio can
+ * be alternatively routed directly to the LPASS hardware with reduced latency.
+ * The definitions for &lpass are here for completeness to simplify changing the
+ * setup with minor changes to the DT (either manually or with DT overlays).
+ */
+&lpass {
+ dai-link@3 {
+ reg = <MI2S_QUATERNARY>;
+ qcom,playback-sd-lines = <1>;
+ };
+};
+
&mdss {
status = "okay";
};
@@ -253,6 +287,10 @@ &mdss_dsi0 {
pinctrl-1 = <&mdss_sleep>;
};

+&mpss_mem {
+ reg = <0x0 0x86800000 0x0 0x5400000>;
+};
+
&pm8916_resin {
status = "okay";
linux,code = <KEY_VOLUMEDOWN>;
@@ -265,6 +303,13 @@ pm8916_l17: l17 {
};
};

+&q6afedai {
+ dai@22 {
+ reg = <QUATERNARY_MI2S_RX>;
+ qcom,sd-lines = <1>;
+ };
+};
+
&sdhc_1 {
status = "okay";
};
@@ -279,6 +324,32 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};

+&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";
+
+ sound_link_backend2: backend2-dai-link {
+ link-name = "Quaternary MI2S";
+
+ cpu {
+ sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ 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>;
+};
+
&reg_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 @@ &reg_touch_key {
status = "disabled";
};

+&sound {
+ model = "samsung-gmax"; /* No secondary microphone */
+};
+
&tlmm {
gpio_leds_default: gpio-led-default-state {
pins = "gpio60";

--
2.42.0

2023-10-03 13:19:57

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 14/14] arm64: dts: qcom: msm8939-samsung-a7: Add sound and modem

From: "Lin, Meng-Bo" <[email protected]>

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" <[email protected]>
[Stephan: Add consistent commit message, minor refactoring]
Signed-off-by: Stephan Gerhold <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8939-samsung-a7.dts | 70 +++++++++++++++++++++++++
1 file changed, 70 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..aa6c39482a2f 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,29 @@ &blsp_uart2 {
status = "okay";
};

+/*
+ * For some reason the speaker amplifier is connected to the second SD line
+ * (MI2S_2_D1) instead of the first (MI2S_2_D0). This must be configured in the
+ * device tree, otherwise audio will seemingly play fine on the wrong SD line
+ * but the speaker stays silent.
+ *
+ * When routing audio via QDSP6 (the default) the &lpass node is reserved and
+ * the definitions from &q6afedai are used. When the modem is disabled audio can
+ * be alternatively routed directly to the LPASS hardware with reduced latency.
+ * The definitions for &lpass are here for completeness to simplify changing the
+ * setup with minor changes to the DT (either manually or with DT overlays).
+ */
+&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 +358,13 @@ pm8916_l17: l17 {
};
};

+&q6afedai {
+ dai@22 {
+ reg = <QUATERNARY_MI2S_RX>;
+ qcom,sd-lines = <1>;
+ };
+};
+
&sdhc_1 {
status = "okay";
};
@@ -335,6 +379,32 @@ &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";
+
+ sound_link_backend2: backend2-dai-link {
+ link-name = "Quaternary MI2S";
+
+ cpu {
+ sound-dai = <&q6afedai QUATERNARY_MI2S_RX>;
+ };
+ platform {
+ sound-dai = <&q6routing>;
+ };
+ codec {
+ sound-dai = <&speaker_codec>;
+ };
+ };
+};
+
&usb {
extcon = <&muic>, <&muic>;
status = "okay";

--
2.42.0

2023-10-03 13:20:21

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 13/14] arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem

From: "Lin, Meng-Bo" <[email protected]>

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 <[email protected]>
Signed-off-by: Markuss Broks <[email protected]>
Signed-off-by: "Lin, Meng-Bo" <[email protected]>
[Stephan: Add consistent commit message]
Signed-off-by: Stephan Gerhold <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8916-samsung-j5-common.dtsi | 14 ++++++++++++++
arch/arm64/boot/dts/qcom/msm8916-samsung-j5.dts | 4 ++++
2 files changed, 18 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..5ca2ada266f4 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,14 @@ &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";
+};
+
&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

2023-10-03 13:20:52

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 09/14] arm64: dts: qcom: msm8916-asus-z00l: Add sound and modem

From: "J.R. Divya Antony" <[email protected]>

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" <[email protected]>
[Stephan: rebase and simplify, add consistent commit message]
Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Stephan Gerhold <[email protected]>
---
arch/arm64/boot/dts/qcom/msm8916-asus-z00l.dts | 21 +++++++++++++++++++++
1 file changed, 21 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..77618c7374df 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,13 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};

+&sound {
+ 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

2023-10-03 13:21:14

by Stephan Gerhold

[permalink] [raw]
Subject: [PATCH v2 11/14] arm64: dts: qcom: msm8916-longcheer-l8910: Add sound and modem

From: Jonathan Albrieux <[email protected]>

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 <[email protected]>
Co-developed-by: Stephan Gerhold <[email protected]>
Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Stephan Gerhold <[email protected]>
---
.../boot/dts/qcom/msm8916-longcheer-l8910.dts | 52 ++++++++++++++++++++++
1 file changed, 52 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..e64bf687ca7d 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,28 @@ &sdhc_2 {
cd-gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
};

+&sound {
+ /*
+ * 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 +250,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

2023-10-22 15:46:41

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 00/14] arm64: dts: qcom: msm8916/39: Enable sound and modem with QDSP6


On Tue, 03 Oct 2023 15:18:18 +0200, Stephan Gerhold wrote:
> Enable sound and modem on most of the MSM8916/MSM8939
> smartphones/tablets supported upstream by:
>
> - Adding the BAM-DMUX DT nodes to msm8939.dtsi for WWAN Internet
> - Adding the QDSP6 DT nodes to both msm8916.dtsi and msm8939.dtsi.
> This is needed because audio must be routed through the QDSP6
> services provided by the modem firmware when the modem is active.
> - Setting up the sound/codec related nodes for all the devices.
>
> [...]

Applied, thanks!

[01/14] arm64: dts: qcom: msm8939: Add BAM-DMUX WWAN
commit: 32f963412a2d8cb65ff2737e6763f88ed15a2efb
[02/14] arm64: dts: qcom: msm8916: Add QDSP6
commit: 861aa8e6829cf2f1a9c5a52dd9cebc722cf7ca44
[03/14] arm64: dts: qcom: msm8939: Add QDSP6
commit: 0718ff7185cf42f8e817e39552feb9d6ed901aff
[04/14] arm64: dts: qcom: msm8916: Add common msm8916-modem-qdsp6.dtsi
commit: 8abbd235b2ecbfba0a445ccd400a54af8fd83bc2
[05/14] arm64: dts: qcom: msm8916-samsung-a2015: Add sound and modem
commit: f276411d0f8286c7ff3e1bd6917ea7ee61152d24
[06/14] arm64: dts: qcom: msm8916-samsung-serranove: Add sound and modem
commit: 6b66abd5858e025b2715b1efb193124dd7cc17c5
[07/14] arm64: dts: qcom: msm8916-wingtech-wt88047: Add sound and modem
commit: 5db767ae36255c0301ede64ee8993e0909efa73f
[08/14] arm64: dts: qcom: msm8916-alcatel-idol347: Add sound and modem
commit: 5d1cec28fd4d09e82e028903423829f59a033965
[09/14] arm64: dts: qcom: msm8916-asus-z00l: Add sound and modem
commit: 462cdffaa83df28d5fbd0c1771eaa85954114c77
[10/14] arm64: dts: qcom: msm8916-longcheer-l8150: Add sound and modem
commit: 1ab407193d38c775261d7beccd080e88f68c7243
[11/14] arm64: dts: qcom: msm8916-longcheer-l8910: Add sound and modem
commit: 2821c34a996b4a0991d33bead5caa84267e2dccd
[12/14] arm64: dts: qcom: msm8916-samsung-gt5: Add sound and modem
commit: 4f6b5edbcfbaa1061c29e6259cc5653f44b673da
[13/14] arm64: dts: qcom: msm8916-samsung-j5: Add sound and modem
commit: cf12268e1b632c6ac16185bd1230af6e1ca517fb
[14/14] arm64: dts: qcom: msm8939-samsung-a7: Add sound and modem
commit: dd5ab5d2ca722110c82459a571e367df7ee6d821

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