[PATCH v3 1/2] ASoC: dt-bindings: Added schema for "nuvoton,nau8325"

Seven Lee posted 2 patches 1 year, 11 months ago
There is a newer version of this series
[PATCH v3 1/2] ASoC: dt-bindings: Added schema for "nuvoton,nau8325"
Posted by Seven Lee 1 year, 11 months ago
Added a DT schema for describing nau8325 audio amplifiers.

Signed-off-by: Seven Lee <wtli@nuvoton.com>
---
 .../bindings/sound/nuvoton,nau8325.yaml       | 74 +++++++++++++++++++
 1 file changed, 74 insertions(+)
 create mode 100755 Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml

diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
new file mode 100755
index 000000000000..297d29462812
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
@@ -0,0 +1,74 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nuvoton,nau8325.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NAU8325 audio Amplifier
+
+maintainers:
+  - Seven Lee <WTLI@nuvoton.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: nuvoton,nau8325
+
+  reg:
+    maxItems: 1
+
+  nuvoton,vref-impedance:
+    description:
+      VREF impedance selection.
+    enum: ["Open", "25kOhm", "125kOhm", "2.5kOhm"]
+
+
+  nuvoton,dac-vref:
+    description: DAC Reference Voltage Setting.
+    enum: ["External VDDA", "1.5V", "1.6V", "1.7V"]
+
+
+  nuvoton,alc-enable:
+    description:
+      Enable digital automatic level control (ALC) function.
+    type: boolean
+
+  nuvoton,clock-detection-disable:
+    description:
+      When clock detection is enabled, it will detect whether MCLK
+      and FS are within the range. MCLK range is from 2.048MHz to 24.576MHz.
+      FS range is from 8kHz to 96kHz. And also needs to detect the ratio
+      MCLK_SRC/LRCK of 256, 400 or 500, and needs to detect the BCLK
+      to make sure data is present. There needs to be at least 8 BCLK
+      cycles per Frame Sync.
+    type: boolean
+
+  nuvoton,clock-det-data:
+    description:
+      Request clock detection to require 2048 non-zero samples before enabling
+      the audio paths. If set then non-zero samples is required, otherwise it
+      doesn't matter.
+    type: boolean
+
+required:
+  - compatible
+  - reg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    i2c {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        codec@21 {
+            compatible = "nuvoton,nau8325";
+            reg = <0x21>;
+            nuvoton,vref-impedance = "125kOhm";
+            nuvoton,dac-vref = "1.6V";
+            nuvoton,alc-enable;
+            nuvoton,clock-det-data;
+        };
+    };
-- 
2.25.1
Re: [PATCH v3 1/2] ASoC: dt-bindings: Added schema for "nuvoton,nau8325"
Posted by Rob Herring 1 year, 11 months ago
On Mon, Mar 04, 2024 at 06:15:22PM +0800, Seven Lee wrote:
> Added a DT schema for describing nau8325 audio amplifiers.

Present tense: Add a ...

Please say more about this device. Features, link to datasheet, etc.

> 
> Signed-off-by: Seven Lee <wtli@nuvoton.com>
> ---
>  .../bindings/sound/nuvoton,nau8325.yaml       | 74 +++++++++++++++++++
>  1 file changed, 74 insertions(+)
>  create mode 100755 Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml

Schemas aren't executable. checkpatch.pl will tell you this.

> 
> diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
> new file mode 100755
> index 000000000000..297d29462812
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
> @@ -0,0 +1,74 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/nuvoton,nau8325.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: NAU8325 audio Amplifier
> +
> +maintainers:
> +  - Seven Lee <WTLI@nuvoton.com>
> +
> +allOf:
> +  - $ref: dai-common.yaml#
> +
> +properties:
> +  compatible:
> +    const: nuvoton,nau8325
> +
> +  reg:
> +    maxItems: 1
> +
> +  nuvoton,vref-impedance:
> +    description:
> +      VREF impedance selection.
> +    enum: ["Open", "25kOhm", "125kOhm", "2.5kOhm"]

Use standard units (-ohms), not strings. For "open", just omit the 
property.

> +
> +
> +  nuvoton,dac-vref:
> +    description: DAC Reference Voltage Setting.
> +    enum: ["External VDDA", "1.5V", "1.6V", "1.7V"]

Use standard units.

> +
> +
> +  nuvoton,alc-enable:
> +    description:
> +      Enable digital automatic level control (ALC) function.
> +    type: boolean
> +
> +  nuvoton,clock-detection-disable:
> +    description:
> +      When clock detection is enabled, it will detect whether MCLK
> +      and FS are within the range. MCLK range is from 2.048MHz to 24.576MHz.
> +      FS range is from 8kHz to 96kHz. And also needs to detect the ratio
> +      MCLK_SRC/LRCK of 256, 400 or 500, and needs to detect the BCLK
> +      to make sure data is present. There needs to be at least 8 BCLK
> +      cycles per Frame Sync.
> +    type: boolean
> +
> +  nuvoton,clock-det-data:
> +    description:
> +      Request clock detection to require 2048 non-zero samples before enabling
> +      the audio paths. If set then non-zero samples is required, otherwise it
> +      doesn't matter.
> +    type: boolean
> +
> +required:
> +  - compatible
> +  - reg
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    i2c {
> +        #address-cells = <1>;
> +        #size-cells = <0>;
> +        codec@21 {
> +            compatible = "nuvoton,nau8325";
> +            reg = <0x21>;
> +            nuvoton,vref-impedance = "125kOhm";
> +            nuvoton,dac-vref = "1.6V";
> +            nuvoton,alc-enable;
> +            nuvoton,clock-det-data;
> +        };
> +    };
> -- 
> 2.25.1
>
Re: [PATCH v3 1/2] ASoC: dt-bindings: Added schema for "nuvoton,nau8325"
Posted by WTLI 1 year, 11 months ago
Rob Herring 於 3/4/2024 9:37 PM 寫道:
> CAUTION - External Email: Do not click links or open attachments unless you acknowledge the sender and content.
>
>
> On Mon, Mar 04, 2024 at 06:15:22PM +0800, Seven Lee wrote:
>> Added a DT schema for describing nau8325 audio amplifiers.
> Present tense: Add a ...
>
> Please say more about this device. Features, link to datasheet, etc.

Are the following revisions correct?
Add a DT schema for describing nau8325 audio amplifiers. The key
features are as follows:
  - Low SPK_VDD Quiescent Current
  - Gain Setting with 2-wire interface
  - Powerful Stereo Class-D Amplifier
  - Low Output Noise
  - Low Current Shutdown Mode
  - Click-and Pop Suppression

More resources :
https://www.nuvoton.com/products/smart-home-audio/audio-amplifiers/class-d-series/nau8325yg/

>
>> Signed-off-by: Seven Lee <wtli@nuvoton.com>
>> ---
>>   .../bindings/sound/nuvoton,nau8325.yaml       | 74 +++++++++++++++++++
>>   1 file changed, 74 insertions(+)
>>   create mode 100755 Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
> Schemas aren't executable. checkpatch.pl will tell you this.

yes, I will.

>
>> diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
>> new file mode 100755
>> index 000000000000..297d29462812
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
>> @@ -0,0 +1,74 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/sound/nuvoton,nau8325.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: NAU8325 audio Amplifier
>> +
>> +maintainers:
>> +  - Seven Lee <WTLI@nuvoton.com>
>> +
>> +allOf:
>> +  - $ref: dai-common.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    const: nuvoton,nau8325
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  nuvoton,vref-impedance:
>> +    description:
>> +      VREF impedance selection.
>> +    enum: ["Open", "25kOhm", "125kOhm", "2.5kOhm"]
> Use standard units (-ohms), not strings. For "open", just omit the
> property.

Is the description of the following modification correct?
nuvoton,vref-impedance:
   $ref: /schemas/types.yaml#/definitions/uint32
   description:
       The vref impedance to be used in KOhms. Voltage Reference impedance
       selection. VREF impedance selection.
   enum:
       - 0 # Disable tie off resistance
       - 1 # 25KOhms
       - 2 # 125KOhms
       - 3 # 2.5kOhms
     default: 2

>
>> +
>> +
>> +  nuvoton,dac-vref:
>> +    description: DAC Reference Voltage Setting.
>> +    enum: ["External VDDA", "1.5V", "1.6V", "1.7V"]
> Use standard units.

Is the description of the following modification correct?
   nuvoton,dac-vref:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
         The dac vref to be used in voltage. DAC reference voltage setting.
     enum:
         - 0 # VDDA
         - 1 # VDDA*1.5
         - 2 # VDDA*1.6
         - 3 # VDDA*1.7
     default: 2

>
>> +
>> +
>> +  nuvoton,alc-enable:
>> +    description:
>> +      Enable digital automatic level control (ALC) function.
>> +    type: boolean
>> +
>> +  nuvoton,clock-detection-disable:
>> +    description:
>> +      When clock detection is enabled, it will detect whether MCLK
>> +      and FS are within the range. MCLK range is from 2.048MHz to 24.576MHz.
>> +      FS range is from 8kHz to 96kHz. And also needs to detect the ratio
>> +      MCLK_SRC/LRCK of 256, 400 or 500, and needs to detect the BCLK
>> +      to make sure data is present. There needs to be at least 8 BCLK
>> +      cycles per Frame Sync.
>> +    type: boolean
>> +
>> +  nuvoton,clock-det-data:
>> +    description:
>> +      Request clock detection to require 2048 non-zero samples before enabling
>> +      the audio paths. If set then non-zero samples is required, otherwise it
>> +      doesn't matter.
>> +    type: boolean
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> +  - |
>> +    i2c {
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        codec@21 {
>> +            compatible = "nuvoton,nau8325";
>> +            reg = <0x21>;
>> +            nuvoton,vref-impedance = "125kOhm";
>> +            nuvoton,dac-vref = "1.6V";
>> +            nuvoton,alc-enable;
>> +            nuvoton,clock-det-data;
>> +        };
>> +    };
>> --
>> 2.25.1
>>
________________________________
________________________________
 The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
Re: [PATCH v3 1/2] ASoC: dt-bindings: Added schema for "nuvoton,nau8325"
Posted by WTLI 1 year, 11 months ago
Rob Herring 於 3/4/2024 9:37 PM 寫道:
> CAUTION - External Email: Do not click links or open attachments unless you acknowledge the sender and content.
>
>
> On Mon, Mar 04, 2024 at 06:15:22PM +0800, Seven Lee wrote:
>> Added a DT schema for describing nau8325 audio amplifiers.
> Present tense: Add a ...
>
> Please say more about this device. Features, link to datasheet, etc.

okay. I will.

>
>> Signed-off-by: Seven Lee <wtli@nuvoton.com>
>> ---
>>   .../bindings/sound/nuvoton,nau8325.yaml       | 74 +++++++++++++++++++
>>   1 file changed, 74 insertions(+)
>>   create mode 100755 Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
> Schemas aren't executable. checkpatch.pl will tell you this.

okay, I will use the checkpatch.pl.

>
>> diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
>> new file mode 100755
>> index 000000000000..297d29462812
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
>> @@ -0,0 +1,74 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/sound/nuvoton,nau8325.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: NAU8325 audio Amplifier
>> +
>> +maintainers:
>> +  - Seven Lee <WTLI@nuvoton.com>
>> +
>> +allOf:
>> +  - $ref: dai-common.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    const: nuvoton,nau8325
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +  nuvoton,vref-impedance:
>> +    description:
>> +      VREF impedance selection.
>> +    enum: ["Open", "25kOhm", "125kOhm", "2.5kOhm"]
> Use standard units (-ohms), not strings. For "open", just omit the
> property.

okay, I will.

>
>> +
>> +
>> +  nuvoton,dac-vref:
>> +    description: DAC Reference Voltage Setting.
>> +    enum: ["External VDDA", "1.5V", "1.6V", "1.7V"]
> Use standard units.

okay, I will use standard units.

>
>> +
>> +
>> +  nuvoton,alc-enable:
>> +    description:
>> +      Enable digital automatic level control (ALC) function.
>> +    type: boolean
>> +
>> +  nuvoton,clock-detection-disable:
>> +    description:
>> +      When clock detection is enabled, it will detect whether MCLK
>> +      and FS are within the range. MCLK range is from 2.048MHz to 24.576MHz.
>> +      FS range is from 8kHz to 96kHz. And also needs to detect the ratio
>> +      MCLK_SRC/LRCK of 256, 400 or 500, and needs to detect the BCLK
>> +      to make sure data is present. There needs to be at least 8 BCLK
>> +      cycles per Frame Sync.
>> +    type: boolean
>> +
>> +  nuvoton,clock-det-data:
>> +    description:
>> +      Request clock detection to require 2048 non-zero samples before enabling
>> +      the audio paths. If set then non-zero samples is required, otherwise it
>> +      doesn't matter.
>> +    type: boolean
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +
>> +unevaluatedProperties: false
>> +
>> +examples:
>> +  - |
>> +    i2c {
>> +        #address-cells = <1>;
>> +        #size-cells = <0>;
>> +        codec@21 {
>> +            compatible = "nuvoton,nau8325";
>> +            reg = <0x21>;
>> +            nuvoton,vref-impedance = "125kOhm";
>> +            nuvoton,dac-vref = "1.6V";
>> +            nuvoton,alc-enable;
>> +            nuvoton,clock-det-data;
>> +        };
>> +    };
>> --
>> 2.25.1
>>
________________________________
________________________________
 The privileged confidential information contained in this email is intended for use only by the addressees as indicated by the original sender of this email. If you are not the addressee indicated in this email or are not responsible for delivery of the email to such a person, please kindly reply to the sender indicating this fact and delete all copies of it from your computer and network server immediately. Your cooperation is highly appreciated. It is advised that any unauthorized use of confidential information of Nuvoton is strictly prohibited; and any information in this email irrelevant to the official business of Nuvoton shall be deemed as neither given nor endorsed by Nuvoton.
Re: [PATCH v3 1/2] ASoC: dt-bindings: Added schema for "nuvoton,nau8325"
Posted by Rob Herring 1 year, 11 months ago
On Mon, 04 Mar 2024 18:15:22 +0800, Seven Lee wrote:
> Added a DT schema for describing nau8325 audio amplifiers.
> 
> Signed-off-by: Seven Lee <wtli@nuvoton.com>
> ---
>  .../bindings/sound/nuvoton,nau8325.yaml       | 74 +++++++++++++++++++
>  1 file changed, 74 insertions(+)
>  create mode 100755 Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
> 

My bot found errors running 'make DT_CHECKER_FLAGS=-m dt_binding_check'
on your patch (DT_CHECKER_FLAGS is new in v5.13):

yamllint warnings/errors:
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:25:12: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:25:20: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:25:30: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:25:41: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:30:12: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:30:29: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:30:37: [error] string value is redundantly quoted with any quotes (quoted-strings)
./Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml:30:45: [error] string value is redundantly quoted with any quotes (quoted-strings)

dtschema/dtc warnings/errors:

doc reference errors (make refcheckdocs):

See https://patchwork.ozlabs.org/project/devicetree-bindings/patch/20240304101523.538989-2-wtli@nuvoton.com

The base for the series is generally the latest rc1. A different dependency
should be noted in *this* patch.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit after running the above command yourself. Note
that DT_SCHEMA_FILES can be set to your schema file to speed up checking
your schema. However, it must be unset to test all examples with your schema.