2024-01-24 16:45:23

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/4] arm64: dts: qcom: sm8550-qrd: correct WCD9385 TX port mapping

WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
it is offset by one. Correct it to fix recording via analogue
microphones.

Cc: <[email protected]>
Fixes: 83fae950c992 ("arm64: dts: qcom: sm8550-qrd: add WCD9385 audio-codec")
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
index 6c8e206080d2..76e9ca954093 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
@@ -842,7 +842,7 @@ &swr2 {
wcd_tx: codec@0,3 {
compatible = "sdw20217010d00";
reg = <0 3>;
- qcom,tx-port-mapping = <1 1 2 3>;
+ qcom,tx-port-mapping = <2 2 3 4>;
};
};

--
2.34.1



2024-01-24 16:45:39

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping

WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
it is offset by one. Correct it to fix recording via analogue
microphones.

The change is based on QRD8550 and should be correct here as well, but
was not tested on MTP8550.

Cc: <[email protected]>
Fixes: a541667c86a9 ("arm64: dts: qcom: sm8550-mtp: add WCD9385 audio-codec")
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
index c2847fd3c209..393702fe61aa 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
@@ -745,7 +745,7 @@ &swr2 {
wcd_tx: codec@0,3 {
compatible = "sdw20217010d00";
reg = <0 3>;
- qcom,tx-port-mapping = <1 1 2 3>;
+ qcom,tx-port-mapping = <2 2 3 4>;
};
};

--
2.34.1


2024-01-24 16:45:50

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 3/4] arm64: dts: qcom: sm8550-qrd: add correct analogue microphones

Add proper audio routes for onboard analogue microphones AMIC[1345] -
MIC biases and route from TX macro codec to WCD9385 audio codec.

This finally brings AMIC1, AMIC3, AMIC4 and AMIC5 onboard microphones to
work. AMIC2 (headphones) should be fine well, however it didn't work
during tests, probably because of incomplete USB switch.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8550-qrd.dts | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
index 76e9ca954093..79ec673f9f7c 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-qrd.dts
@@ -123,14 +123,21 @@ sound {
"SpkrRight IN", "WSA_SPK2 OUT",
"IN1_HPHL", "HPHL_OUT",
"IN2_HPHR", "HPHR_OUT",
+ "AMIC1", "MIC BIAS1",
"AMIC2", "MIC BIAS2",
+ "AMIC3", "MIC BIAS3",
+ "AMIC4", "MIC BIAS3",
+ "AMIC5", "MIC BIAS4",
"VA DMIC0", "MIC BIAS1",
"VA DMIC1", "MIC BIAS1",
"VA DMIC2", "MIC BIAS3",
"TX DMIC0", "MIC BIAS1",
"TX DMIC1", "MIC BIAS2",
"TX DMIC2", "MIC BIAS3",
- "TX SWR_ADC1", "ADC2_OUTPUT";
+ "TX SWR_INPUT0", "ADC1_OUTPUT",
+ "TX SWR_INPUT1", "ADC2_OUTPUT",
+ "TX SWR_INPUT0", "ADC3_OUTPUT",
+ "TX SWR_INPUT1", "ADC4_OUTPUT";

wcd-playback-dai-link {
link-name = "WCD Playback";
--
2.34.1


2024-01-24 17:13:20

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 4/4] arm64: dts: qcom: sm8550-mtp: add correct analogue microphones

Add proper audio routes for onboard analogue microphones AMIC[1345] -
MIC biases and route from TX macro codec to WCD9385 audio codec.

This should bring AMIC1, AMIC2 (headphones), AMIC3, AMIC4 and AMIC5
onboard microphones to work, although was not tested on the hardware.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
index 393702fe61aa..0c94edb8b824 100644
--- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
+++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
@@ -105,14 +105,21 @@ sound {
"SpkrRight IN", "WSA_SPK2 OUT",
"IN1_HPHL", "HPHL_OUT",
"IN2_HPHR", "HPHR_OUT",
+ "AMIC1", "MIC BIAS1",
"AMIC2", "MIC BIAS2",
+ "AMIC3", "MIC BIAS3",
+ "AMIC4", "MIC BIAS3",
+ "AMIC5", "MIC BIAS4",
"VA DMIC0", "MIC BIAS1",
"VA DMIC1", "MIC BIAS1",
"VA DMIC2", "MIC BIAS3",
"TX DMIC0", "MIC BIAS1",
"TX DMIC1", "MIC BIAS2",
"TX DMIC2", "MIC BIAS3",
- "TX SWR_ADC1", "ADC2_OUTPUT";
+ "TX SWR_INPUT0", "ADC1_OUTPUT",
+ "TX SWR_INPUT1", "ADC2_OUTPUT",
+ "TX SWR_INPUT0", "ADC3_OUTPUT",
+ "TX SWR_INPUT1", "ADC4_OUTPUT";

wcd-playback-dai-link {
link-name = "WCD Playback";
--
2.34.1


2024-01-24 17:29:46

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping

On 24/01/2024 17:45, Krzysztof Kozlowski wrote:
> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
> it is offset by one. Correct it to fix recording via analogue
> microphones.
>
> The change is based on QRD8550 and should be correct here as well, but
> was not tested on MTP8550.
>
> Cc: <[email protected]>
> Fixes: a541667c86a9 ("arm64: dts: qcom: sm8550-mtp: add WCD9385 audio-codec")
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> arch/arm64/boot/dts/qcom/sm8550-mtp.dts | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
> index c2847fd3c209..393702fe61aa 100644
> --- a/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
> +++ b/arch/arm64/boot/dts/qcom/sm8550-mtp.dts
> @@ -745,7 +745,7 @@ &swr2 {
> wcd_tx: codec@0,3 {
> compatible = "sdw20217010d00";
> reg = <0 3>;
> - qcom,tx-port-mapping = <1 1 2 3>;
> + qcom,tx-port-mapping = <2 2 3 4>;
> };
> };
>

Reviewed-by: Neil Armstrong <[email protected]>

2024-01-25 10:00:03

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping



On 1/24/24 17:45, Krzysztof Kozlowski wrote:
> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
> it is offset by one. Correct it to fix recording via analogue
> microphones.
>
> The change is based on QRD8550 and should be correct here as well, but
> was not tested on MTP8550.

Would this not be codec-and-not-board-specific, anyway?

>
> Cc: <[email protected]>
> Fixes: a541667c86a9 ("arm64: dts: qcom: sm8550-mtp: add WCD9385 audio-codec")
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---

Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

2024-01-25 10:07:53

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 1/4] arm64: dts: qcom: sm8550-qrd: correct WCD9385 TX port mapping



On 1/24/24 17:45, Krzysztof Kozlowski wrote:
> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
> it is offset by one. Correct it to fix recording via analogue
> microphones.
>
> Cc: <[email protected]>
> Fixes: 83fae950c992 ("arm64: dts: qcom: sm8550-qrd: add WCD9385 audio-codec")
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---

That matches what I believe to be the corresponding part in the DT!

Reviewed-by: Konrad Dybcio <[email protected]>

Konrad

2024-01-25 10:52:29

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping

On 25/01/2024 10:59, Konrad Dybcio wrote:
>
>
> On 1/24/24 17:45, Krzysztof Kozlowski wrote:
>> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
>> it is offset by one. Correct it to fix recording via analogue
>> microphones.
>>
>> The change is based on QRD8550 and should be correct here as well, but
>> was not tested on MTP8550.
>
> Would this not be codec-and-not-board-specific, anyway?

Yes, indeed, it should be.

Best regards,
Krzysztof


2024-01-25 11:06:46

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping



On 1/25/24 11:43, Krzysztof Kozlowski wrote:
> On 25/01/2024 10:59, Konrad Dybcio wrote:
>>
>>
>> On 1/24/24 17:45, Krzysztof Kozlowski wrote:
>>> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
>>> it is offset by one. Correct it to fix recording via analogue
>>> microphones.
>>>
>>> The change is based on QRD8550 and should be correct here as well, but
>>> was not tested on MTP8550.
>>
>> Would this not be codec-and-not-board-specific, anyway?
>
> Yes, indeed, it should be.

Should we move this to the driver and drop the then-uselesss
dt property?

Konrad

2024-01-25 13:02:42

by Neil Armstrong

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping

On 25/01/2024 11:47, Konrad Dybcio wrote:
>
>
> On 1/25/24 11:43, Krzysztof Kozlowski wrote:
>> On 25/01/2024 10:59, Konrad Dybcio wrote:
>>>
>>>
>>> On 1/24/24 17:45, Krzysztof Kozlowski wrote:
>>>> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
>>>> it is offset by one.  Correct it to fix recording via analogue
>>>> microphones.
>>>>
>>>> The change is based on QRD8550 and should be correct here as well, but
>>>> was not tested on MTP8550.
>>>
>>> Would this not be codec-and-not-board-specific, anyway?
>>
>> Yes, indeed, it should be.
>
> Should we move this to the driver and drop the then-uselesss
> dt property?

Actually it's codec-and-soc specific, so I'm against dropping this.

On the sc8280xp & sc7280 it requires a different mapping because the
TX macro changed the way to map the soundwire channels since (at least) SM8450.

Neil

>
> Konrad
>


2024-01-25 16:16:00

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping



On 1/25/24 14:02, [email protected] wrote:
> On 25/01/2024 11:47, Konrad Dybcio wrote:
>>
>>
>> On 1/25/24 11:43, Krzysztof Kozlowski wrote:
>>> On 25/01/2024 10:59, Konrad Dybcio wrote:
>>>>
>>>>
>>>> On 1/24/24 17:45, Krzysztof Kozlowski wrote:
>>>>> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
>>>>> it is offset by one.  Correct it to fix recording via analogue
>>>>> microphones.
>>>>>
>>>>> The change is based on QRD8550 and should be correct here as well, but
>>>>> was not tested on MTP8550.
>>>>
>>>> Would this not be codec-and-not-board-specific, anyway?
>>>
>>> Yes, indeed, it should be.
>>
>> Should we move this to the driver and drop the then-uselesss
>> dt property?
>
> Actually it's codec-and-soc specific, so I'm against dropping this.

Aaaah snap :(

Let's leave it as-is then.

Konrad

2024-02-07 04:49:13

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH 1/4] arm64: dts: qcom: sm8550-qrd: correct WCD9385 TX port mapping


On Wed, 24 Jan 2024 17:45:02 +0100, Krzysztof Kozlowski wrote:
> WCD9385 audio codec TX port mapping was copied form HDK8450, but in fact
> it is offset by one. Correct it to fix recording via analogue
> microphones.
>
>

Applied, thanks!

[1/4] arm64: dts: qcom: sm8550-qrd: correct WCD9385 TX port mapping
commit: 8ca7fbd92c1b28edb5d5df7aeb8bb4886ddb9829
[2/4] arm64: dts: qcom: sm8550-mtp: correct WCD9385 TX port mapping
commit: b66966b1bbc0aa58f7af83cbd56d5a206892857c
[3/4] arm64: dts: qcom: sm8550-qrd: add correct analogue microphones
commit: e2f1a18747b1bcb48900290d8f4de13e2ee55cbb
[4/4] arm64: dts: qcom: sm8550-mtp: add correct analogue microphones
commit: 503c0129b3aaf2aaf481ffd7f0a422af8a18f0b9

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