1 .\" Copyright (c) 2013, Luiz Otavio O Souza <loos@FreeBSD.org>
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .Nd GPIO led generic device driver
37 This driver attaches a
43 driver provides a glue to attach a
45 compatible device to a GPIO pin.
46 Each led on the system has a
48 which is used to export a device in
50 The GPIO pin can then be controlled by writing to this device as described
54 On a hint based system, like
55 .Li MIPS , these values are configureable for
57 .Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
58 .It Va hint.gpioled.%d.at
59 The gpiobus you are attaching to.
60 Normally assigned to gpiobus0.
61 .It Va hint.gpioled.%d.name
62 Arbitrary name of device in
66 .It Va hint.gpioled.%d.pins
67 Which pin on the GPIO interface to map to this instance.
68 Please note that this mask should only ever have one bit set
69 (any others bits - i.e., pins - will be ignored).
75 .Li ARM , the dts part for a
77 device usually looks like:
85 compatible = "gpioled";
86 gpios = <&gpio 16 2 0>; /* GPIO pin 16. */
91 compatible = "gpioled";
92 gpios = <&gpio 17 2 0>; /* GPIO pin 17. */
98 And optionally, you can choose combine all the leds under a single
107 compatible = "gpio-leds";
110 gpios = <&gpio 16 2 0>;
115 gpios = <&gpio 17 2 0>;
122 Both methods are equally supported and it is possible to have the leds
123 defined with any sort of mix between the methods.
124 The only restriction is that a GPIO pin cannot be mapped by two different
127 For more details about the
129 property, please consult
130 .Pa /usr/src/sys/boot/fdt/dts/bindings-gpio.txt .
134 is the arbitrary name of device in
146 manual page first appeared in
150 manual page was written by
151 .An Luiz Otavio O Souza .