2023-12-05 11:49:28

by Nikita Travkin

[permalink] [raw]
Subject: [PATCH v2 0/3] sc7180-acer-aspire1: Add sound

This series adds initial sound support to Acer Aspire 1.

The following sound devices are enabled:
- External stereo speakers
- Headphone jack
- Headset microphone
- DisplayPort sound*

[*] The DisplayPort itself is not yet enabled as it depends on
the embedded controller, which will be added later.

The stereo DMIC in the device lid is omitted from this series
as it requires introduction of the in-soc audio codec, which will
be done later.

While at it, also enable the PMIC RTC that, while is locked
by the firmware as read-only, still allows userspace to track
time with extra tools to save the offset.

Signed-off-by: Nikita Travkin <[email protected]>
---
Changes in v2:
- No changes, picked up tags.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Nikita Travkin (3):
arm64: dts: qcom: acer-aspire1: Enable RTC
arm64: dts: qcom: acer-aspire1: Correct audio codec definition
arm64: dts: qcom: acer-aspire1: Add sound

arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts | 174 ++++++++++++++++++++++-
1 file changed, 172 insertions(+), 2 deletions(-)
---
base-commit: 0f5f12ac05f36f117e793656c3f560625e927f1b
change-id: 20231027-aspire1-sound-53a4c06ac9fd

Best regards,
--
Nikita Travkin <[email protected]>


2023-12-05 11:49:41

by Nikita Travkin

[permalink] [raw]
Subject: [PATCH v2 2/3] arm64: dts: qcom: acer-aspire1: Correct audio codec definition

When initially added, a mistake was made in the definition of the codec.

Despite the fact that the DMIC line is connected on the side of the
codec chip, and relevant passive components, including 0-ohm resistors
connecting the dmics, are present, the dmic line is still cut in
another place on the board, which was overlooked.

Correct this by replacing the dmic configuration with a comment
describing this hardware detail.

While at it, also add missing regulators definitions. This is not a
functional change as all the relevant regulators were already added via
the other rail supplies.

Fixes: 4a9f8f8f2ada ("arm64: dts: qcom: Add Acer Aspire 1")
Signed-off-by: Nikita Travkin <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
index cfde8cd47107..00b442696618 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
@@ -209,9 +209,22 @@ alc5682: codec@1a {
AVDD-supply = <&vreg_l15a_1p8>;
MICVDD-supply = <&reg_codec_3p3>;
VBAT-supply = <&reg_codec_3p3>;
+ DBVDD-supply = <&vreg_l15a_1p8>;
+ LDO1-IN-supply = <&vreg_l15a_1p8>;
+
+ /*
+ * NOTE: The board has a path from this codec to the
+ * DMIC microphones in the lid, however some of the option
+ * resistors are absent and the microphones are connected
+ * to the SoC instead.
+ *
+ * If the resistors were to be changed by the user to
+ * connect the codec, the following could be used:
+ *
+ * realtek,dmic1-data-pin = <1>;
+ * realtek,dmic1-clk-pin = <1>;
+ */

- realtek,dmic1-data-pin = <1>;
- realtek,dmic1-clk-pin = <1>;
realtek,jd-src = <1>;
};
};

--
2.43.0

2023-12-05 11:49:46

by Nikita Travkin

[permalink] [raw]
Subject: [PATCH v2 1/3] arm64: dts: qcom: acer-aspire1: Enable RTC

pm6150 has a read-only RTC that can be used to keep the time with some
extra userspace tools. Enable it.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Nikita Travkin <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts | 4 ++++
1 file changed, 4 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
index dbb48934d499..cfde8cd47107 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
@@ -351,6 +351,10 @@ &pm6150_pon {
status = "disabled";
};

+&pm6150_rtc {
+ status = "okay";
+};
+
&qupv3_id_0 {
status = "okay";
};

--
2.43.0

2023-12-05 11:49:48

by Nikita Travkin

[permalink] [raw]
Subject: [PATCH v2 3/3] arm64: dts: qcom: acer-aspire1: Add sound

This laptop has two i2s speakers; an i2s audio codec for the headset
jack; two DMIC microphones in the lid and the displayport audio channel.

This commit adds the audio node that describes all of the above with the
exception of the DMICs that require in-SoC digital codec to be brought
up, which will be done later.

Note that the displayport channel is connected here for completeness,
but the displayport can't be used yet since the HPD signal is created by
the embedded controller, which will be added later.

Reviewed-by: Konrad Dybcio <[email protected]>
Signed-off-by: Nikita Travkin <[email protected]>
---
arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts | 153 +++++++++++++++++++++++
1 file changed, 153 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
index 00b442696618..5afcb8212f49 100644
--- a/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
+++ b/arch/arm64/boot/dts/qcom/sc7180-acer-aspire1.dts
@@ -3,6 +3,7 @@
/dts-v1/;

#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/sound/qcom,q6asm.h>
#include <dt-bindings/regulator/qcom,rpmh-regulator.h>

#include "sc7180.dtsi"
@@ -129,6 +130,113 @@ reg_lcm_3p3: panel-regulator {
pinctrl-names = "default";
};

+ sound: sound {
+ compatible = "qcom,sc7180-qdsp6-sndcard";
+ pinctrl-0 = <&pri_mi2s_active>, <&pri_mi2s_mclk_active>, <&ter_mi2s_active>;
+ pinctrl-names = "default";
+ model = "Acer-Aspire-1";
+
+ audio-routing =
+ "Headphone Jack", "HPOL",
+ "Headphone Jack", "HPOR";
+
+ 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>;
+ };
+ };
+
+ primary-rx-dai-link {
+ link-name = "Primary MI2S Playback";
+
+ cpu {
+ sound-dai = <&q6afedai PRIMARY_MI2S_RX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+
+ codec {
+ sound-dai = <&alc5682 0>;
+ };
+ };
+
+ primary-tx-dai-link {
+ link-name = "Primary MI2S Capture";
+
+ cpu {
+ sound-dai = <&q6afedai PRIMARY_MI2S_TX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+
+ codec {
+ sound-dai = <&alc5682 0>;
+ };
+ };
+
+ tertiary-rx-dai-link {
+ link-name = "Tertiary MI2S Playback";
+
+ cpu {
+ sound-dai = <&q6afedai TERTIARY_MI2S_RX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+
+ codec {
+ sound-dai = <&max98357a>;
+ };
+ };
+
+ displayport-rx-dai-link {
+ link-name = "DisplayPort Playback";
+
+ cpu {
+ sound-dai = <&q6afedai DISPLAY_PORT_RX>;
+ };
+
+ platform {
+ sound-dai = <&q6routing>;
+ };
+
+ codec {
+ sound-dai = <&mdss_dp>;
+ };
+ };
+ };
+
reg_tp_3p3: touchpad-regulator {
compatible = "regulator-fixed";
regulator-name = "tp_3p3";
@@ -368,6 +476,45 @@ &pm6150_rtc {
status = "okay";
};

+&q6afedai {
+ dai@16 {
+ reg = <PRIMARY_MI2S_RX>;
+ qcom,sd-lines = <1>;
+ };
+
+ dai@17 {
+ reg = <PRIMARY_MI2S_TX>;
+ qcom,sd-lines = <0>;
+ };
+
+ dai@20 {
+ reg = <TERTIARY_MI2S_RX>;
+ qcom,sd-lines = <0>;
+ };
+
+ dai@104 {
+ reg = <DISPLAY_PORT_RX>;
+ };
+};
+
+&q6asmdai {
+ dai@0 {
+ reg = <0>;
+ };
+
+ dai@1 {
+ reg = <1>;
+ };
+
+ dai@2 {
+ reg = <2>;
+ };
+
+ dai@3 {
+ reg = <3>;
+ };
+};
+
&qupv3_id_0 {
status = "okay";
};
@@ -376,6 +523,12 @@ &qupv3_id_1 {
status = "okay";
};

+&remoteproc_adsp {
+ memory-region = <&adsp_mem>;
+ firmware-name = "qcom/sc7180/acer/aspire1/qcadsp7180.mbn";
+ status = "okay";
+};
+
&remoteproc_mpss {
firmware-name = "qcom/sc7180/acer/aspire1/qcmpss7180_nm.mbn";
status = "okay";

--
2.43.0

2023-12-17 17:36:04

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH v2 0/3] sc7180-acer-aspire1: Add sound


On Tue, 05 Dec 2023 16:48:09 +0500, Nikita Travkin wrote:
> This series adds initial sound support to Acer Aspire 1.
>
> The following sound devices are enabled:
> - External stereo speakers
> - Headphone jack
> - Headset microphone
> - DisplayPort sound*
>
> [...]

Applied, thanks!

[1/3] arm64: dts: qcom: acer-aspire1: Enable RTC
commit: 04fe8f0a68a346048f2432380a74a5e393d59a4c
[2/3] arm64: dts: qcom: acer-aspire1: Correct audio codec definition
commit: feec9f0add432a867f23e29afcd2f7088889b8e2
[3/3] arm64: dts: qcom: acer-aspire1: Add sound
commit: 4555798a21c973c66c8de91b58a2d0b4d0df4af3

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