xref: /freebsd-src/sys/contrib/device-tree/Bindings/pwm/pwm-amlogic.yaml (revision b2d2a78ad80ec68d4a17f5aef97d21686cb1e29b)
1fac71e4eSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2fac71e4eSEmmanuel Vadot%YAML 1.2
3fac71e4eSEmmanuel Vadot---
4fac71e4eSEmmanuel Vadot$id: http://devicetree.org/schemas/pwm/pwm-amlogic.yaml#
5fac71e4eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6fac71e4eSEmmanuel Vadot
7fac71e4eSEmmanuel Vadottitle: Amlogic PWM
8fac71e4eSEmmanuel Vadot
9fac71e4eSEmmanuel Vadotmaintainers:
10fac71e4eSEmmanuel Vadot  - Heiner Kallweit <hkallweit1@gmail.com>
11fac71e4eSEmmanuel Vadot
12fac71e4eSEmmanuel Vadotproperties:
13fac71e4eSEmmanuel Vadot  compatible:
14fac71e4eSEmmanuel Vadot    oneOf:
15fac71e4eSEmmanuel Vadot      - enum:
16fac71e4eSEmmanuel Vadot          - amlogic,meson8b-pwm
17fac71e4eSEmmanuel Vadot          - amlogic,meson-gxbb-pwm
18fac71e4eSEmmanuel Vadot          - amlogic,meson-gxbb-ao-pwm
19fac71e4eSEmmanuel Vadot          - amlogic,meson-axg-ee-pwm
20fac71e4eSEmmanuel Vadot          - amlogic,meson-axg-ao-pwm
21fac71e4eSEmmanuel Vadot          - amlogic,meson-g12a-ee-pwm
22fac71e4eSEmmanuel Vadot          - amlogic,meson-g12a-ao-pwm-ab
23fac71e4eSEmmanuel Vadot          - amlogic,meson-g12a-ao-pwm-cd
2401950c46SEmmanuel Vadot        deprecated: true
25fac71e4eSEmmanuel Vadot      - items:
26fac71e4eSEmmanuel Vadot          - const: amlogic,meson-gx-pwm
27fac71e4eSEmmanuel Vadot          - const: amlogic,meson-gxbb-pwm
2801950c46SEmmanuel Vadot        deprecated: true
29fac71e4eSEmmanuel Vadot      - items:
30fac71e4eSEmmanuel Vadot          - const: amlogic,meson-gx-ao-pwm
31fac71e4eSEmmanuel Vadot          - const: amlogic,meson-gxbb-ao-pwm
3201950c46SEmmanuel Vadot        deprecated: true
33fac71e4eSEmmanuel Vadot      - items:
34fac71e4eSEmmanuel Vadot          - const: amlogic,meson8-pwm
35fac71e4eSEmmanuel Vadot          - const: amlogic,meson8b-pwm
3601950c46SEmmanuel Vadot        deprecated: true
3701950c46SEmmanuel Vadot      - enum:
3801950c46SEmmanuel Vadot          - amlogic,meson8-pwm-v2
3901950c46SEmmanuel Vadot          - amlogic,meson-s4-pwm
4001950c46SEmmanuel Vadot      - items:
4101950c46SEmmanuel Vadot          - enum:
42*b2d2a78aSEmmanuel Vadot              - amlogic,meson-a1-pwm
43*b2d2a78aSEmmanuel Vadot          - const: amlogic,meson-s4-pwm
44*b2d2a78aSEmmanuel Vadot      - items:
45*b2d2a78aSEmmanuel Vadot          - enum:
4601950c46SEmmanuel Vadot              - amlogic,meson8b-pwm-v2
4701950c46SEmmanuel Vadot              - amlogic,meson-gxbb-pwm-v2
4801950c46SEmmanuel Vadot              - amlogic,meson-axg-pwm-v2
4901950c46SEmmanuel Vadot              - amlogic,meson-g12-pwm-v2
5001950c46SEmmanuel Vadot          - const: amlogic,meson8-pwm-v2
51fac71e4eSEmmanuel Vadot
52fac71e4eSEmmanuel Vadot  reg:
53fac71e4eSEmmanuel Vadot    maxItems: 1
54fac71e4eSEmmanuel Vadot
55fac71e4eSEmmanuel Vadot  clocks:
56fac71e4eSEmmanuel Vadot    minItems: 1
5701950c46SEmmanuel Vadot    maxItems: 4
5801950c46SEmmanuel Vadot
5901950c46SEmmanuel Vadot  clock-names:
6001950c46SEmmanuel Vadot    minItems: 1
61fac71e4eSEmmanuel Vadot    maxItems: 2
62fac71e4eSEmmanuel Vadot
63*b2d2a78aSEmmanuel Vadot  power-domains:
64*b2d2a78aSEmmanuel Vadot    maxItems: 1
65*b2d2a78aSEmmanuel Vadot
6601950c46SEmmanuel Vadot  "#pwm-cells":
6701950c46SEmmanuel Vadot    const: 3
6801950c46SEmmanuel Vadot
6901950c46SEmmanuel Vadotrequired:
7001950c46SEmmanuel Vadot  - compatible
7101950c46SEmmanuel Vadot  - reg
7201950c46SEmmanuel Vadot
7301950c46SEmmanuel VadotallOf:
7401950c46SEmmanuel Vadot  - $ref: pwm.yaml#
7501950c46SEmmanuel Vadot
7601950c46SEmmanuel Vadot  - if:
7701950c46SEmmanuel Vadot      properties:
7801950c46SEmmanuel Vadot        compatible:
7901950c46SEmmanuel Vadot          contains:
8001950c46SEmmanuel Vadot            enum:
8101950c46SEmmanuel Vadot              - amlogic,meson8-pwm
8201950c46SEmmanuel Vadot              - amlogic,meson8b-pwm
8301950c46SEmmanuel Vadot              - amlogic,meson-gxbb-pwm
8401950c46SEmmanuel Vadot              - amlogic,meson-gxbb-ao-pwm
8501950c46SEmmanuel Vadot              - amlogic,meson-axg-ee-pwm
8601950c46SEmmanuel Vadot              - amlogic,meson-axg-ao-pwm
8701950c46SEmmanuel Vadot              - amlogic,meson-g12a-ee-pwm
8801950c46SEmmanuel Vadot              - amlogic,meson-g12a-ao-pwm-ab
8901950c46SEmmanuel Vadot              - amlogic,meson-g12a-ao-pwm-cd
9001950c46SEmmanuel Vadot    then:
9101950c46SEmmanuel Vadot      # Obsolete historic bindings tied to the driver implementation
9201950c46SEmmanuel Vadot      # The clocks provided here are meant to be matched with the input
9301950c46SEmmanuel Vadot      # known (hard-coded) in the driver and used to select pwm clock
9401950c46SEmmanuel Vadot      # source. Currently, the linux driver ignores this.
9501950c46SEmmanuel Vadot      # This is kept to maintain ABI backward compatibility.
9601950c46SEmmanuel Vadot      properties:
9701950c46SEmmanuel Vadot        clocks:
9801950c46SEmmanuel Vadot          maxItems: 2
99fac71e4eSEmmanuel Vadot        clock-names:
100fac71e4eSEmmanuel Vadot          oneOf:
101fac71e4eSEmmanuel Vadot            - items:
102fac71e4eSEmmanuel Vadot                - enum: [clkin0, clkin1]
103fac71e4eSEmmanuel Vadot            - items:
104fac71e4eSEmmanuel Vadot                - const: clkin0
105fac71e4eSEmmanuel Vadot                - const: clkin1
106fac71e4eSEmmanuel Vadot
10701950c46SEmmanuel Vadot  # Newer binding where clock describe the actual clock inputs of the pwm
10801950c46SEmmanuel Vadot  # block. These are necessary but some inputs may be grounded.
10901950c46SEmmanuel Vadot  - if:
11001950c46SEmmanuel Vadot      properties:
11101950c46SEmmanuel Vadot        compatible:
11201950c46SEmmanuel Vadot          contains:
11301950c46SEmmanuel Vadot            enum:
11401950c46SEmmanuel Vadot              - amlogic,meson8-pwm-v2
11501950c46SEmmanuel Vadot    then:
11601950c46SEmmanuel Vadot      properties:
11701950c46SEmmanuel Vadot        clocks:
11801950c46SEmmanuel Vadot          minItems: 1
11901950c46SEmmanuel Vadot          items:
12001950c46SEmmanuel Vadot            - description: input clock 0 of the pwm block
12101950c46SEmmanuel Vadot            - description: input clock 1 of the pwm block
12201950c46SEmmanuel Vadot            - description: input clock 2 of the pwm block
12301950c46SEmmanuel Vadot            - description: input clock 3 of the pwm block
12401950c46SEmmanuel Vadot        clock-names: false
125fac71e4eSEmmanuel Vadot      required:
12601950c46SEmmanuel Vadot        - clocks
12701950c46SEmmanuel Vadot
12801950c46SEmmanuel Vadot  # Newer IP block take a single input per channel, instead of 4 inputs
12901950c46SEmmanuel Vadot  # for both channels
13001950c46SEmmanuel Vadot  - if:
13101950c46SEmmanuel Vadot      properties:
13201950c46SEmmanuel Vadot        compatible:
13301950c46SEmmanuel Vadot          contains:
13401950c46SEmmanuel Vadot            enum:
13501950c46SEmmanuel Vadot              - amlogic,meson-s4-pwm
13601950c46SEmmanuel Vadot    then:
13701950c46SEmmanuel Vadot      properties:
13801950c46SEmmanuel Vadot        clocks:
13901950c46SEmmanuel Vadot          items:
14001950c46SEmmanuel Vadot            - description: input clock of PWM channel A
14101950c46SEmmanuel Vadot            - description: input clock of PWM channel B
14201950c46SEmmanuel Vadot        clock-names: false
14301950c46SEmmanuel Vadot      required:
14401950c46SEmmanuel Vadot        - clocks
145fac71e4eSEmmanuel Vadot
146*b2d2a78aSEmmanuel Vadot  - if:
147*b2d2a78aSEmmanuel Vadot      properties:
148*b2d2a78aSEmmanuel Vadot        compatible:
149*b2d2a78aSEmmanuel Vadot          contains:
150*b2d2a78aSEmmanuel Vadot            enum:
151*b2d2a78aSEmmanuel Vadot              - amlogic,meson-a1-pwm
152*b2d2a78aSEmmanuel Vadot    then:
153*b2d2a78aSEmmanuel Vadot      required:
154*b2d2a78aSEmmanuel Vadot        - power-domains
155*b2d2a78aSEmmanuel Vadot
156fac71e4eSEmmanuel VadotadditionalProperties: false
157fac71e4eSEmmanuel Vadot
158fac71e4eSEmmanuel Vadotexamples:
159fac71e4eSEmmanuel Vadot  - |
160fac71e4eSEmmanuel Vadot    pwm@8550 {
161fac71e4eSEmmanuel Vadot      compatible = "amlogic,meson-gxbb-pwm";
162fac71e4eSEmmanuel Vadot      reg = <0x08550 0x10>;
163fac71e4eSEmmanuel Vadot      clocks = <&xtal>, <&xtal>;
164fac71e4eSEmmanuel Vadot      clock-names = "clkin0", "clkin1";
165fac71e4eSEmmanuel Vadot      #pwm-cells = <3>;
166fac71e4eSEmmanuel Vadot    };
16701950c46SEmmanuel Vadot  - |
16801950c46SEmmanuel Vadot    pwm@2000 {
16901950c46SEmmanuel Vadot      compatible = "amlogic,meson8-pwm-v2";
17001950c46SEmmanuel Vadot      reg = <0x1000 0x10>;
17101950c46SEmmanuel Vadot      clocks = <&xtal>, <0>, <&fdiv4>, <&fdiv5>;
17201950c46SEmmanuel Vadot      #pwm-cells = <3>;
17301950c46SEmmanuel Vadot    };
17401950c46SEmmanuel Vadot  - |
17501950c46SEmmanuel Vadot    pwm@1000 {
17601950c46SEmmanuel Vadot      compatible = "amlogic,meson-s4-pwm";
17701950c46SEmmanuel Vadot      reg = <0x1000 0x10>;
17801950c46SEmmanuel Vadot      clocks = <&pwm_src_a>, <&pwm_src_b>;
17901950c46SEmmanuel Vadot      #pwm-cells = <3>;
18001950c46SEmmanuel Vadot    };
181