summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/gpio/gpio-tz1090.txt
blob: 174cdf3091700406bd26cb6d324dc2ec04fb10e0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
ImgTec TZ1090 GPIO Controller

Required properties:
- compatible: Compatible property value should be "img,tz1090-gpio".

- reg: Physical base address of the controller and length of memory mapped
  region.

- #address-cells: Should be 1 (for bank subnodes)

- #size-cells: Should be 0 (for bank subnodes)

- Each bank of GPIOs should have a subnode to represent it.

  Bank subnode required properties:
  - reg: Index of bank in the range 0 to 2.

  - gpio-controller: Specifies that the node is a gpio controller.

  - #gpio-cells: Should be 2. The syntax of the gpio specifier used by client
    nodes should have the following values.
       <[phandle of the gpio controller node]
        [gpio number within the gpio bank]
        [gpio flags]>

    Values for gpio specifier:
    - GPIO number: a value in the range 0 to 29.
    - GPIO flags: bit field of flags, as defined in <dt-bindings/gpio/gpio.h>.
      Only the following flags are supported:
        GPIO_ACTIVE_HIGH
        GPIO_ACTIVE_LOW

  Bank subnode optional properties:
  - gpio-ranges: Mapping to pin controller pins (as described in
    Documentation/devicetree/bindings/gpio/gpio.txt)

  - interrupts: Interrupt for the entire bank

  - interrupt-controller: Specifies that the node is an interrupt controller

  - #interrupt-cells: Should be 2. The syntax of the interrupt specifier used by
    client nodes should have the following values.
       <[phandle of the interurupt controller]
        [gpio number within the gpio bank]
        [irq flags]>

    Values for irq specifier:
    - GPIO number: a value in the range 0 to 29
    - IRQ flags: value to describe edge and level triggering, as defined in
      <dt-bindings/interrupt-controller/irq.h>. Only the following flags are
      supported:
        IRQ_TYPE_EDGE_RISING
        IRQ_TYPE_EDGE_FALLING
        IRQ_TYPE_EDGE_BOTH
        IRQ_TYPE_LEVEL_HIGH
        IRQ_TYPE_LEVEL_LOW



Example:

	gpios: gpio-controller@02005800 {
		#address-cells = <1>;
		#size-cells = <0>;
		compatible = "img,tz1090-gpio";
		reg = <0x02005800 0x90>;

		/* bank 0 with an interrupt */
		gpios0: bank@0 {
			#gpio-cells = <2>;
			#interrupt-cells = <2>;
			reg = <0>;
			interrupts = <13 IRQ_TYPE_LEVEL_HIGH>;
			gpio-controller;
			gpio-ranges = <&pinctrl 0 0 30>;
			interrupt-controller;
		};

		/* bank 2 without interrupt */
		gpios2: bank@2 {
			#gpio-cells = <2>;
			reg = <2>;
			gpio-controller;
			gpio-ranges = <&pinctrl 0 60 30>;
		};
	};