dt-bindings: pwm: Allow decimal format in addition to hex format
Subsystems (2)
PATCH v2 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]>.
--- 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]|1[0-5]))*$" "#pwm-cells": description:
Signature · 1 line
2.38.1
PATCH v2 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.
---
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
@@ -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
Re: [PATCH v2 2/2] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
Quoted 6 lines · Tony Lindgren
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.
Quoted 7 lines
Cc Nishanth Menon <[email protected]>Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Cc Vignesh Raghavendra <[email protected]>Signed-off-by Tony Lindgren <[email protected]>---
Best regards,
Krzysztof
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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>
Best regards,
Krzysztof
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|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
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Quoted 19 lines · Uwe Kleine-König
Quoted 18 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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 8 lines
Documentation/devicetree/bindings/pwm/pwm.yaml select: false · line 16
Quoted 4 lines
Documentation/devicetree/bindings/pwm/pwm.yaml +1
-1properties: $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-'
Quoted 3 lines
Is there a use case to match
pwm-1-2-3-4-5
I don't think so.
Regards,
Tony
Quoted 20 lines · Tony Lindgren
Quoted 19 lines · Uwe Kleine-König
Quoted 18 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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 8 lines
Quoted 8 lines
Documentation/devicetree/bindings/pwm/pwm.yaml select: false · line 16
Quoted 4 lines
Documentation/devicetree/bindings/pwm/pwm.yaml +1
-1properties: $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 ().
Quoted 3 lines
Hmm but I think this would also pass for node names like pwm-a-foo?
No, how?
Best regards,
Krzysztof
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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?
Quoted 4 lines
Quoted 2 lines
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
Quoted 50 lines · Tony Lindgren
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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-fAnd now also:
pwm-0
...
pwm-15
Quoted 8 lines
Is there yet another format I'm missing?
Quoted 4 lines
Quoted 2 lines
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...
Quoted 4 lines
Regards,
Tony
Best regards,
Krzysztof
Quoted 53 lines · Krzysztof Kozlowski
Quoted 52 lines · Tony Lindgren
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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-fAnd now also:
pwm-0
...
pwm-15Is there yet another format I'm missing?
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
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
Quoted 54 lines · Tony Lindgren
Quoted 53 lines · Krzysztof Kozlowski
Quoted 52 lines · Tony Lindgren
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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-fAnd now also:
pwm-0
...
pwm-15Is there yet another format I'm missing?
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
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...
Quoted 3 lines
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
Quoted 44 lines · Tony Lindgren
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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
Quoted 7 lines
And now also:
pwm-0
...
pwm-15Is 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
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Quoted 64 lines · Uwe Kleine-König
Quoted 44 lines · Tony Lindgren
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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-fQuoted 7 lines
And now also:
pwm-0
...
pwm-15Is 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
Quoted 7 lines
is allowed but
pwm-10isn'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..
Quoted 1 line
(or maybe better "^pwm(@.+|-[0-9a-f]+)$" ?)
And this too fails for just pwm node name.
Regards,
Tony
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 75 lines · Tony Lindgren
Quoted 64 lines · Uwe Kleine-König
Quoted 44 lines · Tony Lindgren
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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-fQuoted 7 lines
And now also:
pwm-0
...
pwm-15Is 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-4Quoted 7 lines
is allowed but
pwm-10isn't. And I think what we want is:
"^pwm(@.*|-[0-9a-f]*)$"Heh so this fails for just node name pwm:
Quoted 8 lines
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..
Quoted 1 line
(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
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
Quoted 81 lines · Uwe Kleine-König
Quoted 80 lines · Tony Lindgren
Quoted 64 lines · Uwe Kleine-König
Quoted 44 lines · Tony Lindgren
Quoted 28 lines · Krzysztof Kozlowski
Quoted 27 lines · Tony Lindgren
Quoted 26 lines · Uwe Kleine-König
Quoted 17 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]>.
Cc Thierry Reding <[email protected]>Cc Uwe Kleine-König <[email protected]>Suggested-by Krzysztof Kozlowski <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- 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]|1[0-5]))*$"I wonder why you don't make this:
Quoted 3 lines
Quoted 1 line
Quoted 1 line
+ 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-fQuoted 7 lines
And now also:
pwm-0
...
pwm-15Is 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-4Quoted 7 lines
is allowed but
pwm-10isn'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..
Quoted 8 lines
Quoted 3 lines
Quoted 1 line
(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
Quoted 6 lines · Tony Lindgren
Quoted 4 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Quoted 9 lines · Krzysztof Kozlowski
Quoted 6 lines · Tony Lindgren
Quoted 4 lines
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
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel