2021-11-09 13:09:22

by Li-hao Kuo

[permalink] [raw]
Subject: [PATCH v2 2/2] devicetree bindings I2C Add bindings doc for Sunplus SP7021

Add devicetree bindings I2C Add bindings doc for Sunplus SP7021

Signed-off-by: LH.Kuo <[email protected]>
---
Changes in v2:
- Addressed all comments from Mr. Rob Herring.
- Modified the structure and register access method.
- Modifiedthe path about MAINTAINERS. ( wrong messages PATH in v1).
- Modifiedthe the YAML file.

.../devicetree/bindings/i2c/i2c-sunplus.yaml | 82 ++++++++++++++++++++++
MAINTAINERS | 1 +
2 files changed, 83 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml

diff --git a/Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml b/Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
new file mode 100644
index 0000000..af860ee
--- /dev/null
+++ b/Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
@@ -0,0 +1,82 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+# Copyright (C) Sunplus Co., Ltd. 2021
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/i2c/i2c-sunplus.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Sunplus's I2C controller
+
+allOf:
+ - $ref: /schemas/i2c/i2c-controller.yaml#
+
+maintainers:
+ - lh.kuo <[email protected]>
+
+properties:
+ compatible:
+ enum:
+ - sunplus,sp7021-i2cm
+ - sunplus,q645-i2cm
+
+ reg:
+ items:
+ - description: Base address and length of the I2C registers
+ - description: Base address and length of the I2C DMA registers
+
+ reg-names:
+ items:
+ - const: i2cm
+ - const: i2cmdma
+
+ interrupts:
+ maxItems: 1
+
+ clocks:
+ maxItems: 1
+
+ resets:
+ maxItems: 1
+
+ clock-frequency:
+ enum: [ 100000, 400000 ]
+
+ pinctrl-names:
+ description:
+ A pinctrl state named "default" must be defined.
+ const: default
+
+ pinctrl-0:
+ description:
+ A phandle to the default pinctrl state.
+
+required:
+ - compatible
+ - reg
+ - reg-names
+ - interrupts
+ - clocks
+ - resets
+ - pinctrl-names
+ - pinctrl-0
+
+unevaluatedProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/clock/sp-sp7021.h>
+ #include <dt-bindings/reset/sp-sp7021.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ i2c@9C004600 {
+ compatible = "sunplus,sp7021-i2cm";
+ reg = <0x9c004600 0x80>, <0x9c004680 0x80>;
+ reg-names = "i2cm", "i2cmdma";
+ interrupt-parent = <&intc>;
+ interrupts = <174 IRQ_TYPE_LEVEL_HIGH>;
+ clocks = <&clkc I2CM0>;
+ resets = <&rstc RST_I2CM0>;
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&i2cm0_pins>;
+ };
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 5b7a8a2..575a8e0 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -18193,6 +18193,7 @@ SUNPLUS I2C CONTROLLER INTERFACE DRIVER
M: LH Kuo <[email protected]>
L: [email protected]
S: Maintained
+F: Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
F: drivers/i2c/busses/i2c-sunplus.c

SUPERH
--
2.7.4


2021-11-29 20:26:54

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH v2 2/2] devicetree bindings I2C Add bindings doc for Sunplus SP7021

On Tue, Nov 09, 2021 at 02:59:26PM +0800, LH.Kuo wrote:
> Add devicetree bindings I2C Add bindings doc for Sunplus SP7021
>
> Signed-off-by: LH.Kuo <[email protected]>

As with other SunPlus patches, author and S-o-b must match.

> ---
> Changes in v2:
> - Addressed all comments from Mr. Rob Herring.
> - Modified the structure and register access method.
> - Modifiedthe path about MAINTAINERS. ( wrong messages PATH in v1).
> - Modifiedthe the YAML file.
>
> .../devicetree/bindings/i2c/i2c-sunplus.yaml | 82 ++++++++++++++++++++++
> MAINTAINERS | 1 +
> 2 files changed, 83 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
>
> diff --git a/Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml b/Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
> new file mode 100644
> index 0000000..af860ee
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
> @@ -0,0 +1,82 @@
> +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
> +# Copyright (C) Sunplus Co., Ltd. 2021
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/i2c/i2c-sunplus.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Sunplus's I2C controller
> +
> +allOf:
> + - $ref: /schemas/i2c/i2c-controller.yaml#
> +
> +maintainers:
> + - lh.kuo <[email protected]>

Full name here please.

> +
> +properties:
> + compatible:
> + enum:
> + - sunplus,sp7021-i2cm
> + - sunplus,q645-i2cm
> +
> + reg:
> + items:
> + - description: Base address and length of the I2C registers
> + - description: Base address and length of the I2C DMA registers

Drop 'Base address and length of the '.

> +
> + reg-names:
> + items:
> + - const: i2cm
> + - const: i2cmdma
> +
> + interrupts:
> + maxItems: 1
> +
> + clocks:
> + maxItems: 1
> +
> + resets:
> + maxItems: 1
> +
> + clock-frequency:
> + enum: [ 100000, 400000 ]

You can't support other frequencies?

> +
> + pinctrl-names:
> + description:
> + A pinctrl state named "default" must be defined.
> + const: default
> +
> + pinctrl-0:
> + description:
> + A phandle to the default pinctrl state.

You don't have to define pinctrl properties when there's only 'default'.


> +
> +required:
> + - compatible
> + - reg
> + - reg-names
> + - interrupts
> + - clocks
> + - resets
> + - pinctrl-names
> + - pinctrl-0
> +
> +unevaluatedProperties: false
> +
> +examples:
> + - |
> + #include <dt-bindings/clock/sp-sp7021.h>
> + #include <dt-bindings/reset/sp-sp7021.h>
> + #include <dt-bindings/interrupt-controller/irq.h>
> + i2c@9C004600 {
> + compatible = "sunplus,sp7021-i2cm";
> + reg = <0x9c004600 0x80>, <0x9c004680 0x80>;
> + reg-names = "i2cm", "i2cmdma";
> + interrupt-parent = <&intc>;
> + interrupts = <174 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&clkc I2CM0>;
> + resets = <&rstc RST_I2CM0>;
> + clock-frequency = <100000>;
> + pinctrl-names = "default";
> + pinctrl-0 = <&i2cm0_pins>;
> + };
> +...
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 5b7a8a2..575a8e0 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -18193,6 +18193,7 @@ SUNPLUS I2C CONTROLLER INTERFACE DRIVER
> M: LH Kuo <[email protected]>
> L: [email protected]
> S: Maintained
> +F: Documentation/devicetree/bindings/i2c/i2c-sunplus.yaml
> F: drivers/i2c/busses/i2c-sunplus.c
>
> SUPERH
> --
> 2.7.4
>
>