diff mbox series

ASoC: dt-bindings: nau8315: Convert to dtschema

Message ID 20230516054944.1081808-1-CTLIN0@nuvoton.com (mailing list archive)
State Accepted
Commit 268777caf0dd8d3c852cccb949ae73b7ea7b2f5e
Headers show
Series ASoC: dt-bindings: nau8315: Convert to dtschema | expand

Commit Message

David Lin May 16, 2023, 5:49 a.m. UTC
Convert the NAU8315 audio CODEC bindings to DT schema.

Signed-off-by: David Lin <CTLIN0@nuvoton.com>
---
 .../devicetree/bindings/sound/nau8315.txt     | 24 ----------
 .../bindings/sound/nuvoton,nau8315.yaml       | 44 +++++++++++++++++++
 2 files changed, 44 insertions(+), 24 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/nau8315.txt
 create mode 100644 Documentation/devicetree/bindings/sound/nuvoton,nau8315.yaml

Comments

Krzysztof Kozlowski May 16, 2023, 4:10 p.m. UTC | #1
On 16/05/2023 07:49, David Lin wrote:
> Convert the NAU8315 audio CODEC bindings to DT schema.
> 
> Signed-off-by: David Lin <CTLIN0@nuvoton.com>
> ---


> +allOf:
> +  - $ref: dai-common.yaml#
> +
> +properties:
> +  compatible:
> +    enum:
> +      - nuvoton,nau8315
> +      - nuvoton,nau8318
> +
> +  '#sound-dai-cells':
> +    const: 0
> +
> +  enable-gpios:
> +    maxItems: 1
> +    description:
> +      GPIO specifier for the chip's device enable input(EN) pin.
> +      If this option is not specified then driver does not manage
> +      the pin state (e.g. chip is always on).

The only thing driver is doing is to toggle this pin. If it is missing
the entire driver is noop, thus above comment is a bit funny. It
probably should be mandatory pin. But I see it was there since beginning
so ok.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

Best regards,
Krzysztof
David Lin May 17, 2023, 3:28 a.m. UTC | #2
On 5/17/2023 12:10 AM, Krzysztof Kozlowski wrote:
> On 16/05/2023 07:49, David Lin wrote:
>> Convert the NAU8315 audio CODEC bindings to DT schema.
>>
>> Signed-off-by: David Lin <CTLIN0@nuvoton.com>
>> ---
>
>> +allOf:
>> +  - $ref: dai-common.yaml#
>> +
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - nuvoton,nau8315
>> +      - nuvoton,nau8318
>> +
>> +  '#sound-dai-cells':
>> +    const: 0
>> +
>> +  enable-gpios:
>> +    maxItems: 1
>> +    description:
>> +      GPIO specifier for the chip's device enable input(EN) pin.
>> +      If this option is not specified then driver does not manage
>> +      the pin state (e.g. chip is always on).
> The only thing driver is doing is to toggle this pin. If it is missing
> the entire driver is noop, thus above comment is a bit funny. It
> probably should be mandatory pin. But I see it was there since beginning
> so ok.
>
> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>
> Best regards,
> Krzysztof


For "the chip is always on" might be make EN pin is always pull high in
the schematic.

so driver didn't need to manage it. Of course, this driver will just
have software switch.

Generally, the schematic will design an extra gpio for control.

>
Mark Brown May 17, 2023, 2:25 p.m. UTC | #3
On Wed, May 17, 2023 at 11:28:46AM +0800, AS50 CTLin0 wrote:
> On 5/17/2023 12:10 AM, Krzysztof Kozlowski wrote:

> > The only thing driver is doing is to toggle this pin. If it is missing
> > the entire driver is noop, thus above comment is a bit funny. It
> > probably should be mandatory pin. But I see it was there since beginning
> > so ok.

No, it's not just that - the driver also describes the supported formats
and rates to the subsystem so we can constrain the DAI appropraitely.
Mark Brown May 17, 2023, 2:50 p.m. UTC | #4
On Tue, 16 May 2023 13:49:45 +0800, David Lin wrote:
> Convert the NAU8315 audio CODEC bindings to DT schema.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/1] ASoC: dt-bindings: nau8315: Convert to dtschema
      commit: 268777caf0dd8d3c852cccb949ae73b7ea7b2f5e

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/sound/nau8315.txt b/Documentation/devicetree/bindings/sound/nau8315.txt
deleted file mode 100644
index 1cd94517d45e..000000000000
--- a/Documentation/devicetree/bindings/sound/nau8315.txt
+++ /dev/null
@@ -1,24 +0,0 @@ 
-Nuvoton NAU8315 Mono Class-D Amplifier
-
-Required properties:
-- compatible   : "nuvoton,nau8315"
-                 "nuvoton,nau8318"
-
-Optional properties:
-- enable-gpios : GPIO specifier for the chip's device enable input(EN) pin.
-        If this option is not specified then driver does not manage
-        the pin state (e.g. chip is always on).
-
-Example:
-
-#include <dt-bindings/gpio/gpio.h>
-
-nau8315 {
-	compatible = "nuvoton,nau8315";
-	enable-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
-};
-
-nau8318 {
-	compatible = "nuvoton,nau8318";
-	enable-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
-};
diff --git a/Documentation/devicetree/bindings/sound/nuvoton,nau8315.yaml b/Documentation/devicetree/bindings/sound/nuvoton,nau8315.yaml
new file mode 100644
index 000000000000..24006e9dc501
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/nuvoton,nau8315.yaml
@@ -0,0 +1,44 @@ 
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/nuvoton,nau8315.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: NAU8315/NAU8318 Mono Class-D Amplifier
+
+maintainers:
+  - David Lin <CTLIN0@nuvoton.com>
+
+allOf:
+  - $ref: dai-common.yaml#
+
+properties:
+  compatible:
+    enum:
+      - nuvoton,nau8315
+      - nuvoton,nau8318
+
+  '#sound-dai-cells':
+    const: 0
+
+  enable-gpios:
+    maxItems: 1
+    description:
+      GPIO specifier for the chip's device enable input(EN) pin.
+      If this option is not specified then driver does not manage
+      the pin state (e.g. chip is always on).
+
+required:
+  - compatible
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    codec {
+        compatible = "nuvoton,nau8315";
+        #sound-dai-cells = <0>;
+        enable-gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
+    };