xref: /freebsd/sys/contrib/device-tree/Bindings/pwm/pwm-rockchip.yaml (revision 7ef62cebc2f965b0f640263e179276928885e33d)
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          - const: rockchip,rk3328-pwm
36
37  reg:
38    maxItems: 1
39
40  clocks:
41    minItems: 1
42    maxItems: 2
43
44  clock-names:
45    maxItems: 2
46
47  "#pwm-cells":
48    enum: [2, 3]
49    description:
50      Must be 2 (rk2928) or 3 (rk3288 and later).
51      See pwm.yaml for a description of the cell format.
52
53required:
54  - compatible
55  - reg
56
57allOf:
58  - $ref: pwm.yaml#
59
60  - if:
61      properties:
62        compatible:
63          contains:
64            enum:
65              - rockchip,rk3328-pwm
66              - rockchip,rv1108-pwm
67
68    then:
69      properties:
70        clocks:
71          items:
72            - description: Used to derive the functional clock for the device.
73            - description: Used as the APB bus clock.
74
75        clock-names:
76          items:
77            - const: pwm
78            - const: pclk
79
80      required:
81        - clocks
82        - clock-names
83
84    else:
85      properties:
86        clocks:
87          maxItems: 1
88          description:
89            Used both to derive the functional clock
90            for the device and as the bus clock.
91
92      required:
93        - clocks
94
95additionalProperties: false
96
97examples:
98  - |
99    #include <dt-bindings/clock/rk3188-cru-common.h>
100    pwm0: pwm@20030000 {
101      compatible = "rockchip,rk2928-pwm";
102      reg = <0x20030000 0x10>;
103      clocks = <&cru PCLK_PWM01>;
104      #pwm-cells = <2>;
105    };
106