2020-09-16 18:17:04

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 0/8] gpio: add common dtschema

Hi,

This is independent work of pca953x bindings:
https://lore.kernel.org/lkml/[email protected]/T/#u

The DTS patches can be also applied independently.

Best regards,
Krzysztof


Krzysztof Kozlowski (8):
dt-bindings: gpio: add common schema for GPIO controllers
dt-bindings: gpio: include common schema in GPIO controllers
dt-bindings: gpio: pl061: add missing properties and include common
schema
dt-bindings: gpio: fsl-imx-gpio: add i.MX ARMv6 and ARMv7 compatibles
dt-bindings: gpio: fsl-imx-gpio: add gpio-line-names
arm64: dts: imx8mq-librem5: correct GPIO hog property
arm64: dts: imx8mq-librem5: align GPIO hog names with dtschema
ARM: dts: imx: align GPIO hog names with dtschema

.../bindings/gpio/brcm,xgs-iproc-gpio.yaml | 3 +
.../bindings/gpio/fsl-imx-gpio.yaml | 17 ++-
.../devicetree/bindings/gpio/gpio-common.yaml | 126 ++++++++++++++++++
.../devicetree/bindings/gpio/gpio-mxs.yaml | 3 +
.../bindings/gpio/gpio-pca9570.yaml | 3 +
.../devicetree/bindings/gpio/gpio-rda.yaml | 3 +
.../devicetree/bindings/gpio/gpio-vf610.yaml | 3 +
.../devicetree/bindings/gpio/mrvl-gpio.yaml | 1 +
.../devicetree/bindings/gpio/pl061-gpio.yaml | 6 +
.../bindings/gpio/qcom,wcd934x-gpio.yaml | 3 +
.../bindings/gpio/renesas,em-gio.yaml | 3 +
.../bindings/gpio/renesas,rcar-gpio.yaml | 3 +
.../devicetree/bindings/gpio/sifive,gpio.yaml | 3 +
.../gpio/socionext,uniphier-gpio.yaml | 3 +
.../bindings/gpio/xylon,logicvc-gpio.yaml | 3 +
arch/arm/boot/dts/imx51-zii-rdu1.dts | 2 +-
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 8 +-
arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts | 2 +-
.../boot/dts/freescale/imx8mq-librem5.dtsi | 4 +-
19 files changed, 190 insertions(+), 9 deletions(-)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-common.yaml

--
2.17.1


2020-09-16 18:17:17

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 1/8] dt-bindings: gpio: add common schema for GPIO controllers

Convert parts of gpio.txt bindings into common dtschema file for GPIO
controllers. The schema enforces proper naming of GPIO controller nodes
and GPIO hogs.

The schema should be included by specific GPIO controllers bindings.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
.../devicetree/bindings/gpio/gpio-common.yaml | 126 ++++++++++++++++++
1 file changed, 126 insertions(+)
create mode 100644 Documentation/devicetree/bindings/gpio/gpio-common.yaml

diff --git a/Documentation/devicetree/bindings/gpio/gpio-common.yaml b/Documentation/devicetree/bindings/gpio/gpio-common.yaml
new file mode 100644
index 000000000000..d0974fcac659
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-common.yaml
@@ -0,0 +1,126 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/gpio/gpio-common.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common GPIO controller properties
+
+maintainers:
+ - Krzysztof Kozlowski <[email protected]>
+ - Linus Walleij <[email protected]>
+
+properties:
+ nodename:
+ pattern: "^(gpio-controller|gpio)(@[0-9a-f]+|-[0-9a-f]+)?$"
+
+ '#gpio-cells': true
+ gpio-controller: true
+ gpio-ranges: true
+
+ gpio-line-names:
+ description: |
+ Optionally, a GPIO controller may have a "gpio-line-names" property. This
+ is an array of strings defining the names of the GPIO lines going out of
+ the GPIO controller. This name should be the most meaningful producer
+ name for the system, such as a rail name indicating the usage. Package
+ names such as pin name are discouraged: such lines have opaque names
+ (since they are by definition generic purpose) and such names are usually
+ not very helpful.
+
+ For example "MMC-CD", "Red LED Vdd" and "ethernet reset" are reasonable
+ line names as they describe what the line is used for. "GPIO0" is not a
+ good name to give to a GPIO line.
+
+ Placeholders are discouraged: rather use the "" (blank string) if the use
+ of the GPIO line is undefined in your design. The names are assigned
+ starting from line offset 0 from left to right from the passed array. An
+ incomplete array (where the number of passed named are less than ngpios)
+ will still be used up until the last provided valid line index.
+
+ gpio-reserved-ranges:
+ description:
+ Indicates the start and size of the GPIOs that can't be used.
+
+ ngpios:
+ description: |
+ Optionally, a GPIO controller may have a "ngpios" property. This property
+ indicates the number of in-use slots of available slots for GPIOs. The
+ typical example is something like this: the hardware register is 32 bits
+ wide, but only 18 of the bits have a physical counterpart. The driver is
+ generally written so that all 32 bits can be used, but the IP block is
+ reused in a lot of designs, some using all 32 bits, some using 18 and
+ some using 12. In this case, setting "ngpios = <18>;" informs the driver
+ that only the first 18 GPIOs, at local offset 0 .. 17, are in use.
+
+ If these GPIOs do not happen to be the first N GPIOs at offset 0...N-1,
+ an additional set of tuples is needed to specify which GPIOs are
+ unusable, with the gpio-reserved-ranges binding.
+
+patternProperties:
+ "^(hog-[0-9]+|.+-hog(-[0-9]+)?)$":
+ type: object
+ description:
+ The GPIO chip may contain GPIO hog definitions. GPIO hogging is a mechanism
+ providing automatic GPIO request and configuration as part of the
+ gpio-controller's driver probe function.
+ Each GPIO hog definition is represented as a child node of the GPIO controller.
+
+ properties:
+ gpio-hog: true
+ gpios: true
+ input: true
+ output-high: true
+ output-low: true
+ line-name:
+ description:
+ The GPIO label name. If not present the node name is used.
+
+ required:
+ - gpio-hog
+ - gpios
+
+ oneOf:
+ - required:
+ - input
+ - required:
+ - output-high
+ - required:
+ - output-low
+
+ additionalProperties: false
+
+required:
+ - compatible
+ - "#gpio-cells"
+ - gpio-controller
+
+examples:
+ - |
+ gpio-controller@15000000 {
+ compatible = "foo";
+ reg = <0x15000000 0x1000>;
+ gpio-controller;
+ #gpio-cells = <2>;
+ ngpios = <18>;
+ gpio-reserved-ranges = <0 4>, <12 2>;
+ gpio-line-names = "MMC-CD", "MMC-WP", "VDD eth", "RST eth", "LED R",
+ "LED G", "LED B", "Col A", "Col B", "Col C", "Col D",
+ "Row A", "Row B", "Row C", "Row D", "NMI button",
+ "poweroff", "reset";
+ };
+
+ - |
+ gpio-controller@1400 {
+ compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
+ reg = <0x1400 0x18>;
+ gpio-controller;
+ #gpio-cells = <2>;
+
+ line-b-hog {
+ gpio-hog;
+ gpios = <6 0>;
+ input;
+ line-name = "foo-bar-gpio";
+ };
+ };
--
2.17.1

2020-09-16 18:18:18

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 2/8] dt-bindings: gpio: include common schema in GPIO controllers

Include the common GPIO schema in GPIO controllers to be sure all common
properties are properly validated.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
.../devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml | 3 +++
Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml | 3 +++
Documentation/devicetree/bindings/gpio/gpio-mxs.yaml | 3 +++
Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml | 3 +++
Documentation/devicetree/bindings/gpio/gpio-rda.yaml | 3 +++
Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 3 +++
Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml | 1 +
Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml | 3 +++
Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml | 3 +++
Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml | 3 +++
Documentation/devicetree/bindings/gpio/sifive,gpio.yaml | 3 +++
.../devicetree/bindings/gpio/socionext,uniphier-gpio.yaml | 3 +++
Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml | 3 +++
13 files changed, 37 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml b/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml
index c213cb9ddb9f..1ac69b9c03f9 100644
--- a/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml
@@ -13,6 +13,9 @@ description: |
This controller is the Chip Common A GPIO present on a number of Broadcom
switch ASICs with integrated SoCs.

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
const: brcm,iproc-gpio-cca
diff --git a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
index de0b9b5f6a70..737756e081fb 100644
--- a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
@@ -9,6 +9,9 @@ title: Freescale i.MX/MXC GPIO controller
maintainers:
- Anson Huang <[email protected]>

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
oneOf:
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml b/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml
index dfa1133f8c5e..7fc04ab35044 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml
@@ -17,6 +17,9 @@ description: |
GPIO ports share the same IO space with PIN controller, the GPIO node
will be represented as sub-nodes of MXS pinctrl node.

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
enum:
diff --git a/Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml b/Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml
index 338c5312a106..69b12041c893 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml
@@ -9,6 +9,9 @@ title: PCA9570 I2C GPO expander
maintainers:
- Sungbo Eo <[email protected]>

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
enum:
diff --git a/Documentation/devicetree/bindings/gpio/gpio-rda.yaml b/Documentation/devicetree/bindings/gpio/gpio-rda.yaml
index 6ece555f074f..d70c99f463c2 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-rda.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-rda.yaml
@@ -9,6 +9,9 @@ title: RDA Micro GPIO controller
maintainers:
- Manivannan Sadhasivam <[email protected]>

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
const: rda,8810pl-gpio
diff --git a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
index 6ac5a78ad3da..82f3e4b407d1 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
+++ b/Documentation/devicetree/bindings/gpio/gpio-vf610.yaml
@@ -17,6 +17,9 @@ description: |
Note: Each GPIO port should have an alias correctly numbered in "aliases"
node.

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
enum:
diff --git a/Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml b/Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml
index 4db3b8a3332c..e2b7d2d133a8 100644
--- a/Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml
@@ -12,6 +12,7 @@ maintainers:
- Rob Herring <[email protected]>

allOf:
+ - $ref: gpio-common.yaml#
- if:
properties:
compatible:
diff --git a/Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml b/Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml
index 32a566ec3558..2eee374e8396 100644
--- a/Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml
@@ -13,6 +13,9 @@ description: |
Qualcomm Technologies Inc WCD9340/WCD9341 Audio Codec has integrated
gpio controller to control 5 gpios on the chip.

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
enum:
diff --git a/Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml b/Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml
index 8bdef812c87c..845689807678 100644
--- a/Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml
+++ b/Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml
@@ -9,6 +9,9 @@ title: Renesas EMMA Mobile General Purpose I/O Interface
maintainers:
- Magnus Damm <[email protected]>

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
const: renesas,em-gio
diff --git a/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml b/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
index 5026662e4508..c116000d579f 100644
--- a/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml
@@ -9,6 +9,9 @@ title: Renesas R-Car General-Purpose Input/Output Ports (GPIO)
maintainers:
- Geert Uytterhoeven <[email protected]>

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
oneOf:
diff --git a/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml b/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml
index a0efd8dc2538..f2d93b40fc7e 100644
--- a/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/sifive,gpio.yaml
@@ -10,6 +10,9 @@ maintainers:
- Yash Shah <[email protected]>
- Paul Walmsley <[email protected]>

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
compatible:
items:
diff --git a/Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml b/Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml
index c58ff9a94f45..94a911e9c313 100644
--- a/Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/socionext,uniphier-gpio.yaml
@@ -9,6 +9,9 @@ title: UniPhier GPIO controller
maintainers:
- Masahiro Yamada <[email protected]>

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
$nodename:
pattern: "^gpio@[0-9a-f]+$"
diff --git a/Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml b/Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml
index a36aec27069c..0e4581241b3f 100644
--- a/Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml
@@ -23,6 +23,9 @@ description: |
- EN_VEE (power control) mapped to index 7
- V_EN (power control) mapped to index 8

+allOf:
+ - $ref: gpio-common.yaml#
+
properties:
$nodename:
pattern: "^gpio@[0-9a-f]+$"
--
2.17.1

2020-09-16 18:19:00

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 5/8] dt-bindings: gpio: fsl-imx-gpio: add gpio-line-names

Describe common "gpio-line-names" property to fix dtbs_check warnings
like:

arch/arm/boot/dts/imx53-m53menlo.dt.yaml: gpio@53f84000:
'gpio-line-names' does not match any of the regexes: '^(hog-[0-9]+|.+-hog(-[0-9]+)?)$', 'pinctrl-[0-9]+'

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
index ad761e2f380a..347f059d347a 100644
--- a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
@@ -65,7 +65,7 @@ properties:
const: 2

gpio-controller: true
-
+ gpio-line-names: true
gpio-ranges: true

power-domains:
--
2.17.1

2020-09-16 20:37:05

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 8/8] ARM: dts: imx: align GPIO hog names with dtschema

dtschema for GPIO controllers expects GPIO hogs to end with 'hog'
prefix.

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
arch/arm/boot/dts/imx51-zii-rdu1.dts | 2 +-
arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi | 8 ++++----
arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts | 2 +-
3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/arm/boot/dts/imx51-zii-rdu1.dts b/arch/arm/boot/dts/imx51-zii-rdu1.dts
index e559ab0c3645..ec8ca3ac2c1c 100644
--- a/arch/arm/boot/dts/imx51-zii-rdu1.dts
+++ b/arch/arm/boot/dts/imx51-zii-rdu1.dts
@@ -451,7 +451,7 @@
"", "", "", "",
"", "", "", "";

- unused-sd3-wp-gpio {
+ unused-sd3-wp-hog {
/*
* See pinctrl_esdhc1 below for more details on this
*/
diff --git a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
index 66b15748e287..c0a76202e16b 100644
--- a/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-zii-rdu2.dtsi
@@ -330,28 +330,28 @@
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio3_hog>;

- usb-emulation {
+ usb-emulation-hog {
gpio-hog;
gpios = <19 GPIO_ACTIVE_HIGH>;
output-low;
line-name = "usb-emulation";
};

- usb-mode1 {
+ usb-mode1-hog {
gpio-hog;
gpios = <20 GPIO_ACTIVE_HIGH>;
output-high;
line-name = "usb-mode1";
};

- usb-pwr {
+ usb-pwr-hog {
gpio-hog;
gpios = <22 GPIO_ACTIVE_LOW>;
output-high;
line-name = "usb-pwr-ctrl-en-n";
};

- usb-mode2 {
+ usb-mode2-hog {
gpio-hog;
gpios = <23 GPIO_ACTIVE_HIGH>;
output-high;
diff --git a/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts b/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts
index a0bbec57ddc7..3ec042bfccba 100644
--- a/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts
+++ b/arch/arm/boot/dts/imx6ul-ccimx6ulsbcpro.dts
@@ -110,7 +110,7 @@
};

&gpio5 {
- emmc-usd-mux {
+ emmc-usd-mux-hog {
gpio-hog;
gpios = <1 GPIO_ACTIVE_LOW>;
output-high;
--
2.17.1

2020-09-16 20:39:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: [PATCH 4/8] dt-bindings: gpio: fsl-imx-gpio: add i.MX ARMv6 and ARMv7 compatibles

Several DTSes with ARMv6 and ARMv7 i.MX SoCs introduce their own
compatibles so add them to fix dtbs_check warnings like:

arch/arm/boot/dts/imx35-pdk.dt.yaml: gpio@53fa4000:
compatible: ['fsl,imx35-gpio', 'fsl,imx31-gpio'] is not valid under any of the given schemas

arch/arm/boot/dts/imx51-babbage.dt.yaml: gpio@73f90000:
compatible: ['fsl,imx51-gpio', 'fsl,imx35-gpio'] is not valid under any of the given schemas

Signed-off-by: Krzysztof Kozlowski <[email protected]>
---
.../devicetree/bindings/gpio/fsl-imx-gpio.yaml | 12 ++++++++++++
1 file changed, 12 insertions(+)

diff --git a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
index 737756e081fb..ad761e2f380a 100644
--- a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
+++ b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
@@ -21,8 +21,20 @@ properties:
- fsl,imx31-gpio
- fsl,imx35-gpio
- fsl,imx7d-gpio
+ - items:
+ - const: fsl,imx35-gpio
+ - const: fsl,imx31-gpio
- items:
- enum:
+ - fsl,imx50-gpio
+ - fsl,imx51-gpio
+ - fsl,imx53-gpio
+ - fsl,imx6q-gpio
+ - fsl,imx6sl-gpio
+ - fsl,imx6sll-gpio
+ - fsl,imx6sx-gpio
+ - fsl,imx6ul-gpio
+ - fsl,imx7d-gpio
- fsl,imx8mm-gpio
- fsl,imx8mn-gpio
- fsl,imx8mp-gpio
--
2.17.1

2020-09-17 06:42:22

by Geert Uytterhoeven

[permalink] [raw]
Subject: Re: [PATCH 2/8] dt-bindings: gpio: include common schema in GPIO controllers

Hi Krzysztof,

On Wed, Sep 16, 2020 at 6:23 PM Krzysztof Kozlowski <[email protected]> wrote:
> Include the common GPIO schema in GPIO controllers to be sure all common
> properties are properly validated.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>

Thanks for your patch!

> ---
> .../devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-mxs.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-rda.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml | 1 +
> Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/sifive,gpio.yaml | 3 +++
> .../devicetree/bindings/gpio/socionext,uniphier-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml | 3 +++
> 13 files changed, 37 insertions(+)

There are more binding files describing GPIO controllers outside the
Documentation/devicetree/bindings/gpio/ subdirectory, cfr.
'git grep gpio-controller:.true -- "Doc*yaml"'

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

2020-09-17 06:59:53

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/8] dt-bindings: gpio: include common schema in GPIO controllers

On Thu, 17 Sep 2020 at 08:40, Geert Uytterhoeven <[email protected]> wrote:
>
> Hi Krzysztof,
>
> On Wed, Sep 16, 2020 at 6:23 PM Krzysztof Kozlowski <[email protected]> wrote:
> > Include the common GPIO schema in GPIO controllers to be sure all common
> > properties are properly validated.
> >
> > Signed-off-by: Krzysztof Kozlowski <[email protected]>
>
> Thanks for your patch!
>
> > ---
> > .../devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/gpio-mxs.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/gpio-rda.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml | 1 +
> > Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/sifive,gpio.yaml | 3 +++
> > .../devicetree/bindings/gpio/socionext,uniphier-gpio.yaml | 3 +++
> > Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml | 3 +++
> > 13 files changed, 37 insertions(+)
>
> There are more binding files describing GPIO controllers outside the
> Documentation/devicetree/bindings/gpio/ subdirectory, cfr.
> 'git grep gpio-controller:.true -- "Doc*yaml"'

Oh, indeed. Thanks for spotting these. I will check them and send a follow up.

Best regards,
Krzysztof

2020-09-17 07:18:44

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 2/8] dt-bindings: gpio: include common schema in GPIO controllers

On Wed, Sep 16, 2020 at 06:22:44PM +0200, Krzysztof Kozlowski wrote:
> Include the common GPIO schema in GPIO controllers to be sure all common
> properties are properly validated.
>
> Signed-off-by: Krzysztof Kozlowski <[email protected]>
> ---
> .../devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-mxs.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-pca9570.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-rda.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/gpio-vf610.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml | 1 +
> Documentation/devicetree/bindings/gpio/qcom,wcd934x-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/renesas,em-gio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/renesas,rcar-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/sifive,gpio.yaml | 3 +++
> .../devicetree/bindings/gpio/socionext,uniphier-gpio.yaml | 3 +++
> Documentation/devicetree/bindings/gpio/xylon,logicvc-gpio.yaml | 3 +++
> 13 files changed, 37 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml b/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml
> index c213cb9ddb9f..1ac69b9c03f9 100644
> --- a/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml
> +++ b/Documentation/devicetree/bindings/gpio/brcm,xgs-iproc-gpio.yaml
> @@ -13,6 +13,9 @@ description: |
> This controller is the Chip Common A GPIO present on a number of Broadcom
> switch ASICs with integrated SoCs.
>
> +allOf:
> + - $ref: gpio-common.yaml#
> +
> properties:
> compatible:
> const: brcm,iproc-gpio-cca
> diff --git a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
> index de0b9b5f6a70..737756e081fb 100644
> --- a/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
> +++ b/Documentation/devicetree/bindings/gpio/fsl-imx-gpio.yaml
> @@ -9,6 +9,9 @@ title: Freescale i.MX/MXC GPIO controller
> maintainers:
> - Anson Huang <[email protected]>
>
> +allOf:
> + - $ref: gpio-common.yaml#
> +
> properties:
> compatible:
> oneOf:
> diff --git a/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml b/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml
> index dfa1133f8c5e..7fc04ab35044 100644
> --- a/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml
> +++ b/Documentation/devicetree/bindings/gpio/gpio-mxs.yaml
> @@ -17,6 +17,9 @@ description: |
> GPIO ports share the same IO space with PIN controller, the GPIO node
> will be represented as sub-nodes of MXS pinctrl node.
>
> +allOf:
> + - $ref: gpio-common.yaml#
> +

I found something to fix - this one should go under patternProperties,
not here.

Best regards,
Krzysztof

2020-09-17 07:27:20

by J. Neuschäfer

[permalink] [raw]
Subject: Re: [PATCH 8/8] ARM: dts: imx: align GPIO hog names with dtschema

On Wed, Sep 16, 2020 at 06:22:50PM +0200, Krzysztof Kozlowski wrote:
> dtschema for GPIO controllers expects GPIO hogs to end with 'hog'
> prefix.

Nit: It's a suffix if it's at the end.


Thanks,
Jonathan Neuschäfer


Attachments:
(No filename) (227.00 B)
signature.asc (849.00 B)
Download all attachments

2020-09-17 07:30:33

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 8/8] ARM: dts: imx: align GPIO hog names with dtschema

On Thu, 17 Sep 2020 at 09:20, Jonathan Neuschäfer <[email protected]> wrote:
>
> On Wed, Sep 16, 2020 at 06:22:50PM +0200, Krzysztof Kozlowski wrote:
> > dtschema for GPIO controllers expects GPIO hogs to end with 'hog'
> > prefix.
>
> Nit: It's a suffix if it's at the end.

Right, I'll fix the message. Thanks for spotting this.

Best regards,
Krzysztof

2020-09-29 11:59:10

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/8] gpio: add common dtschema

On Wed, Sep 16, 2020 at 6:23 PM Krzysztof Kozlowski <[email protected]> wrote:

> This is independent work of pca953x bindings:
> https://lore.kernel.org/lkml/[email protected]/T/#u
>
> The DTS patches can be also applied independently.

I'm a big fan of this patch series and hope for a v2 soon
so I can apply them.

If you do not foresee any conflicts in the DTS files I can
apply also these, else you can apply them in the i.MX DTS
tree (wherever that is) or I can provide an immutable
branch, whichever you like!

Yours,
Linus Walleij

2020-09-29 12:39:45

by Krzysztof Kozlowski

[permalink] [raw]
Subject: Re: [PATCH 0/8] gpio: add common dtschema

On Tue, Sep 29, 2020 at 01:56:42PM +0200, Linus Walleij wrote:
> On Wed, Sep 16, 2020 at 6:23 PM Krzysztof Kozlowski <[email protected]> wrote:
>
> > This is independent work of pca953x bindings:
> > https://lore.kernel.org/lkml/[email protected]/T/#u
> >
> > The DTS patches can be also applied independently.
>
> I'm a big fan of this patch series and hope for a v2 soon
> so I can apply them.

I sent the dt-bindings part of it already to dtschema and it was
applied. It's missing the description of properties due to licensing
but at least it brings the hog nodes validation.

>
> If you do not foresee any conflicts in the DTS files I can
> apply also these, else you can apply them in the i.MX DTS
> tree (wherever that is) or I can provide an immutable
> branch, whichever you like!

Thanks! I resent already the DTS in separate patchset and most of them
went in.

Best regards,
Krzysztof