aboutsummaryrefslogtreecommitdiff
path: root/sys/dts/bindings-gpio.txt
blob: b13078aeb0b377ff22d6684764aa4bb7de4e57fe (plain) (blame)
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
$FreeBSD$

GPIO configuration.
===================

1. Properties for GPIO Controllers

1.1 #gpio-cells

Property:	#gpio-cells

Value type:	<u32>

Description:	The #gpio-cells property defines the number of cells required
		to encode a gpio specifier.


1.2 gpio-controller

Property:	gpio-controller

Value type:	<empty>

Description:	The presence of a gpio-controller property defines a node as a
		GPIO controller node.


1.3 pin-count

Property:	pin-count

Value type:	<u32>

Description:	The pin-count property defines the number of GPIO pins.


1.4 Example

	GPIO: gpio@10100 {
		#gpio-cells = <3>;
		compatible = "mrvl,gpio";
		reg = <0x10100 0x20>;
		gpio-controller;
		interrupts = <6 7 8 9>;
		interrupt-parent = <&PIC>;
		pin-count = <50>
	};

2. Properties for GPIO consumer nodes.

2.1 gpios

Property:	gpios

Value type:	<prop-encoded-array> encoded as arbitrary number of GPIO
		specifiers.

Description:	The gpios property of a device node defines the GPIO or GPIOs
		that are used by the device. The value of the gpios property
		consists of an arbitrary number of GPIO specifiers.
		
		The first cell of the GPIO specifier is phandle of the node's
		parent GPIO controller and remaining cells are defined by the
		binding describing the GPIO parent, typically include
		information like pin number, direction and various flags.

Example:
		gpios = <&GPIO 0 1 0		/* GPIO[0]:  IN,  NONE */
			 &GPIO 1 2 0>;		/* GPIO[1]:  OUT, NONE */


3. "mrvl,gpio" controller GPIO specifier

	<phandle pin dir flags>


pin:	0-MAX				GPIO pin number.

dir:
	1		IN		Input direction.
	2		OUT		Output direction.

flags:
	0x0000----	IN_NONE
	0x0001----	IN_POL_LOW	Polarity low (active-low).
	0x0002----	IN_IRQ_EDGE	Interrupt, edge triggered.
	0x0004----	IN_IRQ_LEVEL	Interrupt, level triggered.
	
	0x----0000	OUT_NONE
	0x----0001	OUT_BLINK	Blink on the pin.
	0x----0002	OUT_OPEN_DRAIN	Open drain output line.
	0x----0004	OUT_OPEN_SRC	Open source output line.


Example:
	gpios = <&GPIO 0  1 0x00000000		/* GPIO[0]:   IN */
		 &GPIO 1  2 0x00000000		/* GPIO[1]:   OUT */
		 &GPIO 2  1 0x00020000		/* GPIO[2]:   IN, IRQ (edge) */
		 &GPIO 3  1 0x00040000		/* GPIO[3]:   IN, IRQ (level) */
		 ...
		 &GPIO 10 2 0x00000001>;	/* GPIO[10]:  OUT, blink */