1 .\" Copyright (c) 2013, Sean Bruno <sbruno@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
27 .Dd September 13, 2013
34 To compile these devices into your kernel and use the device hints, place the
35 following lines in your kernel configuration file:
36 .Bd -ragged -offset indent
44 Additional device entries for the
47 .Bd -ragged -offset indent
50 .Cd "device imx51_gpio"
54 .Cd "device gpio_avila"
55 .Cd "device gpio_cambria"
60 Additional device entries for the
63 .Bd -ragged -offset indent
64 .Cd "device ar71xxx_gpio"
65 .Cd "device octeon_gpio"
66 .Cd "device rt305_gpio"
69 Additional device entries for the
72 .Bd -ragged -offset indent
79 system provides a simple interface to the bit banging style GPIO bus
80 found on embedded architectures.
85 .Dq General-Purpose Input/Output.
87 The BUS physically consists of multiple pins that can be configured
88 for input/output, IRQ delivery, SDA/SCL
91 On most embedded architechtures (mips/arm), discovery of the bus and
92 configuration of the pins is done via
94 in the platform's kernel
100 bus variables is done via:
101 .Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
102 .It Va hint.gpioiic.%d.at
103 Normally just gpiobus0.
104 .It Va hint.gpioiic.%d.pins
105 This is a bitmask of the pins on the gpio board that are to be used for
106 SCLOCK and SDATA from the IIC bus.
107 To configure pin 0 and 7, use the bitmask of
108 10000001 and convert it to a hexadecimal value of 0x0081.
109 Should only ever have two bits set in mask.
110 .It Va hint.gpioiic.%d.scl
111 Indicates which bit in the
112 .Va hint.gpioiic.%d.pins
113 should be used as the SCLOCK
115 .It Va hint.gpioiic.%d.sda
116 Indicates which bit in the
117 .Va hint.gpioiic.%d.pins
118 should be used as the SDATA
122 The following are only provided by the
125 .Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
126 .It Va hint.gpio.%d.pinmask
127 This is a bitmask of pins on the gpio board that we would like to expose
128 for use to the host o/s.
129 To expose pin 0, 4 and 7, use the bitmask of
130 10010001 converted to the hexadecimal value 0x0091.
131 .It Va hint.gpio.%d.pinon
132 This is a bitmask of pins on the gpio board that will be set to ON at host
134 To set pin 2, 5 and 13 to be set ON at boot, use the bitmask of
135 10000000010010 converted to the hexadecimal value 0x2012.
136 .It Va hint.gpio.function_set
137 .It Va hint.gpio.function_clear
138 These are a bitmask of pins that will remap a pin to handle a specific
139 function (USB, UART TX/RX, etc) in the Atheros function registers.
140 This is mainly used to set/clear functions that we need when they are setup or
144 These values are configureable from the
146 interface and help create
148 compatible devices in
149 .Pa /dev/led/<name> .
150 .Bl -tag -width ".Va hint.gpioiic.%d.atXXX"
151 .It Va hint.gpioled.%d.at
152 Normally assigned to gpiobus0.
153 .It Va hint.gpioled.%d.name
154 Arbitrary name of device in
159 .It Va hint.gpioled.%d.pins
160 Which pin on the GPIO interface to map to this instance.
163 Simply put, each pin of the GPIO interface is connected to an input/output
164 of some device in a system.
171 manual page first appeared in
175 manual page was written by
176 .An Sean Bruno Aq sbruno@FreeBSD.org .