summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/pinctrl/brcm,iproc-gpio.txt
blob: a73cbeb0f309dea99c3823bc1d79898f89285bcd (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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Broadcom iProc GPIO/PINCONF Controller

Required properties:

- compatible:
    "brcm,iproc-gpio" for the generic iProc based GPIO controller IP that
    supports full-featured pinctrl and GPIO functions used in various iProc
    based SoCs

    May contain an SoC-specific compatibility string to accommodate any
    SoC-specific features

    "brcm,cygnus-ccm-gpio", "brcm,cygnus-asiu-gpio", or
    "brcm,cygnus-crmu-gpio" for Cygnus SoCs

    "brcm,iproc-nsp-gpio" for the iProc NSP SoC that has drive strength support
    disabled

    "brcm,iproc-stingray-gpio" for the iProc Stingray SoC that has the general
    pinctrl support completely disabled in this IP block. In Stingray, a
    different IP block is used to handle pinctrl related functions

- reg:
    Define the base and range of the I/O address space that contains SoC
GPIO/PINCONF controller registers

- ngpios:
    Total number of in-use slots in GPIO controller

- #gpio-cells:
    Must be two. The first cell is the GPIO pin number (within the
controller's pin space) and the second cell is used for the following:
    bit[0]: polarity (0 for active high and 1 for active low)

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

Optional properties:

- interrupts:
    Interrupt ID

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

- gpio-ranges:
    Specifies the mapping between gpio controller and pin-controllers pins.
    This requires 4 fields in cells defined as -
    1. Phandle of pin-controller.
    2. GPIO base pin offset.
    3  Pin-control base pin offset.
    4. number of gpio pins which are linearly mapped from pin base.

Supported generic PINCONF properties in child nodes:

- pins:
    The list of pins (within the controller's own pin space) that properties
in the node apply to. Pin names are "gpio-<pin>"

- bias-disable:
    Disable pin bias

- bias-pull-up:
    Enable internal pull up resistor

- bias-pull-down:
    Enable internal pull down resistor

- drive-strength:
    Valid drive strength values include 2, 4, 6, 8, 10, 12, 14, 16 (mA)

Example:
	gpio_ccm: gpio@1800a000 {
		compatible = "brcm,cygnus-ccm-gpio";
		reg = <0x1800a000 0x50>,
		      <0x0301d164 0x20>;
		ngpios = <24>;
		#gpio-cells = <2>;
		gpio-controller;
		interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-controller;

		touch_pins: touch_pins {
			pwr: pwr {
				pins = "gpio-0";
				drive-strength = <16>;
			};

			event: event {
				pins = "gpio-1";
				bias-pull-up;
			};
		};
	};

	gpio_asiu: gpio@180a5000 {
		compatible = "brcm,cygnus-asiu-gpio";
		reg = <0x180a5000 0x668>;
		ngpios = <146>;
		#gpio-cells = <2>;
		gpio-controller;
		interrupts = <GIC_SPI 174 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-controller;
		gpio-ranges = <&pinctrl 0 42 1>,
				<&pinctrl 1 44 3>;
	};

	/*
	 * Touchscreen that uses the CCM GPIO 0 and 1
	 */
	tsc {
		...
		...
		gpio-pwr = <&gpio_ccm 0 0>;
		gpio-event = <&gpio_ccm 1 0>;
	};

	/* Bluetooth that uses the ASIU GPIO 5, with polarity inverted */
	bluetooth {
		...
		...
		bcm,rfkill-bank-sel = <&gpio_asiu 5 1>
	}