xref: /freebsd/sys/contrib/device-tree/Bindings/pwm/loongson,ls7a-pwm.yaml (revision ae5de77ed78ae54d86cead5604869212e8008e6b)
1*ae5de77eSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*ae5de77eSEmmanuel Vadot%YAML 1.2
3*ae5de77eSEmmanuel Vadot---
4*ae5de77eSEmmanuel Vadot$id: http://devicetree.org/schemas/pwm/loongson,ls7a-pwm.yaml#
5*ae5de77eSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*ae5de77eSEmmanuel Vadot
7*ae5de77eSEmmanuel Vadottitle: Loongson PWM Controller
8*ae5de77eSEmmanuel Vadot
9*ae5de77eSEmmanuel Vadotmaintainers:
10*ae5de77eSEmmanuel Vadot  - Binbin Zhou <zhoubinbin@loongson.cn>
11*ae5de77eSEmmanuel Vadot
12*ae5de77eSEmmanuel Vadotdescription:
13*ae5de77eSEmmanuel Vadot  The Loongson PWM has one pulse width output signal and one pulse input
14*ae5de77eSEmmanuel Vadot  signal to be measured.
15*ae5de77eSEmmanuel Vadot  It can be found on Loongson-2K series cpus and Loongson LS7A bridge chips.
16*ae5de77eSEmmanuel Vadot
17*ae5de77eSEmmanuel VadotallOf:
18*ae5de77eSEmmanuel Vadot  - $ref: pwm.yaml#
19*ae5de77eSEmmanuel Vadot
20*ae5de77eSEmmanuel Vadotproperties:
21*ae5de77eSEmmanuel Vadot  compatible:
22*ae5de77eSEmmanuel Vadot    oneOf:
23*ae5de77eSEmmanuel Vadot      - const: loongson,ls7a-pwm
24*ae5de77eSEmmanuel Vadot      - items:
25*ae5de77eSEmmanuel Vadot          - enum:
26*ae5de77eSEmmanuel Vadot              - loongson,ls2k0500-pwm
27*ae5de77eSEmmanuel Vadot              - loongson,ls2k1000-pwm
28*ae5de77eSEmmanuel Vadot              - loongson,ls2k2000-pwm
29*ae5de77eSEmmanuel Vadot          - const: loongson,ls7a-pwm
30*ae5de77eSEmmanuel Vadot
31*ae5de77eSEmmanuel Vadot  reg:
32*ae5de77eSEmmanuel Vadot    maxItems: 1
33*ae5de77eSEmmanuel Vadot
34*ae5de77eSEmmanuel Vadot  interrupts:
35*ae5de77eSEmmanuel Vadot    maxItems: 1
36*ae5de77eSEmmanuel Vadot
37*ae5de77eSEmmanuel Vadot  clocks:
38*ae5de77eSEmmanuel Vadot    maxItems: 1
39*ae5de77eSEmmanuel Vadot
40*ae5de77eSEmmanuel Vadot  '#pwm-cells':
41*ae5de77eSEmmanuel Vadot    description:
42*ae5de77eSEmmanuel Vadot      The first cell must have a value of 0, which specifies the PWM output signal;
43*ae5de77eSEmmanuel Vadot      The second cell is the period in nanoseconds;
44*ae5de77eSEmmanuel Vadot      The third cell flag supported by this binding is PWM_POLARITY_INVERTED.
45*ae5de77eSEmmanuel Vadot    const: 3
46*ae5de77eSEmmanuel Vadot
47*ae5de77eSEmmanuel Vadotrequired:
48*ae5de77eSEmmanuel Vadot  - compatible
49*ae5de77eSEmmanuel Vadot  - reg
50*ae5de77eSEmmanuel Vadot  - interrupts
51*ae5de77eSEmmanuel Vadot  - clocks
52*ae5de77eSEmmanuel Vadot
53*ae5de77eSEmmanuel VadotadditionalProperties: false
54*ae5de77eSEmmanuel Vadot
55*ae5de77eSEmmanuel Vadotexamples:
56*ae5de77eSEmmanuel Vadot  - |
57*ae5de77eSEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
58*ae5de77eSEmmanuel Vadot    #include <dt-bindings/clock/loongson,ls2k-clk.h>
59*ae5de77eSEmmanuel Vadot
60*ae5de77eSEmmanuel Vadot    pwm@1fe22000 {
61*ae5de77eSEmmanuel Vadot        compatible = "loongson,ls2k1000-pwm", "loongson,ls7a-pwm";
62*ae5de77eSEmmanuel Vadot        reg = <0x1fe22000 0x10>;
63*ae5de77eSEmmanuel Vadot        interrupt-parent = <&liointc0>;
64*ae5de77eSEmmanuel Vadot        interrupts = <24 IRQ_TYPE_LEVEL_HIGH>;
65*ae5de77eSEmmanuel Vadot        clocks = <&clk LOONGSON2_APB_CLK>;
66*ae5de77eSEmmanuel Vadot        #pwm-cells = <3>;
67*ae5de77eSEmmanuel Vadot    };
68