xref: /OK3568_Linux_fs/kernel/drivers/pinctrl/mvebu/pinctrl-armada-375.c (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun // SPDX-License-Identifier: GPL-2.0-or-later
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Marvell Armada 375 pinctrl driver based on mvebu pinctrl core
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Copyright (C) 2012 Marvell
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
8*4882a593Smuzhiyun  */
9*4882a593Smuzhiyun 
10*4882a593Smuzhiyun #include <linux/err.h>
11*4882a593Smuzhiyun #include <linux/init.h>
12*4882a593Smuzhiyun #include <linux/io.h>
13*4882a593Smuzhiyun #include <linux/platform_device.h>
14*4882a593Smuzhiyun #include <linux/clk.h>
15*4882a593Smuzhiyun #include <linux/of.h>
16*4882a593Smuzhiyun #include <linux/of_device.h>
17*4882a593Smuzhiyun #include <linux/pinctrl/pinctrl.h>
18*4882a593Smuzhiyun 
19*4882a593Smuzhiyun #include "pinctrl-mvebu.h"
20*4882a593Smuzhiyun 
21*4882a593Smuzhiyun static struct mvebu_mpp_mode mv88f6720_mpp_modes[] = {
22*4882a593Smuzhiyun 	MPP_MODE(0,
23*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
24*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad2"),
25*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "spi0", "cs1"),
26*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "cs1"),
27*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io2")),
28*4882a593Smuzhiyun 	MPP_MODE(1,
29*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
30*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad3"),
31*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "spi0", "mosi"),
32*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "mosi"),
33*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io3")),
34*4882a593Smuzhiyun 	MPP_MODE(2,
35*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
36*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad4"),
37*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ptp", "evreq"),
38*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "led", "c0"),
39*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "audio", "sdi"),
40*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io4"),
41*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "spi1", "mosi")),
42*4882a593Smuzhiyun 	MPP_MODE(3,
43*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
44*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad5"),
45*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ptp", "trig"),
46*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "led", "p3"),
47*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "audio", "mclk"),
48*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io5"),
49*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "spi1", "miso")),
50*4882a593Smuzhiyun 	MPP_MODE(4,
51*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
52*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad6"),
53*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "spi0", "miso"),
54*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "miso"),
55*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io6")),
56*4882a593Smuzhiyun 	MPP_MODE(5,
57*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
58*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad7"),
59*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "spi0", "cs2"),
60*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "cs2"),
61*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io7"),
62*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "spi1", "miso")),
63*4882a593Smuzhiyun 	MPP_MODE(6,
64*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
65*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad0"),
66*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "led", "p1"),
67*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "audio", "lrclk"),
68*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io0")),
69*4882a593Smuzhiyun 	MPP_MODE(7,
70*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
71*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ad1"),
72*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ptp", "clk"),
73*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "led", "p2"),
74*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "audio", "extclk"),
75*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "io1")),
76*4882a593Smuzhiyun 	MPP_MODE(8,
77*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
78*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "bootcs"),
79*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "spi0", "cs0"),
80*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "cs0"),
81*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "ce")),
82*4882a593Smuzhiyun 	MPP_MODE(9,
83*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
84*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "spi0", "sck"),
85*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "sck"),
86*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "we")),
87*4882a593Smuzhiyun 	MPP_MODE(10,
88*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
89*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "dram", "vttctrl"),
90*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "led", "c1"),
91*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "re"),
92*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "spi1", "sck")),
93*4882a593Smuzhiyun 	MPP_MODE(11,
94*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
95*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "a0"),
96*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "led", "c2"),
97*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "audio", "sdo"),
98*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "cle")),
99*4882a593Smuzhiyun 	MPP_MODE(12,
100*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
101*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "a1"),
102*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "audio", "bclk"),
103*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "ale")),
104*4882a593Smuzhiyun 	MPP_MODE(13,
105*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
106*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "dev", "ready"),
107*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "pcie0", "rstout"),
108*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "pcie1", "rstout"),
109*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "nand", "rb"),
110*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "spi1", "mosi")),
111*4882a593Smuzhiyun 	MPP_MODE(14,
112*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
113*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "i2c0", "sda"),
114*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "uart1", "txd")),
115*4882a593Smuzhiyun 	MPP_MODE(15,
116*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
117*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "i2c0", "sck"),
118*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "uart1", "rxd")),
119*4882a593Smuzhiyun 	MPP_MODE(16,
120*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
121*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "uart0", "txd")),
122*4882a593Smuzhiyun 	MPP_MODE(17,
123*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
124*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "uart0", "rxd")),
125*4882a593Smuzhiyun 	MPP_MODE(18,
126*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
127*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "tdm", "int")),
128*4882a593Smuzhiyun 	MPP_MODE(19,
129*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
130*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "tdm", "rst")),
131*4882a593Smuzhiyun 	MPP_MODE(20,
132*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
133*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "tdm", "pclk")),
134*4882a593Smuzhiyun 	MPP_MODE(21,
135*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
136*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "tdm", "fsync")),
137*4882a593Smuzhiyun 	MPP_MODE(22,
138*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
139*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "tdm", "drx")),
140*4882a593Smuzhiyun 	MPP_MODE(23,
141*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
142*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "tdm", "dtx")),
143*4882a593Smuzhiyun 	MPP_MODE(24,
144*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
145*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "p0"),
146*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "rxd0"),
147*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "sd", "cmd"),
148*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "uart0", "rts"),
149*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "spi0", "cs0"),
150*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "cs1")),
151*4882a593Smuzhiyun 	MPP_MODE(25,
152*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
153*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "p2"),
154*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "rxd1"),
155*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "sd", "d0"),
156*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "uart0", "cts"),
157*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "spi0", "mosi"),
158*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "cs2")),
159*4882a593Smuzhiyun 	MPP_MODE(26,
160*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
161*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie0", "clkreq"),
162*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "rxd2"),
163*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "sd", "d2"),
164*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "uart1", "rts"),
165*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "spi0", "cs1"),
166*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "led", "c1")),
167*4882a593Smuzhiyun 	MPP_MODE(27,
168*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
169*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie1", "clkreq"),
170*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "rxd3"),
171*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "sd", "d1"),
172*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "uart1", "cts"),
173*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "spi0", "miso"),
174*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "led", "c2")),
175*4882a593Smuzhiyun 	MPP_MODE(28,
176*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
177*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "p3"),
178*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "txctl"),
179*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "sd", "clk"),
180*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "dram", "vttctrl")),
181*4882a593Smuzhiyun 	MPP_MODE(29,
182*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
183*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie1", "clkreq"),
184*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "rxclk"),
185*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "sd", "d3"),
186*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "spi0", "sck"),
187*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "pcie0", "rstout")),
188*4882a593Smuzhiyun 	MPP_MODE(30,
189*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
190*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "txd0"),
191*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "cs0"),
192*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "p3"),
193*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "ptp", "evreq")),
194*4882a593Smuzhiyun 	MPP_MODE(31,
195*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
196*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "txd1"),
197*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "mosi"),
198*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "p0")),
199*4882a593Smuzhiyun 	MPP_MODE(32,
200*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
201*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "txd2"),
202*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "sck"),
203*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "ptp", "trig"),
204*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "c0")),
205*4882a593Smuzhiyun 	MPP_MODE(33,
206*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
207*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "txd3"),
208*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "miso"),
209*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "p2")),
210*4882a593Smuzhiyun 	MPP_MODE(34,
211*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
212*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "txclkout"),
213*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "sck"),
214*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "c1")),
215*4882a593Smuzhiyun 	MPP_MODE(35,
216*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
217*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge1", "rxctl"),
218*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "cs1"),
219*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "spi0", "cs2"),
220*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "p1")),
221*4882a593Smuzhiyun 	MPP_MODE(36,
222*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
223*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie0", "clkreq"),
224*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "c2")),
225*4882a593Smuzhiyun 	MPP_MODE(37,
226*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
227*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie0", "clkreq"),
228*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "tdm", "int"),
229*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "ge", "mdc")),
230*4882a593Smuzhiyun 	MPP_MODE(38,
231*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
232*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie1", "clkreq"),
233*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "ge", "mdio")),
234*4882a593Smuzhiyun 	MPP_MODE(39,
235*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
236*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "ref", "clkout"),
237*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "p3")),
238*4882a593Smuzhiyun 	MPP_MODE(40,
239*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
240*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "uart1", "txd"),
241*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "p0")),
242*4882a593Smuzhiyun 	MPP_MODE(41,
243*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
244*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "uart1", "rxd"),
245*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "p1")),
246*4882a593Smuzhiyun 	MPP_MODE(42,
247*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
248*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "cs2"),
249*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "c0"),
250*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "ptp", "clk")),
251*4882a593Smuzhiyun 	MPP_MODE(43,
252*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
253*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "sata0", "prsnt"),
254*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "dram", "vttctrl"),
255*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "c1")),
256*4882a593Smuzhiyun 	MPP_MODE(44,
257*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
258*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "sata0", "prsnt")),
259*4882a593Smuzhiyun 	MPP_MODE(45,
260*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
261*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "spi0", "cs2"),
262*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "pcie0", "rstout"),
263*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "led", "c2"),
264*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "spi1", "cs2")),
265*4882a593Smuzhiyun 	MPP_MODE(46,
266*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
267*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "p0"),
268*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "txd0"),
269*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "txd0"),
270*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "we1")),
271*4882a593Smuzhiyun 	MPP_MODE(47,
272*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
273*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "p1"),
274*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "txd1"),
275*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "txd1"),
276*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "ptp", "trig"),
277*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ale0")),
278*4882a593Smuzhiyun 	MPP_MODE(48,
279*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
280*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "p2"),
281*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "txd2"),
282*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "txd2"),
283*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ale1")),
284*4882a593Smuzhiyun 	MPP_MODE(49,
285*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
286*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "p3"),
287*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "txd3"),
288*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "txd3"),
289*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "a2")),
290*4882a593Smuzhiyun 	MPP_MODE(50,
291*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
292*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "c0"),
293*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "rxd0"),
294*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "rxd0"),
295*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "ptp", "evreq"),
296*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad12")),
297*4882a593Smuzhiyun 	MPP_MODE(51,
298*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
299*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "c1"),
300*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "rxd1"),
301*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "rxd1"),
302*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad8")),
303*4882a593Smuzhiyun 	MPP_MODE(52,
304*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
305*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "led", "c2"),
306*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "rxd2"),
307*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "rxd2"),
308*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "i2c0", "sda"),
309*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad9")),
310*4882a593Smuzhiyun 	MPP_MODE(53,
311*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
312*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie1", "rstout"),
313*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "rxd3"),
314*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "rxd3"),
315*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "i2c0", "sck"),
316*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad10")),
317*4882a593Smuzhiyun 	MPP_MODE(54,
318*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
319*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "pcie0", "rstout"),
320*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "rxctl"),
321*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "rxctl"),
322*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad11")),
323*4882a593Smuzhiyun 	MPP_MODE(55,
324*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
325*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "rxclk"),
326*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "rxclk"),
327*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "cs0")),
328*4882a593Smuzhiyun 	MPP_MODE(56,
329*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
330*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "txclkout"),
331*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "txclkout"),
332*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "oe")),
333*4882a593Smuzhiyun 	MPP_MODE(57,
334*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
335*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ge0", "txctl"),
336*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "ge1", "txctl"),
337*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "we0")),
338*4882a593Smuzhiyun 	MPP_MODE(58,
339*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
340*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "c0")),
341*4882a593Smuzhiyun 	MPP_MODE(59,
342*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
343*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "c1")),
344*4882a593Smuzhiyun 	MPP_MODE(60,
345*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
346*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "uart1", "txd"),
347*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "c2"),
348*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad13")),
349*4882a593Smuzhiyun 	MPP_MODE(61,
350*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
351*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "i2c1", "sda"),
352*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "uart1", "rxd"),
353*4882a593Smuzhiyun 		 MPP_FUNCTION(0x3, "spi1", "cs2"),
354*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "p0"),
355*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad14")),
356*4882a593Smuzhiyun 	MPP_MODE(62,
357*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
358*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "i2c1", "sck"),
359*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "p1"),
360*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "ad15")),
361*4882a593Smuzhiyun 	MPP_MODE(63,
362*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
363*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ptp", "trig"),
364*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "p2"),
365*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "burst/last")),
366*4882a593Smuzhiyun 	MPP_MODE(64,
367*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
368*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "dram", "vttctrl"),
369*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "led", "p3")),
370*4882a593Smuzhiyun 	MPP_MODE(65,
371*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
372*4882a593Smuzhiyun 		 MPP_FUNCTION(0x1, "sata1", "prsnt")),
373*4882a593Smuzhiyun 	MPP_MODE(66,
374*4882a593Smuzhiyun 		 MPP_FUNCTION(0x0, "gpio", NULL),
375*4882a593Smuzhiyun 		 MPP_FUNCTION(0x2, "ptp", "evreq"),
376*4882a593Smuzhiyun 		 MPP_FUNCTION(0x4, "spi1", "cs3"),
377*4882a593Smuzhiyun 		 MPP_FUNCTION(0x5, "pcie0", "rstout"),
378*4882a593Smuzhiyun 		 MPP_FUNCTION(0x6, "dev", "cs3")),
379*4882a593Smuzhiyun };
380*4882a593Smuzhiyun 
381*4882a593Smuzhiyun static struct mvebu_pinctrl_soc_info armada_375_pinctrl_info;
382*4882a593Smuzhiyun 
383*4882a593Smuzhiyun static const struct of_device_id armada_375_pinctrl_of_match[] = {
384*4882a593Smuzhiyun 	{ .compatible = "marvell,mv88f6720-pinctrl" },
385*4882a593Smuzhiyun 	{ },
386*4882a593Smuzhiyun };
387*4882a593Smuzhiyun 
388*4882a593Smuzhiyun static const struct mvebu_mpp_ctrl mv88f6720_mpp_controls[] = {
389*4882a593Smuzhiyun 	MPP_FUNC_CTRL(0, 69, NULL, mvebu_mmio_mpp_ctrl),
390*4882a593Smuzhiyun };
391*4882a593Smuzhiyun 
392*4882a593Smuzhiyun static struct pinctrl_gpio_range mv88f6720_mpp_gpio_ranges[] = {
393*4882a593Smuzhiyun 	MPP_GPIO_RANGE(0,   0,  0, 32),
394*4882a593Smuzhiyun 	MPP_GPIO_RANGE(1,  32, 32, 32),
395*4882a593Smuzhiyun 	MPP_GPIO_RANGE(2,  64, 64,  3),
396*4882a593Smuzhiyun };
397*4882a593Smuzhiyun 
armada_375_pinctrl_probe(struct platform_device * pdev)398*4882a593Smuzhiyun static int armada_375_pinctrl_probe(struct platform_device *pdev)
399*4882a593Smuzhiyun {
400*4882a593Smuzhiyun 	struct mvebu_pinctrl_soc_info *soc = &armada_375_pinctrl_info;
401*4882a593Smuzhiyun 
402*4882a593Smuzhiyun 	soc->variant = 0; /* no variants for Armada 375 */
403*4882a593Smuzhiyun 	soc->controls = mv88f6720_mpp_controls;
404*4882a593Smuzhiyun 	soc->ncontrols = ARRAY_SIZE(mv88f6720_mpp_controls);
405*4882a593Smuzhiyun 	soc->modes = mv88f6720_mpp_modes;
406*4882a593Smuzhiyun 	soc->nmodes = ARRAY_SIZE(mv88f6720_mpp_modes);
407*4882a593Smuzhiyun 	soc->gpioranges = mv88f6720_mpp_gpio_ranges;
408*4882a593Smuzhiyun 	soc->ngpioranges = ARRAY_SIZE(mv88f6720_mpp_gpio_ranges);
409*4882a593Smuzhiyun 
410*4882a593Smuzhiyun 	pdev->dev.platform_data = soc;
411*4882a593Smuzhiyun 
412*4882a593Smuzhiyun 	return mvebu_pinctrl_simple_mmio_probe(pdev);
413*4882a593Smuzhiyun }
414*4882a593Smuzhiyun 
415*4882a593Smuzhiyun static struct platform_driver armada_375_pinctrl_driver = {
416*4882a593Smuzhiyun 	.driver = {
417*4882a593Smuzhiyun 		.name = "armada-375-pinctrl",
418*4882a593Smuzhiyun 		.of_match_table = of_match_ptr(armada_375_pinctrl_of_match),
419*4882a593Smuzhiyun 	},
420*4882a593Smuzhiyun 	.probe = armada_375_pinctrl_probe,
421*4882a593Smuzhiyun };
422*4882a593Smuzhiyun builtin_platform_driver(armada_375_pinctrl_driver);
423