From: Alexandre Mergnat <amergnat@baylibre.com>
To: "AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"Krzysztof Kozlowski" <krzysztof.kozlowski@linaro.org>,
"Liam Girdwood" <lgirdwood@gmail.com>,
"Mark Brown" <broonie@kernel.org>,
"Rob Herring" <robh+dt@kernel.org>,
"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"Lee Jones" <lee@kernel.org>, "Flora Fu" <flora.fu@mediatek.com>,
"Jaroslav Kysela" <perex@perex.cz>,
"Takashi Iwai" <tiwai@suse.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Catalin Marinas" <catalin.marinas@arm.com>,
"Will Deacon" <will@kernel.org>
Cc: linux-sound@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-media@vger.kernel.org,
dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org
Subject: Re: [PATCH 01/18] ASoC: dt-bindings: mediatek,mt8365-afe: Add audio afe document
Date: Wed, 28 Feb 2024 12:48:04 +0100 [thread overview]
Message-ID: <a4ba6a35-cfb4-4c3d-a9c7-ccd47d4c32d8@baylibre.com> (raw)
In-Reply-To: <bb86b986-ecd7-416a-9036-082a3cff2176@collabora.com>
On 28/02/2024 11:25, AngeloGioacchino Del Regno wrote:
> Il 28/02/24 10:57, Alexandre Mergnat ha scritto:
>> I think I got it.
>>
>> - mediatek,i2s-shared-clock: will be remove from DT
>> - mediatek,dmic-iir-on: will be remove from DT
>> - mediatek,dmic-irr-mode: will be remove from DT
>> - mediatek,dmic-two-wire-mode: rephrase description needed
>>
>> I've did abstraction (despite me) that IIR settings are runtime config
>> because the driver implement its usage like a one-time-setup -_-'
>>
>
> Yes but just one more thing I just noticed:
> `mediatek,dmic-two-wire-mode` - can we
> please rename this to `mediatek,dmic-mode` ?
Sure, I wasn't aware of this property. I will do it.
Note: the description isn't consistent with the enum comments
"
0 means two wires, 1 means one wire.
...
- 0 # one wire
- 1 # two wires
"
>
> That'd be for consistency check mt6359.yaml and mt6358.txt
>
> mediatek,dmic-mode:
> $ref: /schemas/types.yaml#/definitions/uint32
> description: |
> Indicates how many data pins are used to transmit two channels of
> PDM
> signal. 0 means two wires, 1 means one wire. Default value is 0.
> enum:
> - 0 # one wire
> - 1 # two wires
>
> Cheers,
> Angelo
>
>
>
>> Thanks for the explanations, that help.
>>
>> Regards,
>> Alexandre
>>
>> On 28/02/2024 08:28, Krzysztof Kozlowski wrote:
>>> On 27/02/2024 16:18, Alexandre Mergnat wrote:
>>>>>
>>>>>> + type: boolean
>>>>>> +
>>>>>> + mediatek,dmic-iir-on:
>>>>>> + description:
>>>>>> + Boolean which specifies whether the DMIC IIR is enabled.
>>>>>> + If this property is not present the IIR is disabled.
>>>>>
>>>>> "is enabled" or "enable it"?
>>>>>
>>>>> You described the desired Linux feature or behavior, not the actual
>>>>> hardware. The bindings are about the latter, so instead you need to
>>>>> rephrase the property and its description to match actual hardware
>>>>> capabilities/features/configuration etc.
>>>>
>>>> I will rephrase:
>>>>
>>>> True to enable the Infinite Impulse Response (IIR) filter
>>>> on the digital microphone inputs.
>>>
>>> I still don't know why this is DT-specific. You still tell driver what
>>> to do...
>>>
>>>>
>>>>>
>>>>>> + type: boolean
>>>>>> +
>>>>>> + mediatek,dmic-irr-mode:
>>>>>> + $ref: /schemas/types.yaml#/definitions/uint32
>>>>>> + description:
>>>>>> + Selects stop band of IIR DC-removal filter.
>>>>>> + 0 = Software programmable custom coeff loaded by the driver.
>>>>>
>>>>> Bindings are for hardware, not drivers. Why is this a property of
>>>>> board DTS?
>>>>
>>>> Actually this is a hardware feature. Mode 1 t 5 are predefined filters.
>>>> Mode 0, the HW will read some "coef filter registers" to setup the
>>>> custom filter. the "coef filter regs" are written by the driver.
>>>> Currently the coef values are hardcoded in the driver.
>>>
>>> You don't get the point. Just because you choose some mode it does not
>>> mean is hardware feature for DT. Sampling frequency done by hardware is
>>> also "hardware feature", but do you put it to DT? No.
>>>
>>> Explain why this is board-specific, not runtime configuration.
>>>
>>>>
>>>>>
>>>>>> + 1 = 5Hz if 48KHz mode.
>>>>>> + 2 = 10Hz if 48KHz mode.
>>>>>> + 3 = 25Hz if 48KHz mode.
>>>>>> + 4 = 50Hz if 48KHz mode.
>>>>>> + 5 = 65Hz if 48KHz mode.
>>>>>
>>>>> Use proper unit suffixes - hz.
>>>>>
>>>>>
>>>>>> + enum:
>>>>>> + - 0
>>>>>> + - 1
>>>>>> + - 2
>>>>>> + - 3
>>>>>> + - 4
>>>>>> + - 5
>>>>>> +
>>>>>> + mediatek,dmic-two-wire-mode:
>>>>>> + description:
>>>>>> + Boolean which turns on digital microphone for two wire mode.
>>>>>> + If this property is not present the two wire mode is disabled.
>>>>>
>>>>> This looks like hardware property, but the naming looks like SW. Again
>>>>> you instruct what driver should do. Standard disclaimer:
>>>>>
>>>>> You described the desired Linux feature or behavior, not the actual
>>>>> hardware. The bindings are about the latter, so instead you need to
>>>>> rephrase the property and its description to match actual hardware
>>>>> capabilities/features/configuration etc.
>>>>
>>>> Actually this is a hardware feature. This is ALL I have to describe the
>>>> HW behavior from the datasheet:
>>>> "
>>>> bit name: ul_dmic_two_wire_ctl
>>>> Turns on digital microphone for two wire mode.
>>>> 0: Turn off
>>>> 1: Turn on
>>>
>>> That's rather suggestion it is not a description of hardware but you
>>> want driver to do something...
>>>
>>>> "
>>>>
>>>> On the board schematic, SoC and DMIC and linked by 3 pins:
>>>> - clk
>>>> - data0
>>>> - data1
>>>>
>>>> IMHO, "two-wire-mode" means the HW use 2 pins for data, and the SoC
>>>> must
>>>> be aware of that by reading the register value written by the driver,
>>>> using the value found in the DTS.
>>>
>>> So this depends on type of connection of DMIC? Then rephrase description
>>> property like this.
>>>
>>>>
>>>> I don't get why you think it wouldn't be hardware behavior.
>>>
>>> Because telling what to write to the registers which is typical sign of
>>> people stuffing to DT whatever they need to configure the hardware.
>>>
>>>>
>>>> Rephrase description:
>>>> "True to enable the two wire mode of the digital microphone"
>>>> Is it better ?
>>>
>>> No, because again you describe some sort of mode. If you insist on such
>>> description, then my answer is: it's runtime, so not suitable for DT.
>>> Instead describe what is the hardware problem/configuration, e.g. "DMIC
>>> is connected with only CLK and DATA0, without third pin" etc.
>>>
>>>>
>>>> About the property name, "mediatek,dmic-two-wire-ctl" sound better
>>>> for you ?
>>>
>>> To sound more like a register less like physical characteristic of the
>>> board? No. The name can stay, I don't have better ideas.
>>>
>>>
>>> Best regards,
>>> Krzysztof
>>>
>>
>
--
Regards,
Alexandre
next prev parent reply other threads:[~2024-02-28 11:48 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-26 14:01 [PATCH 00/18] Add audio support for the MediaTek Genio 350-evk board Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 01/18] ASoC: dt-bindings: mediatek,mt8365-afe: Add audio afe document Alexandre Mergnat
2024-02-27 9:01 ` Krzysztof Kozlowski
2024-02-27 15:18 ` Alexandre Mergnat
2024-02-28 7:28 ` Krzysztof Kozlowski
2024-02-28 9:57 ` Alexandre Mergnat
2024-02-28 10:25 ` AngeloGioacchino Del Regno
2024-02-28 11:48 ` Alexandre Mergnat [this message]
2024-02-28 12:09 ` Krzysztof Kozlowski
2024-02-26 14:01 ` [PATCH 02/18] ASoC: dt-bindings: mediatek,mt8365-mt6357: Add audio sound card document Alexandre Mergnat
2024-02-26 15:30 ` AngeloGioacchino Del Regno
2024-02-27 10:23 ` Alexandre Mergnat
2024-02-27 10:31 ` Krzysztof Kozlowski
2024-02-27 12:38 ` AngeloGioacchino Del Regno
2024-02-28 9:18 ` Alexandre Mergnat
2024-02-27 9:06 ` Krzysztof Kozlowski
2024-02-26 14:01 ` [PATCH 03/18] dt-bindings: mfd: mediatek: Add codec property for MT6357 PMIC Alexandre Mergnat
2024-02-27 9:08 ` Krzysztof Kozlowski
2024-02-26 14:01 ` [PATCH 04/18] ASoC: mediatek: mt8365: Add common header Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 05/18] SoC: mediatek: mt8365: support audio clock control Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 06/18] ASoC: mediatek: mt8365: Add I2S DAI support Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 07/18] ASoC: mediatek: mt8365: Add ADDA " Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 08/18] ASoC: mediatek: mt8365: Add DMIC " Alexandre Mergnat
2024-02-27 9:10 ` Krzysztof Kozlowski
2024-02-26 14:01 ` [PATCH 09/18] ASoC: mediatek: mt8365: Add PCM " Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 10/18] ASoc: mediatek: mt8365: Add a specific soundcard for EVK amergnat
2024-02-26 15:10 ` AngeloGioacchino Del Regno
2024-02-27 8:43 ` Krzysztof Kozlowski
2024-02-26 14:01 ` [PATCH 11/18] ASoC: mediatek: mt8365: Add platform driver Alexandre Mergnat
2024-02-27 8:50 ` Krzysztof Kozlowski
2024-02-26 14:01 ` [PATCH 12/18] ASoC: codecs: mt6357: add MT6357 codec amergnat
2024-02-26 15:25 ` AngeloGioacchino Del Regno
2024-03-12 14:50 ` Alexandre Mergnat
2024-03-12 14:54 ` AngeloGioacchino Del Regno
2024-02-26 16:09 ` Mark Brown
2024-03-12 18:03 ` Alexandre Mergnat
2024-03-13 17:23 ` Mark Brown
2024-03-15 11:01 ` Alexandre Mergnat
2024-03-15 14:30 ` Mark Brown
2024-03-15 15:05 ` Alexandre Mergnat
2024-03-15 15:15 ` Mark Brown
2024-03-15 17:36 ` Alexandre Mergnat
2024-03-15 18:09 ` Mark Brown
2024-03-13 17:11 ` Alexandre Mergnat
2024-03-13 17:24 ` Mark Brown
2024-02-26 14:01 ` [PATCH 13/18] mfd: mt6397-core: register mt6357 sound codec amergnat
2024-02-26 15:26 ` AngeloGioacchino Del Regno
2024-02-29 17:45 ` (subset) " Lee Jones
2024-02-26 14:01 ` [PATCH 14/18] ASoC: mediatek: Add MT8365 support Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 15/18] arm64: defconfig: enable mt8365 sound Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 16/18] arm64: dts: mediatek: add mt6357 audio codec support Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 17/18] arm64: dts: mediatek: add afe support for mt8365 SoC Alexandre Mergnat
2024-02-26 14:01 ` [PATCH 18/18] arm64: dts: mediatek: add audio support for mt8365-evk Alexandre Mergnat
2024-02-26 14:54 ` [PATCH 00/18] Add audio support for the MediaTek Genio 350-evk board AngeloGioacchino Del Regno
2024-03-28 10:09 ` Alexandre Mergnat
2024-02-27 15:06 ` Mark Brown
2024-03-12 8:58 ` Alexandre Mergnat
2024-03-15 14:38 ` Mark Brown
2024-03-15 15:28 ` Alexandre Mergnat
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=a4ba6a35-cfb4-4c3d-a9c7-ccd47d4c32d8@baylibre.com \
--to=amergnat@baylibre.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=broonie@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=christian.koenig@amd.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=flora.fu@mediatek.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-sound@vger.kernel.org \
--cc=matthias.bgg@gmail.com \
--cc=perex@perex.cz \
--cc=robh+dt@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=tiwai@suse.com \
--cc=will@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;
as well as URLs for NNTP newsgroup(s).