diff options
author | James Hogan <james.hogan@imgtec.com> | 2013-06-25 10:27:43 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2013-07-20 13:00:44 -0400 |
commit | 9caf1f2202da2affedf0c9e3c1ccda8ea6d353e1 (patch) | |
tree | 09dbe80d481bddaa5677b47a1ffa0573e4776e22 /Documentation | |
parent | ad81f0545ef01ea651886dddac4bef6cec930092 (diff) |
gpio-tz1090: add TZ1090 gpio driver
Add a GPIO driver for the main GPIOs found in the TZ1090 (Comet) SoC.
This doesn't include low-power GPIOs as they're controlled separately
via the Powerdown Controller (PDC) registers.
The driver is instantiated by device tree and supports interrupts for
all GPIOs.
Changes in v4:
- fix typos in DT bindings compatible properties
- reference Documentation/devicetree/bindings/gpio/gpio.txt in
gpio-ranges description in DT bindings
- fix gpio-ranges examples in DT bindings (it must now have 3 cells)
- gpio-tz1090: use of_property_read_u32 instead of of_get_property
Changes in v3:
- separated from irq-imgpdc and removed arch/metag changes to allow
these patches to go upstream separately via the pinctrl[/gpio] trees
(particularly the pinctrl drivers depend on the new pinconf DT
bindings).
- some s/unsigned/unsigned int/.
- some s/unsigned int/bool/ and use of BIT().
- gpio-tz1090*: refer to <dt-bindings/gpio/gpio.h> and
<dt-bindings/interrupt-controller/irq.h> flags in bindings.
- gpio-tz1090*: move initcall from postcore to subsys.
- gpio-tz1090: add REG_ prefix to some constants for consistency.
- gpio-tz1090: add comment to explain tz1090_gpio_irq_next_edge
cunningness.
Changes in v2:
- gpio-tz1090: remove references to Linux flags in dt bindings
- gpio-tz1090: make use of BIT() from linux/bitops.h
- gpio-tz1090: make register accessors inline to match pinctrl
- gpio-tz1090: update gpio-ranges to use 3 cells after recent ABI
breakage
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Grant Likely <grant.likely@linaro.org>
Cc: Rob Herring <rob.herring@calxeda.com>
Cc: Rob Landley <rob@landley.net>
Cc: Linus Walleij <linus.walleij@linaro.org>
Cc: linux-doc@vger.kernel.org
Cc: devicetree-discuss@lists.ozlabs.org
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/devicetree/bindings/gpio/gpio-tz1090.txt | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/Documentation/devicetree/bindings/gpio/gpio-tz1090.txt b/Documentation/devicetree/bindings/gpio/gpio-tz1090.txt new file mode 100644 index 000000000000..174cdf309170 --- /dev/null +++ b/Documentation/devicetree/bindings/gpio/gpio-tz1090.txt | |||
@@ -0,0 +1,88 @@ | |||
1 | ImgTec TZ1090 GPIO Controller | ||
2 | |||
3 | Required properties: | ||
4 | - compatible: Compatible property value should be "img,tz1090-gpio". | ||
5 | |||
6 | - reg: Physical base address of the controller and length of memory mapped | ||
7 | region. | ||
8 | |||
9 | - #address-cells: Should be 1 (for bank subnodes) | ||
10 | |||
11 | - #size-cells: Should be 0 (for bank subnodes) | ||
12 | |||
13 | - Each bank of GPIOs should have a subnode to represent it. | ||
14 | |||
15 | Bank subnode required properties: | ||
16 | - reg: Index of bank in the range 0 to 2. | ||
17 | |||
18 | - gpio-controller: Specifies that the node is a gpio controller. | ||
19 | |||
20 | - #gpio-cells: Should be 2. The syntax of the gpio specifier used by client | ||
21 | nodes should have the following values. | ||
22 | <[phandle of the gpio controller node] | ||
23 | [gpio number within the gpio bank] | ||
24 | [gpio flags]> | ||
25 | |||
26 | Values for gpio specifier: | ||
27 | - GPIO number: a value in the range 0 to 29. | ||
28 | - GPIO flags: bit field of flags, as defined in <dt-bindings/gpio/gpio.h>. | ||
29 | Only the following flags are supported: | ||
30 | GPIO_ACTIVE_HIGH | ||
31 | GPIO_ACTIVE_LOW | ||
32 | |||
33 | Bank subnode optional properties: | ||
34 | - gpio-ranges: Mapping to pin controller pins (as described in | ||
35 | Documentation/devicetree/bindings/gpio/gpio.txt) | ||
36 | |||
37 | - interrupts: Interrupt for the entire bank | ||
38 | |||
39 | - interrupt-controller: Specifies that the node is an interrupt controller | ||
40 | |||
41 | - #interrupt-cells: Should be 2. The syntax of the interrupt specifier used by | ||
42 | client nodes should have the following values. | ||
43 | <[phandle of the interurupt controller] | ||
44 | [gpio number within the gpio bank] | ||
45 | [irq flags]> | ||
46 | |||
47 | Values for irq specifier: | ||
48 | - GPIO number: a value in the range 0 to 29 | ||
49 | - IRQ flags: value to describe edge and level triggering, as defined in | ||
50 | <dt-bindings/interrupt-controller/irq.h>. Only the following flags are | ||
51 | supported: | ||
52 | IRQ_TYPE_EDGE_RISING | ||
53 | IRQ_TYPE_EDGE_FALLING | ||
54 | IRQ_TYPE_EDGE_BOTH | ||
55 | IRQ_TYPE_LEVEL_HIGH | ||
56 | IRQ_TYPE_LEVEL_LOW | ||
57 | |||
58 | |||
59 | |||
60 | Example: | ||
61 | |||
62 | gpios: gpio-controller@02005800 { | ||
63 | #address-cells = <1>; | ||
64 | #size-cells = <0>; | ||
65 | compatible = "img,tz1090-gpio"; | ||
66 | reg = <0x02005800 0x90>; | ||
67 | |||
68 | /* bank 0 with an interrupt */ | ||
69 | gpios0: bank@0 { | ||
70 | #gpio-cells = <2>; | ||
71 | #interrupt-cells = <2>; | ||
72 | reg = <0>; | ||
73 | interrupts = <13 IRQ_TYPE_LEVEL_HIGH>; | ||
74 | gpio-controller; | ||
75 | gpio-ranges = <&pinctrl 0 0 30>; | ||
76 | interrupt-controller; | ||
77 | }; | ||
78 | |||
79 | /* bank 2 without interrupt */ | ||
80 | gpios2: bank@2 { | ||
81 | #gpio-cells = <2>; | ||
82 | reg = <2>; | ||
83 | gpio-controller; | ||
84 | gpio-ranges = <&pinctrl 0 60 30>; | ||
85 | }; | ||
86 | }; | ||
87 | |||
88 | |||