2023-03-02 11:58:25

by Srinivas Kandagatla

[permalink] [raw]
Subject: [PATCH 0/4] arm64: dts: qcom: sc8280xp: fix audio dts

While testing DMIC on the panel, its noticed that some of the settings in
dts seems to very incorrect. Mostly around clocks and frameshapping data.
An another patch fixes dai link for dmic which is incorrectly pointing to tx macro.

Along with these patches, with a pending csr patch device switch and dmic seems to work
recent changes in x13s ucm.

Thanks,
Srini

Srinivas Kandagatla (4):
arm64: dts: qcom: sc8280xp: fix rx frame shapping info
arm64: dts: qcom: sc8280xp: fix lpass tx macro clocks
arm64: dts: qcom: sc8280xp-x13s: fix dmic sample rate
arm64: dts: qcom: sc8280xp-x13s: fix va dmic dai links and routing

.../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 10 +++++-----
arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 18 +++++++++---------
2 files changed, 14 insertions(+), 14 deletions(-)

--
2.21.0



2023-03-02 11:58:33

by Srinivas Kandagatla

[permalink] [raw]
Subject: [PATCH 1/4] arm64: dts: qcom: sc8280xp: fix rx frame shapping info

Some of the SoundWire frameshapping data seems incorrect, fix these values.

Fixes: 1749a8ae49a3 ("arm64: dts: qcom: sc8280xp: add SoundWire and LPASS")
Signed-off-by: Srinivas Kandagatla <[email protected]>
---
arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
index f9aadf8209d5..022b0c041341 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
@@ -1924,12 +1924,12 @@
qcom,ports-sinterval-low = /bits/ 8 <0x03 0x1f 0x1f 0x07 0x00>;
qcom,ports-offset1 = /bits/ 8 <0x00 0x00 0x0B 0x01 0x00>;
qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x0B 0x00 0x00>;
- qcom,ports-hstart = /bits/ 8 <0xff 0x03 0xff 0xff 0xff>;
- qcom,ports-hstop = /bits/ 8 <0xff 0x06 0xff 0xff 0xff>;
+ qcom,ports-hstart = /bits/ 8 <0xff 0x03 0x00 0xff 0xff>;
+ qcom,ports-hstop = /bits/ 8 <0xff 0x06 0x0f 0xff 0xff>;
qcom,ports-word-length = /bits/ 8 <0x01 0x07 0x04 0xff 0xff>;
- qcom,ports-block-pack-mode = /bits/ 8 <0xff 0x00 0x01 0xff 0xff>;
+ qcom,ports-block-pack-mode = /bits/ 8 <0xff 0xff 0x01 0xff 0xff>;
qcom,ports-lane-control = /bits/ 8 <0x01 0x00 0x00 0x00 0x00>;
- qcom,ports-block-group-count = /bits/ 8 <0xff 0xff 0xff 0xff 0x00>;
+ qcom,ports-block-group-count = /bits/ 8 <0xff 0xff 0xff 0xff 0xff>;

#sound-dai-cells = <1>;
#address-cells = <2>;
@@ -2029,15 +2029,15 @@

qcom,din-ports = <4>;
qcom,dout-ports = <0>;
- qcom,ports-sinterval-low = /bits/ 8 <0x01 0x03 0x03 0x03>;
- qcom,ports-offset1 = /bits/ 8 <0x01 0x00 0x02 0x01>;
+ qcom,ports-sinterval-low = /bits/ 8 <0x01 0x01 0x03 0x03>;
+ qcom,ports-offset1 = /bits/ 8 <0x01 0x00 0x02 0x00>;
qcom,ports-offset2 = /bits/ 8 <0x00 0x00 0x00 0x00>;
qcom,ports-block-pack-mode = /bits/ 8 <0xff 0xff 0xff 0xff>;
qcom,ports-hstart = /bits/ 8 <0xff 0xff 0xff 0xff>;
qcom,ports-hstop = /bits/ 8 <0xff 0xff 0xff 0xff>;
- qcom,ports-word-length = /bits/ 8 <0xff 0x00 0xff 0xff>;
+ qcom,ports-word-length = /bits/ 8 <0xff 0xff 0xff 0xff>;
qcom,ports-block-group-count = /bits/ 8 <0xff 0xff 0xff 0xff>;
- qcom,ports-lane-control = /bits/ 8 <0x00 0x01 0x00 0x00>;
+ qcom,ports-lane-control = /bits/ 8 <0x00 0x01 0x00 0x01>;

status = "disabled";
};
--
2.21.0


2023-03-02 11:58:36

by Srinivas Kandagatla

[permalink] [raw]
Subject: [PATCH 2/4] arm64: dts: qcom: sc8280xp: fix lpass tx macro clocks

Tx macro soundwire clock is for some reason is incorrectly assigned to
va macro, fix this and use tx macro clock instead.

Fixes: 1749a8ae49a3 ("arm64: dts: qcom: sc8280xp: add SoundWire and LPASS")
Signed-off-by: Srinivas Kandagatla <[email protected]>
---
arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
index 022b0c041341..fc1504de6890 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
@@ -2020,7 +2020,7 @@
<&intc GIC_SPI 520 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "core", "wake";

- clocks = <&vamacro>;
+ clocks = <&txmacro>;
clock-names = "iface";
label = "TX";
#sound-dai-cells = <1>;
--
2.21.0


2023-03-02 11:58:41

by Srinivas Kandagatla

[permalink] [raw]
Subject: [PATCH 4/4] arm64: dts: qcom: sc8280xp-x13s: fix va dmic dai links and routing

VA dmics 0, 1, 2 micbias on X13s are connected to WCD MICBIAS1, WCD MICBIAS1
and WCD MICBIAS3 respectively. Reflect this in dt to get dmics working.
Also fix dmics to go via VA Macro instead of TX macro to fix device switching.

Fixes: 8c1ea87e80b4 ("arm64: dts: qcom: sc8280xp-x13s: Add soundcard support")
Signed-off-by: Srinivas Kandagatla <[email protected]>
---
.../arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index d18d405d1776..89230112e288 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -933,9 +933,9 @@
"VA DMIC0", "MIC BIAS1",
"VA DMIC1", "MIC BIAS1",
"VA DMIC2", "MIC BIAS3",
- "TX DMIC0", "MIC BIAS1",
- "TX DMIC1", "MIC BIAS2",
- "TX DMIC2", "MIC BIAS3",
+ "VA DMIC0", "VA MIC BIAS1",
+ "VA DMIC1", "VA MIC BIAS1",
+ "VA DMIC2", "VA MIC BIAS3",
"TX SWR_ADC1", "ADC2_OUTPUT";

wcd-playback-dai-link {
@@ -986,7 +986,7 @@
va-dai-link {
link-name = "VA Capture";
cpu {
- sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
+ sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
};

platform {
--
2.21.0


2023-03-02 11:58:44

by Srinivas Kandagatla

[permalink] [raw]
Subject: [PATCH 3/4] arm64: dts: qcom: sc8280xp-x13s: fix dmic sample rate

The version of dmic that is on X13s panel supports clock frequency
of range 1 Mhz to 4.8 MHz for normal operation.

So correct the existing node to reflect this.

Fixes: 8c1ea87e80b4 ("arm64: dts: qcom: sc8280xp-x13s: Add soundcard support")
Signed-off-by: Srinivas Kandagatla <[email protected]>
---
arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
index 198a81405e6e..d18d405d1776 100644
--- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
+++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
@@ -1111,7 +1111,7 @@

vdd-micb-supply = <&vreg_s10b>;

- qcom,dmic-sample-rate = <600000>;
+ qcom,dmic-sample-rate = <4800000>;

status = "okay";
};
--
2.21.0


2023-03-02 12:24:36

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sc8280xp: fix lpass tx macro clocks



On 2.03.2023 12:57, Srinivas Kandagatla wrote:
> Tx macro soundwire clock is for some reason is incorrectly assigned to
> va macro, fix this and use tx macro clock instead.
>
> Fixes: 1749a8ae49a3 ("arm64: dts: qcom: sc8280xp: add SoundWire and LPASS")
> Signed-off-by: Srinivas Kandagatla <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
> arch/arm64/boot/dts/qcom/sc8280xp.dtsi | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> index 022b0c041341..fc1504de6890 100644
> --- a/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> +++ b/arch/arm64/boot/dts/qcom/sc8280xp.dtsi
> @@ -2020,7 +2020,7 @@
> <&intc GIC_SPI 520 IRQ_TYPE_LEVEL_HIGH>;
> interrupt-names = "core", "wake";
>
> - clocks = <&vamacro>;
> + clocks = <&txmacro>;
> clock-names = "iface";
> label = "TX";
> #sound-dai-cells = <1>;

2023-03-02 12:25:17

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 3/4] arm64: dts: qcom: sc8280xp-x13s: fix dmic sample rate



On 2.03.2023 12:57, Srinivas Kandagatla wrote:
> The version of dmic that is on X13s panel supports clock frequency
> of range 1 Mhz to 4.8 MHz for normal operation.
>
> So correct the existing node to reflect this.
>
> Fixes: 8c1ea87e80b4 ("arm64: dts: qcom: sc8280xp-x13s: Add soundcard support")
Does it depend on any driver changes? If not, Cc stable?

> Signed-off-by: Srinivas Kandagatla <[email protected]>
> ---
Reviewed-by: Konrad Dybcio <[email protected]>

Konrad
> arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> index 198a81405e6e..d18d405d1776 100644
> --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> @@ -1111,7 +1111,7 @@
>
> vdd-micb-supply = <&vreg_s10b>;
>
> - qcom,dmic-sample-rate = <600000>;
> + qcom,dmic-sample-rate = <4800000>;
>
> status = "okay";
> };

2023-03-02 12:28:42

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 4/4] arm64: dts: qcom: sc8280xp-x13s: fix va dmic dai links and routing



On 2.03.2023 12:57, Srinivas Kandagatla wrote:
> VA dmics 0, 1, 2 micbias on X13s are connected to WCD MICBIAS1, WCD MICBIAS1
> and WCD MICBIAS3 respectively. Reflect this in dt to get dmics working.
I'm far from good when it comes to sound, but is it expected that
(VA DMICn) are are connected to both (MIC BIASn) and (VA MIC BIAS{1, 1, 3})?

> Also fix dmics to go via VA Macro instead of TX macro to fix device switching.
>
> Fixes: 8c1ea87e80b4 ("arm64: dts: qcom: sc8280xp-x13s: Add soundcard support")
If that doesn't depend on any driver changes, please Cc stable
so that distros will pick this up.

Konrad
> Signed-off-by: Srinivas Kandagatla <[email protected]>
> ---
> .../arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> index d18d405d1776..89230112e288 100644
> --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
> @@ -933,9 +933,9 @@
> "VA DMIC0", "MIC BIAS1",
> "VA DMIC1", "MIC BIAS1",
> "VA DMIC2", "MIC BIAS3",
> - "TX DMIC0", "MIC BIAS1",
> - "TX DMIC1", "MIC BIAS2",
> - "TX DMIC2", "MIC BIAS3",
> + "VA DMIC0", "VA MIC BIAS1",
> + "VA DMIC1", "VA MIC BIAS1",
> + "VA DMIC2", "VA MIC BIAS3",
> "TX SWR_ADC1", "ADC2_OUTPUT";
>
> wcd-playback-dai-link {
> @@ -986,7 +986,7 @@
> va-dai-link {
> link-name = "VA Capture";
> cpu {
> - sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
> + sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
> };
>
> platform {

2023-03-02 13:45:47

by Srinivas Kandagatla

[permalink] [raw]
Subject: Re: [PATCH 4/4] arm64: dts: qcom: sc8280xp-x13s: fix va dmic dai links and routing



On 02/03/2023 12:28, Konrad Dybcio wrote:
>
>
> On 2.03.2023 12:57, Srinivas Kandagatla wrote:
>> VA dmics 0, 1, 2 micbias on X13s are connected to WCD MICBIAS1, WCD MICBIAS1
>> and WCD MICBIAS3 respectively. Reflect this in dt to get dmics working.
> I'm far from good when it comes to sound, but is it expected that
> (VA DMICn) are are connected to both (MIC BIASn) and (VA MIC BIAS{1, 1, 3})?
>
one DMIC data lane can be used to connect to two DMICs, for L and R
data. So the MIC Bias line too, so for DMIC0, and DMIC1 which is
connected to MICBIAS1 and DMIC2 is connected to BIAS3. Why its bias3
line instead of bias2 is totally board dependent and how the wiring is done.

>> Also fix dmics to go via VA Macro instead of TX macro to fix device switching.
>>
>> Fixes: 8c1ea87e80b4 ("arm64: dts: qcom: sc8280xp-x13s: Add soundcard support")
> If that doesn't depend on any driver changes, please Cc stable
> so that distros will pick this up.
These patches are about to appear in rc1.. so I don't see any help
adding stable.

--srini
>
> Konrad
>> Signed-off-by: Srinivas Kandagatla <[email protected]>
>> ---
>> .../arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 8 ++++----
>> 1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> index d18d405d1776..89230112e288 100644
>> --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts
>> @@ -933,9 +933,9 @@
>> "VA DMIC0", "MIC BIAS1",
>> "VA DMIC1", "MIC BIAS1",
>> "VA DMIC2", "MIC BIAS3",
>> - "TX DMIC0", "MIC BIAS1",
>> - "TX DMIC1", "MIC BIAS2",
>> - "TX DMIC2", "MIC BIAS3",
>> + "VA DMIC0", "VA MIC BIAS1",
>> + "VA DMIC1", "VA MIC BIAS1",
>> + "VA DMIC2", "VA MIC BIAS3",
>> "TX SWR_ADC1", "ADC2_OUTPUT";
>>
>> wcd-playback-dai-link {
>> @@ -986,7 +986,7 @@
>> va-dai-link {
>> link-name = "VA Capture";
>> cpu {
>> - sound-dai = <&q6apmbedai TX_CODEC_DMA_TX_3>;
>> + sound-dai = <&q6apmbedai VA_CODEC_DMA_TX_0>;
>> };
>>
>> platform {

2023-03-15 23:34:58

by Bjorn Andersson

[permalink] [raw]
Subject: Re: [PATCH 0/4] arm64: dts: qcom: sc8280xp: fix audio dts

On Thu, 2 Mar 2023 11:57:37 +0000, Srinivas Kandagatla wrote:
> While testing DMIC on the panel, its noticed that some of the settings in
> dts seems to very incorrect. Mostly around clocks and frameshapping data.
> An another patch fixes dai link for dmic which is incorrectly pointing to tx macro.
>
> Along with these patches, with a pending csr patch device switch and dmic seems to work
> recent changes in x13s ucm.
>
> [...]

Applied, thanks!

[1/4] arm64: dts: qcom: sc8280xp: fix rx frame shapping info
commit: 670b7d6569bf439c90d7aac48ec36ee3e3013754
[2/4] arm64: dts: qcom: sc8280xp: fix lpass tx macro clocks
commit: e43bd22cb377bf4c4e5b12daacaf02f5c24fbb16
[3/4] arm64: dts: qcom: sc8280xp-x13s: fix dmic sample rate
commit: 4def7aa377ba1dbe66335ca3ebe3aa5a5bc3fe67
[4/4] arm64: dts: qcom: sc8280xp-x13s: fix va dmic dai links and routing
commit: 2e498f35c385654396e94cf12e097522d3973d41

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