mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
To: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
	Bjorn Andersson <andersson@kernel.org>,
	Konrad Dybcio <konradybcio@kernel.org>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] arm64: dts: qcom: sm8750-mtp: Add sound (speakers, headset codec, dmics)
Date: Wed, 30 Apr 2025 08:19:04 +0200	[thread overview]
Message-ID: <0e007f7f-d9ff-4b2d-914d-ad62b9983bba@linaro.org> (raw)
In-Reply-To: <9b6c5f67-0bbc-490f-9982-4e28218aa6eb@oss.qualcomm.com>

On 29/04/2025 21:11, Konrad Dybcio wrote:
> On 4/28/25 4:41 PM, Krzysztof Kozlowski wrote:
>> On 25/04/2025 11:30, Konrad Dybcio wrote:
>>> On 4/24/25 11:40 AM, Krzysztof Kozlowski wrote:
>>>> Add device nodes for most of the sound support - WSA883x smart speakers,
>>>> WCD9395 audio codec (headset) and sound card - which allows sound
>>>> playback via speakers and recording via DMIC microphones.  Changes bring
>>>> necessary foundation for headset playback/recording via USB, but that
>>>> part is not yet ready.
>>>>
>>>> Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>> ---
>>>
>>> [...]
>>>
>>>> +	sound {
>>>> +		compatible = "qcom,sm8750-sndcard", "qcom,sm8450-sndcard";
>>>> +		model = "SM8750-MTP";
>>>> +		audio-routing = "SpkrLeft IN", "WSA_SPK1 OUT",
>>>> +				"SpkrRight IN", "WSA_SPK2 OUT",
>>>> +				"IN1_HPHL", "HPHL_OUT",
>>>> +				"IN2_HPHR", "HPHR_OUT",
>>>> +				"AMIC2", "MIC BIAS2",
>>>> +				"VA DMIC0", "MIC BIAS3", /* MIC4 on schematics */
>>>> +				"VA DMIC1", "MIC BIAS3", /* MIC1 on schematics */
>>>
>>> Is this a mistake in what the codec driver exposes, or just a fumble
>>> in numbering $somewhere?
>>
>> Which mistake? MIC4? Schematics call name things differently. They
>> always were, so to make it clear for people without schematics I wrote
>> which MIC it actually is.
> 
> I'm not sure how to parse your response
> 
> are you saying that there are MIC[0..4] that are/may be connected
> to different codec ports, and that the MIC4/1 lines are plumbed to
> VA DMIC0/1 respectively?

Yes, as always. Nothing weird here.

> 
> I think I got confused about the MIC BIAS3 going to both and none

What is both and none?

> matching the index, but perhaps that's just because it comes from
> the WCD (which is the third piece of hw involved beyond VA and the
> mic itself)

Again, what is the mistake you are pointing here?

> 
>>
>>>
>>>> +				"VA DMIC2", "MIC BIAS1",
>>>> +				"VA DMIC3", "MIC BIAS1",
>>>> +				"VA DMIC0", "VA MIC BIAS3",
>>>> +				"VA DMIC1", "VA MIC BIAS3",
>>>> +				"VA DMIC2", "VA MIC BIAS1",
>>>> +				"VA DMIC3", "VA MIC BIAS1",
>>>> +				"TX SWR_INPUT1", "ADC2_OUTPUT";
>>>> +
>>>> +		wcd-playback-dai-link {
>>>> +			link-name = "WCD Playback";
>>>> +
>>>> +			cpu {
>>>> +				sound-dai = <&q6apmbedai RX_CODEC_DMA_RX_0>;
>>>> +			};
>>>> +
>>>> +			codec {
>>>
>>> 'co'dec < 'cp'u
>>>
>>> [...]
>>
>> That was the convention so far, but we can start a new one, sure. Just
>> ask the same all other patch contributors, because each of them will be
>> copying old code, which means cpu->codec->platform
> 
> I've been doing just that for the past couple weeks indeed
> 
>>>> +		/*
>>>> +		 * WCD9395 RX Port 1 (HPH_L/R)      <=> SWR1 Port 1 (HPH_L/R)
>>>> +		 * WCD9395 RX Port 2 (CLSH)         <=> SWR1 Port 2 (CLSH)
>>>> +		 * WCD9395 RX Port 3 (COMP_L/R)     <=> SWR1 Port 3 (COMP_L/R)
>>>> +		 * WCD9395 RX Port 4 (LO)           <=> SWR1 Port 4 (LO)
>>>> +		 * WCD9395 RX Port 5 (DSD_L/R)      <=> SWR1 Port 5 (DSD_L/R)
>>>> +		 * WCD9395 RX Port 6 (HIFI_PCM_L/R) <=> SWR1 Port 9 (HIFI_PCM_L/R)
>>>> +		 */
>>>> +		qcom,rx-port-mapping = <1 2 3 4 5 9>;
>>>
>>> Does this deserve some dt-bindings constants?
>>
>> No, because these are hardware details/constants. Drivers do not use them.
> 
> I'd argue it makes sense here - it makes more sense to pass meaningfully
> named constants to the driver, rather than blobs with a comment

Sense of what? You want to make it a binding then answer what does it
bind, what part of ABI for driver is here a binding (answer none:
because driver does not use it)?



Best regards,
Krzysztof

  reply	other threads:[~2025-04-30  6:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-24  9:40 [PATCH 0/2] arm64: dts: qcom: sm8750: Add sound Krzysztof Kozlowski
2025-04-24  9:40 ` [PATCH 1/2] arm64: dts: qcom: sm8750: Add Soundwire nodes Krzysztof Kozlowski
2025-04-25  9:24   ` Konrad Dybcio
2025-05-08 10:37     ` Krzysztof Kozlowski
2025-05-12 19:38       ` Konrad Dybcio
2025-05-13  8:26         ` Krzysztof Kozlowski
2025-05-16 11:36           ` Konrad Dybcio
2025-05-16 21:46         ` Dmitry Baryshkov
2025-04-24  9:40 ` [PATCH 2/2] arm64: dts: qcom: sm8750-mtp: Add sound (speakers, headset codec, dmics) Krzysztof Kozlowski
2025-04-25  9:30   ` Konrad Dybcio
2025-04-28 14:41     ` Krzysztof Kozlowski
2025-04-29 19:11       ` Konrad Dybcio
2025-04-30  6:19         ` Krzysztof Kozlowski [this message]
2025-04-30 10:48           ` Konrad Dybcio
2025-04-30 11:07             ` neil.armstrong
2025-04-30 11:17               ` Konrad Dybcio
2025-04-30 11:18             ` Krzysztof Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0e007f7f-d9ff-4b2d-914d-ad62b9983bba@linaro.org \
    --to=krzysztof.kozlowski@linaro.org \
    --cc=andersson@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=konrad.dybcio@oss.qualcomm.com \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®