xref: /freebsd/sys/contrib/device-tree/Bindings/gpio/gpio-delay.yaml (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
1*f126890aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*f126890aSEmmanuel Vadot%YAML 1.2
3*f126890aSEmmanuel Vadot---
4*f126890aSEmmanuel Vadot$id: http://devicetree.org/schemas/gpio/gpio-delay.yaml#
5*f126890aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*f126890aSEmmanuel Vadot
7*f126890aSEmmanuel Vadottitle: GPIO delay controller
8*f126890aSEmmanuel Vadot
9*f126890aSEmmanuel Vadotmaintainers:
10*f126890aSEmmanuel Vadot  - Alexander Stein <linux@ew.tq-group.com>
11*f126890aSEmmanuel Vadot
12*f126890aSEmmanuel Vadotdescription: |
13*f126890aSEmmanuel Vadot  This binding describes an electrical setup where setting an GPIO output
14*f126890aSEmmanuel Vadot  is delayed by some external setup, e.g. RC circuit.
15*f126890aSEmmanuel Vadot
16*f126890aSEmmanuel Vadot  +----------+                    +-----------+
17*f126890aSEmmanuel Vadot  |          |             VCC_B  |           |
18*f126890aSEmmanuel Vadot  |          |              |     |           |
19*f126890aSEmmanuel Vadot  |          | VCC_A        _     |           |
20*f126890aSEmmanuel Vadot  |  GPIO    |             | | R  |  Consumer |
21*f126890aSEmmanuel Vadot  |controller|        ___  |_|    |           |
22*f126890aSEmmanuel Vadot  |          |       |   |  |     |           |
23*f126890aSEmmanuel Vadot  |      [IOx|-------|   |--+-----|-----+     |
24*f126890aSEmmanuel Vadot  |          |       |___|  |     |   input   |
25*f126890aSEmmanuel Vadot  |          |              |     |           |
26*f126890aSEmmanuel Vadot  +----------+             --- C  +-----------+
27*f126890aSEmmanuel Vadot                           ---
28*f126890aSEmmanuel Vadot                            |
29*f126890aSEmmanuel Vadot                            -
30*f126890aSEmmanuel Vadot                           GND
31*f126890aSEmmanuel Vadot
32*f126890aSEmmanuel Vadot  If the input on the consumer is controlled by an open-drain signal
33*f126890aSEmmanuel Vadot  attached to an RC circuit the ramp-up delay is not under control
34*f126890aSEmmanuel Vadot  of the GPIO controller.
35*f126890aSEmmanuel Vadot
36*f126890aSEmmanuel Vadotproperties:
37*f126890aSEmmanuel Vadot  compatible:
38*f126890aSEmmanuel Vadot    const: gpio-delay
39*f126890aSEmmanuel Vadot
40*f126890aSEmmanuel Vadot  "#gpio-cells":
41*f126890aSEmmanuel Vadot    description: |
42*f126890aSEmmanuel Vadot      Specifies the pin, ramp-up and ramp-down delays. The
43*f126890aSEmmanuel Vadot      delays are specified in microseconds.
44*f126890aSEmmanuel Vadot    const: 3
45*f126890aSEmmanuel Vadot
46*f126890aSEmmanuel Vadot  gpios:
47*f126890aSEmmanuel Vadot    description: Array of GPIOs which output signal change is delayed
48*f126890aSEmmanuel Vadot    minItems: 1
49*f126890aSEmmanuel Vadot    maxItems: 32
50*f126890aSEmmanuel Vadot
51*f126890aSEmmanuel Vadot  gpio-controller: true
52*f126890aSEmmanuel Vadot
53*f126890aSEmmanuel Vadot  gpio-line-names:
54*f126890aSEmmanuel Vadot    minItems: 1
55*f126890aSEmmanuel Vadot    maxItems: 32
56*f126890aSEmmanuel Vadot
57*f126890aSEmmanuel Vadotrequired:
58*f126890aSEmmanuel Vadot  - compatible
59*f126890aSEmmanuel Vadot  - "#gpio-cells"
60*f126890aSEmmanuel Vadot  - gpio-controller
61*f126890aSEmmanuel Vadot  - gpios
62*f126890aSEmmanuel Vadot
63*f126890aSEmmanuel VadotadditionalProperties: false
64*f126890aSEmmanuel Vadot
65*f126890aSEmmanuel Vadotexamples:
66*f126890aSEmmanuel Vadot  - |
67*f126890aSEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
68*f126890aSEmmanuel Vadot
69*f126890aSEmmanuel Vadot    enable_delay: enable-delay {
70*f126890aSEmmanuel Vadot        compatible = "gpio-delay";
71*f126890aSEmmanuel Vadot        #gpio-cells = <3>;
72*f126890aSEmmanuel Vadot        gpio-controller;
73*f126890aSEmmanuel Vadot        gpios = <&gpio0 3 GPIO_ACTIVE_LOW>,
74*f126890aSEmmanuel Vadot                <&gpio3 1 GPIO_ACTIVE_HIGH>;
75*f126890aSEmmanuel Vadot    };
76*f126890aSEmmanuel Vadot
77*f126890aSEmmanuel Vadot    consumer {
78*f126890aSEmmanuel Vadot        enable-gpios = <&enable_delay 0 130000 30000>;
79*f126890aSEmmanuel Vadot    };
80