All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-21 11:55 ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-21 11:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Uwe Kleine-König, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

Let's allow node numbering in decimal format too.

Simple human-readable increments/IDs are usually decimal, hex is only for
addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
--- a/Documentation/devicetree/bindings/pwm/pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
@@ -13,7 +13,7 @@ select: false
 
 properties:
   $nodename:
-    pattern: "^pwm(@.*|-[0-9a-f])*$"
+    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
 
   "#pwm-cells":
     description:
-- 
2.38.1

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

* [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-21 11:55 ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-21 11:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Uwe Kleine-König, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

Let's allow node numbering in decimal format too.

Simple human-readable increments/IDs are usually decimal, hex is only for
addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.

Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
--- a/Documentation/devicetree/bindings/pwm/pwm.yaml
+++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
@@ -13,7 +13,7 @@ select: false
 
 properties:
   $nodename:
-    pattern: "^pwm(@.*|-[0-9a-f])*$"
+    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
 
   "#pwm-cells":
     description:
-- 
2.38.1

_______________________________________________
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] 34+ messages in thread

* [PATCH v2 2/2] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-21 11:55 ` Tony Lindgren
@ 2022-11-21 11:55   ` Tony Lindgren
  -1 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-21 11:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Nishanth Menon,
	Thierry Reding, Uwe Kleine-König, Vignesh Raghavendra,
	Krzysztof Kozlowski

Update for yaml and remove the old txt binding.

As we can replace most of the custom timer API with standard Linux
frameworks such as clock framework, let's tag the properties for
ti,prescaler and ti,clock-source as deprecated.

Cc: Nishanth Menon <nm@ti.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---

Changes since v1:

- Fix issues noticed by Krzysztof

---
 .../bindings/pwm/pwm-omap-dmtimer.txt         | 22 -------
 .../bindings/pwm/ti,omap-dmtimer-pwm.yaml     | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml

diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
deleted file mode 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-* OMAP PWM for dual-mode timers
-
-Required properties:
-- compatible: Shall contain "ti,omap-dmtimer-pwm".
-- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer-dm.yaml for info
-  about these timers.
-- #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
-  the cells format.
-
-Optional properties:
-- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet
-- ti,clock-source: Set dmtimer parent clock, values between 0 and 2:
-  - 0x00 - high-frequency system clock (timer_sys_ck)
-  - 0x01 - 32-kHz always-on clock (timer_32k_ck)
-  - 0x02 - external clock (timer_ext_ck, OMAP2 only)
-
-Example:
-	pwm9: dmtimer-pwm@9 {
-		compatible = "ti,omap-dmtimer-pwm";
-		ti,timers = <&timer9>;
-		#pwm-cells = <3>;
-	};
diff --git a/Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml b/Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml
new file mode 100644
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/ti,omap-dmtimer-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI dual mode timer PWM controller
+
+maintainers:
+  - Tony Lindgren <tony@atomide.com>
+
+description:
+  TI dual mode timer instances have an IO pin for PWM capability
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  compatible:
+    const: ti,omap-dmtimer-pwm
+
+  "#pwm-cells":
+    const: 3
+
+  ti,timers:
+    description: Timer instance phandle for the PWM
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  ti,prescaler:
+    description: |
+      Legacy clock prescaler for timer. The timer counter is prescaled
+      with 2^n where n is the prescaler.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+    deprecated: true
+
+  ti,clock-source:
+    description: |
+      Legacy clock for timer, please use assigned-clocks instead.
+      0x00 - high-frequency system clock (timer_sys_ck)
+      0x01 - 32-kHz always-on clock (timer_32k_ck)
+      0x02 - external clock (timer_ext_ck, OMAP2 only)
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2 ]
+    deprecated: true
+
+required:
+  - compatible
+  - ti,timers
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm9: pwm {
+      compatible = "ti,omap-dmtimer-pwm";
+      ti,timers = <&timer9>;
+      #pwm-cells = <3>;
+    };
-- 
2.38.1

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

* [PATCH v2 2/2] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
@ 2022-11-21 11:55   ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-21 11:55 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Nishanth Menon,
	Thierry Reding, Uwe Kleine-König, Vignesh Raghavendra,
	Krzysztof Kozlowski

Update for yaml and remove the old txt binding.

As we can replace most of the custom timer API with standard Linux
frameworks such as clock framework, let's tag the properties for
ti,prescaler and ti,clock-source as deprecated.

Cc: Nishanth Menon <nm@ti.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---

Changes since v1:

- Fix issues noticed by Krzysztof

---
 .../bindings/pwm/pwm-omap-dmtimer.txt         | 22 -------
 .../bindings/pwm/ti,omap-dmtimer-pwm.yaml     | 59 +++++++++++++++++++
 2 files changed, 59 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml

diff --git a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt b/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
deleted file mode 100644
--- a/Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-* OMAP PWM for dual-mode timers
-
-Required properties:
-- compatible: Shall contain "ti,omap-dmtimer-pwm".
-- ti,timers: phandle to PWM capable OMAP timer. See timer/ti,timer-dm.yaml for info
-  about these timers.
-- #pwm-cells: Should be 3. See pwm.yaml in this directory for a description of
-  the cells format.
-
-Optional properties:
-- ti,prescaler: Should be a value between 0 and 7, see the timers datasheet
-- ti,clock-source: Set dmtimer parent clock, values between 0 and 2:
-  - 0x00 - high-frequency system clock (timer_sys_ck)
-  - 0x01 - 32-kHz always-on clock (timer_32k_ck)
-  - 0x02 - external clock (timer_ext_ck, OMAP2 only)
-
-Example:
-	pwm9: dmtimer-pwm@9 {
-		compatible = "ti,omap-dmtimer-pwm";
-		ti,timers = <&timer9>;
-		#pwm-cells = <3>;
-	};
diff --git a/Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml b/Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml
new file mode 100644
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml
@@ -0,0 +1,59 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/ti,omap-dmtimer-pwm.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: TI dual mode timer PWM controller
+
+maintainers:
+  - Tony Lindgren <tony@atomide.com>
+
+description:
+  TI dual mode timer instances have an IO pin for PWM capability
+
+allOf:
+  - $ref: pwm.yaml#
+
+properties:
+  compatible:
+    const: ti,omap-dmtimer-pwm
+
+  "#pwm-cells":
+    const: 3
+
+  ti,timers:
+    description: Timer instance phandle for the PWM
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  ti,prescaler:
+    description: |
+      Legacy clock prescaler for timer. The timer counter is prescaled
+      with 2^n where n is the prescaler.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
+    deprecated: true
+
+  ti,clock-source:
+    description: |
+      Legacy clock for timer, please use assigned-clocks instead.
+      0x00 - high-frequency system clock (timer_sys_ck)
+      0x01 - 32-kHz always-on clock (timer_32k_ck)
+      0x02 - external clock (timer_ext_ck, OMAP2 only)
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2 ]
+    deprecated: true
+
+required:
+  - compatible
+  - ti,timers
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm9: pwm {
+      compatible = "ti,omap-dmtimer-pwm";
+      ti,timers = <&timer9>;
+      #pwm-cells = <3>;
+    };
-- 
2.38.1

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-21 11:55 ` Tony Lindgren
@ 2022-11-21 12:20   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 12:20 UTC (permalink / raw)
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Uwe Kleine-König, Nishanth Menon, Vignesh Raghavendra

On 21/11/2022 12:55, Tony Lindgren wrote:
> Let's allow node numbering in decimal format too.
> 
> Simple human-readable increments/IDs are usually decimal, hex is only for
> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>


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

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-21 12:20   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 12:20 UTC (permalink / raw)
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Uwe Kleine-König, Nishanth Menon, Vignesh Raghavendra

On 21/11/2022 12:55, Tony Lindgren wrote:
> Let's allow node numbering in decimal format too.
> 
> Simple human-readable increments/IDs are usually decimal, hex is only for
> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>


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

Best regards,
Krzysztof


_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 2/2] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-21 11:55   ` Tony Lindgren
@ 2022-11-21 12:20     ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 12:20 UTC (permalink / raw)
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Nishanth Menon,
	Thierry Reding, Uwe Kleine-König, Vignesh Raghavendra

On 21/11/2022 12:55, Tony Lindgren wrote:
> Update for yaml and remove the old txt binding.
> 
> As we can replace most of the custom timer API with standard Linux
> frameworks such as clock framework, let's tag the properties for
> ti,prescaler and ti,clock-source as deprecated.
> 
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> 


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

Best regards,
Krzysztof


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

* Re: [PATCH v2 2/2] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
@ 2022-11-21 12:20     ` Krzysztof Kozlowski
  0 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 12:20 UTC (permalink / raw)
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Nishanth Menon,
	Thierry Reding, Uwe Kleine-König, Vignesh Raghavendra

On 21/11/2022 12:55, Tony Lindgren wrote:
> Update for yaml and remove the old txt binding.
> 
> As we can replace most of the custom timer API with standard Linux
> frameworks such as clock framework, let's tag the properties for
> ti,prescaler and ti,clock-source as deprecated.
> 
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
> 


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

Best regards,
Krzysztof


_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-21 11:55 ` Tony Lindgren
@ 2022-11-21 14:40   ` Uwe Kleine-König
  -1 siblings, 0 replies; 34+ messages in thread
From: Uwe Kleine-König @ 2022-11-21 14:40 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

[-- Attachment #1: Type: text/plain, Size: 1328 bytes --]

On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> Let's allow node numbering in decimal format too.
> 
> Simple human-readable increments/IDs are usually decimal, hex is only for
> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> @@ -13,7 +13,7 @@ select: false
>  
>  properties:
>    $nodename:
> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"

I wonder why you don't make this:

+    pattern: "^pwm(@.*|-[0-9a-f]*)$"

Is there a use case to match

	pwm-1-2-3-4-5

?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-21 14:40   ` Uwe Kleine-König
  0 siblings, 0 replies; 34+ messages in thread
From: Uwe Kleine-König @ 2022-11-21 14:40 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra


[-- Attachment #1.1: Type: text/plain, Size: 1328 bytes --]

On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> Let's allow node numbering in decimal format too.
> 
> Simple human-readable increments/IDs are usually decimal, hex is only for
> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> 
> Cc: Thierry Reding <thierry.reding@gmail.com>
> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> @@ -13,7 +13,7 @@ select: false
>  
>  properties:
>    $nodename:
> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"

I wonder why you don't make this:

+    pattern: "^pwm(@.*|-[0-9a-f]*)$"

Is there a use case to match

	pwm-1-2-3-4-5

?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-21 14:40   ` Uwe Kleine-König
@ 2022-11-21 14:48     ` Tony Lindgren
  -1 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-21 14:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > Let's allow node numbering in decimal format too.
> > 
> > Simple human-readable increments/IDs are usually decimal, hex is only for
> > addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > 
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > @@ -13,7 +13,7 @@ select: false
> >  
> >  properties:
> >    $nodename:
> > -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> 
> I wonder why you don't make this:
> 
> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"

Hmm but I think this would also pass for node names like pwm-a-foo?

I just used the following to look for similar examples FYI:

$ find Documentation/devicetree/bindings/ -name \*.yaml | \
	xargs grep pattern: | grep '1\[0-'

> Is there a use case to match
> 
> 	pwm-1-2-3-4-5

I don't think so.

Regards,

Tony


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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-21 14:48     ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-21 14:48 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Krzysztof Kozlowski, Nishanth Menon,
	Vignesh Raghavendra

* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > Let's allow node numbering in decimal format too.
> > 
> > Simple human-readable increments/IDs are usually decimal, hex is only for
> > addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > 
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> > ---
> >  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > @@ -13,7 +13,7 @@ select: false
> >  
> >  properties:
> >    $nodename:
> > -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> 
> I wonder why you don't make this:
> 
> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"

Hmm but I think this would also pass for node names like pwm-a-foo?

I just used the following to look for similar examples FYI:

$ find Documentation/devicetree/bindings/ -name \*.yaml | \
	xargs grep pattern: | grep '1\[0-'

> Is there a use case to match
> 
> 	pwm-1-2-3-4-5

I don't think so.

Regards,

Tony


_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-21 14:48     ` Tony Lindgren
@ 2022-11-21 16:15       ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 16:15 UTC (permalink / raw)
  To: Tony Lindgren, Uwe Kleine-König
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Nishanth Menon, Vignesh Raghavendra

On 21/11/2022 15:48, Tony Lindgren wrote:
> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
>>> Let's allow node numbering in decimal format too.
>>>
>>> Simple human-readable increments/IDs are usually decimal, hex is only for
>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
>>>
>>> Cc: Thierry Reding <thierry.reding@gmail.com>
>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>> ---
>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>> @@ -13,7 +13,7 @@ select: false
>>>  
>>>  properties:
>>>    $nodename:
>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
>>
>> I wonder why you don't make this:
>>
>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"

Yes, the '*' should be within ().

> 
> Hmm but I think this would also pass for node names like pwm-a-foo?
> 

No, how?


Best regards,
Krzysztof


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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-21 16:15       ` Krzysztof Kozlowski
  0 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 16:15 UTC (permalink / raw)
  To: Tony Lindgren, Uwe Kleine-König
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Nishanth Menon, Vignesh Raghavendra

On 21/11/2022 15:48, Tony Lindgren wrote:
> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
>>> Let's allow node numbering in decimal format too.
>>>
>>> Simple human-readable increments/IDs are usually decimal, hex is only for
>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
>>>
>>> Cc: Thierry Reding <thierry.reding@gmail.com>
>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>> ---
>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>> @@ -13,7 +13,7 @@ select: false
>>>  
>>>  properties:
>>>    $nodename:
>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
>>
>> I wonder why you don't make this:
>>
>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"

Yes, the '*' should be within ().

> 
> Hmm but I think this would also pass for node names like pwm-a-foo?
> 

No, how?


Best regards,
Krzysztof


_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-21 16:15       ` Krzysztof Kozlowski
@ 2022-11-22  4:43         ` Tony Lindgren
  -1 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22  4:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> On 21/11/2022 15:48, Tony Lindgren wrote:
> > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> >>> Let's allow node numbering in decimal format too.
> >>>
> >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> >>>
> >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> >>> ---
> >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>> @@ -13,7 +13,7 @@ select: false
> >>>  
> >>>  properties:
> >>>    $nodename:
> >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> >>
> >> I wonder why you don't make this:
> >>
> >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> 
> Yes, the '*' should be within ().

Sorry I guess I don't follow. So for what type of naming is the second '*'
actually needed here, or is it needed at all?

We only want to match the following:

pwm@1234

pwm-0
...
pwm-f

And now also:

pwm-0
...
pwm-15

Is there yet another format I'm missing?

> > Hmm but I think this would also pass for node names like pwm-a-foo?
> > 
> 
> No, how?

Because of the second extra '*' there :)

Regards,

Tony

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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22  4:43         ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22  4:43 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> On 21/11/2022 15:48, Tony Lindgren wrote:
> > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> >>> Let's allow node numbering in decimal format too.
> >>>
> >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> >>>
> >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> >>> ---
> >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>
> >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>> @@ -13,7 +13,7 @@ select: false
> >>>  
> >>>  properties:
> >>>    $nodename:
> >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> >>
> >> I wonder why you don't make this:
> >>
> >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> 
> Yes, the '*' should be within ().

Sorry I guess I don't follow. So for what type of naming is the second '*'
actually needed here, or is it needed at all?

We only want to match the following:

pwm@1234

pwm-0
...
pwm-f

And now also:

pwm-0
...
pwm-15

Is there yet another format I'm missing?

> > Hmm but I think this would also pass for node names like pwm-a-foo?
> > 
> 
> No, how?

Because of the second extra '*' there :)

Regards,

Tony

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22  4:43         ` Tony Lindgren
@ 2022-11-22  7:36           ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-22  7:36 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

On 22/11/2022 05:43, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
>> On 21/11/2022 15:48, Tony Lindgren wrote:
>>> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
>>>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
>>>>> Let's allow node numbering in decimal format too.
>>>>>
>>>>> Simple human-readable increments/IDs are usually decimal, hex is only for
>>>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
>>>>>
>>>>> Cc: Thierry Reding <thierry.reding@gmail.com>
>>>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>>>> ---
>>>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>> @@ -13,7 +13,7 @@ select: false
>>>>>  
>>>>>  properties:
>>>>>    $nodename:
>>>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
>>>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
>>>>
>>>> I wonder why you don't make this:
>>>>
>>>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
>>
>> Yes, the '*' should be within ().
> 
> Sorry I guess I don't follow. So for what type of naming is the second '*'
> actually needed here, or is it needed at all?
> 
> We only want to match the following:
> 
> pwm@1234
> 
> pwm-0
> ...
> pwm-f
> 
> And now also:
> 
> pwm-0
> ...
> pwm-15
> 
> Is there yet another format I'm missing?
> 
>>> Hmm but I think this would also pass for node names like pwm-a-foo?
>>>
>>
>> No, how?
> 
> Because of the second extra '*' there :)

It cannot multiple dashes...

> 
> Regards,
> 
> Tony

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22  7:36           ` Krzysztof Kozlowski
  0 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-22  7:36 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

On 22/11/2022 05:43, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
>> On 21/11/2022 15:48, Tony Lindgren wrote:
>>> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
>>>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
>>>>> Let's allow node numbering in decimal format too.
>>>>>
>>>>> Simple human-readable increments/IDs are usually decimal, hex is only for
>>>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
>>>>>
>>>>> Cc: Thierry Reding <thierry.reding@gmail.com>
>>>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>>>> ---
>>>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>> @@ -13,7 +13,7 @@ select: false
>>>>>  
>>>>>  properties:
>>>>>    $nodename:
>>>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
>>>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
>>>>
>>>> I wonder why you don't make this:
>>>>
>>>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
>>
>> Yes, the '*' should be within ().
> 
> Sorry I guess I don't follow. So for what type of naming is the second '*'
> actually needed here, or is it needed at all?
> 
> We only want to match the following:
> 
> pwm@1234
> 
> pwm-0
> ...
> pwm-f
> 
> And now also:
> 
> pwm-0
> ...
> pwm-15
> 
> Is there yet another format I'm missing?
> 
>>> Hmm but I think this would also pass for node names like pwm-a-foo?
>>>
>>
>> No, how?
> 
> Because of the second extra '*' there :)

It cannot multiple dashes...

> 
> Regards,
> 
> Tony

Best regards,
Krzysztof


_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22  7:36           ` Krzysztof Kozlowski
@ 2022-11-22  8:11             ` Tony Lindgren
  -1 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22  8:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221122 07:26]:
> On 22/11/2022 05:43, Tony Lindgren wrote:
> > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> >> On 21/11/2022 15:48, Tony Lindgren wrote:
> >>> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> >>>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> >>>>> Let's allow node numbering in decimal format too.
> >>>>>
> >>>>> Simple human-readable increments/IDs are usually decimal, hex is only for
> >>>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> >>>>>
> >>>>> Cc: Thierry Reding <thierry.reding@gmail.com>
> >>>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >>>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> >>>>> ---
> >>>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> >>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>>>> @@ -13,7 +13,7 @@ select: false
> >>>>>  
> >>>>>  properties:
> >>>>>    $nodename:
> >>>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> >>>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> >>>>
> >>>> I wonder why you don't make this:
> >>>>
> >>>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> >>
> >> Yes, the '*' should be within ().
> > 
> > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > actually needed here, or is it needed at all?
> > 
> > We only want to match the following:
> > 
> > pwm@1234
> > 
> > pwm-0
> > ...
> > pwm-f
> > 
> > And now also:
> > 
> > pwm-0
> > ...
> > pwm-15
> > 
> > Is there yet another format I'm missing?
> > 
> >>> Hmm but I think this would also pass for node names like pwm-a-foo?
> >>>
> >>
> >> No, how?
> > 
> > Because of the second extra '*' there :)
> 
> It cannot multiple dashes...

Sorry I'm still confused.. Care to specify what match do you want to
use here and why?

Regards,

Tony

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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22  8:11             ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22  8:11 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221122 07:26]:
> On 22/11/2022 05:43, Tony Lindgren wrote:
> > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> >> On 21/11/2022 15:48, Tony Lindgren wrote:
> >>> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> >>>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> >>>>> Let's allow node numbering in decimal format too.
> >>>>>
> >>>>> Simple human-readable increments/IDs are usually decimal, hex is only for
> >>>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> >>>>>
> >>>>> Cc: Thierry Reding <thierry.reding@gmail.com>
> >>>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> >>>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> >>>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> >>>>> ---
> >>>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> >>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>>>>
> >>>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> >>>>> @@ -13,7 +13,7 @@ select: false
> >>>>>  
> >>>>>  properties:
> >>>>>    $nodename:
> >>>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> >>>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> >>>>
> >>>> I wonder why you don't make this:
> >>>>
> >>>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> >>
> >> Yes, the '*' should be within ().
> > 
> > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > actually needed here, or is it needed at all?
> > 
> > We only want to match the following:
> > 
> > pwm@1234
> > 
> > pwm-0
> > ...
> > pwm-f
> > 
> > And now also:
> > 
> > pwm-0
> > ...
> > pwm-15
> > 
> > Is there yet another format I'm missing?
> > 
> >>> Hmm but I think this would also pass for node names like pwm-a-foo?
> >>>
> >>
> >> No, how?
> > 
> > Because of the second extra '*' there :)
> 
> It cannot multiple dashes...

Sorry I'm still confused.. Care to specify what match do you want to
use here and why?

Regards,

Tony

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22  8:11             ` Tony Lindgren
@ 2022-11-22  8:29               ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-22  8:29 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

On 22/11/2022 09:11, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221122 07:26]:
>> On 22/11/2022 05:43, Tony Lindgren wrote:
>>> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
>>>> On 21/11/2022 15:48, Tony Lindgren wrote:
>>>>> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
>>>>>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
>>>>>>> Let's allow node numbering in decimal format too.
>>>>>>>
>>>>>>> Simple human-readable increments/IDs are usually decimal, hex is only for
>>>>>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
>>>>>>>
>>>>>>> Cc: Thierry Reding <thierry.reding@gmail.com>
>>>>>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>>>>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>>>>>> ---
>>>>>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>>>> @@ -13,7 +13,7 @@ select: false
>>>>>>>  
>>>>>>>  properties:
>>>>>>>    $nodename:
>>>>>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
>>>>>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
>>>>>>
>>>>>> I wonder why you don't make this:
>>>>>>
>>>>>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
>>>>
>>>> Yes, the '*' should be within ().
>>>
>>> Sorry I guess I don't follow. So for what type of naming is the second '*'
>>> actually needed here, or is it needed at all?
>>>
>>> We only want to match the following:
>>>
>>> pwm@1234
>>>
>>> pwm-0
>>> ...
>>> pwm-f
>>>
>>> And now also:
>>>
>>> pwm-0
>>> ...
>>> pwm-15
>>>
>>> Is there yet another format I'm missing?
>>>
>>>>> Hmm but I think this would also pass for node names like pwm-a-foo?
>>>>>
>>>>
>>>> No, how?
>>>
>>> Because of the second extra '*' there :)
>>
>> It cannot multiple dashes...

Yeah, it should be - it cannot match multiple dashes...

> 
> Sorry I'm still confused.. Care to specify what match do you want to
> use here and why?

Pattern:
-[0-9a-f]*
cannot match -1-2-3 because it does not cover the dash.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22  8:29               ` Krzysztof Kozlowski
  0 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-22  8:29 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

On 22/11/2022 09:11, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221122 07:26]:
>> On 22/11/2022 05:43, Tony Lindgren wrote:
>>> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
>>>> On 21/11/2022 15:48, Tony Lindgren wrote:
>>>>> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
>>>>>> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
>>>>>>> Let's allow node numbering in decimal format too.
>>>>>>>
>>>>>>> Simple human-readable increments/IDs are usually decimal, hex is only for
>>>>>>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
>>>>>>>
>>>>>>> Cc: Thierry Reding <thierry.reding@gmail.com>
>>>>>>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>>>>>>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>>>>> Signed-off-by: Tony Lindgren <tony@atomide.com>
>>>>>>> ---
>>>>>>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
>>>>>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>>>>>
>>>>>>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>>>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>>>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
>>>>>>> @@ -13,7 +13,7 @@ select: false
>>>>>>>  
>>>>>>>  properties:
>>>>>>>    $nodename:
>>>>>>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
>>>>>>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
>>>>>>
>>>>>> I wonder why you don't make this:
>>>>>>
>>>>>> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
>>>>
>>>> Yes, the '*' should be within ().
>>>
>>> Sorry I guess I don't follow. So for what type of naming is the second '*'
>>> actually needed here, or is it needed at all?
>>>
>>> We only want to match the following:
>>>
>>> pwm@1234
>>>
>>> pwm-0
>>> ...
>>> pwm-f
>>>
>>> And now also:
>>>
>>> pwm-0
>>> ...
>>> pwm-15
>>>
>>> Is there yet another format I'm missing?
>>>
>>>>> Hmm but I think this would also pass for node names like pwm-a-foo?
>>>>>
>>>>
>>>> No, how?
>>>
>>> Because of the second extra '*' there :)
>>
>> It cannot multiple dashes...

Yeah, it should be - it cannot match multiple dashes...

> 
> Sorry I'm still confused.. Care to specify what match do you want to
> use here and why?

Pattern:
-[0-9a-f]*
cannot match -1-2-3 because it does not cover the dash.

Best regards,
Krzysztof


_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22  4:43         ` Tony Lindgren
@ 2022-11-22  9:36           ` Uwe Kleine-König
  -1 siblings, 0 replies; 34+ messages in thread
From: Uwe Kleine-König @ 2022-11-22  9:36 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

[-- Attachment #1: Type: text/plain, Size: 2670 bytes --]

On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > >>> Let's allow node numbering in decimal format too.
> > >>>
> > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > >>>
> > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > >>> ---
> > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > >>> @@ -13,7 +13,7 @@ select: false
> > >>>  
> > >>>  properties:
> > >>>    $nodename:
> > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > >>
> > >> I wonder why you don't make this:
> > >>
> > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > 
> > Yes, the '*' should be within ().
> 
> Sorry I guess I don't follow. So for what type of naming is the second '*'
> actually needed here, or is it needed at all?
> 
> We only want to match the following:
> 
> pwm@1234
> 
> pwm-0
> ...
> pwm-f
> 
> And now also:
> 
> pwm-0
> ...
> pwm-15
> 
> Is there yet another format I'm missing?

I think there is a misunderstanding about the type of pattern here. Do
we talk about a shell pattern where "[0-9a-f]*" matches a name starting
with a hex digit followed by any number of any caracter, or is it a
regexp where the * means "any number of the preceding pattern", so
effectively a word consisting of only hex digits.

The .* part makes me think we're talking about a regexp, so the old
pattern ("^pwm(@.*|-[0-9a-f])*$") means that

	pwm-1-2-3-4

is allowed but

	pwm-10

isn't. And I think what we want is:

	"^pwm(@.*|-[0-9a-f]*)$"

(or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22  9:36           ` Uwe Kleine-König
  0 siblings, 0 replies; 34+ messages in thread
From: Uwe Kleine-König @ 2022-11-22  9:36 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra


[-- Attachment #1.1: Type: text/plain, Size: 2670 bytes --]

On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > >>> Let's allow node numbering in decimal format too.
> > >>>
> > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > >>>
> > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > >>> ---
> > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > >>>
> > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > >>> @@ -13,7 +13,7 @@ select: false
> > >>>  
> > >>>  properties:
> > >>>    $nodename:
> > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > >>
> > >> I wonder why you don't make this:
> > >>
> > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > 
> > Yes, the '*' should be within ().
> 
> Sorry I guess I don't follow. So for what type of naming is the second '*'
> actually needed here, or is it needed at all?
> 
> We only want to match the following:
> 
> pwm@1234
> 
> pwm-0
> ...
> pwm-f
> 
> And now also:
> 
> pwm-0
> ...
> pwm-15
> 
> Is there yet another format I'm missing?

I think there is a misunderstanding about the type of pattern here. Do
we talk about a shell pattern where "[0-9a-f]*" matches a name starting
with a hex digit followed by any number of any caracter, or is it a
regexp where the * means "any number of the preceding pattern", so
effectively a word consisting of only hex digits.

The .* part makes me think we're talking about a regexp, so the old
pattern ("^pwm(@.*|-[0-9a-f])*$") means that

	pwm-1-2-3-4

is allowed but

	pwm-10

isn't. And I think what we want is:

	"^pwm(@.*|-[0-9a-f]*)$"

(or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22  9:36           ` Uwe Kleine-König
@ 2022-11-22 10:37             ` Tony Lindgren
  -1 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22 10:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > >>> Let's allow node numbering in decimal format too.
> > > >>>
> > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > >>>
> > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > >>> ---
> > > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >>>
> > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > >>> @@ -13,7 +13,7 @@ select: false
> > > >>>  
> > > >>>  properties:
> > > >>>    $nodename:
> > > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > >>
> > > >> I wonder why you don't make this:
> > > >>
> > > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > 
> > > Yes, the '*' should be within ().
> > 
> > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > actually needed here, or is it needed at all?
> > 
> > We only want to match the following:
> > 
> > pwm@1234
> > 
> > pwm-0
> > ...
> > pwm-f
> > 
> > And now also:
> > 
> > pwm-0
> > ...
> > pwm-15
> > 
> > Is there yet another format I'm missing?
> 
> I think there is a misunderstanding about the type of pattern here. Do
> we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> with a hex digit followed by any number of any caracter, or is it a
> regexp where the * means "any number of the preceding pattern", so
> effectively a word consisting of only hex digits.
> 
> The .* part makes me think we're talking about a regexp, so the old
> pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> 
> 	pwm-1-2-3-4
> 
> is allowed but
> 
> 	pwm-10
> 
> isn't. And I think what we want is:
> 
> 	"^pwm(@.*|-[0-9a-f]*)$"

Heh so this fails for just node name pwm:

pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'

Maybe that's why the second '..)*$' was there originally for?
And adding it back there fixes pwm but allows pwm-1-2-3..

> (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)

And this too fails for just pwm node name.

Regards,

Tony

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22 10:37             ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22 10:37 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > >>> Let's allow node numbering in decimal format too.
> > > >>>
> > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > >>>
> > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > >>> ---
> > > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >>>
> > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > >>> @@ -13,7 +13,7 @@ select: false
> > > >>>  
> > > >>>  properties:
> > > >>>    $nodename:
> > > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > >>
> > > >> I wonder why you don't make this:
> > > >>
> > > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > 
> > > Yes, the '*' should be within ().
> > 
> > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > actually needed here, or is it needed at all?
> > 
> > We only want to match the following:
> > 
> > pwm@1234
> > 
> > pwm-0
> > ...
> > pwm-f
> > 
> > And now also:
> > 
> > pwm-0
> > ...
> > pwm-15
> > 
> > Is there yet another format I'm missing?
> 
> I think there is a misunderstanding about the type of pattern here. Do
> we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> with a hex digit followed by any number of any caracter, or is it a
> regexp where the * means "any number of the preceding pattern", so
> effectively a word consisting of only hex digits.
> 
> The .* part makes me think we're talking about a regexp, so the old
> pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> 
> 	pwm-1-2-3-4
> 
> is allowed but
> 
> 	pwm-10
> 
> isn't. And I think what we want is:
> 
> 	"^pwm(@.*|-[0-9a-f]*)$"

Heh so this fails for just node name pwm:

pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'

Maybe that's why the second '..)*$' was there originally for?
And adding it back there fixes pwm but allows pwm-1-2-3..

> (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)

And this too fails for just pwm node name.

Regards,

Tony

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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22 10:37             ` Tony Lindgren
@ 2022-11-22 10:57               ` Uwe Kleine-König
  -1 siblings, 0 replies; 34+ messages in thread
From: Uwe Kleine-König @ 2022-11-22 10:57 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

[-- Attachment #1: Type: text/plain, Size: 3445 bytes --]

On Tue, Nov 22, 2022 at 12:37:26PM +0200, Tony Lindgren wrote:
> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> > On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > > >>> Let's allow node numbering in decimal format too.
> > > > >>>
> > > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > > >>>
> > > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > > >>> ---
> > > > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >>>
> > > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > >>> @@ -13,7 +13,7 @@ select: false
> > > > >>>  
> > > > >>>  properties:
> > > > >>>    $nodename:
> > > > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > > >>
> > > > >> I wonder why you don't make this:
> > > > >>
> > > > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > > 
> > > > Yes, the '*' should be within ().
> > > 
> > > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > > actually needed here, or is it needed at all?
> > > 
> > > We only want to match the following:
> > > 
> > > pwm@1234
> > > 
> > > pwm-0
> > > ...
> > > pwm-f
> > > 
> > > And now also:
> > > 
> > > pwm-0
> > > ...
> > > pwm-15
> > > 
> > > Is there yet another format I'm missing?
> > 
> > I think there is a misunderstanding about the type of pattern here. Do
> > we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> > with a hex digit followed by any number of any caracter, or is it a
> > regexp where the * means "any number of the preceding pattern", so
> > effectively a word consisting of only hex digits.
> > 
> > The .* part makes me think we're talking about a regexp, so the old
> > pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> > 
> > 	pwm-1-2-3-4
> > 
> > is allowed but
> > 
> > 	pwm-10
> > 
> > isn't. And I think what we want is:
> > 
> > 	"^pwm(@.*|-[0-9a-f]*)$"
> 
> Heh so this fails for just node name pwm:
> 
> pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'
> 
> Maybe that's why the second '..)*$' was there originally for?
> And adding it back there fixes pwm but allows pwm-1-2-3..
> 
> > (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)
> 
> And this too fails for just pwm node name.

Then let's pick:


	"^pwm(@.+|-[0-9a-f]+)?$"

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22 10:57               ` Uwe Kleine-König
  0 siblings, 0 replies; 34+ messages in thread
From: Uwe Kleine-König @ 2022-11-22 10:57 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra


[-- Attachment #1.1: Type: text/plain, Size: 3445 bytes --]

On Tue, Nov 22, 2022 at 12:37:26PM +0200, Tony Lindgren wrote:
> * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> > On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > > >>> Let's allow node numbering in decimal format too.
> > > > >>>
> > > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > > >>>
> > > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > > >>> ---
> > > > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >>>
> > > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > >>> @@ -13,7 +13,7 @@ select: false
> > > > >>>  
> > > > >>>  properties:
> > > > >>>    $nodename:
> > > > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > > >>
> > > > >> I wonder why you don't make this:
> > > > >>
> > > > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > > 
> > > > Yes, the '*' should be within ().
> > > 
> > > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > > actually needed here, or is it needed at all?
> > > 
> > > We only want to match the following:
> > > 
> > > pwm@1234
> > > 
> > > pwm-0
> > > ...
> > > pwm-f
> > > 
> > > And now also:
> > > 
> > > pwm-0
> > > ...
> > > pwm-15
> > > 
> > > Is there yet another format I'm missing?
> > 
> > I think there is a misunderstanding about the type of pattern here. Do
> > we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> > with a hex digit followed by any number of any caracter, or is it a
> > regexp where the * means "any number of the preceding pattern", so
> > effectively a word consisting of only hex digits.
> > 
> > The .* part makes me think we're talking about a regexp, so the old
> > pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> > 
> > 	pwm-1-2-3-4
> > 
> > is allowed but
> > 
> > 	pwm-10
> > 
> > isn't. And I think what we want is:
> > 
> > 	"^pwm(@.*|-[0-9a-f]*)$"
> 
> Heh so this fails for just node name pwm:
> 
> pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'
> 
> Maybe that's why the second '..)*$' was there originally for?
> And adding it back there fixes pwm but allows pwm-1-2-3..
> 
> > (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)
> 
> And this too fails for just pwm node name.

Then let's pick:


	"^pwm(@.+|-[0-9a-f]+)?$"

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

[-- Attachment #2: Type: text/plain, Size: 176 bytes --]

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22 10:57               ` Uwe Kleine-König
@ 2022-11-22 11:11                 ` Tony Lindgren
  -1 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22 11:11 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 10:47]:
> On Tue, Nov 22, 2022 at 12:37:26PM +0200, Tony Lindgren wrote:
> > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> > > On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > > > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > > > >>> Let's allow node numbering in decimal format too.
> > > > > >>>
> > > > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > > > >>>
> > > > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > > > >>> ---
> > > > > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > > > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >>>
> > > > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> @@ -13,7 +13,7 @@ select: false
> > > > > >>>  
> > > > > >>>  properties:
> > > > > >>>    $nodename:
> > > > > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > > > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > > > >>
> > > > > >> I wonder why you don't make this:
> > > > > >>
> > > > > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > > > 
> > > > > Yes, the '*' should be within ().
> > > > 
> > > > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > > > actually needed here, or is it needed at all?
> > > > 
> > > > We only want to match the following:
> > > > 
> > > > pwm@1234
> > > > 
> > > > pwm-0
> > > > ...
> > > > pwm-f
> > > > 
> > > > And now also:
> > > > 
> > > > pwm-0
> > > > ...
> > > > pwm-15
> > > > 
> > > > Is there yet another format I'm missing?
> > > 
> > > I think there is a misunderstanding about the type of pattern here. Do
> > > we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> > > with a hex digit followed by any number of any caracter, or is it a
> > > regexp where the * means "any number of the preceding pattern", so
> > > effectively a word consisting of only hex digits.
> > > 
> > > The .* part makes me think we're talking about a regexp, so the old
> > > pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> > > 
> > > 	pwm-1-2-3-4
> > > 
> > > is allowed but
> > > 
> > > 	pwm-10
> > > 
> > > isn't. And I think what we want is:
> > > 
> > > 	"^pwm(@.*|-[0-9a-f]*)$"
> > 
> > Heh so this fails for just node name pwm:
> > 
> > pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'
> > 
> > Maybe that's why the second '..)*$' was there originally for?
> > And adding it back there fixes pwm but allows pwm-1-2-3..
> > 
> > > (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)
> > 
> > And this too fails for just pwm node name.
> 
> Then let's pick:
> 
> 
> 	"^pwm(@.+|-[0-9a-f]+)?$"

That works for pwm and pwm-11, but now fails for pwm11 :)

Tony

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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22 11:11                 ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22 11:11 UTC (permalink / raw)
  To: Uwe Kleine-König
  Cc: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 10:47]:
> On Tue, Nov 22, 2022 at 12:37:26PM +0200, Tony Lindgren wrote:
> > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221122 09:26]:
> > > On Tue, Nov 22, 2022 at 06:43:55AM +0200, Tony Lindgren wrote:
> > > > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 16:05]:
> > > > > On 21/11/2022 15:48, Tony Lindgren wrote:
> > > > > > * Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [221121 14:30]:
> > > > > >> On Mon, Nov 21, 2022 at 01:55:24PM +0200, Tony Lindgren wrote:
> > > > > >>> Let's allow node numbering in decimal format too.
> > > > > >>>
> > > > > >>> Simple human-readable increments/IDs are usually decimal, hex is only for
> > > > > >>> addresses as noted by Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>.
> > > > > >>>
> > > > > >>> Cc: Thierry Reding <thierry.reding@gmail.com>
> > > > > >>> Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> > > > > >>> Suggested-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
> > > > > >>> Signed-off-by: Tony Lindgren <tony@atomide.com>
> > > > > >>> ---
> > > > > >>>  Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
> > > > > >>>  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >>>
> > > > > >>> diff --git a/Documentation/devicetree/bindings/pwm/pwm.yaml b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> --- a/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> +++ b/Documentation/devicetree/bindings/pwm/pwm.yaml
> > > > > >>> @@ -13,7 +13,7 @@ select: false
> > > > > >>>  
> > > > > >>>  properties:
> > > > > >>>    $nodename:
> > > > > >>> -    pattern: "^pwm(@.*|-[0-9a-f])*$"
> > > > > >>> +    pattern: "^pwm(@.*|-([0-9a-f]|1[0-5]))*$"
> > > > > >>
> > > > > >> I wonder why you don't make this:
> > > > > >>
> > > > > >> +    pattern: "^pwm(@.*|-[0-9a-f]*)$"
> > > > > 
> > > > > Yes, the '*' should be within ().
> > > > 
> > > > Sorry I guess I don't follow. So for what type of naming is the second '*'
> > > > actually needed here, or is it needed at all?
> > > > 
> > > > We only want to match the following:
> > > > 
> > > > pwm@1234
> > > > 
> > > > pwm-0
> > > > ...
> > > > pwm-f
> > > > 
> > > > And now also:
> > > > 
> > > > pwm-0
> > > > ...
> > > > pwm-15
> > > > 
> > > > Is there yet another format I'm missing?
> > > 
> > > I think there is a misunderstanding about the type of pattern here. Do
> > > we talk about a shell pattern where "[0-9a-f]*" matches a name starting
> > > with a hex digit followed by any number of any caracter, or is it a
> > > regexp where the * means "any number of the preceding pattern", so
> > > effectively a word consisting of only hex digits.
> > > 
> > > The .* part makes me think we're talking about a regexp, so the old
> > > pattern ("^pwm(@.*|-[0-9a-f])*$") means that
> > > 
> > > 	pwm-1-2-3-4
> > > 
> > > is allowed but
> > > 
> > > 	pwm-10
> > > 
> > > isn't. And I think what we want is:
> > > 
> > > 	"^pwm(@.*|-[0-9a-f]*)$"
> > 
> > Heh so this fails for just node name pwm:
> > 
> > pwm: $nodename:0: 'pwm' does not match '^pwm(@.*|-[0-9a-f]*)$'
> > 
> > Maybe that's why the second '..)*$' was there originally for?
> > And adding it back there fixes pwm but allows pwm-1-2-3..
> > 
> > > (or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)
> > 
> > And this too fails for just pwm node name.
> 
> Then let's pick:
> 
> 
> 	"^pwm(@.+|-[0-9a-f]+)?$"

That works for pwm and pwm-11, but now fails for pwm11 :)

Tony

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22 11:11                 ` Tony Lindgren
@ 2022-11-22 11:30                   ` Krzysztof Kozlowski
  -1 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-22 11:30 UTC (permalink / raw)
  To: Tony Lindgren, Uwe Kleine-König
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Nishanth Menon, Vignesh Raghavendra

On 22/11/2022 12:11, Tony Lindgren wrote:
>> Then let's pick:
>>
>>
>> 	"^pwm(@.+|-[0-9a-f]+)?$"
> 
> That works for pwm and pwm-11, but now fails for pwm11 :)

Which was never valid, so no problem.

Best regards,
Krzysztof


_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22 11:30                   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 34+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-22 11:30 UTC (permalink / raw)
  To: Tony Lindgren, Uwe Kleine-König
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Thierry Reding, Nishanth Menon, Vignesh Raghavendra

On 22/11/2022 12:11, Tony Lindgren wrote:
>> Then let's pick:
>>
>>
>> 	"^pwm(@.+|-[0-9a-f]+)?$"
> 
> That works for pwm and pwm-11, but now fails for pwm11 :)

Which was never valid, so no problem.

Best regards,
Krzysztof


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

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
  2022-11-22 11:30                   ` Krzysztof Kozlowski
@ 2022-11-22 11:40                     ` Tony Lindgren
  -1 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22 11:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221122 11:20]:
> On 22/11/2022 12:11, Tony Lindgren wrote:
> >> Then let's pick:
> >>
> >>
> >> 	"^pwm(@.+|-[0-9a-f]+)?$"
> > 
> > That works for pwm and pwm-11, but now fails for pwm11 :)
> 
> Which was never valid, so no problem.

OK, let's go with that then! Thanks Krzysztof & Uwe, I'll post
updated patches.

Regards,

Tony

_______________________________________________
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] 34+ messages in thread

* Re: [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format
@ 2022-11-22 11:40                     ` Tony Lindgren
  0 siblings, 0 replies; 34+ messages in thread
From: Tony Lindgren @ 2022-11-22 11:40 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Uwe Kleine-König, Rob Herring, Krzysztof Kozlowski,
	devicetree, linux-arm-kernel, linux-omap, Thierry Reding,
	Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221122 11:20]:
> On 22/11/2022 12:11, Tony Lindgren wrote:
> >> Then let's pick:
> >>
> >>
> >> 	"^pwm(@.+|-[0-9a-f]+)?$"
> > 
> > That works for pwm and pwm-11, but now fails for pwm11 :)
> 
> Which was never valid, so no problem.

OK, let's go with that then! Thanks Krzysztof & Uwe, I'll post
updated patches.

Regards,

Tony

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

end of thread, other threads:[~2022-11-22 11:43 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-21 11:55 [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format Tony Lindgren
2022-11-21 11:55 ` Tony Lindgren
2022-11-21 11:55 ` [PATCH v2 2/2] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml Tony Lindgren
2022-11-21 11:55   ` Tony Lindgren
2022-11-21 12:20   ` Krzysztof Kozlowski
2022-11-21 12:20     ` Krzysztof Kozlowski
2022-11-21 12:20 ` [PATCH v2 1/2] dt-bindings: pwm: Allow decimal format in addition to hex format Krzysztof Kozlowski
2022-11-21 12:20   ` Krzysztof Kozlowski
2022-11-21 14:40 ` Uwe Kleine-König
2022-11-21 14:40   ` Uwe Kleine-König
2022-11-21 14:48   ` Tony Lindgren
2022-11-21 14:48     ` Tony Lindgren
2022-11-21 16:15     ` Krzysztof Kozlowski
2022-11-21 16:15       ` Krzysztof Kozlowski
2022-11-22  4:43       ` Tony Lindgren
2022-11-22  4:43         ` Tony Lindgren
2022-11-22  7:36         ` Krzysztof Kozlowski
2022-11-22  7:36           ` Krzysztof Kozlowski
2022-11-22  8:11           ` Tony Lindgren
2022-11-22  8:11             ` Tony Lindgren
2022-11-22  8:29             ` Krzysztof Kozlowski
2022-11-22  8:29               ` Krzysztof Kozlowski
2022-11-22  9:36         ` Uwe Kleine-König
2022-11-22  9:36           ` Uwe Kleine-König
2022-11-22 10:37           ` Tony Lindgren
2022-11-22 10:37             ` Tony Lindgren
2022-11-22 10:57             ` Uwe Kleine-König
2022-11-22 10:57               ` Uwe Kleine-König
2022-11-22 11:11               ` Tony Lindgren
2022-11-22 11:11                 ` Tony Lindgren
2022-11-22 11:30                 ` Krzysztof Kozlowski
2022-11-22 11:30                   ` Krzysztof Kozlowski
2022-11-22 11:40                   ` Tony Lindgren
2022-11-22 11:40                     ` Tony Lindgren

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.