Skip to content

Commit

Permalink
dt-bindings: pwm: pwm-tiehrpwm: Convert to json schema
Browse files Browse the repository at this point in the history
Convert the tiehrpwm binding to DT schema format using json-schema.
Along with this conversion the following changes are included:
- 'clock' and 'clock-names' properties are marked as required as
   driver fails to probe without these properties
- Dropped ti,am33xx-ehrpwm as it is no longer applicable.
- 'power-domains' property is introduced and marked as optional.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
  • Loading branch information
Lokesh Vutla authored and Thierry Reding committed Jun 4, 2021
1 parent 79dd354 commit 2ba4597
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 50 deletions.
50 changes: 0 additions & 50 deletions Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.txt

This file was deleted.

64 changes: 64 additions & 0 deletions Documentation/devicetree/bindings/pwm/pwm-tiehrpwm.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/pwm-tiehrpwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: TI SOC EHRPWM based PWM controller

maintainers:
- Vignesh R <vigneshr@ti.com>

allOf:
- $ref: pwm.yaml#

properties:
compatible:
oneOf:
- const: ti,am3352-ehrpwm
- items:
- enum:
- ti,da850-ehrpwm
- ti,am4372-ehrpwm
- ti,dra746-ehrpwm
- ti,am654-ehrpwm
- const: ti,am3352-ehrpwm

reg:
maxItems: 1

"#pwm-cells":
const: 3
description: |
See pwm.yaml in this directory for a description of the cells format.
The only third cell flag supported by this binding is PWM_POLARITY_INVERTED.
clock-names:
items:
- const: tbclk
- const: fck

clocks:
maxItems: 2

power-domains:
maxItems: 1

required:
- compatible
- reg
- "#pwm-cells"
- clocks
- clock-names

additionalProperties: false

examples:
- |
ehrpwm0: pwm@48300200 { /* EHRPWM on am33xx */
compatible = "ti,am3352-ehrpwm";
#pwm-cells = <3>;
reg = <0x48300200 0x100>;
clocks = <&ehrpwm0_tbclk>, <&l4ls_gclk>;
clock-names = "tbclk", "fck";
};

0 comments on commit 2ba4597

Please sign in to comment.