public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Neo Chang <YLCHANG2@nuvoton.com>
Cc: broonie@kernel.org, lgirdwood@gmail.com, perex@perex.cz,
	 tiwai@suse.com, robh@kernel.org, krzk+dt@kernel.org,
	linux-sound@vger.kernel.org,  devicetree@vger.kernel.org,
	alsa-devel@alsa-project.org, neo.chang70@gmail.com,
	 kchsu0@nuvoton.com, sjlin0@nuvoton.com
Subject: Re: [PATCH 1/2] ASoC: dt-bindings: nuvoton,nau8360: Add bindings for NAU83G60
Date: Sat, 25 Apr 2026 12:13:07 +0200	[thread overview]
Message-ID: <20260425-independent-puzzling-pigeon-a3fd84@quoll> (raw)
In-Reply-To: <20260424033953.280520-2-YLCHANG2@nuvoton.com>

On Fri, Apr 24, 2026 at 11:39:52AM +0800, Neo Chang wrote:
> Add device tree bindings documentation for the Nuvoton NAU83G60
> audio amplifier.
> 
> Signed-off-by: Neo Chang <YLCHANG2@nuvoton.com>

A nit, subject: drop second/last, redundant "bindings for". The
"dt-bindings" prefix is already stating that these are bindings.
See also:
https://elixir.bootlin.com/linux/v6.17-rc3/source/Documentation/devicetree/bindings/submitting-patches.rst#L18

> ---
>  .../bindings/sound/nuvoton,nau8360.yaml       | 115 ++++++++++++++++++
>  1 file changed, 115 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8360.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8360.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8360.yaml
> new file mode 100644
> index 000000000000..29b10155c4f9
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8360.yaml
> @@ -0,0 +1,115 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/nuvoton,nau8360.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Nuvoton NAU83G60 Stereo Class-D Amplifier with DSP
> +
> +description: |
> +  Stereo Class-D Amplifier with DSP and I/V-sense driver.

If "driver" as in "Linux driver" then please drop the word.

> +  This device supports I2C.
> +
> +maintainers:
> +  - Neo Chang <YLCHANG2@nuvoton.com>
> +
> +properties:
> +  compatible:
> +    enum:
> +      - nuvoton,nau8360
> +
> +  reg:
> +    maxItems: 1
> +    description: |
> +      The I2C address of the device. The address is determined by the external
> +      hardware configuration of GPIO1 and GPIO2 pins:
> +       - 0x1a (GPIO2=Low, GPIO1=Low)
> +       - 0x1b (GPIO2=Low, GPIO1=High)
> +       - 0x4a (GPIO2=High, GPIO1=Low)
> +       - 0x4b (GPIO2=High, GPIO1=High)
> +
> +  "#sound-dai-cells":
> +    const: 0
> +
> +  clocks:
> +    maxItems: 1
> +
> +  clock-names:
> +    const: mclk
> +
> +  nuvoton,dsp-bypass:
> +    type: boolean
> +    description: |

Do not need '|' unless you need to preserve formatting.

> +      Forcibly disable/bypass DSP path.

Why would that be hard-coded for given board?

> +
> +  nuvoton,low-latency:
> +    type: boolean
> +    description: |
> +      Enable low latency mode.
> +      Please note the feature helps sensing performance
> +      but worsens power consumption.

I could imagine that low-latency needed for certain use-cases, like
realtime audio, thus not really board-level DT configuration, but
runtime.

> +
> +  nuvoton,anc-enable:
> +    type: boolean
> +    description: |
> +      Enable ANC (Active Noise Cancellation) feature.

This as well.

> +      NAU83G60 provides configurable low latency ANC path to Advanced DSP through TDM-RX.
> +      To reduce latency, the ANC path only supports 48 kHz sample rates.
> +
> +  nuvoton,aec-enable:
> +    type: boolean
> +    description: |
> +      Enable AEC (Acoustic Echo Cancellation) feature.

As well.

> +      NAU83G60 provides Advanced DSP processed audio data as AEC reference through TDM-TX.
> +      The AEC path only supports 48 kHz sample rates.
> +
> +  nuvoton,pbtl-enable:
> +    type: boolean
> +    description: |
> +      NAU83G60 supports PBTL mode for mono output.
> +
> +  nuvoton,vbat-microvolt:
> +    minimum: 8000000 # 8V
> +    maximum: 24000000 # 24V
> +    description: |
> +      VBAT supply voltage in microvolts.

This device does not have any supply, so how could you set its voltage?
Plus, regulator bindings define it, not per-device propeties. Drop the property.

Also, add missing supply.

> +      This is the analog power supply, provided by an external power source
> +      or battery, and must be between 8V and 24V.
> +
> +  nuvoton,tdm-channel-length:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [16, 24, 32]
> +    description: |
> +      Assign TDM channel length.
> +      The length must be 16, 24, or 32.
> +
> +  nuvoton,dsp-fw-names:
> +    $ref: /schemas/types.yaml#/definitions/string-array
> +    minItems: 2
> +    maxItems: 2
> +    description: |
> +      Assign firmware filenames for left and right DSP cores.

Please use standard properties. This is the second one you re-implement.
If there is one single thing which upstream kernel hates is the
reimplementation of standard things by each vendor.

firmware-name:
(and see other examples how to write it - items: with descriptions)

> +
> +required:
> +  - compatible
> +  - reg
> +
> +allOf:
> +  - $ref: dai-common.yaml#
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +
> +        codec@1a {
> +            #sound-dai-cells = <0>;
> +            compatible = "nuvoton,nau8360";
> +            reg = <0x1a>;
> +            nuvoton,dsp-bypass;
> +            nuvoton,vbat-microvolt = <12000000>;

Add the rest of properties o make this complete.

Best regards,
Krzysztof


  reply	other threads:[~2026-04-25 10:13 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-24  3:39 [PATCH 0/2] ASoC: codecs: Add Nuvoton NAU83G60 audio codec driver Neo Chang
2026-04-24  3:39 ` [PATCH 1/2] ASoC: dt-bindings: nuvoton,nau8360: Add bindings for NAU83G60 Neo Chang
2026-04-25 10:13   ` Krzysztof Kozlowski [this message]
2026-04-29  3:03     ` YLCHANG2
2026-04-24  3:39 ` [PATCH 2/2] ASoC: codecs: nau8360: Add support for NAU83G60 amplifier Neo Chang
2026-04-24 15:56   ` Mark Brown
2026-04-29  3:11     ` YLCHANG2

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=20260425-independent-puzzling-pigeon-a3fd84@quoll \
    --to=krzk@kernel.org \
    --cc=YLCHANG2@nuvoton.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=kchsu0@nuvoton.com \
    --cc=krzk+dt@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-sound@vger.kernel.org \
    --cc=neo.chang70@gmail.com \
    --cc=perex@perex.cz \
    --cc=robh@kernel.org \
    --cc=sjlin0@nuvoton.com \
    --cc=tiwai@suse.com \
    /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