All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/1] fix all errors except one reported by dt_binding_check
@ 2020-10-15  4:44 ` Zhen Lei
  0 siblings, 0 replies; 8+ messages in thread
From: Zhen Lei @ 2020-10-15  4:44 UTC (permalink / raw)
  To: Rob Herring, Pavel Machek, Dan Murphy, linux-leds, Lee Jones,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, Mark Brown,
	linux-spi, Lubomir Rintel, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Zhen Lei

v1 --> v2:
1. I'm sorry. I'm not familiar with the GPIO driver, which leads to a low-level
   mistake. Now, I rewrite the patch 6/6 in v1. For more detail, please refer:   
   https://lore.kernel.org/linux-arm-kernel/49b680f8-d7d7-8ea3-894c-73cbfacc5ba4@huawei.com/T/#u


v1:
When people add multiple or common YAML files, they usually perform a full
dt_binding_check. Unfortunately, some YAML files cannot pass the self-check.
The errors or warning are listed below. It is necessary to eliminate them,
so that people's time and energy are not wasted every time when execute
comprehensive dt_binding_check.

This error is fixed by Patch 1:
/root/leizhen/linux-next/Documentation/devicetree/bindings/leds/leds-lp55xx.example.dt.yaml: led-controller@33: multi-led@2:color:0:0: 9 is greater than the maximum of 8
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml

These errors are fixed by Patch 2:
/root/leizhen/linux-next/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.example.dt.yaml: ec@0: 'typec' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/extcon/extcon-usbc-cros-ec.example.dt.yaml: cros-ec@0: 'extcon0', 'extcon1' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.example.dt.yaml: cros-ec@0: 'ec-pwm' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/regulator/google,cros-ec-regulator.example.dt.yaml: ec@0: '#address-cells', '#size-cells', 'regulator@0' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dt.yaml: cros-ec@0: '#address-cells', '#size-cells', 'ec-codec@10500000' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml

These errors are fixed by Patch 3 and 4:
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dts:21.13-30.11: Warning (spi_bus_bridge): /example-0/spi: incorrect #address-cells for SPI bus
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dts:21.13-30.11: Warning (spi_bus_bridge): /example-0/spi: incorrect #size-cells for SPI bus
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'

Patch 5 and 6 fix the dtbs_check errors detected by Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
/root/leizhen/linux-next/arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: slave: 'cmd-gpios' is a required property
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
/root/leizhen/linux-next/arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml

I have no good idea for this one, so leave it.
Documentation/devicetree/bindings/pci/xilinx-versal-cpm.example.dts:43.62-47.30: Warning (pci_device_reg): /example-0/versal/pcie@fca10000/interrupt-controller: missing PCI reg property

Zhen Lei (1):
  dt-bindings: misc: add support for both property names cmd-gpios and
    cmd-gpio

 Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

-- 
1.8.3



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

* [PATCH v2 0/1] fix all errors except one reported by dt_binding_check
@ 2020-10-15  4:44 ` Zhen Lei
  0 siblings, 0 replies; 8+ messages in thread
From: Zhen Lei @ 2020-10-15  4:44 UTC (permalink / raw)
  To: Rob Herring, Pavel Machek, Dan Murphy, linux-leds, Lee Jones,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, Mark Brown,
	linux-spi, Lubomir Rintel, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Zhen Lei

v1 --> v2:
1. I'm sorry. I'm not familiar with the GPIO driver, which leads to a low-level
   mistake. Now, I rewrite the patch 6/6 in v1. For more detail, please refer:   
   https://lore.kernel.org/linux-arm-kernel/49b680f8-d7d7-8ea3-894c-73cbfacc5ba4@huawei.com/T/#u


v1:
When people add multiple or common YAML files, they usually perform a full
dt_binding_check. Unfortunately, some YAML files cannot pass the self-check.
The errors or warning are listed below. It is necessary to eliminate them,
so that people's time and energy are not wasted every time when execute
comprehensive dt_binding_check.

This error is fixed by Patch 1:
/root/leizhen/linux-next/Documentation/devicetree/bindings/leds/leds-lp55xx.example.dt.yaml: led-controller@33: multi-led@2:color:0:0: 9 is greater than the maximum of 8
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/leds/leds-lp55xx.yaml

These errors are fixed by Patch 2:
/root/leizhen/linux-next/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.example.dt.yaml: ec@0: 'typec' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/extcon/extcon-usbc-cros-ec.example.dt.yaml: cros-ec@0: 'extcon0', 'extcon1' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/pwm/google,cros-ec-pwm.example.dt.yaml: cros-ec@0: 'ec-pwm' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/regulator/google,cros-ec-regulator.example.dt.yaml: ec@0: '#address-cells', '#size-cells', 'regulator@0' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml
/root/leizhen/linux-next/Documentation/devicetree/bindings/sound/google,cros-ec-codec.example.dt.yaml: cros-ec@0: '#address-cells', '#size-cells', 'ec-codec@10500000' do not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/mfd/google,cros-ec.yaml

These errors are fixed by Patch 3 and 4:
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dts:21.13-30.11: Warning (spi_bus_bridge): /example-0/spi: incorrect #address-cells for SPI bus
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dts:21.13-30.11: Warning (spi_bus_bridge): /example-0/spi: incorrect #size-cells for SPI bus
Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.example.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'

Patch 5 and 6 fix the dtbs_check errors detected by Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dtb: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #address-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2.dtsi:472.23-480.6: Warning (spi_bus_bridge): /soc/apb@d4000000/spi@d4037000: incorrect #size-cells for SPI bus
  also defined at arch/arm/boot/dts/mmp2-olpc-xo-1-75.dts:225.7-237.3
arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: Warning (spi_bus_reg): Failed prerequisite 'spi_bus_bridge'
/root/leizhen/linux-next/arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: slave: 'cmd-gpios' is a required property
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
/root/leizhen/linux-next/arch/arm/boot/dts/mmp2-olpc-xo-1-75.dt.yaml: slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'
        From schema: /root/leizhen/linux-next/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml

I have no good idea for this one, so leave it.
Documentation/devicetree/bindings/pci/xilinx-versal-cpm.example.dts:43.62-47.30: Warning (pci_device_reg): /example-0/versal/pcie@fca10000/interrupt-controller: missing PCI reg property

Zhen Lei (1):
  dt-bindings: misc: add support for both property names cmd-gpios and
    cmd-gpio

 Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

-- 
1.8.3



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 1/1] dt-bindings: misc: add support for both property names cmd-gpios and cmd-gpio
  2020-10-15  4:44 ` Zhen Lei
@ 2020-10-15  4:44   ` Zhen Lei
  -1 siblings, 0 replies; 8+ messages in thread
From: Zhen Lei @ 2020-10-15  4:44 UTC (permalink / raw)
  To: Rob Herring, Pavel Machek, Dan Murphy, linux-leds, Lee Jones,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, Mark Brown,
	linux-spi, Lubomir Rintel, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Zhen Lei

The definition "gpio_suffixes[] = { "gpios", "gpio" }" shows that both
property names "cmd-gpios" and "cmd-gpio" are supported. But currently
only "cmd-gpios" is allowed in this yaml, and the name used in
mmp2-olpc-xo-1-75.dts is cmd-gpio. As a result, the following errors is
reported.

slave: 'cmd-gpios' is a required property
slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
index b3c45c046ba5e37..dd549380a085709 100644
--- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
+++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
@@ -24,15 +24,21 @@ properties:
   compatible:
     const: olpc,xo1.75-ec
 
-  cmd-gpios:
+  spi-cpha: true
+
+patternProperties:
+  "^cmd-gpio[s]?$":
     description: GPIO uspecifier of the CMD pin
     maxItems: 1
 
-  spi-cpha: true
-
 required:
   - compatible
-  - cmd-gpios
+
+oneOf:
+  - required:
+      - cmd-gpio
+  - required:
+      - cmd-gpios
 
 additionalProperties: false
 
-- 
1.8.3



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

* [PATCH v2 1/1] dt-bindings: misc: add support for both property names cmd-gpios and cmd-gpio
@ 2020-10-15  4:44   ` Zhen Lei
  0 siblings, 0 replies; 8+ messages in thread
From: Zhen Lei @ 2020-10-15  4:44 UTC (permalink / raw)
  To: Rob Herring, Pavel Machek, Dan Murphy, linux-leds, Lee Jones,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, Mark Brown,
	linux-spi, Lubomir Rintel, devicetree, linux-arm-kernel,
	linux-kernel
  Cc: Zhen Lei

The definition "gpio_suffixes[] = { "gpios", "gpio" }" shows that both
property names "cmd-gpios" and "cmd-gpio" are supported. But currently
only "cmd-gpios" is allowed in this yaml, and the name used in
mmp2-olpc-xo-1-75.dts is cmd-gpio. As a result, the following errors is
reported.

slave: 'cmd-gpios' is a required property
slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'

Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
---
 Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
index b3c45c046ba5e37..dd549380a085709 100644
--- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
+++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
@@ -24,15 +24,21 @@ properties:
   compatible:
     const: olpc,xo1.75-ec
 
-  cmd-gpios:
+  spi-cpha: true
+
+patternProperties:
+  "^cmd-gpio[s]?$":
     description: GPIO uspecifier of the CMD pin
     maxItems: 1
 
-  spi-cpha: true
-
 required:
   - compatible
-  - cmd-gpios
+
+oneOf:
+  - required:
+      - cmd-gpio
+  - required:
+      - cmd-gpios
 
 additionalProperties: false
 
-- 
1.8.3



_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 1/1] dt-bindings: misc: add support for both property names cmd-gpios and cmd-gpio
  2020-10-15  4:44   ` Zhen Lei
@ 2020-10-15  7:01     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2020-10-15  7:01 UTC (permalink / raw)
  To: Zhen Lei
  Cc: Rob Herring, Pavel Machek, Dan Murphy, linux-leds, Lee Jones,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, Mark Brown,
	linux-spi, Lubomir Rintel, devicetree, linux-arm-kernel,
	linux-kernel

Hi Zhen,

Thanks for your patch!

On Thu, Oct 15, 2020 at 6:52 AM Zhen Lei <thunder.leizhen@huawei.com> wrote:
> The definition "gpio_suffixes[] = { "gpios", "gpio" }" shows that both
> property names "cmd-gpios" and "cmd-gpio" are supported. But currently
> only "cmd-gpios" is allowed in this yaml, and the name used in
> mmp2-olpc-xo-1-75.dts is cmd-gpio. As a result, the following errors is
> reported.
>
> slave: 'cmd-gpios' is a required property
> slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> index b3c45c046ba5e37..dd549380a085709 100644
> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> @@ -24,15 +24,21 @@ properties:
>    compatible:
>      const: olpc,xo1.75-ec
>
> -  cmd-gpios:
> +  spi-cpha: true
> +
> +patternProperties:
> +  "^cmd-gpio[s]?$":
>      description: GPIO uspecifier of the CMD pin
>      maxItems: 1

In general, the *-gpio form is deprecated.  So why complicate the DT
bindings by adding support for deprecated properties?

  1. Explicitly allowing deprecated properties means new users may be
     added,
  2. Once all in-tree DTS files are converted, the warnings will be gone
     anyway,
  3. Out-of-tree DTB will still work, as it's very unlikely support for
     the "gpio" suffix can/will be dropped anytime soon,
  4. If anyone runs the validator on out-of-tree DTS files, the most
     probable intention is to fix any detected issues anyway, and the
     files can be updated, too,
  5. If any out-of-tree code or tooling relies on the *-gpio form, it
     may already be broken.

> -  spi-cpha: true
> -
>  required:
>    - compatible
> -  - cmd-gpios
> +
> +oneOf:
> +  - required:
> +      - cmd-gpio
> +  - required:
> +      - cmd-gpios
>
>  additionalProperties: false

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

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

* Re: [PATCH v2 1/1] dt-bindings: misc: add support for both property names cmd-gpios and cmd-gpio
@ 2020-10-15  7:01     ` Geert Uytterhoeven
  0 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2020-10-15  7:01 UTC (permalink / raw)
  To: Zhen Lei
  Cc: linux-arm-kernel, devicetree, Lubomir Rintel, Lee Jones,
	Mark Brown, linux-kernel, linux-spi, Guenter Roeck, Rob Herring,
	Dan Murphy, Pavel Machek, Enric Balletbo i Serra, Benson Leung,
	linux-leds

Hi Zhen,

Thanks for your patch!

On Thu, Oct 15, 2020 at 6:52 AM Zhen Lei <thunder.leizhen@huawei.com> wrote:
> The definition "gpio_suffixes[] = { "gpios", "gpio" }" shows that both
> property names "cmd-gpios" and "cmd-gpio" are supported. But currently
> only "cmd-gpios" is allowed in this yaml, and the name used in
> mmp2-olpc-xo-1-75.dts is cmd-gpio. As a result, the following errors is
> reported.
>
> slave: 'cmd-gpios' is a required property
> slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'
>
> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
> ---
>  Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> index b3c45c046ba5e37..dd549380a085709 100644
> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
> @@ -24,15 +24,21 @@ properties:
>    compatible:
>      const: olpc,xo1.75-ec
>
> -  cmd-gpios:
> +  spi-cpha: true
> +
> +patternProperties:
> +  "^cmd-gpio[s]?$":
>      description: GPIO uspecifier of the CMD pin
>      maxItems: 1

In general, the *-gpio form is deprecated.  So why complicate the DT
bindings by adding support for deprecated properties?

  1. Explicitly allowing deprecated properties means new users may be
     added,
  2. Once all in-tree DTS files are converted, the warnings will be gone
     anyway,
  3. Out-of-tree DTB will still work, as it's very unlikely support for
     the "gpio" suffix can/will be dropped anytime soon,
  4. If anyone runs the validator on out-of-tree DTS files, the most
     probable intention is to fix any detected issues anyway, and the
     files can be updated, too,
  5. If any out-of-tree code or tooling relies on the *-gpio form, it
     may already be broken.

> -  spi-cpha: true
> -
>  required:
>    - compatible
> -  - cmd-gpios
> +
> +oneOf:
> +  - required:
> +      - cmd-gpio
> +  - required:
> +      - cmd-gpios
>
>  additionalProperties: false

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 1/1] dt-bindings: misc: add support for both property names cmd-gpios and cmd-gpio
  2020-10-15  7:01     ` Geert Uytterhoeven
@ 2020-10-15  7:59       ` Leizhen (ThunderTown)
  -1 siblings, 0 replies; 8+ messages in thread
From: Leizhen (ThunderTown) @ 2020-10-15  7:59 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Rob Herring, Pavel Machek, Dan Murphy, linux-leds, Lee Jones,
	Benson Leung, Enric Balletbo i Serra, Guenter Roeck, Mark Brown,
	linux-spi, Lubomir Rintel, devicetree, linux-arm-kernel,
	linux-kernel



On 2020/10/15 15:01, Geert Uytterhoeven wrote:
> Hi Zhen,
> 
> Thanks for your patch!
> 
> On Thu, Oct 15, 2020 at 6:52 AM Zhen Lei <thunder.leizhen@huawei.com> wrote:
>> The definition "gpio_suffixes[] = { "gpios", "gpio" }" shows that both
>> property names "cmd-gpios" and "cmd-gpio" are supported. But currently
>> only "cmd-gpios" is allowed in this yaml, and the name used in
>> mmp2-olpc-xo-1-75.dts is cmd-gpio. As a result, the following errors is
>> reported.
>>
>> slave: 'cmd-gpios' is a required property
>> slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>  Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> index b3c45c046ba5e37..dd549380a085709 100644
>> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> @@ -24,15 +24,21 @@ properties:
>>    compatible:
>>      const: olpc,xo1.75-ec
>>
>> -  cmd-gpios:
>> +  spi-cpha: true
>> +
>> +patternProperties:
>> +  "^cmd-gpio[s]?$":
>>      description: GPIO uspecifier of the CMD pin
>>      maxItems: 1
> 
> In general, the *-gpio form is deprecated.  So why complicate the DT
> bindings by adding support for deprecated properties?

I just don't know this information. So this patch can be ignored.

> 
>   1. Explicitly allowing deprecated properties means new users may be
>      added,
>   2. Once all in-tree DTS files are converted, the warnings will be gone
>      anyway,
>   3. Out-of-tree DTB will still work, as it's very unlikely support for
>      the "gpio" suffix can/will be dropped anytime soon,
>   4. If anyone runs the validator on out-of-tree DTS files, the most
>      probable intention is to fix any detected issues anyway, and the
>      files can be updated, too,
>   5. If any out-of-tree code or tooling relies on the *-gpio form, it
>      may already be broken.
> 
>> -  spi-cpha: true
>> -
>>  required:
>>    - compatible
>> -  - cmd-gpios
>> +
>> +oneOf:
>> +  - required:
>> +      - cmd-gpio
>> +  - required:
>> +      - cmd-gpios
>>
>>  additionalProperties: false
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 


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

* Re: [PATCH v2 1/1] dt-bindings: misc: add support for both property names cmd-gpios and cmd-gpio
@ 2020-10-15  7:59       ` Leizhen (ThunderTown)
  0 siblings, 0 replies; 8+ messages in thread
From: Leizhen (ThunderTown) @ 2020-10-15  7:59 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: linux-arm-kernel, devicetree, Lubomir Rintel, Lee Jones,
	Mark Brown, linux-kernel, linux-spi, Guenter Roeck, Rob Herring,
	Dan Murphy, Pavel Machek, Enric Balletbo i Serra, Benson Leung,
	linux-leds



On 2020/10/15 15:01, Geert Uytterhoeven wrote:
> Hi Zhen,
> 
> Thanks for your patch!
> 
> On Thu, Oct 15, 2020 at 6:52 AM Zhen Lei <thunder.leizhen@huawei.com> wrote:
>> The definition "gpio_suffixes[] = { "gpios", "gpio" }" shows that both
>> property names "cmd-gpios" and "cmd-gpio" are supported. But currently
>> only "cmd-gpios" is allowed in this yaml, and the name used in
>> mmp2-olpc-xo-1-75.dts is cmd-gpio. As a result, the following errors is
>> reported.
>>
>> slave: 'cmd-gpios' is a required property
>> slave: 'cmd-gpio' does not match any of the regexes: 'pinctrl-[0-9]+'
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>> ---
>>  Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml | 14 ++++++++++----
>>  1 file changed, 10 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> index b3c45c046ba5e37..dd549380a085709 100644
>> --- a/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> +++ b/Documentation/devicetree/bindings/misc/olpc,xo1.75-ec.yaml
>> @@ -24,15 +24,21 @@ properties:
>>    compatible:
>>      const: olpc,xo1.75-ec
>>
>> -  cmd-gpios:
>> +  spi-cpha: true
>> +
>> +patternProperties:
>> +  "^cmd-gpio[s]?$":
>>      description: GPIO uspecifier of the CMD pin
>>      maxItems: 1
> 
> In general, the *-gpio form is deprecated.  So why complicate the DT
> bindings by adding support for deprecated properties?

I just don't know this information. So this patch can be ignored.

> 
>   1. Explicitly allowing deprecated properties means new users may be
>      added,
>   2. Once all in-tree DTS files are converted, the warnings will be gone
>      anyway,
>   3. Out-of-tree DTB will still work, as it's very unlikely support for
>      the "gpio" suffix can/will be dropped anytime soon,
>   4. If anyone runs the validator on out-of-tree DTS files, the most
>      probable intention is to fix any detected issues anyway, and the
>      files can be updated, too,
>   5. If any out-of-tree code or tooling relies on the *-gpio form, it
>      may already be broken.
> 
>> -  spi-cpha: true
>> -
>>  required:
>>    - compatible
>> -  - cmd-gpios
>> +
>> +oneOf:
>> +  - required:
>> +      - cmd-gpio
>> +  - required:
>> +      - cmd-gpios
>>
>>  additionalProperties: false
> 
> Gr{oetje,eeting}s,
> 
>                         Geert
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-10-15  8:01 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-15  4:44 [PATCH v2 0/1] fix all errors except one reported by dt_binding_check Zhen Lei
2020-10-15  4:44 ` Zhen Lei
2020-10-15  4:44 ` [PATCH v2 1/1] dt-bindings: misc: add support for both property names cmd-gpios and cmd-gpio Zhen Lei
2020-10-15  4:44   ` Zhen Lei
2020-10-15  7:01   ` Geert Uytterhoeven
2020-10-15  7:01     ` Geert Uytterhoeven
2020-10-15  7:59     ` Leizhen (ThunderTown)
2020-10-15  7:59       ` Leizhen (ThunderTown)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.