linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
@ 2022-11-18 12:54 Tony Lindgren
  2022-11-18 14:22 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2022-11-18 12:54 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Nishanth Menon,
	Vignesh Raghavendra

Update for yaml and remove the old txt binding.

Cc: Nishanth Menon <nm@ti.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 .../bindings/pwm/pwm-omap-dmtimer.txt         | 22 --------
 .../bindings/pwm/ti,pwm-omap-dmtimer.yaml     | 56 +++++++++++++++++++
 2 files changed, 56 insertions(+), 22 deletions(-)
 delete mode 100644 Documentation/devicetree/bindings/pwm/pwm-omap-dmtimer.txt
 create mode 100644 Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.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,pwm-omap-dmtimer.yaml b/Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml
new file mode 100644
--- /dev/null
+++ b/Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml
@@ -0,0 +1,56 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/pwm/ti,pwm-omap-dmtimer.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:
+  $nodename:
+    pattern: "^pwm-([1-9]|1[0-2])$"
+
+  compatible:
+    const: ti,omap-dmtimer-pwm
+
+  "#pwm-cells":
+    const: 3
+
+  ti,timers:
+    description: phandle to the timer instance used for PWM
+    $ref: /schemas/types.yaml#/definitions/phandle
+
+  ti,prescaler:
+    description: legacy clock prescaled for timer
+    $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, use assigned-clocks instead
+    $ref: /schemas/types.yaml#/definitions/uint32
+    enum: [ 0, 1, 2 ]
+    deprecated: true
+
+required:
+  - compatible
+  - ti,timers
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    pwm9: pwm-9 {
+      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] 7+ messages in thread

* Re: [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-18 12:54 [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml Tony Lindgren
@ 2022-11-18 14:22 ` Krzysztof Kozlowski
  2022-11-18 14:32   ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-18 14:22 UTC (permalink / raw)
  To: Tony Lindgren, Rob Herring, Krzysztof Kozlowski
  Cc: devicetree, linux-arm-kernel, linux-omap, Nishanth Menon,
	Vignesh Raghavendra

On 18/11/2022 13:54, Tony Lindgren wrote:
> Update for yaml and remove the old txt binding.
> 
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Vignesh Raghavendra <vigneshr@ti.com>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Thank you for your patch. There is something to discuss/improve.

> -Example:
> -	pwm9: dmtimer-pwm@9 {
> -		compatible = "ti,omap-dmtimer-pwm";
> -		ti,timers = <&timer9>;
> -		#pwm-cells = <3>;
> -	};
> diff --git a/Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml b/Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml
> new file mode 100644
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/pwm/ti,pwm-omap-dmtimer.yaml

Use filename matching the compatible, so ti,omap-dmtimer-pwm.yaml

> @@ -0,0 +1,56 @@
> +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/pwm/ti,pwm-omap-dmtimer.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:
> +  $nodename:
> +    pattern: "^pwm-([1-9]|1[0-2])$"

Drop the nodename, device schemas do not need to enforce it.

> +
> +  compatible:
> +    const: ti,omap-dmtimer-pwm
> +
> +  "#pwm-cells":
> +    const: 3
> +
> +  ti,timers:
> +    description: phandle to the timer instance used for PWM
> +    $ref: /schemas/types.yaml#/definitions/phandle
> +
> +  ti,prescaler:
> +    description: legacy clock prescaled for timer
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
> +    deprecated: true

This was not deprecated before and your commit msg does not mention it.

> +
> +  ti,clock-source:
> +    description: legacy clock for timer, use assigned-clocks instead
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    enum: [ 0, 1, 2 ]

You miss here explanation of constants.

> +    deprecated: true

This was not deprecated before and your commit msg does not mention it.

> +
> +required:
> +  - compatible
> +  - ti,timers
> +
> +unevaluatedProperties: false
> +
> +examples:
> +  - |
> +    pwm9: pwm-9 {

Node name: pwm

> +      compatible = "ti,omap-dmtimer-pwm";
> +      ti,timers = <&timer9>;
> +      #pwm-cells = <3>;
> +    };

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

* Re: [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-18 14:22 ` Krzysztof Kozlowski
@ 2022-11-18 14:32   ` Tony Lindgren
  2022-11-18 14:43     ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2022-11-18 14:32 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:12]:
> On 18/11/2022 13:54, Tony Lindgren wrote:
> > +properties:
> > +  $nodename:
> > +    pattern: "^pwm-([1-9]|1[0-2])$"
> 
> Drop the nodename, device schemas do not need to enforce it.

Hmm I think that's needed to avoid warnings if the knob is
tweaked to 11? Right now the max timer value is 12.

> > +  ti,prescaler:
> > +    description: legacy clock prescaled for timer
> > +    $ref: /schemas/types.yaml#/definitions/uint32
> > +    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
> > +    deprecated: true
> 
> This was not deprecated before and your commit msg does not mention it.

OK will add and fix up the other things you noticed too.

Thanks,

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

* Re: [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-18 14:32   ` Tony Lindgren
@ 2022-11-18 14:43     ` Krzysztof Kozlowski
  2022-11-21 10:08       ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-18 14:43 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Nishanth Menon, Vignesh Raghavendra

On 18/11/2022 15:32, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:12]:
>> On 18/11/2022 13:54, Tony Lindgren wrote:
>>> +properties:
>>> +  $nodename:
>>> +    pattern: "^pwm-([1-9]|1[0-2])$"
>>
>> Drop the nodename, device schemas do not need to enforce it.
> 
> Hmm I think that's needed to avoid warnings if the knob is
> tweaked to 11? Right now the max timer value is 12.

Which warnings? The pwm.yaml allows up to 15.


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

* Re: [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-18 14:43     ` Krzysztof Kozlowski
@ 2022-11-21 10:08       ` Tony Lindgren
  2022-11-21 10:32         ` Krzysztof Kozlowski
  0 siblings, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2022-11-21 10:08 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:33]:
> On 18/11/2022 15:32, Tony Lindgren wrote:
> > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:12]:
> >> On 18/11/2022 13:54, Tony Lindgren wrote:
> >>> +properties:
> >>> +  $nodename:
> >>> +    pattern: "^pwm-([1-9]|1[0-2])$"
> >>
> >> Drop the nodename, device schemas do not need to enforce it.
> > 
> > Hmm I think that's needed to avoid warnings if the knob is
> > tweaked to 11? Right now the max timer value is 12.
> 
> Which warnings? The pwm.yaml allows up to 15.

Heh I was using dec instead of hex.. :) Yup pwm.yaml works just fine.

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

* Re: [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-21 10:08       ` Tony Lindgren
@ 2022-11-21 10:32         ` Krzysztof Kozlowski
  2022-11-21 11:33           ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Krzysztof Kozlowski @ 2022-11-21 10:32 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Nishanth Menon, Vignesh Raghavendra

On 21/11/2022 11:08, Tony Lindgren wrote:
> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:33]:
>> On 18/11/2022 15:32, Tony Lindgren wrote:
>>> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:12]:
>>>> On 18/11/2022 13:54, Tony Lindgren wrote:
>>>>> +properties:
>>>>> +  $nodename:
>>>>> +    pattern: "^pwm-([1-9]|1[0-2])$"
>>>>
>>>> Drop the nodename, device schemas do not need to enforce it.
>>>
>>> Hmm I think that's needed to avoid warnings if the knob is
>>> tweaked to 11? Right now the max timer value is 12.
>>
>> Which warnings? The pwm.yaml allows up to 15.
> 
> Heh I was using dec instead of hex.. :) Yup pwm.yaml works just fine.

This could be fixed (extended) in pwm.yaml as well, because simple
human-readable increments/IDs are usually decimal. hex is only for
addresses.

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

* Re: [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml
  2022-11-21 10:32         ` Krzysztof Kozlowski
@ 2022-11-21 11:33           ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2022-11-21 11:33 UTC (permalink / raw)
  To: Krzysztof Kozlowski
  Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-arm-kernel,
	linux-omap, Nishanth Menon, Vignesh Raghavendra

* Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221121 10:22]:
> On 21/11/2022 11:08, Tony Lindgren wrote:
> > * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:33]:
> >> On 18/11/2022 15:32, Tony Lindgren wrote:
> >>> * Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> [221118 14:12]:
> >>>> On 18/11/2022 13:54, Tony Lindgren wrote:
> >>>>> +properties:
> >>>>> +  $nodename:
> >>>>> +    pattern: "^pwm-([1-9]|1[0-2])$"
> >>>>
> >>>> Drop the nodename, device schemas do not need to enforce it.
> >>>
> >>> Hmm I think that's needed to avoid warnings if the knob is
> >>> tweaked to 11? Right now the max timer value is 12.
> >>
> >> Which warnings? The pwm.yaml allows up to 15.
> > 
> > Heh I was using dec instead of hex.. :) Yup pwm.yaml works just fine.
> 
> This could be fixed (extended) in pwm.yaml as well, because simple
> human-readable increments/IDs are usually decimal. hex is only for
> addresses.

OK I'll do a patch for that.

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

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

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-18 12:54 [PATCH] dt-bindings: pwm: ti,pwm-omap-dmtimer: Update binding for yaml Tony Lindgren
2022-11-18 14:22 ` Krzysztof Kozlowski
2022-11-18 14:32   ` Tony Lindgren
2022-11-18 14:43     ` Krzysztof Kozlowski
2022-11-21 10:08       ` Tony Lindgren
2022-11-21 10:32         ` Krzysztof Kozlowski
2022-11-21 11:33           ` Tony Lindgren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).