diff options
author | David Riley <davidriley@chromium.org> | 2014-08-27 15:23:51 -0400 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-09-26 13:51:15 -0400 |
commit | 371bb20d6927f204ef5a7887ecddb06b2501c0d9 (patch) | |
tree | ddfd58bf6787b7f459d3fde499a4b83c290835cb /Documentation/devicetree/bindings/gpio | |
parent | 1670d8569eeb5c5c15776d37b00a2afb5255bf28 (diff) |
power: Add simple gpio-restart driver
This driver registers a restart handler to set a GPIO line high/low
to reset a board based on devicetree bindings.
Signed-off-by: David Riley <davidriley@chromium.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'Documentation/devicetree/bindings/gpio')
-rw-r--r-- | Documentation/devicetree/bindings/gpio/gpio-restart.txt | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio-restart.txt b/Documentation/devicetree/bindings/gpio/gpio-restart.txt new file mode 100644 index 000000000000..af3701bc15c4 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-restart.txt | |||
@@ -0,0 +1,54 @@ | |||
1 | Drive a GPIO line that can be used to restart the system from a restart | ||
2 | handler. | ||
3 | |||
4 | This binding supports level and edge triggered reset. At driver load | ||
5 | time, the driver will request the given gpio line and install a restart | ||
6 | handler. If the optional properties 'open-source' is not found, the GPIO line | ||
7 | will be driven in the inactive state. Otherwise its not driven until | ||
8 | the restart is initiated. | ||
9 | |||
10 | When the system is restarted, the restart handler will be invoked in | ||
11 | priority order. The gpio is configured as an output, and driven active, | ||
12 | triggering a level triggered reset condition. This will also cause an | ||
13 | inactive->active edge condition, triggering positive edge triggered | ||
14 | reset. After a delay specified by active-delay, the GPIO is set to | ||
15 | inactive, thus causing an active->inactive edge, triggering negative edge | ||
16 | triggered reset. After a delay specified by inactive-delay, the GPIO | ||
17 | is driven active again. After a delay specified by wait-delay, the | ||
18 | restart handler completes allowing other restart handlers to be attempted. | ||
19 | |||
20 | Required properties: | ||
21 | - compatible : should be "gpio-restart". | ||
22 | - gpios : The GPIO to set high/low, see "gpios property" in | ||
23 | Documentation/devicetree/bindings/gpio/gpio.txt. If the pin should be | ||
24 | low to reset the board set it to "Active Low", otherwise set | ||
25 | gpio to "Active High". | ||
26 | |||
27 | Optional properties: | ||
28 | - open-source : Treat the GPIO as being open source and defer driving | ||
29 | it to when the restart is initiated. If this optional property is not | ||
30 | specified, the GPIO is initialized as an output in its inactive state. | ||
31 | - priority : A priority ranging from 0 to 255 (default 128) according to | ||
32 | the following guidelines: | ||
33 | 0: Restart handler of last resort, with limited restart | ||
34 | capabilities | ||
35 | 128: Default restart handler; use if no other restart handler is | ||
36 | expected to be available, and/or if restart functionality is | ||
37 | sufficient to restart the entire system | ||
38 | 255: Highest priority restart handler, will preempt all other | ||
39 | restart handlers | ||
40 | - active-delay: Delay (default 100) to wait after driving gpio active [ms] | ||
41 | - inactive-delay: Delay (default 100) to wait after driving gpio inactive [ms] | ||
42 | - wait-delay: Delay (default 3000) to wait after completing restart | ||
43 | sequence [ms] | ||
44 | |||
45 | Examples: | ||
46 | |||
47 | gpio-restart { | ||
48 | compatible = "gpio-restart"; | ||
49 | gpios = <&gpio 4 0>; | ||
50 | priority = <128>; | ||
51 | active-delay = <100>; | ||
52 | inactive-delay = <100>; | ||
53 | wait-delay = <3000>; | ||
54 | }; | ||