summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/pwm/mediatek,mt2712-pwm.yaml
blob: 8e176ba7a525fcd0795e0c40c96b6615e00bc197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/pwm/mediatek,mt2712-pwm.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: MediaTek PWM Controller

maintainers:
  - John Crispin <john@phrozen.org>

allOf:
  - $ref: pwm.yaml#

properties:
  compatible:
    oneOf:
      - enum:
          - mediatek,mt2712-pwm
          - mediatek,mt6795-pwm
          - mediatek,mt7622-pwm
          - mediatek,mt7623-pwm
          - mediatek,mt7628-pwm
          - mediatek,mt7629-pwm
          - mediatek,mt7986-pwm
          - mediatek,mt8183-pwm
          - mediatek,mt8365-pwm
          - mediatek,mt8516-pwm
      - items:
          - enum:
              - mediatek,mt8195-pwm
          - const: mediatek,mt8183-pwm

  reg:
    maxItems: 1

  "#pwm-cells":
    const: 2

  interrupts:
    maxItems: 1

  clocks:
    minItems: 2
    maxItems: 10

  clock-names:
    description:
      This controller needs two input clocks for its core and one
      clock for each PWM output.
    minItems: 2
    items:
      - const: top
      - const: main
      - const: pwm1
      - const: pwm2
      - const: pwm3
      - const: pwm4
      - const: pwm5
      - const: pwm6
      - const: pwm7
      - const: pwm8

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

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/arm-gic.h>
    #include <dt-bindings/clock/mt2712-clk.h>
    #include <dt-bindings/interrupt-controller/irq.h>

    pwm0: pwm@11006000 {
        compatible = "mediatek,mt2712-pwm";
        reg = <0x11006000 0x1000>;
        #pwm-cells = <2>;
        interrupts = <GIC_SPI 77 IRQ_TYPE_LEVEL_LOW>;
        clocks = <&topckgen CLK_TOP_PWM_SEL>, <&pericfg CLK_PERI_PWM>,
                 <&pericfg CLK_PERI_PWM0>, <&pericfg CLK_PERI_PWM1>,
                 <&pericfg CLK_PERI_PWM2>, <&pericfg CLK_PERI_PWM3>,
                 <&pericfg CLK_PERI_PWM4>, <&pericfg CLK_PERI_PWM5>,
                 <&pericfg CLK_PERI_PWM6>, <&pericfg CLK_PERI_PWM7>;
        clock-names = "top", "main",
                      "pwm1", "pwm2",
                      "pwm3", "pwm4",
                      "pwm5", "pwm6",
                      "pwm7", "pwm8";
    };