xref: /freebsd/sys/contrib/device-tree/Bindings/pwm/pwm-samsung.yaml (revision 8d13bc63c0e1d50bc9e47ac1f26329c999bfecf0)
1c66ec88fSEmmanuel Vadot# SPDX-License-Identifier: GPL-2.0
2c66ec88fSEmmanuel Vadot%YAML 1.2
3c66ec88fSEmmanuel Vadot---
4c66ec88fSEmmanuel Vadot$id: http://devicetree.org/schemas/pwm/pwm-samsung.yaml#
5c66ec88fSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6c66ec88fSEmmanuel Vadot
7c66ec88fSEmmanuel Vadottitle: Samsung SoC PWM timers
8c66ec88fSEmmanuel Vadot
9c66ec88fSEmmanuel Vadotmaintainers:
10c66ec88fSEmmanuel Vadot  - Thierry Reding <thierry.reding@gmail.com>
11c66ec88fSEmmanuel Vadot  - Krzysztof Kozlowski <krzk@kernel.org>
12c66ec88fSEmmanuel Vadot
13c66ec88fSEmmanuel Vadotdescription: |+
14c66ec88fSEmmanuel Vadot  Samsung SoCs contain PWM timer blocks which can be used for system clock source
15c66ec88fSEmmanuel Vadot  and clock event timers, as well as to drive SoC outputs with PWM signal. Each
16c66ec88fSEmmanuel Vadot  PWM timer block provides 5 PWM channels (not all of them can drive physical
17c66ec88fSEmmanuel Vadot  outputs - see SoC and board manual).
18c66ec88fSEmmanuel Vadot
19c66ec88fSEmmanuel Vadot  Be aware that the clocksource driver supports only uniprocessor systems.
20c66ec88fSEmmanuel Vadot
21c66ec88fSEmmanuel Vadotproperties:
22c66ec88fSEmmanuel Vadot  compatible:
23aa1a8ff2SEmmanuel Vadot    oneOf:
24aa1a8ff2SEmmanuel Vadot      - enum:
25c66ec88fSEmmanuel Vadot          - samsung,s3c2410-pwm             # 16-bit, S3C24xx
26c66ec88fSEmmanuel Vadot          - samsung,s3c6400-pwm             # 32-bit, S3C64xx
27c66ec88fSEmmanuel Vadot          - samsung,s5p6440-pwm             # 32-bit, S5P64x0
28c66ec88fSEmmanuel Vadot          - samsung,s5pc100-pwm             # 32-bit, S5PC100, S5PV210, Exynos4210 rev0 SoCs
29c66ec88fSEmmanuel Vadot          - samsung,exynos4210-pwm          # 32-bit, Exynos
30aa1a8ff2SEmmanuel Vadot      - items:
31aa1a8ff2SEmmanuel Vadot          - enum:
32*8d13bc63SEmmanuel Vadot              - samsung,exynos5433-pwm
33*8d13bc63SEmmanuel Vadot              - samsung,exynos7-pwm
34aa1a8ff2SEmmanuel Vadot              - samsung,exynosautov9-pwm
35*8d13bc63SEmmanuel Vadot              - samsung,exynosautov920-pwm
36*8d13bc63SEmmanuel Vadot              - tesla,fsd-pwm
37aa1a8ff2SEmmanuel Vadot          - const: samsung,exynos4210-pwm
38c66ec88fSEmmanuel Vadot
39c66ec88fSEmmanuel Vadot  reg:
40c66ec88fSEmmanuel Vadot    maxItems: 1
41c66ec88fSEmmanuel Vadot
42c66ec88fSEmmanuel Vadot  clocks:
43c66ec88fSEmmanuel Vadot    minItems: 1
44c66ec88fSEmmanuel Vadot    maxItems: 3
45c66ec88fSEmmanuel Vadot
46c66ec88fSEmmanuel Vadot  clock-names:
47c66ec88fSEmmanuel Vadot    description: |
48c66ec88fSEmmanuel Vadot      Should contain all following required clock names:
49c66ec88fSEmmanuel Vadot      - "timers" - PWM base clock used to generate PWM signals,
50c66ec88fSEmmanuel Vadot      and any subset of following optional clock names:
51c66ec88fSEmmanuel Vadot      - "pwm-tclk0" - first external PWM clock source,
52c66ec88fSEmmanuel Vadot      - "pwm-tclk1" - second external PWM clock source.
53c66ec88fSEmmanuel Vadot      Note that not all IP variants allow using all external clock sources.
54c66ec88fSEmmanuel Vadot      Refer to SoC documentation to learn which clock source configurations
55c66ec88fSEmmanuel Vadot      are available.
56c66ec88fSEmmanuel Vadot    oneOf:
57c66ec88fSEmmanuel Vadot      - items:
58c66ec88fSEmmanuel Vadot          - const: timers
59c66ec88fSEmmanuel Vadot      - items:
60c66ec88fSEmmanuel Vadot          - const: timers
61c66ec88fSEmmanuel Vadot          - const: pwm-tclk0
62c66ec88fSEmmanuel Vadot      - items:
63c66ec88fSEmmanuel Vadot          - const: timers
64c66ec88fSEmmanuel Vadot          - const: pwm-tclk1
65c66ec88fSEmmanuel Vadot      - items:
66c66ec88fSEmmanuel Vadot          - const: timers
67c66ec88fSEmmanuel Vadot          - const: pwm-tclk0
68c66ec88fSEmmanuel Vadot          - const: pwm-tclk1
69c66ec88fSEmmanuel Vadot
70c66ec88fSEmmanuel Vadot  interrupts:
71c66ec88fSEmmanuel Vadot    description:
72c66ec88fSEmmanuel Vadot      One interrupt per timer, starting at timer 0. Necessary only for SoCs which
73c66ec88fSEmmanuel Vadot      use PWM clocksource.
74c66ec88fSEmmanuel Vadot    minItems: 1
75c66ec88fSEmmanuel Vadot    maxItems: 5
76c66ec88fSEmmanuel Vadot
77c66ec88fSEmmanuel Vadot  "#pwm-cells":
78c66ec88fSEmmanuel Vadot    description:
79c66ec88fSEmmanuel Vadot      The only third cell flag supported by this binding
80c66ec88fSEmmanuel Vadot      is PWM_POLARITY_INVERTED.
81c66ec88fSEmmanuel Vadot    const: 3
82c66ec88fSEmmanuel Vadot
83c66ec88fSEmmanuel Vadot  samsung,pwm-outputs:
84c66ec88fSEmmanuel Vadot    description:
85c66ec88fSEmmanuel Vadot      A list of PWM channels used as PWM outputs on particular platform.
86c66ec88fSEmmanuel Vadot      It is an array of up to 5 elements being indices of PWM channels
87c66ec88fSEmmanuel Vadot      (from 0 to 4), the order does not matter.
88c66ec88fSEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
89c66ec88fSEmmanuel Vadot    uniqueItems: true
90c66ec88fSEmmanuel Vadot    items:
91c66ec88fSEmmanuel Vadot      minimum: 0
92c66ec88fSEmmanuel Vadot      maximum: 4
93c66ec88fSEmmanuel Vadot
94c66ec88fSEmmanuel Vadotrequired:
95c66ec88fSEmmanuel Vadot  - clocks
96c66ec88fSEmmanuel Vadot  - clock-names
97c66ec88fSEmmanuel Vadot  - compatible
98c66ec88fSEmmanuel Vadot  - reg
99c66ec88fSEmmanuel Vadot
100c66ec88fSEmmanuel VadotadditionalProperties: false
101c66ec88fSEmmanuel Vadot
102c66ec88fSEmmanuel VadotallOf:
103c66ec88fSEmmanuel Vadot  - $ref: pwm.yaml#
104c66ec88fSEmmanuel Vadot
105c66ec88fSEmmanuel Vadot  - if:
106c66ec88fSEmmanuel Vadot      properties:
107c66ec88fSEmmanuel Vadot        compatible:
108c66ec88fSEmmanuel Vadot          contains:
109c66ec88fSEmmanuel Vadot            enum:
110c66ec88fSEmmanuel Vadot              - samsung,s3c2410-pwm
111c66ec88fSEmmanuel Vadot              - samsung,s3c6400-pwm
112c66ec88fSEmmanuel Vadot              - samsung,s5p6440-pwm
113c66ec88fSEmmanuel Vadot              - samsung,s5pc100-pwm
114c66ec88fSEmmanuel Vadot    then:
115c66ec88fSEmmanuel Vadot      required:
116c66ec88fSEmmanuel Vadot        - interrupts
117c66ec88fSEmmanuel Vadot
118c66ec88fSEmmanuel Vadotexamples:
119c66ec88fSEmmanuel Vadot  - |
120c66ec88fSEmmanuel Vadot    pwm@7f006000 {
121c66ec88fSEmmanuel Vadot        compatible = "samsung,s3c6400-pwm";
122c66ec88fSEmmanuel Vadot        reg = <0x7f006000 0x1000>;
123c66ec88fSEmmanuel Vadot        interrupt-parent = <&vic0>;
124c66ec88fSEmmanuel Vadot        interrupts = <23>, <24>, <25>, <27>, <28>;
125c66ec88fSEmmanuel Vadot        clocks = <&clock 67>;
126c66ec88fSEmmanuel Vadot        clock-names = "timers";
127c66ec88fSEmmanuel Vadot        samsung,pwm-outputs = <0>, <1>;
128c66ec88fSEmmanuel Vadot        #pwm-cells = <3>;
129c66ec88fSEmmanuel Vadot    };
130