diff mbox series

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

Message ID 20240322025405.3340064-2-wtli@nuvoton.com
State New
Headers show
Series [v4,1/2] ASoC: dt-bindings: Added schema for "nuvoton,nau8325" | expand

Commit Message

WTLI March 22, 2024, 2:54 a.m. UTC
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       | 90 +++++++++++++++++++
 1 file changed, 90 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml

Comments

Rob Herring March 22, 2024, 6:25 p.m. UTC | #1
On Fri, Mar 22, 2024 at 10:54:04AM +0800, Seven Lee wrote:
> 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       | 90 +++++++++++++++++++
>  1 file changed, 90 insertions(+)
>  create mode 100644 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 100644
> index 000000000000..6ded94c0e644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
> @@ -0,0 +1,90 @@
> +# 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:
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    description:
> +      The vref impedance to be used in kohms. Middle of voltage enables
> +      Tie-Off selection options. Due to the high impedance of the VREF
> +      pin, it is important to use a low-leakage capacitor. Possible
> +      values are 0, 1, 2, and 3 as per the below,
> +
> +      0 = Disable tie off resistance
> +      1 = 25 kohms
> +      2 = 125 kohms
> +      3 = 2.5 kohms
> +    enum: [ 0, 1, 2, 3 ]

Once again, use standard unit suffix on the property name: 

nuvoton,vref-impedance-ohms:
  enum: [0, 2500, 25000, 125000]

Rob
Krzysztof Kozlowski March 23, 2024, 11:05 a.m. UTC | #2
On 22/03/2024 03:54, Seven Lee wrote:
> 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

Please use scripts/get_maintainers.pl to get a list of necessary people
and lists to CC (and consider --no-git-fallback argument). It might
happen, that command when run on an older kernel, gives you outdated
entries. Therefore please be sure you base your patches on recent Linux
kernel.

Tools like b4 or scripts/get_maintainer.pl provide you proper list of
people, so fix your workflow. Tools might also fail if you work on some
ancient tree (don't, instead use mainline), work on fork of kernel
(don't, instead use mainline) or you ignore some maintainers (really
don't). Just use b4 and everything should be fine, although remember
about `b4 prep --auto-to-cc` if you added new patches to the patchset.

You keep skipping maintainers on almost all your patches. Why?

Best regards,
Krzysztof
WTLI March 25, 2024, 7:38 a.m. UTC | #3
Krzysztof Kozlowski 於 3/23/2024 7:05 PM 寫道:
> CAUTION - External Email: Do not click links or open attachments unless you acknowledge the sender and content.
>
>
> On 22/03/2024 03:54, Seven Lee wrote:
>> 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
> Please use scripts/get_maintainers.pl to get a list of necessary people
> and lists to CC (and consider --no-git-fallback argument). It might
> happen, that command when run on an older kernel, gives you outdated
> entries. Therefore please be sure you base your patches on recent Linux
> kernel.
>
> Tools like b4 or scripts/get_maintainer.pl provide you proper list of
> people, so fix your workflow. Tools might also fail if you work on some
> ancient tree (don't, instead use mainline), work on fork of kernel
> (don't, instead use mainline) or you ignore some maintainers (really
> don't). Just use b4 and everything should be fine, although remember
> about `b4 prep --auto-to-cc` if you added new patches to the patchset.
>
> You keep skipping maintainers on almost all your patches. Why?
>
> Best regards,
> Krzysztof

I'm so sorry. I will use scripts/get_maintainers.pl. to get a list of
necessary people for
check every send e-mail.

>
WTLI March 25, 2024, 7:42 a.m. UTC | #4
Rob Herring 於 3/23/2024 2:25 AM 寫道:

CAUTION - External Email: Do not click links or open attachments unless you acknowledge the sender and content.


On Fri, Mar 22, 2024 at 10:54:04AM +0800, Seven Lee wrote:


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><mailto:wtli@nuvoton.com>
---
 .../bindings/sound/nuvoton,nau8325.yaml       | 90 +++++++++++++++++++
 1 file changed, 90 insertions(+)
 create mode 100644 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 100644
index 000000000000..6ded94c0e644
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
@@ -0,0 +1,90 @@
+# 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><mailto:WTLI@nuvoton.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    const: nuvoton,nau8325
+
+  reg:
+    maxItems: 1
+
+  nuvoton,vref-impedance:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      The vref impedance to be used in kohms. Middle of voltage enables
+      Tie-Off selection options. Due to the high impedance of the VREF
+      pin, it is important to use a low-leakage capacitor. Possible
+      values are 0, 1, 2, and 3 as per the below,
+
+      0 = Disable tie off resistance
+      1 = 25 kohms
+      2 = 125 kohms
+      3 = 2.5 kohms
+    enum: [ 0, 1, 2, 3 ]



Once again, use standard unit suffix on the property name:

nuvoton,vref-impedance-ohms:
  enum: [0, 2500, 25000, 125000]

Rob

I'm so Sorry, I made a mistake. So, I will modify it as follows,
nuvoton,vref-impedance-ohms:
    description:
      The vref impedance to be used in ohms. Middle of voltage enables
      Tie-Off selection options. Due to the high impedance of the VREF
      pin, it is important to use a low-leakage capacitor.

    enum: [ 0, 25000, 125000, 2500 ]
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
new file mode 100644
index 000000000000..6ded94c0e644
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8325.yaml
@@ -0,0 +1,90 @@ 
+# 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:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      The vref impedance to be used in kohms. Middle of voltage enables
+      Tie-Off selection options. Due to the high impedance of the VREF
+      pin, it is important to use a low-leakage capacitor. Possible
+      values are 0, 1, 2, and 3 as per the below,
+
+      0 = Disable tie off resistance
+      1 = 25 kohms
+      2 = 125 kohms
+      3 = 2.5 kohms
+    enum: [ 0, 1, 2, 3 ]
+
+  nuvoton,dac-vref:
+    $ref: /schemas/types.yaml#/definitions/uint32
+    description:
+      The dac vref to be used in voltage. DAC reference voltage setting. Can
+      be used for minor tuning of the output level. Possible values are 0, 1,
+      2, and 3 as per the below,
+
+      0 = VDDA
+      1 = VDDA * 1.5
+      2 = VDDA * 1.6
+      3 = VDDA * 1.7
+    enum: [ 0, 1, 2, 3 ]
+
+  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 = <2>;
+            nuvoton,dac-vref = <2>;
+            nuvoton,alc-enable;
+            nuvoton,clock-det-data;
+        };
+    };