linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml
@ 2022-09-28  9:29 Chunyan Zhang
  2022-09-28  9:29 ` [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC " Chunyan Zhang
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Chunyan Zhang @ 2022-09-28  9:29 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Baolin Wang, Orson Zhai, Chunyan Zhang, LKML

From: Chunyan Zhang <chunyan.zhang@unisoc.com>

Convert the Unisoc gpio controller binding to DT schema format.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 .../devicetree/bindings/gpio/gpio-sprd.txt    | 28 --------
 .../devicetree/bindings/gpio/sprd,gpio.yaml   | 70 +++++++++++++++++++
 2 files changed, 70 insertions(+), 28 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-sprd.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/sprd,gpio.yaml

diff --git a/Documentation/devicetree/bindings/gpio/gpio-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-sprd.txt
deleted file mode 100644
index eca97d45388f..000000000000
--- a/Documentation/devicetree/bindings/gpio/gpio-sprd.txt
+++ /dev/null
@@ -1,28 +0,0 @@
-Spreadtrum GPIO controller bindings
-
-The controller's registers are organized as sets of sixteen 16-bit
-registers with each set controlling a bank of up to 16 pins. A single
-interrupt is shared for all of the banks handled by the controller.
-
-Required properties:
-- compatible: Should be "sprd,sc9860-gpio".
-- reg: Define the base and range of the I/O address space containing
-the GPIO controller registers.
-- gpio-controller: Marks the device node as a GPIO controller.
-- #gpio-cells: Should be <2>. The first cell is the gpio number and
-the second cell is used to specify optional parameters.
-- interrupt-controller: Marks the device node as an interrupt controller.
-- #interrupt-cells: Should be <2>. Specifies the number of cells needed
-to encode interrupt source.
-- interrupts: Should be the port interrupt shared by all the gpios.
-
-Example:
-	ap_gpio: gpio@40280000 {
-		compatible = "sprd,sc9860-gpio";
-		reg = <0 0x40280000 0 0x1000>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-		interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
-	};
diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
new file mode 100644
index 000000000000..c0cd1ed9809b
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2022 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/sprd,gpio.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc GPIO controller
+
+maintainers:
+  - Orson Zhai <orsonzhai@gmail.com>
+  - Baolin Wang <baolin.wang7@gmail.com>
+  - Chunyan Zhang <zhang.lyra@gmail.com>
+
+description:
+  The controller's registers are organized as sets of sixteen 16-bit
+  registers with each set controlling a bank of up to 16 pins. A single
+  interrupt is shared for all of the banks handled by the controller.
+
+properties:
+  compatible:
+    const: sprd,sc9860-gpio
+
+  reg:
+    maxItems: 1
+
+  gpio-controller: true
+
+  "#gpio-cells":
+    const: 2
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  interrupts:
+    maxItems: 1
+    description: The interrupt shared by all GPIO lines for this controller.
+
+required:
+  - compatible
+  - reg
+  - gpio-controller
+  - "#gpio-cells"
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        ap_gpio: gpio@40280000 {
+            compatible = "sprd,sc9860-gpio";
+            reg = <0 0x40280000 0 0x1000>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            interrupts = <GIC_SPI 50 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC controller binding to yaml
  2022-09-28  9:29 [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Chunyan Zhang
@ 2022-09-28  9:29 ` Chunyan Zhang
  2022-09-28 11:34   ` Krzysztof Kozlowski
  2022-09-28  9:29 ` [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512 Chunyan Zhang
  2022-09-28 11:31 ` [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Krzysztof Kozlowski
  2 siblings, 1 reply; 11+ messages in thread
From: Chunyan Zhang @ 2022-09-28  9:29 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Baolin Wang, Orson Zhai, Chunyan Zhang, LKML

From: Chunyan Zhang <chunyan.zhang@unisoc.com>

Convert the Unisoc EIC controller binding to DT schema format.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 .../bindings/gpio/gpio-eic-sprd.txt           |  97 ------------
 .../bindings/gpio/sprd,gpio-eic.yaml          | 145 ++++++++++++++++++
 2 files changed, 145 insertions(+), 97 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
 create mode 100644 Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml

diff --git a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
deleted file mode 100644
index 54040a2bfe3a..000000000000
--- a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
+++ /dev/null
@@ -1,97 +0,0 @@
-Spreadtrum EIC controller bindings
-
-The EIC is the abbreviation of external interrupt controller, which can
-be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
-one is in digital chip, and another one is in PMIC. The digital chip EIC
-controller contains 4 sub-modules: EIC-debounce, EIC-latch, EIC-async and
-EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
-module.
-
-The EIC-debounce sub-module provides up to 8 source input signal
-connections. A debounce mechanism is used to capture the input signals'
-stable status (millisecond resolution) and a single-trigger mechanism
-is introduced into this sub-module to enhance the input event detection
-reliability. In addition, this sub-module's clock can be shut off
-automatically to reduce power dissipation. Moreover the debounce range
-is from 1ms to 4s with a step size of 1ms. The input signal will be
-ignored if it is asserted for less than 1 ms.
-
-The EIC-latch sub-module is used to latch some special power down signals
-and generate interrupts, since the EIC-latch does not depend on the APB
-clock to capture signals.
-
-The EIC-async sub-module uses a 32kHz clock to capture the short signals
-(microsecond resolution) to generate interrupts by level or edge trigger.
-
-The EIC-sync is similar with GPIO's input function, which is a synchronized
-signal input register. It can generate interrupts by level or edge trigger
-when detecting input signals.
-
-Required properties:
-- compatible: Should be one of the following:
-  "sprd,sc9860-eic-debounce",
-  "sprd,sc9860-eic-latch",
-  "sprd,sc9860-eic-async",
-  "sprd,sc9860-eic-sync",
-  "sprd,sc2731-eic".
-- reg: Define the base and range of the I/O address space containing
-  the GPIO controller registers.
-- gpio-controller: Marks the device node as a GPIO controller.
-- #gpio-cells: Should be <2>. The first cell is the gpio number and
-  the second cell is used to specify optional parameters.
-- interrupt-controller: Marks the device node as an interrupt controller.
-- #interrupt-cells: Should be <2>. Specifies the number of cells needed
-  to encode interrupt source.
-- interrupts: Should be the port interrupt shared by all the gpios.
-
-Example:
-	eic_debounce: gpio@40210000 {
-		compatible = "sprd,sc9860-eic-debounce";
-		reg = <0 0x40210000 0 0x80>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
-	};
-
-	eic_latch: gpio@40210080 {
-		compatible = "sprd,sc9860-eic-latch";
-		reg = <0 0x40210080 0 0x20>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
-	};
-
-	eic_async: gpio@402100a0 {
-		compatible = "sprd,sc9860-eic-async";
-		reg = <0 0x402100a0 0 0x20>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
-	};
-
-	eic_sync: gpio@402100c0 {
-		compatible = "sprd,sc9860-eic-sync";
-		reg = <0 0x402100c0 0 0x20>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
-	};
-
-	pmic_eic: gpio@300 {
-		compatible = "sprd,sc2731-eic";
-		reg = <0x300>;
-		interrupt-parent = <&sc2731_pmic>;
-		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
-		gpio-controller;
-		#gpio-cells = <2>;
-		interrupt-controller;
-		#interrupt-cells = <2>;
-	};
diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
new file mode 100644
index 000000000000..e25ee1884c07
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
@@ -0,0 +1,145 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+# Copyright 2022 Unisoc Inc.
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/sprd,gpio-eic.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Unisoc EIC controller
+
+maintainers:
+  - Orson Zhai <orsonzhai@gmail.com>
+  - Baolin Wang <baolin.wang7@gmail.com>
+  - Chunyan Zhang <zhang.lyra@gmail.com>
+
+description:
+  The EIC is the abbreviation of external interrupt controller, which can
+  be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
+  one is in digital chip, and another one is in PMIC. The digital chip EIC
+  controller contains 4 sub-modules, i.e. EIC-debounce, EIC-latch, EIC-async and
+  EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
+  module.
+
+  The EIC-debounce sub-module provides up to 8 source input signal
+  connections. A debounce mechanism is used to capture the input signals'
+  stable status (millisecond resolution) and a single-trigger mechanism
+  is introduced into this sub-module to enhance the input event detection
+  reliability. In addition, this sub-module's clock can be shut off
+  automatically to reduce power dissipation. Moreover the debounce range
+  is from 1ms to 4s with a step size of 1ms. The input signal will be
+  ignored if it is asserted for less than 1 ms.
+
+  The EIC-latch sub-module is used to latch some special power down signals
+  and generate interrupts, since the EIC-latch does not depend on the APB
+  clock to capture signals.
+
+  The EIC-async sub-module uses a 32kHz clock to capture the short signals
+  (microsecond resolution) to generate interrupts by level or edge trigger.
+
+  The EIC-sync is similar with GPIO's input function, which is a synchronized
+  signal input register. It can generate interrupts by level or edge trigger
+  when detecting input signals.
+
+properties:
+  compatible:
+    enum:
+      - sprd,sc9860-eic-debounce
+      - sprd,sc9860-eic-latch
+      - sprd,sc9860-eic-async
+      - sprd,sc9860-eic-sync
+      - sprd,sc2731-eic
+
+  reg:
+    minItems: 1
+    maxItems: 4
+
+  gpio-controller: true
+
+  "#gpio-cells":
+    const: 2
+
+  interrupt-controller: true
+
+  "#interrupt-cells":
+    const: 2
+
+  interrupts:
+    maxItems: 1
+    description: The interrupt shared by all GPIO lines for this controller.
+
+required:
+  - compatible
+  - reg
+  - gpio-controller
+  - "#gpio-cells"
+  - interrupt-controller
+  - "#interrupt-cells"
+  - interrupts
+
+additionalProperties: false
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    soc {
+        #address-cells = <2>;
+        #size-cells = <2>;
+
+        eic_debounce: gpio@40210000 {
+            compatible = "sprd,sc9860-eic-debounce";
+            reg = <0 0x40210000 0 0x80>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+        };
+
+        eic_latch: gpio@40210080 {
+            compatible = "sprd,sc9860-eic-latch";
+            reg = <0 0x40210080 0 0x20>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+        };
+
+        eic_async: gpio@402100a0 {
+            compatible = "sprd,sc9860-eic-async";
+            reg = <0 0x402100a0 0 0x20>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+        };
+
+        eic_sync: gpio@402100c0 {
+            compatible = "sprd,sc9860-eic-sync";
+            reg = <0 0x402100c0 0 0x20>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+            interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
+        };
+    };
+
+    sc2730_pmic {
+        #address-cells = <1>;
+        #size-cells = <0>;
+
+        pmic_eic: gpio@300 {
+            compatible = "sprd,sc2731-eic";
+            reg = <0x300>;
+            interrupt-parent = <&sc2731_pmic>;
+            interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
+            gpio-controller;
+            #gpio-cells = <2>;
+            interrupt-controller;
+            #interrupt-cells = <2>;
+        };
+    };
+...
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512
  2022-09-28  9:29 [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Chunyan Zhang
  2022-09-28  9:29 ` [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC " Chunyan Zhang
@ 2022-09-28  9:29 ` Chunyan Zhang
  2022-09-28 11:34   ` Krzysztof Kozlowski
  2022-10-04  7:45   ` Linus Walleij
  2022-09-28 11:31 ` [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Krzysztof Kozlowski
  2 siblings, 2 replies; 11+ messages in thread
From: Chunyan Zhang @ 2022-09-28  9:29 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Baolin Wang, Orson Zhai, Chunyan Zhang, LKML

From: Chunyan Zhang <chunyan.zhang@unisoc.com>

UMS512 use the same GPIO and EIC controller with SC9860, so this
patch adds compatible string for UMS512 directly.

Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
---
 .../bindings/gpio/sprd,gpio-eic.yaml          | 33 +++++++++++++++----
 .../devicetree/bindings/gpio/sprd,gpio.yaml   |  7 +++-
 2 files changed, 33 insertions(+), 7 deletions(-)

diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
index e25ee1884c07..07f7d2b56da6 100644
--- a/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
+++ b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
@@ -42,12 +42,33 @@ description:
 
 properties:
   compatible:
-    enum:
-      - sprd,sc9860-eic-debounce
-      - sprd,sc9860-eic-latch
-      - sprd,sc9860-eic-async
-      - sprd,sc9860-eic-sync
-      - sprd,sc2731-eic
+    oneOf:
+      - enum:
+          - sprd,sc9860-eic-debounce
+          - sprd,sc9860-eic-latch
+          - sprd,sc9860-eic-async
+          - sprd,sc9860-eic-sync
+          - sprd,sc2731-eic
+      - items:
+          - enum:
+              - sprd,ums512-eic-debounce
+          - const: sprd,sc9860-eic-debounce
+      - items:
+          - enum:
+              - sprd,ums512-eic-latch
+          - const: sprd,sc9860-eic-latch
+      - items:
+          - enum:
+              - sprd,ums512-eic-async
+          - const: sprd,sc9860-eic-async
+      - items:
+          - enum:
+              - sprd,ums512-eic-sync
+          - const: sprd,sc9860-eic-sync
+      - items:
+          - enum:
+              - sprd,sc2730-eic
+          - const: sprd,sc2731-eic
 
   reg:
     minItems: 1
diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
index c0cd1ed9809b..a1ecb2b96a76 100644
--- a/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
@@ -19,7 +19,12 @@ description:
 
 properties:
   compatible:
-    const: sprd,sc9860-gpio
+    oneOf:
+      - const: sprd,sc9860-gpio
+      - items:
+          - enum:
+              - sprd,ums512-gpio
+          - const: sprd,sc9860-gpio
 
   reg:
     maxItems: 1
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml
  2022-09-28  9:29 [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Chunyan Zhang
  2022-09-28  9:29 ` [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC " Chunyan Zhang
  2022-09-28  9:29 ` [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512 Chunyan Zhang
@ 2022-09-28 11:31 ` Krzysztof Kozlowski
  2022-09-29  2:29   ` Chunyan Zhang
  2 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-28 11:31 UTC (permalink / raw)
  To: Chunyan Zhang, Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Baolin Wang, Orson Zhai, LKML

On 28/09/2022 11:29, Chunyan Zhang wrote:
> From: Chunyan Zhang <chunyan.zhang@unisoc.com>
> 
> Convert the Unisoc gpio controller binding to DT schema format.
> 


Thank you for your patch. There is something to discuss/improve.

> diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
> new file mode 100644
> index 000000000000..c0cd1ed9809b
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
> @@ -0,0 +1,70 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright 2022 Unisoc Inc.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/sprd,gpio.yaml#

Use compatible as filename, so sprd,sc9860-gpio.yaml

> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Unisoc GPIO controller
> +

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC controller binding to yaml
  2022-09-28  9:29 ` [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC " Chunyan Zhang
@ 2022-09-28 11:34   ` Krzysztof Kozlowski
  2022-09-29  8:36     ` Chunyan Zhang
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-28 11:34 UTC (permalink / raw)
  To: Chunyan Zhang, Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Baolin Wang, Orson Zhai, LKML

On 28/09/2022 11:29, Chunyan Zhang wrote:
> From: Chunyan Zhang <chunyan.zhang@unisoc.com>
> 
> Convert the Unisoc EIC controller binding to DT schema format.
> 
> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
> ---
>  .../bindings/gpio/gpio-eic-sprd.txt           |  97 ------------
>  .../bindings/gpio/sprd,gpio-eic.yaml          | 145 ++++++++++++++++++
>  2 files changed, 145 insertions(+), 97 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
>  create mode 100644 Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
> 
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> deleted file mode 100644
> index 54040a2bfe3a..000000000000
> --- a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> +++ /dev/null
> @@ -1,97 +0,0 @@
> -Spreadtrum EIC controller bindings
> -
> -The EIC is the abbreviation of external interrupt controller, which can
> -be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
> -one is in digital chip, and another one is in PMIC. The digital chip EIC
> -controller contains 4 sub-modules: EIC-debounce, EIC-latch, EIC-async and
> -EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
> -module.
> -
> -The EIC-debounce sub-module provides up to 8 source input signal
> -connections. A debounce mechanism is used to capture the input signals'
> -stable status (millisecond resolution) and a single-trigger mechanism
> -is introduced into this sub-module to enhance the input event detection
> -reliability. In addition, this sub-module's clock can be shut off
> -automatically to reduce power dissipation. Moreover the debounce range
> -is from 1ms to 4s with a step size of 1ms. The input signal will be
> -ignored if it is asserted for less than 1 ms.
> -
> -The EIC-latch sub-module is used to latch some special power down signals
> -and generate interrupts, since the EIC-latch does not depend on the APB
> -clock to capture signals.
> -
> -The EIC-async sub-module uses a 32kHz clock to capture the short signals
> -(microsecond resolution) to generate interrupts by level or edge trigger.
> -
> -The EIC-sync is similar with GPIO's input function, which is a synchronized
> -signal input register. It can generate interrupts by level or edge trigger
> -when detecting input signals.
> -
> -Required properties:
> -- compatible: Should be one of the following:
> -  "sprd,sc9860-eic-debounce",
> -  "sprd,sc9860-eic-latch",
> -  "sprd,sc9860-eic-async",
> -  "sprd,sc9860-eic-sync",
> -  "sprd,sc2731-eic".
> -- reg: Define the base and range of the I/O address space containing
> -  the GPIO controller registers.
> -- gpio-controller: Marks the device node as a GPIO controller.
> -- #gpio-cells: Should be <2>. The first cell is the gpio number and
> -  the second cell is used to specify optional parameters.
> -- interrupt-controller: Marks the device node as an interrupt controller.
> -- #interrupt-cells: Should be <2>. Specifies the number of cells needed
> -  to encode interrupt source.
> -- interrupts: Should be the port interrupt shared by all the gpios.
> -
> -Example:
> -	eic_debounce: gpio@40210000 {
> -		compatible = "sprd,sc9860-eic-debounce";
> -		reg = <0 0x40210000 0 0x80>;
> -		gpio-controller;
> -		#gpio-cells = <2>;
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> -	};
> -
> -	eic_latch: gpio@40210080 {
> -		compatible = "sprd,sc9860-eic-latch";
> -		reg = <0 0x40210080 0 0x20>;
> -		gpio-controller;
> -		#gpio-cells = <2>;
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> -	};
> -
> -	eic_async: gpio@402100a0 {
> -		compatible = "sprd,sc9860-eic-async";
> -		reg = <0 0x402100a0 0 0x20>;
> -		gpio-controller;
> -		#gpio-cells = <2>;
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> -	};
> -
> -	eic_sync: gpio@402100c0 {
> -		compatible = "sprd,sc9860-eic-sync";
> -		reg = <0 0x402100c0 0 0x20>;
> -		gpio-controller;
> -		#gpio-cells = <2>;
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -		interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> -	};
> -
> -	pmic_eic: gpio@300 {
> -		compatible = "sprd,sc2731-eic";
> -		reg = <0x300>;
> -		interrupt-parent = <&sc2731_pmic>;
> -		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
> -		gpio-controller;
> -		#gpio-cells = <2>;
> -		interrupt-controller;
> -		#interrupt-cells = <2>;
> -	};
> diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
> new file mode 100644
> index 000000000000..e25ee1884c07
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
> @@ -0,0 +1,145 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +# Copyright 2022 Unisoc Inc.
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/gpio/sprd,gpio-eic.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Unisoc EIC controller
> +
> +maintainers:
> +  - Orson Zhai <orsonzhai@gmail.com>
> +  - Baolin Wang <baolin.wang7@gmail.com>
> +  - Chunyan Zhang <zhang.lyra@gmail.com>
> +
> +description:
> +  The EIC is the abbreviation of external interrupt controller, which can
> +  be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
> +  one is in digital chip, and another one is in PMIC. The digital chip EIC
> +  controller contains 4 sub-modules, i.e. EIC-debounce, EIC-latch, EIC-async and
> +  EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
> +  module.
> +
> +  The EIC-debounce sub-module provides up to 8 source input signal
> +  connections. A debounce mechanism is used to capture the input signals'
> +  stable status (millisecond resolution) and a single-trigger mechanism
> +  is introduced into this sub-module to enhance the input event detection
> +  reliability. In addition, this sub-module's clock can be shut off
> +  automatically to reduce power dissipation. Moreover the debounce range
> +  is from 1ms to 4s with a step size of 1ms. The input signal will be
> +  ignored if it is asserted for less than 1 ms.
> +
> +  The EIC-latch sub-module is used to latch some special power down signals
> +  and generate interrupts, since the EIC-latch does not depend on the APB
> +  clock to capture signals.
> +
> +  The EIC-async sub-module uses a 32kHz clock to capture the short signals
> +  (microsecond resolution) to generate interrupts by level or edge trigger.
> +
> +  The EIC-sync is similar with GPIO's input function, which is a synchronized
> +  signal input register. It can generate interrupts by level or edge trigger
> +  when detecting input signals.
> +
> +properties:
> +  compatible:
> +    enum:
> +      - sprd,sc9860-eic-debounce
> +      - sprd,sc9860-eic-latch
> +      - sprd,sc9860-eic-async
> +      - sprd,sc9860-eic-sync
> +      - sprd,sc2731-eic
> +
> +  reg:
> +    minItems: 1
> +    maxItems: 4

Why up to 4 items? Previous bindings did not mention it. I also do not
see any users of this. Anyway you need to describe the items (items with
description) and restrict per variant in allOf:if:then


> +
> +  gpio-controller: true
> +
> +  "#gpio-cells":
> +    const: 2
> +
> +  interrupt-controller: true
> +
> +  "#interrupt-cells":
> +    const: 2
> +
> +  interrupts:
> +    maxItems: 1
> +    description: The interrupt shared by all GPIO lines for this controller.
> +
> +required:
> +  - compatible
> +  - reg
> +  - gpio-controller
> +  - "#gpio-cells"
> +  - interrupt-controller
> +  - "#interrupt-cells"
> +  - interrupts
> +
> +additionalProperties: false
> +
> +examples:
> +  - |
> +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> +
> +    soc {
> +        #address-cells = <2>;
> +        #size-cells = <2>;
> +
> +        eic_debounce: gpio@40210000 {
> +            compatible = "sprd,sc9860-eic-debounce";
> +            reg = <0 0x40210000 0 0x80>;
> +            gpio-controller;
> +            #gpio-cells = <2>;
> +            interrupt-controller;
> +            #interrupt-cells = <2>;
> +            interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;

One example is enough. All others are the same.


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512
  2022-09-28  9:29 ` [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512 Chunyan Zhang
@ 2022-09-28 11:34   ` Krzysztof Kozlowski
  2022-10-04  7:45   ` Linus Walleij
  1 sibling, 0 replies; 11+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-28 11:34 UTC (permalink / raw)
  To: Chunyan Zhang, Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski
  Cc: linux-gpio, devicetree, Baolin Wang, Orson Zhai, LKML

On 28/09/2022 11:29, Chunyan Zhang wrote:
> From: Chunyan Zhang <chunyan.zhang@unisoc.com>
> 
> UMS512 use the same GPIO and EIC controller with SC9860, so this
> patch adds compatible string for UMS512 directly.

Do not use "This commit/patch".
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

With commit msg fixed:

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

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml
  2022-09-28 11:31 ` [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Krzysztof Kozlowski
@ 2022-09-29  2:29   ` Chunyan Zhang
  2022-09-29  7:02     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 11+ messages in thread
From: Chunyan Zhang @ 2022-09-29  2:29 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, linux-gpio, devicetree, Baolin Wang,
	Orson Zhai, LKML

Hi Krzysztof,

On Wed, 28 Sept 2022 at 19:31, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 28/09/2022 11:29, Chunyan Zhang wrote:
> > From: Chunyan Zhang <chunyan.zhang@unisoc.com>
> >
> > Convert the Unisoc gpio controller binding to DT schema format.
> >
>
>
> Thank you for your patch. There is something to discuss/improve.
>
> > diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
> > new file mode 100644
> > index 000000000000..c0cd1ed9809b
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
> > @@ -0,0 +1,70 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +# Copyright 2022 Unisoc Inc.
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/gpio/sprd,gpio.yaml#
>
> Use compatible as filename, so sprd,sc9860-gpio.yaml

Humm... This is not only for SC9860, also for other IPs, UMS512 as an
example which added in this patchset.

Thanks for the review,
Chunyan

>
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Unisoc GPIO controller
> > +
>
> Best regards,
> Krzysztof
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml
  2022-09-29  2:29   ` Chunyan Zhang
@ 2022-09-29  7:02     ` Krzysztof Kozlowski
  2022-09-29  7:43       ` Chunyan Zhang
  0 siblings, 1 reply; 11+ messages in thread
From: Krzysztof Kozlowski @ 2022-09-29  7:02 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, linux-gpio, devicetree, Baolin Wang,
	Orson Zhai, LKML

On 29/09/2022 04:29, Chunyan Zhang wrote:
> Hi Krzysztof,
> 
> On Wed, 28 Sept 2022 at 19:31, Krzysztof Kozlowski
> <krzysztof.kozlowski@linaro.org> wrote:
>>
>> On 28/09/2022 11:29, Chunyan Zhang wrote:
>>> From: Chunyan Zhang <chunyan.zhang@unisoc.com>
>>>
>>> Convert the Unisoc gpio controller binding to DT schema format.
>>>
>>
>>
>> Thank you for your patch. There is something to discuss/improve.
>>
>>> diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
>>> new file mode 100644
>>> index 000000000000..c0cd1ed9809b
>>> --- /dev/null
>>> +++ b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
>>> @@ -0,0 +1,70 @@
>>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
>>> +# Copyright 2022 Unisoc Inc.
>>> +%YAML 1.2
>>> +---
>>> +$id: http://devicetree.org/schemas/gpio/sprd,gpio.yaml#
>>
>> Use compatible as filename, so sprd,sc9860-gpio.yaml
> 
> Humm... This is not only for SC9860, also for other IPs, UMS512 as an
> example which added in this patchset.
> 


Then it's ok. It seems you have also typo in commit subject (Conver).

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml
  2022-09-29  7:02     ` Krzysztof Kozlowski
@ 2022-09-29  7:43       ` Chunyan Zhang
  0 siblings, 0 replies; 11+ messages in thread
From: Chunyan Zhang @ 2022-09-29  7:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, linux-gpio, devicetree, Baolin Wang,
	Orson Zhai, LKML

On Thu, 29 Sept 2022 at 15:02, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 29/09/2022 04:29, Chunyan Zhang wrote:
> > Hi Krzysztof,
> >
> > On Wed, 28 Sept 2022 at 19:31, Krzysztof Kozlowski
> > <krzysztof.kozlowski@linaro.org> wrote:
> >>
> >> On 28/09/2022 11:29, Chunyan Zhang wrote:
> >>> From: Chunyan Zhang <chunyan.zhang@unisoc.com>
> >>>
> >>> Convert the Unisoc gpio controller binding to DT schema format.
> >>>
> >>
> >>
> >> Thank you for your patch. There is something to discuss/improve.
> >>
> >>> diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
> >>> new file mode 100644
> >>> index 000000000000..c0cd1ed9809b
> >>> --- /dev/null
> >>> +++ b/Documentation/devicetree/bindings/gpio/sprd,gpio.yaml
> >>> @@ -0,0 +1,70 @@
> >>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> >>> +# Copyright 2022 Unisoc Inc.
> >>> +%YAML 1.2
> >>> +---
> >>> +$id: http://devicetree.org/schemas/gpio/sprd,gpio.yaml#
> >>
> >> Use compatible as filename, so sprd,sc9860-gpio.yaml
> >
> > Humm... This is not only for SC9860, also for other IPs, UMS512 as an
> > example which added in this patchset.
> >
>
>
> Then it's ok. It seems you have also typo in commit subject (Conver).

Ah yes -_-||, will fix that.

>
> Best regards,
> Krzysztof
>

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC controller binding to yaml
  2022-09-28 11:34   ` Krzysztof Kozlowski
@ 2022-09-29  8:36     ` Chunyan Zhang
  0 siblings, 0 replies; 11+ messages in thread
From: Chunyan Zhang @ 2022-09-29  8:36 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Linus Walleij, Bartosz Golaszewski, Rob Herring,
	Krzysztof Kozlowski, linux-gpio, devicetree, Baolin Wang,
	Orson Zhai, LKML

On Wed, 28 Sept 2022 at 19:34, Krzysztof Kozlowski
<krzysztof.kozlowski@linaro.org> wrote:
>
> On 28/09/2022 11:29, Chunyan Zhang wrote:
> > From: Chunyan Zhang <chunyan.zhang@unisoc.com>
> >
> > Convert the Unisoc EIC controller binding to DT schema format.
> >
> > Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>
> > ---
> >  .../bindings/gpio/gpio-eic-sprd.txt           |  97 ------------
> >  .../bindings/gpio/sprd,gpio-eic.yaml          | 145 ++++++++++++++++++
> >  2 files changed, 145 insertions(+), 97 deletions(-)
> >  delete mode 100644 Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> >  create mode 100644 Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
> >
> > diff --git a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt b/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> > deleted file mode 100644
> > index 54040a2bfe3a..000000000000
> > --- a/Documentation/devicetree/bindings/gpio/gpio-eic-sprd.txt
> > +++ /dev/null
> > @@ -1,97 +0,0 @@
> > -Spreadtrum EIC controller bindings
> > -
> > -The EIC is the abbreviation of external interrupt controller, which can
> > -be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
> > -one is in digital chip, and another one is in PMIC. The digital chip EIC
> > -controller contains 4 sub-modules: EIC-debounce, EIC-latch, EIC-async and
> > -EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
> > -module.
> > -
> > -The EIC-debounce sub-module provides up to 8 source input signal
> > -connections. A debounce mechanism is used to capture the input signals'
> > -stable status (millisecond resolution) and a single-trigger mechanism
> > -is introduced into this sub-module to enhance the input event detection
> > -reliability. In addition, this sub-module's clock can be shut off
> > -automatically to reduce power dissipation. Moreover the debounce range
> > -is from 1ms to 4s with a step size of 1ms. The input signal will be
> > -ignored if it is asserted for less than 1 ms.
> > -
> > -The EIC-latch sub-module is used to latch some special power down signals
> > -and generate interrupts, since the EIC-latch does not depend on the APB
> > -clock to capture signals.
> > -
> > -The EIC-async sub-module uses a 32kHz clock to capture the short signals
> > -(microsecond resolution) to generate interrupts by level or edge trigger.
> > -
> > -The EIC-sync is similar with GPIO's input function, which is a synchronized
> > -signal input register. It can generate interrupts by level or edge trigger
> > -when detecting input signals.
> > -
> > -Required properties:
> > -- compatible: Should be one of the following:
> > -  "sprd,sc9860-eic-debounce",
> > -  "sprd,sc9860-eic-latch",
> > -  "sprd,sc9860-eic-async",
> > -  "sprd,sc9860-eic-sync",
> > -  "sprd,sc2731-eic".
> > -- reg: Define the base and range of the I/O address space containing
> > -  the GPIO controller registers.
> > -- gpio-controller: Marks the device node as a GPIO controller.
> > -- #gpio-cells: Should be <2>. The first cell is the gpio number and
> > -  the second cell is used to specify optional parameters.
> > -- interrupt-controller: Marks the device node as an interrupt controller.
> > -- #interrupt-cells: Should be <2>. Specifies the number of cells needed
> > -  to encode interrupt source.
> > -- interrupts: Should be the port interrupt shared by all the gpios.
> > -
> > -Example:
> > -     eic_debounce: gpio@40210000 {
> > -             compatible = "sprd,sc9860-eic-debounce";
> > -             reg = <0 0x40210000 0 0x80>;
> > -             gpio-controller;
> > -             #gpio-cells = <2>;
> > -             interrupt-controller;
> > -             #interrupt-cells = <2>;
> > -             interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> > -     };
> > -
> > -     eic_latch: gpio@40210080 {
> > -             compatible = "sprd,sc9860-eic-latch";
> > -             reg = <0 0x40210080 0 0x20>;
> > -             gpio-controller;
> > -             #gpio-cells = <2>;
> > -             interrupt-controller;
> > -             #interrupt-cells = <2>;
> > -             interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> > -     };
> > -
> > -     eic_async: gpio@402100a0 {
> > -             compatible = "sprd,sc9860-eic-async";
> > -             reg = <0 0x402100a0 0 0x20>;
> > -             gpio-controller;
> > -             #gpio-cells = <2>;
> > -             interrupt-controller;
> > -             #interrupt-cells = <2>;
> > -             interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> > -     };
> > -
> > -     eic_sync: gpio@402100c0 {
> > -             compatible = "sprd,sc9860-eic-sync";
> > -             reg = <0 0x402100c0 0 0x20>;
> > -             gpio-controller;
> > -             #gpio-cells = <2>;
> > -             interrupt-controller;
> > -             #interrupt-cells = <2>;
> > -             interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
> > -     };
> > -
> > -     pmic_eic: gpio@300 {
> > -             compatible = "sprd,sc2731-eic";
> > -             reg = <0x300>;
> > -             interrupt-parent = <&sc2731_pmic>;
> > -             interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
> > -             gpio-controller;
> > -             #gpio-cells = <2>;
> > -             interrupt-controller;
> > -             #interrupt-cells = <2>;
> > -     };
> > diff --git a/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
> > new file mode 100644
> > index 000000000000..e25ee1884c07
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/gpio/sprd,gpio-eic.yaml
> > @@ -0,0 +1,145 @@
> > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > +# Copyright 2022 Unisoc Inc.
> > +%YAML 1.2
> > +---
> > +$id: http://devicetree.org/schemas/gpio/sprd,gpio-eic.yaml#
> > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > +
> > +title: Unisoc EIC controller
> > +
> > +maintainers:
> > +  - Orson Zhai <orsonzhai@gmail.com>
> > +  - Baolin Wang <baolin.wang7@gmail.com>
> > +  - Chunyan Zhang <zhang.lyra@gmail.com>
> > +
> > +description:
> > +  The EIC is the abbreviation of external interrupt controller, which can
> > +  be used only in input mode. The Spreadtrum platform has 2 EIC controllers,
> > +  one is in digital chip, and another one is in PMIC. The digital chip EIC
> > +  controller contains 4 sub-modules, i.e. EIC-debounce, EIC-latch, EIC-async and
> > +  EIC-sync. But the PMIC EIC controller contains only one EIC-debounce sub-
> > +  module.
> > +
> > +  The EIC-debounce sub-module provides up to 8 source input signal
> > +  connections. A debounce mechanism is used to capture the input signals'
> > +  stable status (millisecond resolution) and a single-trigger mechanism
> > +  is introduced into this sub-module to enhance the input event detection
> > +  reliability. In addition, this sub-module's clock can be shut off
> > +  automatically to reduce power dissipation. Moreover the debounce range
> > +  is from 1ms to 4s with a step size of 1ms. The input signal will be
> > +  ignored if it is asserted for less than 1 ms.
> > +
> > +  The EIC-latch sub-module is used to latch some special power down signals
> > +  and generate interrupts, since the EIC-latch does not depend on the APB
> > +  clock to capture signals.
> > +
> > +  The EIC-async sub-module uses a 32kHz clock to capture the short signals
> > +  (microsecond resolution) to generate interrupts by level or edge trigger.
> > +
> > +  The EIC-sync is similar with GPIO's input function, which is a synchronized
> > +  signal input register. It can generate interrupts by level or edge trigger
> > +  when detecting input signals.
> > +
> > +properties:
> > +  compatible:
> > +    enum:
> > +      - sprd,sc9860-eic-debounce
> > +      - sprd,sc9860-eic-latch
> > +      - sprd,sc9860-eic-async
> > +      - sprd,sc9860-eic-sync
> > +      - sprd,sc2731-eic
> > +
> > +  reg:
> > +    minItems: 1
> > +    maxItems: 4
>
> Why up to 4 items? Previous bindings did not mention it. I also do not

For the mainstream gpio-eic-sprd driver [1], it supports 3 reg items,
I will fix this.

> see any users of this. Anyway you need to describe the items (items with
> description) and restrict per variant in allOf:if:then

Ok.

>
> > +
> > +  gpio-controller: true
> > +
> > +  "#gpio-cells":
> > +    const: 2
> > +
> > +  interrupt-controller: true
> > +
> > +  "#interrupt-cells":
> > +    const: 2
> > +
> > +  interrupts:
> > +    maxItems: 1
> > +    description: The interrupt shared by all GPIO lines for this controller.
> > +
> > +required:
> > +  - compatible
> > +  - reg
> > +  - gpio-controller
> > +  - "#gpio-cells"
> > +  - interrupt-controller
> > +  - "#interrupt-cells"
> > +  - interrupts
> > +
> > +additionalProperties: false
> > +
> > +examples:
> > +  - |
> > +    #include <dt-bindings/interrupt-controller/arm-gic.h>
> > +
> > +    soc {
> > +        #address-cells = <2>;
> > +        #size-cells = <2>;
> > +
> > +        eic_debounce: gpio@40210000 {
> > +            compatible = "sprd,sc9860-eic-debounce";
> > +            reg = <0 0x40210000 0 0x80>;
> > +            gpio-controller;
> > +            #gpio-cells = <2>;
> > +            interrupt-controller;
> > +            #interrupt-cells = <2>;
> > +            interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
>
> One example is enough. All others are the same.

Ok, will remove.

Thanks for the review,
Chunyan

[1] https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/+/refs/tags/v6.0-rc7/drivers/gpio/gpio-eic-sprd.c#592

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512
  2022-09-28  9:29 ` [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512 Chunyan Zhang
  2022-09-28 11:34   ` Krzysztof Kozlowski
@ 2022-10-04  7:45   ` Linus Walleij
  1 sibling, 0 replies; 11+ messages in thread
From: Linus Walleij @ 2022-10-04  7:45 UTC (permalink / raw)
  To: Chunyan Zhang
  Cc: Bartosz Golaszewski, Rob Herring, Krzysztof Kozlowski,
	linux-gpio, devicetree, Baolin Wang, Orson Zhai, LKML

On Wed, Sep 28, 2022 at 11:29 AM Chunyan Zhang <zhang.lyra@gmail.com> wrote:

> From: Chunyan Zhang <chunyan.zhang@unisoc.com>
>
> UMS512 use the same GPIO and EIC controller with SC9860, so this
> patch adds compatible string for UMS512 directly.
>
> Signed-off-by: Chunyan Zhang <chunyan.zhang@unisoc.com>

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-10-04  7:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-28  9:29 [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Chunyan Zhang
2022-09-28  9:29 ` [PATCH 2/3] dt-bindings: gpio: Conver Unisoc EIC " Chunyan Zhang
2022-09-28 11:34   ` Krzysztof Kozlowski
2022-09-29  8:36     ` Chunyan Zhang
2022-09-28  9:29 ` [PATCH 3/3] dt-bindings: gpio: Add compatible string for Unisoc UMS512 Chunyan Zhang
2022-09-28 11:34   ` Krzysztof Kozlowski
2022-10-04  7:45   ` Linus Walleij
2022-09-28 11:31 ` [PATCH 1/3] dt-bindings: gpio: Conver Unisoc GPIO controller binding to yaml Krzysztof Kozlowski
2022-09-29  2:29   ` Chunyan Zhang
2022-09-29  7:02     ` Krzysztof Kozlowski
2022-09-29  7:43       ` Chunyan Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).