[PATCH] ASoC: dt-bindings: ak4642: switch to yaml base Documentation

2020-06-18 Thread Kuninori Morimoto
From: Kuninori Morimoto 

This patch switches from .txt base to .yaml base Document.

Signed-off-by: Kuninori Morimoto 
---
 .../devicetree/bindings/sound/ak4642.txt  | 37 
 .../devicetree/bindings/sound/ak4642.yaml | 57 +++
 2 files changed, 57 insertions(+), 37 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/sound/ak4642.txt
 create mode 100644 Documentation/devicetree/bindings/sound/ak4642.yaml

diff --git a/Documentation/devicetree/bindings/sound/ak4642.txt 
b/Documentation/devicetree/bindings/sound/ak4642.txt
deleted file mode 100644
index 58e48ee97175..
--- a/Documentation/devicetree/bindings/sound/ak4642.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-AK4642 I2C transmitter
-
-This device supports I2C mode only.
-
-Required properties:
-
-  - compatible : "asahi-kasei,ak4642" or "asahi-kasei,ak4643" or 
"asahi-kasei,ak4648"
-  - reg : The chip select number on the I2C bus
-
-Optional properties:
-
-  - #clock-cells : common clock binding; shall be set to 0
-  - clocks :   common clock binding; MCKI clock
-  - clock-frequency :  common clock binding; frequency of MCKO
-  - clock-output-names :   common clock binding; MCKO clock name
-
-Example 1:
-
- {
-   ak4648: ak4648@12 {
-   compatible = "asahi-kasei,ak4642";
-   reg = <0x12>;
-   };
-};
-
-Example 2:
-
- {
-   ak4643: codec@12 {
-   compatible = "asahi-kasei,ak4643";
-   reg = <0x12>;
-   #clock-cells = <0>;
-   clocks = <_clock>;
-   clock-frequency = <12288000>;
-   clock-output-names = "ak4643_mcko";
-   };
-};
diff --git a/Documentation/devicetree/bindings/sound/ak4642.yaml 
b/Documentation/devicetree/bindings/sound/ak4642.yaml
new file mode 100644
index ..c8ffc86fd2d3
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/ak4642.yaml
@@ -0,0 +1,57 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/sound/ak4642.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: AK4642 I2C transmitter Device Tree Bindings
+
+maintainers:
+  - Kuninori Morimoto 
+
+properties:
+  compatible:
+enum:
+  - asahi-kasei,ak4642
+  - asahi-kasei,ak4643
+  - asahi-kasei,ak4648
+
+  reg:
+maxItems: 1
+
+  "#clock-cells":
+const: 0
+
+  "#sound-dai-cells":
+const: 0
+
+  clocks:
+maxItems: 1
+
+  clock-frequency:
+description: frequency of MCKO
+
+  clock-output-names:
+maxItems: 1
+
+required:
+  - compatible
+  - reg
+
+additionalProperties: false
+
+examples:
+  - |
+i2c {
+#address-cells = <1>;
+#size-cells = <0>;
+ak4643: codec@12 {
+compatible = "asahi-kasei,ak4643";
+#sound-dai-cells = <0>;
+reg = <0x12>;
+#clock-cells = <0>;
+clocks = <_clock>;
+clock-frequency = <12288000>;
+clock-output-names = "ak4643_mcko";
+};
+};
-- 
2.25.1



Re: [PATCH] ASoC: dt-bindings: ak4642: switch to yaml base Documentation

2020-05-06 Thread Rob Herring
On Tue, Apr 21, 2020 at 02:17:53PM +0900, Kuninori Morimoto wrote:
> From: Kuninori Morimoto 
> 
> This patch switches from .txt base to .yaml base Document.
> 
> Signed-off-by: Kuninori Morimoto 
> ---
>  .../devicetree/bindings/sound/ak4642.txt  | 37 
>  .../devicetree/bindings/sound/ak4642.yaml | 58 +++
>  2 files changed, 58 insertions(+), 37 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/sound/ak4642.txt
>  create mode 100644 Documentation/devicetree/bindings/sound/ak4642.yaml
> 
> diff --git a/Documentation/devicetree/bindings/sound/ak4642.txt 
> b/Documentation/devicetree/bindings/sound/ak4642.txt
> deleted file mode 100644
> index 58e48ee97175..
> --- a/Documentation/devicetree/bindings/sound/ak4642.txt
> +++ /dev/null
> @@ -1,37 +0,0 @@
> -AK4642 I2C transmitter
> -
> -This device supports I2C mode only.
> -
> -Required properties:
> -
> -  - compatible : "asahi-kasei,ak4642" or "asahi-kasei,ak4643" or 
> "asahi-kasei,ak4648"
> -  - reg : The chip select number on the I2C bus
> -
> -Optional properties:
> -
> -  - #clock-cells :   common clock binding; shall be set to 0
> -  - clocks : common clock binding; MCKI clock
> -  - clock-frequency :common clock binding; frequency of MCKO
> -  - clock-output-names : common clock binding; MCKO clock name
> -
> -Example 1:
> -
> - {
> - ak4648: ak4648@12 {
> - compatible = "asahi-kasei,ak4642";
> - reg = <0x12>;
> - };
> -};
> -
> -Example 2:
> -
> - {
> - ak4643: codec@12 {
> - compatible = "asahi-kasei,ak4643";
> - reg = <0x12>;
> - #clock-cells = <0>;
> - clocks = <_clock>;
> - clock-frequency = <12288000>;
> - clock-output-names = "ak4643_mcko";
> - };
> -};
> diff --git a/Documentation/devicetree/bindings/sound/ak4642.yaml 
> b/Documentation/devicetree/bindings/sound/ak4642.yaml
> new file mode 100644
> index ..6cd213be2266
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/sound/ak4642.yaml
> @@ -0,0 +1,58 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/sound/ak4642.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: AK4642 I2C transmitter Device Tree Bindings
> +
> +maintainers:
> +  - Kuninori Morimoto 
> +
> +properties:
> +  compatible:
> +enum:
> +  - asahi-kasei,ak4642
> +  - asahi-kasei,ak4643
> +  - asahi-kasei,ak4648
> +
> +  reg:
> +maxItems: 1
> +
> +  "#clock-cells":
> +const: 0

Need a blank line here.

> +  "#sound-dai-cells":
> +const: 0
> +
> +  clocks:
> +maxItems: 1
> +
> +  clock-frequency:
> +description: common clock binding; frequency of MCKO
> +$ref: /schemas/types.yaml#/definitions/uint32

Already has a type. Is there some range of frequencies?

> +
> +  clock-output-names:
> +description: common clock name
> +$ref: /schemas/types.yaml#/definitions/string

Already has a type. Just 'maxItems: 1'.

> +
> +required:
> +  - compatible
> +  - reg
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +i2c {
> +#address-cells = <1>;
> +#size-cells = <0>;
> +ak4643: codec@12 {
> +compatible = "asahi-kasei,ak4643";
> +#sound-dai-cells = <0>;
> +reg = <0x12>;
> +#clock-cells = <0>;
> +clocks = <_clock>;
> +clock-frequency = <12288000>;
> +clock-output-names = "ak4643_mcko";
> +};
> +};
> -- 
> 2.17.1
>