diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2012-09-18 04:57:10 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2012-09-18 17:27:25 -0400 |
commit | 5e969a401a0126806cc2a358800b5b52d6c0a246 (patch) | |
tree | bf1abac453b63d37222331cb414e2a783ae9887b /Documentation/devicetree/bindings/gpio | |
parent | d724f1c9c3c7dee420b8d778ee53207ef3c17120 (diff) |
gpio: Add Avionic Design N-bit GPIO expander support
This commit adds a driver for the Avionic Design N-bit GPIO expander.
The expander provides a variable number of GPIO pins with interrupt
support.
Changes in v2:
- allow building the driver as a module
- assign of_node unconditionally
- use linear mapping IRQ domain
- properly cleanup IRQ domain
- add OF device table and annotate device tables
- emulate rising and falling edge triggers
- increase #gpio-cells to 2
- drop support for !OF
- use IS_ENABLED to conditionalize DEBUG_FS code
Changes in v3:
- make IRQ support runtime configurable (interrupt-controller property)
- drop interrupt-controller and #interrupt-cells from DT binding
- add inline to_adnp() function to wrap container_of() macro
- consistently use adnp as name for struct adnp variables
- remove irq_mask_cur and rename irq_mask to irq_enable
- fix a subtle deadlock in adnp_gpio_direction_output()
- remove dynamic allocations from debugfs code
- rename regs to num_regs to avoid confusion
- annotate non-trivial code with comments
- don't acquire mutex in adnp_gpio_get()
- assume NO_IRQ == 0
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: devicetree-discuss@lists.ozlabs.org
Cc: Linus Walleij <linus.walleij@stericsson.com>
Cc: linux-kernel@vger.kernel.org
Acked-by: Rob Herring <rob.herring@calxeda.com>
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'Documentation/devicetree/bindings/gpio')
-rw-r--r-- | Documentation/devicetree/bindings/gpio/gpio-adnp.txt | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio-adnp.txt b/Documentation/devicetree/bindings/gpio/gpio-adnp.txt new file mode 100644 index 000000000000..5a09a216fe65 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-adnp.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | Avionic Design N-bit GPIO expander bindings | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: should be "ad,gpio-adnp" | ||
5 | - reg: The I2C slave address for this device. | ||
6 | - interrupt-parent: phandle of the parent interrupt controller. | ||
7 | - interrupts: Interrupt specifier for the controllers interrupt. | ||
8 | - #gpio-cells: Should be 2. The first cell is the GPIO number and the | ||
9 | second cell is used to specify optional parameters: | ||
10 | - bit 0: polarity (0: normal, 1: inverted) | ||
11 | - gpio-controller: Marks the device as a GPIO controller | ||
12 | - nr-gpios: The number of pins supported by the controller. | ||
13 | |||
14 | Example: | ||
15 | |||
16 | gpioext: gpio-controller@41 { | ||
17 | compatible = "ad,gpio-adnp"; | ||
18 | reg = <0x41>; | ||
19 | |||
20 | interrupt-parent = <&gpio>; | ||
21 | interrupts = <160 1>; | ||
22 | |||
23 | gpio-controller; | ||
24 | #gpio-cells = <2>; | ||
25 | |||
26 | interrupt-controller; | ||
27 | #interrupt-cells = <2>; | ||
28 | |||
29 | nr-gpios = <64>; | ||
30 | }; | ||