diff mbox series

[v4,2/4] spi: ls7a: Add YAML schemas

Message ID 1608892552-15457-2-git-send-email-zhangqing@loongson.cn (mailing list archive)
State Superseded
Headers show
Series [v4,1/4] spi: LS7A: Add Loongson LS7A SPI controller driver support | expand

Commit Message

Qing Zhang Dec. 25, 2020, 10:35 a.m. UTC
Switch the DT binding to a YAML schema to enable the DT validation.

Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
---

v4: fix warnings/errors about running 'make dt_binding_check'

---
 .../devicetree/bindings/spi/loongson,spi-ls7a.yaml | 46 ++++++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml

Comments

Sergey Shtylyov Dec. 25, 2020, 12:19 p.m. UTC | #1
On 12/25/20 1:35 PM, Qing Zhang wrote:

> Switch the DT binding to a YAML schema to enable the DT validation.
> 
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> ---
> 
> v4: fix warnings/errors about running 'make dt_binding_check'
> 
> ---
>  .../devicetree/bindings/spi/loongson,spi-ls7a.yaml | 46 ++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
> 
> diff --git a/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
> new file mode 100644
> index 0000000..8cc9bc5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/loongson,spi-ls7a.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Loongson LS7A PCH SPI Controller
> +
> +maintainers:
> +  - Qing Zhang <zhangqing@loongson.cn>
> +
> +description: |
> +  This controller can be found in Loongson-3 systems with LS7A PCH.
> +
> +properties:
> +  compatible:
> +    const: loongson,ls7a-spi
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - num-chipselects
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pci {
> +        #address-cells = <3>;
> +        #size-cells = <2>;
> +
> +        spi@16,0 {
> +        compatible = "pci0014,7a0b.0",
> +                        "pci0014,7a0b",
> +                        "pciclass088000",
> +                        "pciclass0800";
> +
> +        reg = <0xb000 0x0 0x0 0x0 0x0>;
> +        num-chipselects = <0>;

    The above lines after { need extra indentation level.

> +        };
> +    };
> +
> +...

MBR, Sergei
Jiaxun Yang Dec. 26, 2020, 3:31 a.m. UTC | #2
在 2020/12/25 下午6:35, Qing Zhang 写道:
> Switch the DT binding to a YAML schema to enable the DT validation.
>
> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
> ---
>
> v4: fix warnings/errors about running 'make dt_binding_check'
>
> ---
>   .../devicetree/bindings/spi/loongson,spi-ls7a.yaml | 46 ++++++++++++++++++++++
>   1 file changed, 46 insertions(+)
>   create mode 100644 Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
>
> diff --git a/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
> new file mode 100644
> index 0000000..8cc9bc5
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
> @@ -0,0 +1,46 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/spi/loongson,spi-ls7a.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Loongson LS7A PCH SPI Controller
> +
> +maintainers:
> +  - Qing Zhang <zhangqing@loongson.cn>
> +
> +description: |
> +  This controller can be found in Loongson-3 systems with LS7A PCH.
> +
> +properties:
> +  compatible:
> +    const: loongson,ls7a-spi
> +
> +  reg:
> +    maxItems: 1
> +
> +required:
> +  - compatible
> +  - reg
> +  - num-chipselects

num-chipselects never parsed in code?

Thanks.

- Jiaxun



> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    pci {
> +        #address-cells = <3>;
> +        #size-cells = <2>;
> +
> +        spi@16,0 {
> +        compatible = "pci0014,7a0b.0",
> +                        "pci0014,7a0b",
> +                        "pciclass088000",
> +                        "pciclass0800";
> +
> +        reg = <0xb000 0x0 0x0 0x0 0x0>;
> +        num-chipselects = <0>;
> +        };
> +    };
> +
> +...
Qing Zhang Dec. 26, 2020, 6:31 a.m. UTC | #3
Hi,Jiaxun

Thank you for your reply.

I will also delete the num chipelects attribute in the device tree.

And I will send v5 in the soon.

Thanks,

-Qing

On 12/26/2020 11:31 AM, Jiaxun Yang wrote:
> 在 2020/12/25 下午6:35, Qing Zhang 写道:
>> Switch the DT binding to a YAML schema to enable the DT validation.
>>
>> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
>> ---
>>
>> v4: fix warnings/errors about running 'make dt_binding_check'
>>
>> ---
>>   .../devicetree/bindings/spi/loongson,spi-ls7a.yaml | 46 
>> ++++++++++++++++++++++
>>   1 file changed, 46 insertions(+)
>>   create mode 100644 
>> Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
>>
>> diff --git 
>> a/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml 
>> b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
>> new file mode 100644
>> index 0000000..8cc9bc5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
>> @@ -0,0 +1,46 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/spi/loongson,spi-ls7a.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Loongson LS7A PCH SPI Controller
>> +
>> +maintainers:
>> +  - Qing Zhang <zhangqing@loongson.cn>
>> +
>> +description: |
>> +  This controller can be found in Loongson-3 systems with LS7A PCH.
>> +
>> +properties:
>> +  compatible:
>> +    const: loongson,ls7a-spi
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - num-chipselects
>
> num-chipselects never parsed in code?
>
> Thanks.
>
> - Jiaxun
>
>
>
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    pci {
>> +        #address-cells = <3>;
>> +        #size-cells = <2>;
>> +
>> +        spi@16,0 {
>> +        compatible = "pci0014,7a0b.0",
>> +                        "pci0014,7a0b",
>> +                        "pciclass088000",
>> +                        "pciclass0800";
>> +
>> +        reg = <0xb000 0x0 0x0 0x0 0x0>;
>> +        num-chipselects = <0>;
>> +        };
>> +    };
>> +
>> +...
Qing Zhang Dec. 26, 2020, 6:40 a.m. UTC | #4
Hi,Sergei

Thank you for your reply and suggestion .

I will use extra indentation levels and send v5 in the soon.

Thanks,

-Qing


On 12/25/2020 08:19 PM, Sergei Shtylyov wrote:
> On 12/25/20 1:35 PM, Qing Zhang wrote:
>
>> Switch the DT binding to a YAML schema to enable the DT validation.
>>
>> Signed-off-by: Qing Zhang <zhangqing@loongson.cn>
>> ---
>>
>> v4: fix warnings/errors about running 'make dt_binding_check'
>>
>> ---
>>   .../devicetree/bindings/spi/loongson,spi-ls7a.yaml | 46 ++++++++++++++++++++++
>>   1 file changed, 46 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
>>
>> diff --git a/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
>> new file mode 100644
>> index 0000000..8cc9bc5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
>> @@ -0,0 +1,46 @@
>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>> +%YAML 1.2
>> +---
>> +$id: http://devicetree.org/schemas/spi/loongson,spi-ls7a.yaml#
>> +$schema: http://devicetree.org/meta-schemas/core.yaml#
>> +
>> +title: Loongson LS7A PCH SPI Controller
>> +
>> +maintainers:
>> +  - Qing Zhang <zhangqing@loongson.cn>
>> +
>> +description: |
>> +  This controller can be found in Loongson-3 systems with LS7A PCH.
>> +
>> +properties:
>> +  compatible:
>> +    const: loongson,ls7a-spi
>> +
>> +  reg:
>> +    maxItems: 1
>> +
>> +required:
>> +  - compatible
>> +  - reg
>> +  - num-chipselects
>> +
>> +additionalProperties: false
>> +
>> +examples:
>> +  - |
>> +    pci {
>> +        #address-cells = <3>;
>> +        #size-cells = <2>;
>> +
>> +        spi@16,0 {
>> +        compatible = "pci0014,7a0b.0",
>> +                        "pci0014,7a0b",
>> +                        "pciclass088000",
>> +                        "pciclass0800";
>> +
>> +        reg = <0xb000 0x0 0x0 0x0 0x0>;
>> +        num-chipselects = <0>;
>      The above lines after { need extra indentation level.
>
>> +        };
>> +    };
>> +
>> +...
> MBR, Sergei
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
new file mode 100644
index 0000000..8cc9bc5
--- /dev/null
+++ b/Documentation/devicetree/bindings/spi/loongson,spi-ls7a.yaml
@@ -0,0 +1,46 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/spi/loongson,spi-ls7a.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Loongson LS7A PCH SPI Controller
+
+maintainers:
+  - Qing Zhang <zhangqing@loongson.cn>
+
+description: |
+  This controller can be found in Loongson-3 systems with LS7A PCH.
+
+properties:
+  compatible:
+    const: loongson,ls7a-spi
+
+  reg:
+    maxItems: 1
+
+required:
+  - compatible
+  - reg
+  - num-chipselects
+
+additionalProperties: false
+
+examples:
+  - |
+    pci {
+        #address-cells = <3>;
+        #size-cells = <2>;
+
+        spi@16,0 {
+        compatible = "pci0014,7a0b.0",
+                        "pci0014,7a0b",
+                        "pciclass088000",
+                        "pciclass0800";
+
+        reg = <0xb000 0x0 0x0 0x0 0x0>;
+        num-chipselects = <0>;
+        };
+    };
+
+...