xref: /linux/Documentation/devicetree/bindings/pwm/pwm-rockchip.yaml (revision 42874e4eb35bdfc54f8514685e50434098ba4f6c)
1# SPDX-License-Identifier: GPL-2.0
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/pwm/pwm-rockchip.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Rockchip PWM controller
8
9maintainers:
10  - Heiko Stuebner <heiko@sntech.de>
11
12properties:
13  compatible:
14    oneOf:
15      - const: rockchip,rk2928-pwm
16      - const: rockchip,rk3288-pwm
17      - const: rockchip,rk3328-pwm
18      - const: rockchip,vop-pwm
19      - items:
20          - const: rockchip,rk3036-pwm
21          - const: rockchip,rk2928-pwm
22      - items:
23          - enum:
24              - rockchip,rk3128-pwm
25              - rockchip,rk3368-pwm
26              - rockchip,rk3399-pwm
27              - rockchip,rv1108-pwm
28          - const: rockchip,rk3288-pwm
29      - items:
30          - enum:
31              - rockchip,px30-pwm
32              - rockchip,rk3308-pwm
33              - rockchip,rk3568-pwm
34              - rockchip,rk3588-pwm
35              - rockchip,rv1126-pwm
36          - const: rockchip,rk3328-pwm
37
38  reg:
39    maxItems: 1
40
41  clocks:
42    minItems: 1
43    maxItems: 2
44
45  clock-names:
46    maxItems: 2
47
48  "#pwm-cells":
49    enum: [2, 3]
50    description:
51      Must be 2 (rk2928) or 3 (rk3288 and later).
52      See pwm.yaml for a description of the cell format.
53
54required:
55  - compatible
56  - reg
57
58allOf:
59  - $ref: pwm.yaml#
60
61  - if:
62      properties:
63        compatible:
64          contains:
65            enum:
66              - rockchip,rk3328-pwm
67              - rockchip,rv1108-pwm
68
69    then:
70      properties:
71        clocks:
72          items:
73            - description: Used to derive the functional clock for the device.
74            - description: Used as the APB bus clock.
75
76        clock-names:
77          items:
78            - const: pwm
79            - const: pclk
80
81      required:
82        - clocks
83        - clock-names
84
85    else:
86      properties:
87        clocks:
88          maxItems: 1
89          description:
90            Used both to derive the functional clock
91            for the device and as the bus clock.
92
93      required:
94        - clocks
95
96additionalProperties: false
97
98examples:
99  - |
100    #include <dt-bindings/clock/rk3188-cru-common.h>
101    pwm0: pwm@20030000 {
102      compatible = "rockchip,rk2928-pwm";
103      reg = <0x20030000 0x10>;
104      clocks = <&cru PCLK_PWM01>;
105      #pwm-cells = <2>;
106    };
107