Skip to contentSkip to conversation

dt-bindings: pwm: Allow decimal format in addition to hex format

PATCH In review Tony Lindgren 4 participants 11 messages Nov 22, 2022 – Jan 13, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 dt-bindings: pwm: Allow decimal format in addition to hex format

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

---

Changes since v2:

- Use pattern suggested by Krzysztof and Uwe

Changes since v1:

- New patch added to deal with pwm-omap-dmtimer binding

---
 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/pwm/pwm.yaml +1 -1
@@ -13,7 +13,7 @@ select: false
 
 properties:
   $nodename:
-    pattern: "^pwm(@.*|-[0-9a-f])*$"
+    pattern: "^pwm(@.+|-[0-9a-f]+)?$"
 
   "#pwm-cells":
     description:
Signature · 1 line
2.38.1
#1 lore raw

PATCH v3 2/2 dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml

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 <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Uwe Kleine-König <[email protected]>
Cc Vignesh Raghavendra <[email protected]>

---

Changes since v2:

- Reviewed-by collected from Krzysztof, no changes

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
Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt deleted +0 -22
deleted file mode 100644
@@ -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>;
-	};
Documentation/devicetree/bindings/pwm/ti,omap-dmtimer-pwm.yaml new file +59 -0

59 lines not on this page · raw message

Signature · 1 line
2.38.1
Reviewed-by on v3 1/2
#2 lore raw
In reply to Tony Lindgren
Quoted 9 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

Best regards,
Krzysztof

Acked-by on v3 1/2
#3 lore raw
In reply to Tony Lindgren
Quoted 9 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

Quoted 5 lines

Which tree should this merged through? The obvious candidates are pwm, dt and omap.

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
#4 lore raw
Quoted 16 lines · Uwe Kleine-König
Quoted 9 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

Quoted 5 lines
Quoted 4 lines

Which tree should this merged through? The obvious candidates are pwm, dt and omap.

The dt folks usually queue the binding patches separately.

Regards,

Tony

#5 lore raw

Hello Tony,

Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Uwe Kleine-König
Quoted 14 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

Quoted 6 lines
Quoted 4 lines

Which tree should this merged through? The obvious candidates are pwm, dt and omap.

The dt folks usually queue the binding patches separately.

fine, so I marked your series in the PWM patchwork as "handled-elsewhere".

Best regards
Uwe

Signature · 2 lines
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
maintainer
#6 lore raw
In reply to Tony Lindgren
Quoted 17 lines · Tony Lindgren
Quoted 16 lines · Uwe Kleine-König
Quoted 14 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

Quoted 6 lines
Quoted 4 lines

Which tree should this merged through? The obvious candidates are pwm, dt and omap.

The dt folks usually queue the binding patches separately.

The default is they go thru the subsystem trees, and I mainly pickup what has not after some time (and is standalone binding change).

Rob

maintainer
#7 lore raw
In reply to Tony Lindgren
Quoted 32 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

---

Changes since v2:

- Use pattern suggested by Krzysztof and Uwe

Changes since v1:

- New patch added to deal with pwm-omap-dmtimer binding

---
 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Documentation/devicetree/bindings/pwm/pwm.yaml select: false · line 16

Quoted 5 lines
Documentation/devicetree/bindings/pwm/pwm.yaml +1 -1
@@ -13,7 +13,7 @@ select: false
 
 properties:
   $nodename:
-    pattern: "^pwm(@.*|-[0-9a-f])*$"
+    pattern: "^pwm(@.+|-[0-9a-f]+)?$"

So now pwm-10 could be either?

I'm fine with decimal, but can we do that everywhere we do this -N naming?

Quoted 6 lines
Documentation/devicetree/bindings/pwm/pwm.yaml +0 -0
   "#pwm-cells":
     description:
Signature · 1 line
2.38.1
#8 lore raw
Quoted 34 lines · Rob Herring
Quoted 33 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

---

Changes since v2:

- Use pattern suggested by Krzysztof and Uwe

Changes since v1:

- New patch added to deal with pwm-omap-dmtimer binding

---
 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/pwm/pwm.yaml +0 -0
@@ -13,7 +13,7 @@ select: false
 
Quoted 6 lines

Documentation/devicetree/bindings/pwm/pwm.yaml select: false · line 16

Quoted 4 lines
Documentation/devicetree/bindings/pwm/pwm.yaml +1 -1
 properties:
   $nodename:
-    pattern: "^pwm(@.*|-[0-9a-f])*$"
+    pattern: "^pwm(@.+|-[0-9a-f]+)?$"

So now pwm-10 could be either?

Yes.

Quoted 2 lines

I'm fine with decimal, but can we do that everywhere we do this -N naming?

Do you mean the '[0-9a-f]' users that don't use '[0-9af]+'?

These can be found with:

$ find Documentation/devicetree/bindings/ -name \*.yaml | \
	xargs grep pattern: | grep '\[0-9a-f\]' | grep -v '\[0-9a-f\]+'

Not sure if some of these need to intentionally limit the node numbering to 15.

If you have some other criteria in mind, let me know :)

That sounds like a separate patch though.

Regards,

Tony

maintainer
#9 lore raw
Quoted 42 lines · Tony Lindgren
Quoted 34 lines · Rob Herring
Quoted 33 lines · Tony Lindgren

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 <[email protected]>.

Let's use an improved match suggested by Krzysztof Kozlowski <[email protected]> and improved a bit by Uwe Kleine-König <[email protected]>.

---

Changes since v2:

- Use pattern suggested by Krzysztof and Uwe

Changes since v1:

- New patch added to deal with pwm-omap-dmtimer binding

---
 Documentation/devicetree/bindings/pwm/pwm.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/pwm/pwm.yaml +0 -0
@@ -13,7 +13,7 @@ select: false
 
Quoted 6 lines

Documentation/devicetree/bindings/pwm/pwm.yaml select: false · line 16

Quoted 4 lines
Documentation/devicetree/bindings/pwm/pwm.yaml +1 -1
 properties:
   $nodename:
-    pattern: "^pwm(@.*|-[0-9a-f])*$"
+    pattern: "^pwm(@.+|-[0-9a-f]+)?$"

So now pwm-10 could be either?

Quoted 6 lines

Yes.

Quoted 2 lines

I'm fine with decimal, but can we do that everywhere we do this -N naming?

Do you mean the '[0-9a-f]' users that don't use '[0-9af]+'?

No, I mean for all cases of <nodename>-N, can be we consistent. Either we use hex or we use decimal.

Quoted 5 lines

These can be found with:

$ find Documentation/devicetree/bindings/ -name \*.yaml | \
	xargs grep pattern: | grep '\[0-9a-f\]' | grep -v '\[0-9a-f\]+'

Not quite. It's just cases of '-N':

$ find Documentation/devicetree/bindings/ -name \*.yaml |         xargs grep pattern: | grep '\-\[0-9a-f\]' | grep -v '\[0-9a-f\]+'
Documentation/devicetree/bindings/phy/intel,combo-phy.yaml:    pattern: "combophy(@.*|-[0-9a-f])*$"
Documentation/devicetree/bindings/pwm/pwm.yaml:    pattern: "^pwm(@.*|-[0-9a-f])*$"
Documentation/devicetree/bindings/timestamp/hardware-timestamps-common.yaml:    pattern: "^timestamp(@.*|-[0-9a-f])?$"
Documentation/devicetree/bindings/watchdog/watchdog.yaml:    pattern: "^watchdog(@.*|-[0-9a-f])?$"
Documentation/devicetree/bindings/spi/spi-controller.yaml:    pattern: "^spi(@.*|-[0-9a-f])*$"
Documentation/devicetree/bindings/rtc/rtc.yaml:    pattern: "^rtc(@.*|-[0-9a-f])*$"

And there's probably some more in dtschema.

Quoted 3 lines

Not sure if some of these need to intentionally limit the node numbering to 15.

No, I think it was all just cases of 15 should be enough for anyone.

Quoted 2 lines

If you have some other criteria in mind, let me know :)

If the numbering is hex, then it is as you have it. (Though we can't enforce that.

If it is decimal, then the regex should be ([0-9]|[1-9][0-9]+).

Rob

#10 lore raw

Hi Rob,

Quoted 41 lines · Rob Herring
Quoted 13 lines · Tony Lindgren
Quoted 11 lines · Rob Herring

Documentation/devicetree/bindings/pwm/pwm.yaml select: false · line 16

Quoted 8 lines · Tony Lindgren
Documentation/devicetree/bindings/pwm/pwm.yaml +1 -1
@@ -13,7 +13,7 @@ select: false
 
 properties:
   $nodename:
-    pattern: "^pwm(@.*|-[0-9a-f])*$"
+    pattern: "^pwm(@.+|-[0-9a-f]+)?$"

So now pwm-10 could be either?

Quoted 6 lines

Yes.

Quoted 2 lines

I'm fine with decimal, but can we do that everywhere we do this -N naming?

Do you mean the '[0-9a-f]' users that don't use '[0-9af]+'?

No, I mean for all cases of <nodename>-N, can be we consistent. Either we use hex or we use decimal.

Quoted 5 lines

These can be found with:

$ find Documentation/devicetree/bindings/ -name \*.yaml | \
	xargs grep pattern: | grep '\[0-9a-f\]' | grep -v '\[0-9a-f\]+'

Not quite. It's just cases of '-N':

$ find Documentation/devicetree/bindings/ -name \*.yaml |         xargs grep pattern: | grep '\-\[0-9a-f\]' | grep -v '\[0-9a-f\]+'
Documentation/devicetree/bindings/phy/intel,combo-phy.yaml:    pattern: "combophy(@.*|-[0-9a-f])*$"
Documentation/devicetree/bindings/pwm/pwm.yaml:    pattern: "^pwm(@.*|-[0-9a-f])*$"
Documentation/devicetree/bindings/timestamp/hardware-timestamps-common.yaml:    pattern: "^timestamp(@.*|-[0-9a-f])?$"
Documentation/devicetree/bindings/watchdog/watchdog.yaml:    pattern: "^watchdog(@.*|-[0-9a-f])?$"
Documentation/devicetree/bindings/spi/spi-controller.yaml:    pattern: "^spi(@.*|-[0-9a-f])*$"
Documentation/devicetree/bindings/rtc/rtc.yaml:    pattern: "^rtc(@.*|-[0-9a-f])*$"
Quoted 1 line

And there's probably some more in dtschema.

Looking at this again, not exactly sure still what you want..

Can you please post some initial patch maybe, verbal patches are a bit tricky :)

Regards,

Tony

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel