sh-pfc: Add DT support
[deliverable/linux.git] / Documentation / devicetree / bindings / pinctrl / renesas,pfc-pinctrl.txt
CommitLineData
fe1c9a82
LP
1* Renesas Pin Function Controller (GPIO and Pin Mux/Config)
2
3The Pin Function Controller (PFC) is a Pin Mux/Config controller. On SH7372,
4SH73A0, R8A73A4 and R8A7740 it also acts as a GPIO controller.
5
6
7Pin Control
8-----------
9
10Required Properties:
11
12 - compatible: should be one of the following.
13 - "renesas,pfc-r8a73a4": for R8A73A4 (R-Mobile APE6) compatible pin-controller.
14 - "renesas,pfc-r8a7740": for R8A7740 (R-Mobile A1) compatible pin-controller.
15 - "renesas,pfc-r8a7778": for R8A7778 (R-Mobile M1) compatible pin-controller.
16 - "renesas,pfc-r8a7779": for R8A7779 (R-Car H1) compatible pin-controller.
17 - "renesas,pfc-r8a7790": for R8A7790 (R-Car H2) compatible pin-controller.
18 - "renesas,pfc-sh7372": for SH7372 (SH-Mobile AP4) compatible pin-controller.
19 - "renesas,pfc-sh73a0": for SH73A0 (SH-Mobile AG5) compatible pin-controller.
20
21 - reg: Base address and length of each memory resource used by the pin
22 controller hardware module.
23
24Optional properties:
25
26 - #gpio-range-cells: Mandatory when the PFC doesn't handle GPIO, forbidden
27 otherwise. Should be 3.
28
29The PFC node also acts as a container for pin configuration nodes. Please refer
30to pinctrl-bindings.txt in this directory for the definition of the term "pin
31configuration node" and for the common pinctrl bindings used by client devices.
32
33Each pin configuration node represents desired functions to select on a pin
34group or a list of pin groups. The functions and pin groups can be specified
35directly in the pin configuration node, or grouped in child subnodes. Several
36functions can thus be referenced as a single pin configuration node by client
37devices.
38
39A configuration node or subnode must contain a function and reference at least
40one pin group.
41
42All pin configuration nodes and subnodes names are ignored. All of those nodes
43are parsed through phandles and processed purely based on their content.
44
45Pin Configuration Node Properties:
46
47- renesas,groups : An array of strings, each string containing the name of a pin
48 group.
49
50- renesas,function: A string containing the name of the function to mux to the
51 pin group(s) specified by the renesas,groups property
52
53 Valid values for pin, group and function names can be found in the group and
54 function arrays of the PFC data file corresponding to the SoC
55 (drivers/pinctrl/sh-pfc/pfc-*.c)
56
57
58GPIO
59----
60
61On SH7372, SH73A0, R8A73A4 and R8A7740 the PFC node is also a GPIO controller
62node.
63
64Required Properties:
65
66 - gpio-controller: Marks the device node as a gpio controller.
67
68 - #gpio-cells: Should be 2. The first cell is the GPIO number and the second
69 cell specifies GPIO flags, as defined in <dt-bindings/gpio/gpio.h>. Only the
70 GPIO_ACTIVE_HIGH and GPIO_ACTIVE_LOW flags are supported.
71
72The syntax of the gpio specifier used by client nodes should be the following
73with values derived from the SoC user manual.
74
75 <[phandle of the gpio controller node]
76 [pin number within the gpio controller]
77 [flags]>
78
79On other mach-shmobile platforms GPIO is handled by the gpio-rcar driver.
80Please refer to Documentation/devicetree/bindings/gpio/renesas,gpio-rcar.txt
81for documentation of the GPIO device tree bindings on those platforms.
82
83
84Examples
85--------
86
87Example 1: SH73A0 (SH-Mobile AG5) pin controller node
88
89 pfc: pfc@e6050000 {
90 compatible = "renesas,pfc-sh73a0";
91 reg = <0xe6050000 0x8000>,
92 <0xe605801c 0x1c>;
93 gpio-controller;
94 #gpio-cells = <2>;
95 };
96
97Example 2: A GPIO LED node that references a GPIO
98
99 #include <dt-bindings/gpio/gpio.h>
100
101 leds {
102 compatible = "gpio-leds";
103 led1 {
104 gpios = <&pfc 20 GPIO_ACTIVE_LOW>;
105 };
106 };
107
108Example 3: KZM-A9-GT (SH-Mobile AG5) default pin state hog and pin control maps
109 for the MMCIF and SCIFA4 devices
110
111 &pfc {
112 pinctrl-0 = <&scifa4_pins>;
113 pinctrl-names = "default";
114
115 mmcif_pins: mmcif {
116 renesas,groups = "mmc0_data8_0", "mmc0_ctrl_0";
117 renesas,function = "mmc0";
118 };
119
120 scifa4_pins: scifa4 {
121 renesas,groups = "scifa4_data", "scifa4_ctrl";
122 renesas,function = "scifa4";
123 };
124 };
125
126Example 4: KZM-A9-GT (SH-Mobile AG5) default pin state for the MMCIF device
127
128 &mmcif {
129 pinctrl-0 = <&mmcif_pins>;
130 pinctrl-names = "default";
131
132 bus-width = <8>;
133 vmmc-supply = <&reg_1p8v>;
134 status = "okay";
135 };
This page took 0.039882 seconds and 5 git commands to generate.