blob: 0f07dc554a1dd8e977f435d7fcc925267f2fabf4 [file] [log] [blame]
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +02001/*
2 * Marvell Kirkwood pinctrl driver based on mvebu pinctrl core
3 *
4 * Author: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#include <linux/err.h>
13#include <linux/init.h>
14#include <linux/io.h>
15#include <linux/module.h>
16#include <linux/platform_device.h>
17#include <linux/clk.h>
18#include <linux/of.h>
19#include <linux/of_device.h>
20#include <linux/pinctrl/pinctrl.h>
21
22#include "pinctrl-mvebu.h"
23
Sebastian Hesselbarth3a25f9f2014-01-31 01:32:42 +010024static void __iomem *mpp_base;
25
26static int kirkwood_mpp_ctrl_get(unsigned pid, unsigned long *config)
27{
28 return default_mpp_ctrl_get(mpp_base, pid, config);
29}
30
31static int kirkwood_mpp_ctrl_set(unsigned pid, unsigned long config)
32{
33 return default_mpp_ctrl_set(mpp_base, pid, config);
34}
35
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010036#define V(f6180, f6190, f6192, f6281, f6282, dx4122) \
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020037 ((f6180 << 0) | (f6190 << 1) | (f6192 << 2) | \
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010038 (f6281 << 3) | (f6282 << 4) | (dx4122 << 5))
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020039
40enum kirkwood_variant {
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010041 VARIANT_MV88F6180 = V(1, 0, 0, 0, 0, 0),
42 VARIANT_MV88F6190 = V(0, 1, 0, 0, 0, 0),
43 VARIANT_MV88F6192 = V(0, 0, 1, 0, 0, 0),
44 VARIANT_MV88F6281 = V(0, 0, 0, 1, 0, 0),
45 VARIANT_MV88F6282 = V(0, 0, 0, 0, 1, 0),
46 VARIANT_MV98DX4122 = V(0, 0, 0, 0, 0, 1),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020047};
48
49static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
50 MPP_MODE(0,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010051 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
52 MPP_VAR_FUNCTION(0x1, "nand", "io2", V(1, 1, 1, 1, 1, 1)),
53 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020054 MPP_MODE(1,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010055 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
56 MPP_VAR_FUNCTION(0x1, "nand", "io3", V(1, 1, 1, 1, 1, 1)),
57 MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020058 MPP_MODE(2,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010059 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
60 MPP_VAR_FUNCTION(0x1, "nand", "io4", V(1, 1, 1, 1, 1, 1)),
61 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020062 MPP_MODE(3,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010063 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
64 MPP_VAR_FUNCTION(0x1, "nand", "io5", V(1, 1, 1, 1, 1, 1)),
65 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020066 MPP_MODE(4,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010067 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
68 MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1, 1)),
69 MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1, 1)),
70 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
71 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0)),
72 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020073 MPP_MODE(5,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010074 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
75 MPP_VAR_FUNCTION(0x1, "nand", "io7", V(1, 1, 1, 1, 1, 1)),
76 MPP_VAR_FUNCTION(0x2, "uart0", "txd", V(1, 1, 1, 1, 1, 1)),
77 MPP_VAR_FUNCTION(0x4, "ptp", "trig", V(1, 1, 1, 1, 0, 0)),
78 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
79 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020080 MPP_MODE(6,
Simon Guinot889c5d32013-01-08 22:37:04 +010081 MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1)),
82 MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1)),
83 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020084 MPP_MODE(7,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010085 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
86 MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)),
87 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1)),
88 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0)),
89 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020090 MPP_MODE(8,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010091 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
92 MPP_VAR_FUNCTION(0x1, "twsi0", "sda", V(1, 1, 1, 1, 1, 1)),
93 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1)),
94 MPP_VAR_FUNCTION(0x3, "uart1", "rts", V(1, 1, 1, 1, 1, 1)),
95 MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr", V(0, 1, 1, 1, 1, 0)),
96 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)),
97 MPP_VAR_FUNCTION(0xc, "ptp", "clk", V(1, 1, 1, 1, 0, 0)),
98 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020099 MPP_MODE(9,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100100 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
101 MPP_VAR_FUNCTION(0x1, "twsi0", "sck", V(1, 1, 1, 1, 1, 1)),
102 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1)),
103 MPP_VAR_FUNCTION(0x3, "uart1", "cts", V(1, 1, 1, 1, 1, 1)),
104 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)),
105 MPP_VAR_FUNCTION(0xc, "ptp", "evreq", V(1, 1, 1, 1, 0, 0)),
106 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200107 MPP_MODE(10,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100108 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
109 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1)),
110 MPP_VAR_FUNCTION(0X3, "uart0", "txd", V(1, 1, 1, 1, 1, 1)),
111 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
112 MPP_VAR_FUNCTION(0xc, "ptp", "trig", V(1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200113 MPP_MODE(11,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100114 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
115 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1)),
116 MPP_VAR_FUNCTION(0x3, "uart0", "rxd", V(1, 1, 1, 1, 1, 1)),
117 MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq", V(1, 1, 1, 1, 0, 0)),
118 MPP_VAR_FUNCTION(0xc, "ptp-2", "trig", V(1, 1, 1, 1, 0, 0)),
119 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0)),
120 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200121 MPP_MODE(12,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100122 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 0, 1, 0)),
123 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 0)),
124 MPP_VAR_FUNCTION(0x1, "sdio", "clk", V(1, 1, 1, 1, 1, 0)),
125 MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0)),
126 MPP_VAR_FUNCTION(0xb, "spi", "mosi", V(0, 0, 0, 0, 1, 0)),
127 MPP_VAR_FUNCTION(0xd, "twsi1", "sda", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200128 MPP_MODE(13,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100129 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
130 MPP_VAR_FUNCTION(0x1, "sdio", "cmd", V(1, 1, 1, 1, 1, 0)),
131 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 1)),
132 MPP_VAR_FUNCTION(0xa, "audio", "rmclk", V(0, 0, 0, 0, 1, 0)),
133 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200134 MPP_MODE(14,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100135 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
136 MPP_VAR_FUNCTION(0x1, "sdio", "d0", V(1, 1, 1, 1, 1, 0)),
137 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 1)),
138 MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)),
139 MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0)),
140 MPP_VAR_FUNCTION(0xb, "audio-1", "sdi", V(0, 0, 0, 0, 1, 0)),
141 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200142 MPP_MODE(15,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100143 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
144 MPP_VAR_FUNCTION(0x1, "sdio", "d1", V(1, 1, 1, 1, 1, 0)),
145 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1)),
146 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 0)),
147 MPP_VAR_FUNCTION(0x4, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
148 MPP_VAR_FUNCTION(0xb, "spi", "cs", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200149 MPP_MODE(16,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100150 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
151 MPP_VAR_FUNCTION(0x1, "sdio", "d2", V(1, 1, 1, 1, 1, 0)),
152 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1)),
153 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 0)),
154 MPP_VAR_FUNCTION(0x4, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
155 MPP_VAR_FUNCTION(0xb, "lcd", "extclk", V(0, 0, 0, 0, 1, 0)),
156 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200157 MPP_MODE(17,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100158 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
159 MPP_VAR_FUNCTION(0x1, "sdio", "d3", V(1, 1, 1, 1, 1, 0)),
160 MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)),
161 MPP_VAR_FUNCTION(0xa, "sata1", "act", V(0, 0, 0, 0, 1, 0)),
162 MPP_VAR_FUNCTION(0xd, "twsi1", "sck", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200163 MPP_MODE(18,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100164 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
165 MPP_VAR_FUNCTION(0x1, "nand", "io0", V(1, 1, 1, 1, 1, 1)),
166 MPP_VAR_FUNCTION(0x2, "pex", "clkreq", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200167 MPP_MODE(19,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100168 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
169 MPP_VAR_FUNCTION(0x1, "nand", "io1", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200170 MPP_MODE(20,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100171 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
172 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1, 0)),
173 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0)),
174 MPP_VAR_FUNCTION(0x3, "ge1", "txd0", V(0, 1, 1, 1, 1, 0)),
175 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0)),
176 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
177 MPP_VAR_FUNCTION(0xb, "lcd", "d0", V(0, 0, 0, 0, 1, 0)),
178 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(1, 0, 0, 0, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200179 MPP_MODE(21,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100180 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
181 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1, 0)),
182 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 1, 1, 1, 0)),
183 MPP_VAR_FUNCTION(0x3, "ge1", "txd1", V(0, 1, 1, 1, 1, 0)),
184 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 0, 0, 0)),
185 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0)),
186 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
187 MPP_VAR_FUNCTION(0xb, "lcd", "d1", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200188 MPP_MODE(22,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100189 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
190 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1, 0)),
191 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 1, 1, 1, 0)),
192 MPP_VAR_FUNCTION(0x3, "ge1", "txd2", V(0, 1, 1, 1, 1, 0)),
193 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 0, 0, 0)),
194 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 1, 1, 1, 0)),
195 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)),
196 MPP_VAR_FUNCTION(0xb, "lcd", "d2", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200197 MPP_MODE(23,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100198 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
199 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1, 0)),
200 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 1, 1, 1, 0)),
201 MPP_VAR_FUNCTION(0x3, "ge1", "txd3", V(0, 1, 1, 1, 1, 0)),
202 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(1, 0, 0, 0, 0, 0)),
203 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 1, 1, 1, 0)),
204 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)),
205 MPP_VAR_FUNCTION(0xb, "lcd", "d3", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200206 MPP_MODE(24,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100207 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
208 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1, 0)),
209 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 1, 1, 1, 0)),
210 MPP_VAR_FUNCTION(0x3, "ge1", "rxd0", V(0, 1, 1, 1, 1, 0)),
211 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(1, 0, 0, 0, 0, 0)),
212 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 1, 1, 1, 0)),
213 MPP_VAR_FUNCTION(0xb, "lcd", "d4", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200214 MPP_MODE(25,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100215 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
216 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1, 0)),
217 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 1, 1, 1, 0)),
218 MPP_VAR_FUNCTION(0x3, "ge1", "rxd1", V(0, 1, 1, 1, 1, 0)),
219 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(1, 0, 0, 0, 0, 0)),
220 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 1, 1, 1, 0)),
221 MPP_VAR_FUNCTION(0xb, "lcd", "d5", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200222 MPP_MODE(26,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100223 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
224 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1, 0)),
225 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0)),
226 MPP_VAR_FUNCTION(0x3, "ge1", "rxd2", V(0, 1, 1, 1, 1, 0)),
227 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(1, 0, 0, 0, 0, 0)),
228 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 1, 1, 1, 0)),
229 MPP_VAR_FUNCTION(0xb, "lcd", "d6", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200230 MPP_MODE(27,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100231 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
232 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1, 0)),
233 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0)),
234 MPP_VAR_FUNCTION(0x3, "ge1", "rxd3", V(0, 1, 1, 1, 1, 0)),
235 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(1, 0, 0, 0, 0, 0)),
236 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 1, 1, 1, 0)),
237 MPP_VAR_FUNCTION(0xb, "lcd", "d7", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200238 MPP_MODE(28,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100239 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
240 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1, 0)),
241 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 1, 1, 1, 0)),
242 MPP_VAR_FUNCTION(0x3, "ge1", "col", V(0, 1, 1, 1, 1, 0)),
243 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(1, 0, 0, 0, 0, 0)),
244 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0)),
245 MPP_VAR_FUNCTION(0xb, "lcd", "d8", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200246 MPP_MODE(29,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100247 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
248 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1, 0)),
249 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 1, 1, 1, 0)),
250 MPP_VAR_FUNCTION(0x3, "ge1", "txclk", V(0, 1, 1, 1, 1, 0)),
251 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 0, 0, 0)),
252 MPP_VAR_FUNCTION(0xb, "lcd", "d9", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200253 MPP_MODE(30,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100254 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
255 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1, 0)),
256 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 1, 1, 1, 0)),
257 MPP_VAR_FUNCTION(0x3, "ge1", "rxctl", V(0, 1, 1, 1, 1, 0)),
258 MPP_VAR_FUNCTION(0xb, "lcd", "d10", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200259 MPP_MODE(31,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100260 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
261 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1, 0)),
262 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 1, 1, 1, 0)),
263 MPP_VAR_FUNCTION(0x3, "ge1", "rxclk", V(0, 1, 1, 1, 1, 0)),
264 MPP_VAR_FUNCTION(0xb, "lcd", "d11", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200265 MPP_MODE(32,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100266 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
267 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1, 0)),
268 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 1, 1, 1, 0)),
269 MPP_VAR_FUNCTION(0x3, "ge1", "txclko", V(0, 1, 1, 1, 1, 0)),
270 MPP_VAR_FUNCTION(0xb, "lcd", "d12", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200271 MPP_MODE(33,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100272 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 1, 1, 1, 1, 0)),
273 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 1, 1, 1, 0)),
274 MPP_VAR_FUNCTION(0x3, "ge1", "txctl", V(0, 1, 1, 1, 1, 0)),
275 MPP_VAR_FUNCTION(0xb, "lcd", "d13", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200276 MPP_MODE(34,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100277 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 1)),
278 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 1, 1, 1, 0)),
279 MPP_VAR_FUNCTION(0x3, "ge1", "txen", V(0, 1, 1, 1, 1, 0)),
280 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 0, 1, 1, 0)),
281 MPP_VAR_FUNCTION(0xb, "lcd", "d14", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200282 MPP_MODE(35,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100283 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 1)),
284 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0)),
285 MPP_VAR_FUNCTION(0x3, "ge1", "rxerr", V(0, 1, 1, 1, 1, 0)),
286 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
287 MPP_VAR_FUNCTION(0xb, "lcd", "d15", V(0, 0, 0, 0, 1, 0)),
288 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(0, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200289 MPP_MODE(36,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100290 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
291 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1, 0)),
292 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 0, 1, 1, 0)),
293 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 1, 1, 0)),
294 MPP_VAR_FUNCTION(0xb, "twsi1", "sda", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200295 MPP_MODE(37,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100296 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
297 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1, 0)),
298 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 0, 1, 1, 0)),
299 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 1, 1, 0)),
300 MPP_VAR_FUNCTION(0xb, "twsi1", "sck", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200301 MPP_MODE(38,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100302 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
303 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1, 0)),
304 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 0, 1, 1, 0)),
305 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 0, 1, 1, 0)),
306 MPP_VAR_FUNCTION(0xb, "lcd", "d18", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200307 MPP_MODE(39,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100308 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
309 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1, 0)),
310 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 0, 1, 1, 0)),
311 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 0, 1, 1, 0)),
312 MPP_VAR_FUNCTION(0xb, "lcd", "d19", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200313 MPP_MODE(40,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100314 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
315 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1, 0)),
316 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 0, 1, 1, 0)),
317 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 0, 1, 1, 0)),
318 MPP_VAR_FUNCTION(0xb, "lcd", "d20", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200319 MPP_MODE(41,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100320 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
321 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1, 0)),
322 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0)),
323 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 0, 1, 1, 0)),
324 MPP_VAR_FUNCTION(0xb, "lcd", "d21", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200325 MPP_MODE(42,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100326 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
327 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1, 0)),
328 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0)),
329 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 0, 1, 1, 0)),
330 MPP_VAR_FUNCTION(0xb, "lcd", "d22", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200331 MPP_MODE(43,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100332 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
333 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1, 0)),
334 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 0, 1, 1, 0)),
335 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 0, 1, 1, 0)),
336 MPP_VAR_FUNCTION(0xb, "lcd", "d23", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200337 MPP_MODE(44,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100338 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
339 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1, 0)),
340 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 0, 1, 1, 0)),
341 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 1, 1, 0)),
342 MPP_VAR_FUNCTION(0xb, "lcd", "clk", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200343 MPP_MODE(45,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100344 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
345 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1, 0)),
346 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 0, 1, 1, 0)),
347 MPP_VAR_FUNCTION(0xb, "lcd", "e", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200348 MPP_MODE(46,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100349 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)),
350 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1, 0)),
351 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 0, 1, 1, 0)),
352 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200353 MPP_MODE(47,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100354 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)),
355 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1, 0)),
356 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 0, 1, 1, 0)),
357 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200358 MPP_MODE(48,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100359 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)),
360 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1, 0)),
361 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 0, 1, 1, 0)),
362 MPP_VAR_FUNCTION(0xb, "lcd", "d16", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200363 MPP_MODE(49,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100364 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 1)),
365 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 0, 0, 0, 1, 0)),
366 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0, 0)),
367 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 0, 1, 1, 0)),
368 MPP_VAR_FUNCTION(0x5, "ptp", "clk", V(0, 0, 0, 1, 0, 0)),
369 MPP_VAR_FUNCTION(0xa, "pex", "clkreq", V(0, 0, 0, 0, 1, 0)),
370 MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200371};
372
373static struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
Sebastian Hesselbarth1217b792014-01-31 01:48:48 +0100374 MPP_FUNC_CTRL(0, 29, NULL, kirkwood_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200375};
376
377static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
378 MPP_GPIO_RANGE(0, 0, 0, 30),
379};
380
381static struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
Sebastian Hesselbarth1217b792014-01-31 01:48:48 +0100382 MPP_FUNC_CTRL(0, 35, NULL, kirkwood_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200383};
384
385static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
386 MPP_GPIO_RANGE(0, 0, 0, 32),
387 MPP_GPIO_RANGE(1, 32, 32, 4),
388};
389
390static struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
Sebastian Hesselbarth1217b792014-01-31 01:48:48 +0100391 MPP_FUNC_CTRL(0, 49, NULL, kirkwood_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200392};
393
394static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
395 MPP_GPIO_RANGE(0, 0, 0, 32),
396 MPP_GPIO_RANGE(1, 32, 32, 18),
397};
398
399static struct mvebu_pinctrl_soc_info mv88f6180_info = {
400 .variant = VARIANT_MV88F6180,
401 .controls = mv88f6180_mpp_controls,
402 .ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
403 .modes = mv88f6xxx_mpp_modes,
404 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
405 .gpioranges = mv88f6180_gpio_ranges,
406 .ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
407};
408
409static struct mvebu_pinctrl_soc_info mv88f6190_info = {
410 .variant = VARIANT_MV88F6190,
411 .controls = mv88f619x_mpp_controls,
412 .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
413 .modes = mv88f6xxx_mpp_modes,
414 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
415 .gpioranges = mv88f619x_gpio_ranges,
416 .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
417};
418
419static struct mvebu_pinctrl_soc_info mv88f6192_info = {
420 .variant = VARIANT_MV88F6192,
421 .controls = mv88f619x_mpp_controls,
422 .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
423 .modes = mv88f6xxx_mpp_modes,
424 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
425 .gpioranges = mv88f619x_gpio_ranges,
426 .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
427};
428
429static struct mvebu_pinctrl_soc_info mv88f6281_info = {
430 .variant = VARIANT_MV88F6281,
431 .controls = mv88f628x_mpp_controls,
432 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
433 .modes = mv88f6xxx_mpp_modes,
434 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
435 .gpioranges = mv88f628x_gpio_ranges,
436 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
437};
438
439static struct mvebu_pinctrl_soc_info mv88f6282_info = {
440 .variant = VARIANT_MV88F6282,
441 .controls = mv88f628x_mpp_controls,
442 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
443 .modes = mv88f6xxx_mpp_modes,
444 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
445 .gpioranges = mv88f628x_gpio_ranges,
446 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
447};
448
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100449static struct mvebu_pinctrl_soc_info mv98dx4122_info = {
450 .variant = VARIANT_MV98DX4122,
451 .controls = mv88f628x_mpp_controls,
452 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
453 .modes = mv88f6xxx_mpp_modes,
454 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
455 .gpioranges = mv88f628x_gpio_ranges,
456 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
457};
458
Fabian Frederickbaa9946e2015-03-16 20:59:09 +0100459static const struct of_device_id kirkwood_pinctrl_of_match[] = {
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200460 { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
461 { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
462 { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
463 { .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
464 { .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100465 { .compatible = "marvell,98dx4122-pinctrl", .data = &mv98dx4122_info },
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200466 { }
467};
468
Greg Kroah-Hartman150632b2012-12-21 13:10:23 -0800469static int kirkwood_pinctrl_probe(struct platform_device *pdev)
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200470{
Sebastian Hesselbarth1217b792014-01-31 01:48:48 +0100471 struct resource *res;
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200472 const struct of_device_id *match =
473 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
Andrew Lunn16fa36b2013-01-09 19:28:09 +0100474 pdev->dev.platform_data = (void *)match->data;
Sebastian Hesselbarth1217b792014-01-31 01:48:48 +0100475
476 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
477 mpp_base = devm_ioremap_resource(&pdev->dev, res);
478 if (IS_ERR(mpp_base))
479 return PTR_ERR(mpp_base);
480
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200481 return mvebu_pinctrl_probe(pdev);
482}
483
Greg Kroah-Hartman150632b2012-12-21 13:10:23 -0800484static int kirkwood_pinctrl_remove(struct platform_device *pdev)
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200485{
486 return mvebu_pinctrl_remove(pdev);
487}
488
489static struct platform_driver kirkwood_pinctrl_driver = {
490 .driver = {
491 .name = "kirkwood-pinctrl",
Sachin Kamatf2e93942013-10-21 14:47:14 +0530492 .of_match_table = kirkwood_pinctrl_of_match,
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200493 },
494 .probe = kirkwood_pinctrl_probe,
Greg Kroah-Hartman150632b2012-12-21 13:10:23 -0800495 .remove = kirkwood_pinctrl_remove,
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200496};
497
498module_platform_driver(kirkwood_pinctrl_driver);
499
500MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
501MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
502MODULE_LICENSE("GPL v2");