2024-06-11 14:26:15

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: fix WCD audio codec TX port mapping

Starting with the LPASS v11 (SM8550 also X1E80100), there is an
additional output port on SWR2 Soundwire instance, thus WCD9385 audio
codec TX port mapping should be shifted by one. This is a necessary fix
for proper audio recording via analogue microphones connected to WCD9385
codec (e.g. headset AMIC2).

Fixes: 229c9ce0fd11 ("arm64: dts: qcom: x1e80100-crd: add WCD9385 Audio Codec")
Cc: <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
index f19d89d3d6e1..12a4c4637baf 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
@@ -775,7 +775,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.43.0



2024-06-11 14:26:19

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 2/2] arm64: dts: qcom: x1e80100-crd: fix DAI used for headset recording

The SWR2 Soundwire instance has 1 output and 4 input ports, so for the
headset recording (via the WCD9385 codec and the TX macro codec) we want
to use the next DAI, not the first one (see qcom,dout-ports and
qcom,din-ports for soundwire@6d30000 node).

Original code was copied from other devices like SM8450 and SM8550. On
the SM8450 this was a correct setting, however on the SM8550 this worked
probably only by coincidence, because the DTS defined no output ports on
SWR2 Soundwire.

This is a necessary fix for proper audio recording via analogue
microphones connected to WCD9385 codec (e.g. headset AMIC2).

Fixes: 4442a67eedc1 ("arm64: dts: qcom: x1e80100-crd: add sound card")
Cc: <[email protected]>
Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm64/boot/dts/qcom/x1e80100-crd.dts | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
index 12a4c4637baf..05e62d9f1cbc 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-crd.dts
@@ -102,7 +102,7 @@ cpu {
};

codec {
- sound-dai = <&wcd938x 1>, <&swr2 0>, <&lpass_txmacro 0>;
+ sound-dai = <&wcd938x 1>, <&swr2 1>, <&lpass_txmacro 0>;
};

platform {
--
2.43.0


2024-06-13 07:43:41

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 1/2] arm64: dts: qcom: x1e80100-crd: fix WCD audio codec TX port mapping



On 6/11/24 16:25, Krzysztof Kozlowski wrote:
> Starting with the LPASS v11 (SM8550 also X1E80100), there is an
> additional output port on SWR2 Soundwire instance, thus WCD9385 audio
> codec TX port mapping should be shifted by one. This is a necessary fix
> for proper audio recording via analogue microphones connected to WCD9385
> codec (e.g. headset AMIC2).
>
> Fixes: 229c9ce0fd11 ("arm64: dts: qcom: x1e80100-crd: add WCD9385 Audio Codec")
> Cc: <[email protected]>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---

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

Konrad

2024-06-13 07:47:01

by Konrad Dybcio

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: qcom: x1e80100-crd: fix DAI used for headset recording



On 6/11/24 16:25, Krzysztof Kozlowski wrote:
> The SWR2 Soundwire instance has 1 output and 4 input ports, so for the
> headset recording (via the WCD9385 codec and the TX macro codec) we want
> to use the next DAI, not the first one (see qcom,dout-ports and
> qcom,din-ports for soundwire@6d30000 node).
>
> Original code was copied from other devices like SM8450 and SM8550. On
> the SM8450 this was a correct setting, however on the SM8550 this worked
> probably only by coincidence, because the DTS defined no output ports on
> SWR2 Soundwire.

Planning to send a fix for that?

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

Konrad

2024-06-13 09:11:24

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: qcom: x1e80100-crd: fix DAI used for headset recording

On 13/06/2024 09:45, Konrad Dybcio wrote:
>
>
> On 6/11/24 16:25, Krzysztof Kozlowski wrote:
>> The SWR2 Soundwire instance has 1 output and 4 input ports, so for the
>> headset recording (via the WCD9385 codec and the TX macro codec) we want
>> to use the next DAI, not the first one (see qcom,dout-ports and
>> qcom,din-ports for soundwire@6d30000 node).
>>
>> Original code was copied from other devices like SM8450 and SM8550. On
>> the SM8450 this was a correct setting, however on the SM8550 this worked
>> probably only by coincidence, because the DTS defined no output ports on
>> SWR2 Soundwire.
>
> Planning to send a fix for that?
>
> Reviewed-by: Konrad Dybcio <[email protected]>

Not really, because microphone works on these targets and changing it
would require testing. I don't have boards suitable for testing, so
let's just leave it.

Best regards,
Krzysztof


2024-06-13 10:10:54

by Dmitry Baryshkov

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: qcom: x1e80100-crd: fix DAI used for headset recording

On Thu, Jun 13, 2024 at 11:11:05AM +0200, Krzysztof Kozlowski wrote:
> On 13/06/2024 09:45, Konrad Dybcio wrote:
> >
> >
> > On 6/11/24 16:25, Krzysztof Kozlowski wrote:
> >> The SWR2 Soundwire instance has 1 output and 4 input ports, so for the
> >> headset recording (via the WCD9385 codec and the TX macro codec) we want
> >> to use the next DAI, not the first one (see qcom,dout-ports and
> >> qcom,din-ports for soundwire@6d30000 node).
> >>
> >> Original code was copied from other devices like SM8450 and SM8550. On
> >> the SM8450 this was a correct setting, however on the SM8550 this worked
> >> probably only by coincidence, because the DTS defined no output ports on
> >> SWR2 Soundwire.
> >
> > Planning to send a fix for that?
> >
> > Reviewed-by: Konrad Dybcio <[email protected]>
>
> Not really, because microphone works on these targets and changing it
> would require testing. I don't have boards suitable for testing, so
> let's just leave it.

If you provide instructions, I can test microphones on SM8450 HDK.

--
With best wishes
Dmitry

2024-06-13 13:17:49

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/2] arm64: dts: qcom: x1e80100-crd: fix DAI used for headset recording

On 13/06/2024 12:10, Dmitry Baryshkov wrote:
> On Thu, Jun 13, 2024 at 11:11:05AM +0200, Krzysztof Kozlowski wrote:
>> On 13/06/2024 09:45, Konrad Dybcio wrote:
>>>
>>>
>>> On 6/11/24 16:25, Krzysztof Kozlowski wrote:
>>>> The SWR2 Soundwire instance has 1 output and 4 input ports, so for the
>>>> headset recording (via the WCD9385 codec and the TX macro codec) we want
>>>> to use the next DAI, not the first one (see qcom,dout-ports and
>>>> qcom,din-ports for soundwire@6d30000 node).
>>>>
>>>> Original code was copied from other devices like SM8450 and SM8550. On
>>>> the SM8450 this was a correct setting, however on the SM8550 this worked
>>>> probably only by coincidence, because the DTS defined no output ports on
>>>> SWR2 Soundwire.
>>>
>>> Planning to send a fix for that?
>>>
>>> Reviewed-by: Konrad Dybcio <[email protected]>
>>
>> Not really, because microphone works on these targets and changing it
>> would require testing. I don't have boards suitable for testing, so
>> let's just leave it.
>
> If you provide instructions, I can test microphones on SM8450 HDK.
>

SM8550 and SM8650

Best regards,
Krzysztof