aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-05-06 18:40:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-05-06 18:40:55 -0400
commit30c67e93c526639aaac90fa873800104b7c16d16 (patch)
tree6d8d0fd248d4e60bdc175dacbd196fc44f23ce11 /Documentation
parentf87bb9ee62700fa11713c630ac5671f253233b94 (diff)
parent08ffb2229fafc2c3a696b325a74bf4198d6b91d7 (diff)
Merge tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux
Pull GPIO changes from Grant Likely: "The usual selection of bug fixes and driver updates for GPIO. Nothing really stands out except the addition of the GRGPIO driver and some enhacements to ACPI support" I'm pulling this despite the earlier mess. Let's hope it compiles these days. * tag 'gpio-for-linus' of git://git.secretlab.ca/git/linux: (46 commits) gpio: grgpio: Add irq support gpio: grgpio: Add device driver for GRGPIO cores gpiolib-acpi: introduce acpi_get_gpio_by_index() helper GPIO: gpio-generic: remove kfree() from bgpio_remove call gpio / ACPI: Handle ACPI events in accordance with the spec gpio: lpc32xx: Fix off-by-one valid range checking for bank gpio: mcp23s08: convert driver to DT gpio/omap: force restore if context loss is not detectable gpio/omap: optimise interrupt service routine gpio/omap: remove extra context restores in *_runtime_resume() gpio/omap: free irq domain in probe() failure paths gpio: gpio-generic: Add 16 and 32 bit big endian byte order support gpio: samsung: Add terminating entry for exynos_pinctrl_ids gpio: mvebu: add dbg_show function MAX7301 GPIO: Do not force SPI speed when using OF Platform gpio: gpio-tps65910.c: fix checkpatch error gpio: gpio-timberdale.c: fix checkpatch error gpio: gpio-tc3589x.c: fix checkpatch errors gpio: gpio-stp-xway.c: fix checkpatch error gpio: gpio-sch.c: fix checkpatch error ...
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/acpi/enumeration.txt32
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-grgpio.txt26
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt47
-rw-r--r--Documentation/devicetree/bindings/gpio/gpio-omap.txt7
4 files changed, 109 insertions, 3 deletions
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt
index 94a656131885..b0d541042ac6 100644
--- a/Documentation/acpi/enumeration.txt
+++ b/Documentation/acpi/enumeration.txt
@@ -199,6 +199,8 @@ the device to the driver. For example:
199 { 199 {
200 Name (SBUF, ResourceTemplate() 200 Name (SBUF, ResourceTemplate()
201 { 201 {
202 ...
203 // Used to power on/off the device
202 GpioIo (Exclusive, PullDefault, 0x0000, 0x0000, 204 GpioIo (Exclusive, PullDefault, 0x0000, 0x0000,
203 IoRestrictionOutputOnly, "\\_SB.PCI0.GPI0", 205 IoRestrictionOutputOnly, "\\_SB.PCI0.GPI0",
204 0x00, ResourceConsumer,,) 206 0x00, ResourceConsumer,,)
@@ -206,10 +208,20 @@ the device to the driver. For example:
206 // Pin List 208 // Pin List
207 0x0055 209 0x0055
208 } 210 }
211
212 // Interrupt for the device
213 GpioInt (Edge, ActiveHigh, ExclusiveAndWake, PullNone,
214 0x0000, "\\_SB.PCI0.GPI0", 0x00, ResourceConsumer,,)
215 {
216 // Pin list
217 0x0058
218 }
219
209 ... 220 ...
210 221
211 Return (SBUF)
212 } 222 }
223
224 Return (SBUF)
213 } 225 }
214 226
215These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0" 227These GPIO numbers are controller relative and path "\\_SB.PCI0.GPI0"
@@ -220,6 +232,24 @@ The driver can do this by including <linux/acpi_gpio.h> and then calling
220acpi_get_gpio(path, gpio). This will return the Linux GPIO number or 232acpi_get_gpio(path, gpio). This will return the Linux GPIO number or
221negative errno if there was no translation found. 233negative errno if there was no translation found.
222 234
235In a simple case of just getting the Linux GPIO number from device
236resources one can use acpi_get_gpio_by_index() helper function. It takes
237pointer to the device and index of the GpioIo/GpioInt descriptor in the
238device resources list. For example:
239
240 int gpio_irq, gpio_power;
241 int ret;
242
243 gpio_irq = acpi_get_gpio_by_index(dev, 1, NULL);
244 if (gpio_irq < 0)
245 /* handle error */
246
247 gpio_power = acpi_get_gpio_by_index(dev, 0, NULL);
248 if (gpio_power < 0)
249 /* handle error */
250
251 /* Now we can use the GPIO numbers */
252
223Other GpioIo parameters must be converted first by the driver to be 253Other GpioIo parameters must be converted first by the driver to be
224suitable to the gpiolib before passing them. 254suitable to the gpiolib before passing them.
225 255
diff --git a/Documentation/devicetree/bindings/gpio/gpio-grgpio.txt b/Documentation/devicetree/bindings/gpio/gpio-grgpio.txt
new file mode 100644
index 000000000000..e466598105fc
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-grgpio.txt
@@ -0,0 +1,26 @@
1Aeroflex Gaisler GRGPIO General Purpose I/O cores.
2
3The GRGPIO GPIO core is available in the GRLIB VHDL IP core library.
4
5Note: In the ordinary environment for the GRGPIO core, a Leon SPARC system,
6these properties are built from information in the AMBA plug&play.
7
8Required properties:
9
10- name : Should be "GAISLER_GPIO" or "01_01a"
11
12- reg : Address and length of the register set for the device
13
14- interrupts : Interrupt numbers for this device
15
16Optional properties:
17
18- nbits : The number of gpio lines. If not present driver assumes 32 lines.
19
20- irqmap : An array with an index for each gpio line. An index is either a valid
21 index into the interrupts property array, or 0xffffffff that indicates
22 no irq for that line. Driver provides no interrupt support if not
23 present.
24
25For further information look in the documentation for the GLIB IP core library:
26http://www.gaisler.com/products/grlib/grip.pdf
diff --git a/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
new file mode 100644
index 000000000000..629d0ef17308
--- /dev/null
+++ b/Documentation/devicetree/bindings/gpio/gpio-mcp23s08.txt
@@ -0,0 +1,47 @@
1Microchip MCP2308/MCP23S08/MCP23017/MCP23S17 driver for
28-/16-bit I/O expander with serial interface (I2C/SPI)
3
4Required properties:
5- compatible : Should be
6 - "mcp,mcp23s08" for 8 GPIO SPI version
7 - "mcp,mcp23s17" for 16 GPIO SPI version
8 - "mcp,mcp23008" for 8 GPIO I2C version or
9 - "mcp,mcp23017" for 16 GPIO I2C version of the chip
10- #gpio-cells : Should be two.
11 - first cell is the pin number
12 - second cell is used to specify flags. Flags are currently unused.
13- gpio-controller : Marks the device node as a GPIO controller.
14- reg : For an address on its bus. I2C uses this a the I2C address of the chip.
15 SPI uses this to specify the chipselect line which the chip is
16 connected to. The driver and the SPI variant of the chip support
17 multiple chips on the same chipselect. Have a look at
18 mcp,spi-present-mask below.
19
20Required device specific properties (only for SPI chips):
21- mcp,spi-present-mask : This is a present flag, that makes only sense for SPI
22 chips - as the name suggests. Multiple SPI chips can share the same
23 SPI chipselect. Set a bit in bit0-7 in this mask to 1 if there is a
24 chip connected with the corresponding spi address set. For example if
25 you have a chip with address 3 connected, you have to set bit3 to 1,
26 which is 0x08. mcp23s08 chip variant only supports bits 0-3. It is not
27 possible to mix mcp23s08 and mcp23s17 on the same chipselect. Set at
28 least one bit to 1 for SPI chips.
29- spi-max-frequency = The maximum frequency this chip is able to handle
30
31Example I2C:
32gpiom1: gpio@20 {
33 compatible = "mcp,mcp23017";
34 gpio-controller;
35 #gpio-cells = <2>;
36 reg = <0x20>;
37};
38
39Example SPI:
40gpiom1: gpio@0 {
41 compatible = "mcp,mcp23s17";
42 gpio-controller;
43 #gpio-cells = <2>;
44 spi-present-mask = <0x01>;
45 reg = <0>;
46 spi-max-frequency = <1000000>;
47};
diff --git a/Documentation/devicetree/bindings/gpio/gpio-omap.txt b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
index bff51a2fee1e..1b524c0c79fe 100644
--- a/Documentation/devicetree/bindings/gpio/gpio-omap.txt
+++ b/Documentation/devicetree/bindings/gpio/gpio-omap.txt
@@ -20,8 +20,11 @@ Required properties:
20 8 = active low level-sensitive. 20 8 = active low level-sensitive.
21 21
22OMAP specific properties: 22OMAP specific properties:
23- ti,hwmods: Name of the hwmod associated to the GPIO: 23- ti,hwmods: Name of the hwmod associated to the GPIO:
24 "gpio<X>", <X> being the 1-based instance number from the HW spec 24 "gpio<X>", <X> being the 1-based instance number
25 from the HW spec.
26- ti,gpio-always-on: Indicates if a GPIO bank is always powered and
27 so will never lose its logic state.
25 28
26 29
27Example: 30Example: