blob: d45c31f281c85647fe8cf96139f1a8ccd3c6eae2 [file] [log] [blame]
Thomas Gleixner2874c5f2019-05-27 08:55:01 +02001// SPDX-License-Identifier: GPL-2.0-or-later
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +02002/*
3 * Marvell Kirkwood pinctrl driver based on mvebu pinctrl core
4 *
5 * Author: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +02006 */
7
8#include <linux/err.h>
9#include <linux/init.h>
10#include <linux/io.h>
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020011#include <linux/platform_device.h>
12#include <linux/clk.h>
13#include <linux/of.h>
14#include <linux/of_device.h>
15#include <linux/pinctrl/pinctrl.h>
16
17#include "pinctrl-mvebu.h"
18
Chris Packhameed43e72019-06-18 09:54:57 +120019#define V(f6180, f6190, f6192, f6281, f6282, dx4122, dx1135) \
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020020 ((f6180 << 0) | (f6190 << 1) | (f6192 << 2) | \
Chris Packhameed43e72019-06-18 09:54:57 +120021 (f6281 << 3) | (f6282 << 4) | (dx4122 << 5) | \
22 (dx1135 << 6))
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020023
24enum kirkwood_variant {
Chris Packhameed43e72019-06-18 09:54:57 +120025 VARIANT_MV88F6180 = V(1, 0, 0, 0, 0, 0, 0),
26 VARIANT_MV88F6190 = V(0, 1, 0, 0, 0, 0, 0),
27 VARIANT_MV88F6192 = V(0, 0, 1, 0, 0, 0, 0),
28 VARIANT_MV88F6281 = V(0, 0, 0, 1, 0, 0, 0),
29 VARIANT_MV88F6282 = V(0, 0, 0, 0, 1, 0, 0),
30 VARIANT_MV98DX4122 = V(0, 0, 0, 0, 0, 1, 0),
31 VARIANT_MV98DX1135 = V(0, 0, 0, 0, 0, 0, 1),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020032};
33
34static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
35 MPP_MODE(0,
Chris Packhameed43e72019-06-18 09:54:57 +120036 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
37 MPP_VAR_FUNCTION(0x1, "nand", "io2", V(1, 1, 1, 1, 1, 1, 1)),
38 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020039 MPP_MODE(1,
Chris Packhameed43e72019-06-18 09:54:57 +120040 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
41 MPP_VAR_FUNCTION(0x1, "nand", "io3", V(1, 1, 1, 1, 1, 1, 1)),
42 MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020043 MPP_MODE(2,
Chris Packhameed43e72019-06-18 09:54:57 +120044 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
45 MPP_VAR_FUNCTION(0x1, "nand", "io4", V(1, 1, 1, 1, 1, 1, 1)),
46 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020047 MPP_MODE(3,
Chris Packhameed43e72019-06-18 09:54:57 +120048 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
49 MPP_VAR_FUNCTION(0x1, "nand", "io5", V(1, 1, 1, 1, 1, 1, 1)),
50 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020051 MPP_MODE(4,
Chris Packhameed43e72019-06-18 09:54:57 +120052 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
53 MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1, 1, 1)),
54 MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1, 1, 1)),
55 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)),
56 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0, 0)),
57 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020058 MPP_MODE(5,
Chris Packhameed43e72019-06-18 09:54:57 +120059 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
60 MPP_VAR_FUNCTION(0x1, "nand", "io7", V(1, 1, 1, 1, 1, 1, 1)),
61 MPP_VAR_FUNCTION(0x2, "uart0", "txd", V(1, 1, 1, 1, 1, 1, 1)),
62 MPP_VAR_FUNCTION(0x4, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0)),
63 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)),
64 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020065 MPP_MODE(6,
Chris Packhameed43e72019-06-18 09:54:57 +120066 MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1, 1)),
67 MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1, 1)),
68 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020069 MPP_MODE(7,
Chris Packhameed43e72019-06-18 09:54:57 +120070 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
71 MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1, 1)),
72 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1, 1)),
73 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0)),
74 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020075 MPP_MODE(8,
Chris Packhameed43e72019-06-18 09:54:57 +120076 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
77 MPP_VAR_FUNCTION(0x1, "twsi0", "sda", V(1, 1, 1, 1, 1, 1, 1)),
78 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1, 1)),
79 MPP_VAR_FUNCTION(0x3, "uart1", "rts", V(1, 1, 1, 1, 1, 1, 1)),
80 MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr", V(0, 1, 1, 1, 1, 0, 0)),
81 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0, 0)),
82 MPP_VAR_FUNCTION(0xc, "ptp", "clk", V(1, 1, 1, 1, 0, 0, 0)),
83 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020084 MPP_MODE(9,
Chris Packhameed43e72019-06-18 09:54:57 +120085 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
86 MPP_VAR_FUNCTION(0x1, "twsi0", "sck", V(1, 1, 1, 1, 1, 1, 1)),
87 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1, 1)),
88 MPP_VAR_FUNCTION(0x3, "uart1", "cts", V(1, 1, 1, 1, 1, 1, 1)),
89 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0, 0)),
90 MPP_VAR_FUNCTION(0xc, "ptp", "evreq", V(1, 1, 1, 1, 0, 0, 0)),
91 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020092 MPP_MODE(10,
Chris Packhameed43e72019-06-18 09:54:57 +120093 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
94 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1, 1)),
95 MPP_VAR_FUNCTION(0X3, "uart0", "txd", V(1, 1, 1, 1, 1, 1, 1)),
96 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)),
97 MPP_VAR_FUNCTION(0xc, "ptp", "trig", V(1, 1, 1, 1, 0, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020098 MPP_MODE(11,
Chris Packhameed43e72019-06-18 09:54:57 +120099 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
100 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1, 1)),
101 MPP_VAR_FUNCTION(0x3, "uart0", "rxd", V(1, 1, 1, 1, 1, 1, 1)),
102 MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq", V(1, 1, 1, 1, 0, 0, 0)),
103 MPP_VAR_FUNCTION(0xc, "ptp-2", "trig", V(1, 1, 1, 1, 0, 0, 0)),
104 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0, 0)),
105 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200106 MPP_MODE(12,
Chris Packhameed43e72019-06-18 09:54:57 +1200107 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 0, 1, 0, 0)),
108 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 0, 0)),
109 MPP_VAR_FUNCTION(0x1, "sdio", "clk", V(1, 1, 1, 1, 1, 0, 0)),
110 MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0, 0)),
111 MPP_VAR_FUNCTION(0xb, "spi", "mosi", V(0, 0, 0, 0, 1, 0, 0)),
112 MPP_VAR_FUNCTION(0xd, "twsi1", "sda", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200113 MPP_MODE(13,
Chris Packhameed43e72019-06-18 09:54:57 +1200114 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
115 MPP_VAR_FUNCTION(0x1, "sdio", "cmd", V(1, 1, 1, 1, 1, 0, 0)),
116 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 1, 1)),
117 MPP_VAR_FUNCTION(0xa, "audio", "rmclk", V(0, 0, 0, 0, 1, 0, 0)),
118 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200119 MPP_MODE(14,
Chris Packhameed43e72019-06-18 09:54:57 +1200120 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
121 MPP_VAR_FUNCTION(0x1, "sdio", "d0", V(1, 1, 1, 1, 1, 0, 0)),
122 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 1, 1)),
123 MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0, 0)),
124 MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0, 0)),
125 MPP_VAR_FUNCTION(0xb, "audio-1", "sdi", V(0, 0, 0, 0, 1, 0, 0)),
126 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200127 MPP_MODE(15,
Chris Packhameed43e72019-06-18 09:54:57 +1200128 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
129 MPP_VAR_FUNCTION(0x1, "sdio", "d1", V(1, 1, 1, 1, 1, 0, 0)),
130 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1, 1)),
131 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 0, 0)),
132 MPP_VAR_FUNCTION(0x4, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)),
133 MPP_VAR_FUNCTION(0xb, "spi", "cs", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200134 MPP_MODE(16,
Chris Packhameed43e72019-06-18 09:54:57 +1200135 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
136 MPP_VAR_FUNCTION(0x1, "sdio", "d2", V(1, 1, 1, 1, 1, 0, 0)),
137 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1, 1)),
138 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 0, 0)),
139 MPP_VAR_FUNCTION(0x4, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)),
140 MPP_VAR_FUNCTION(0xb, "lcd", "extclk", V(0, 0, 0, 0, 1, 0, 0)),
141 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200142 MPP_MODE(17,
Chris Packhameed43e72019-06-18 09:54:57 +1200143 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0, 0)),
144 MPP_VAR_FUNCTION(0x1, "sdio", "d3", V(1, 1, 1, 1, 1, 0, 0)),
145 MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0, 0)),
146 MPP_VAR_FUNCTION(0xa, "sata1", "act", V(0, 0, 0, 0, 1, 0, 0)),
147 MPP_VAR_FUNCTION(0xd, "twsi1", "sck", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200148 MPP_MODE(18,
Chris Packhameed43e72019-06-18 09:54:57 +1200149 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
150 MPP_VAR_FUNCTION(0x1, "nand", "io0", V(1, 1, 1, 1, 1, 1, 1)),
151 MPP_VAR_FUNCTION(0x2, "pex", "clkreq", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200152 MPP_MODE(19,
Chris Packhameed43e72019-06-18 09:54:57 +1200153 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1, 1)),
154 MPP_VAR_FUNCTION(0x1, "nand", "io1", V(1, 1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200155 MPP_MODE(20,
Chris Packhameed43e72019-06-18 09:54:57 +1200156 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
157 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1, 0, 0)),
158 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0, 0)),
159 MPP_VAR_FUNCTION(0x3, "ge1", "txd0", V(0, 1, 1, 1, 1, 0, 0)),
160 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0, 0)),
161 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0, 0)),
162 MPP_VAR_FUNCTION(0xb, "lcd", "d0", V(0, 0, 0, 0, 1, 0, 0)),
163 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(0, 0, 0, 0, 0, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200164 MPP_MODE(21,
Chris Packhameed43e72019-06-18 09:54:57 +1200165 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
166 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1, 0, 0)),
167 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 1, 1, 1, 0, 0)),
168 MPP_VAR_FUNCTION(0x3, "ge1", "txd1", V(0, 1, 1, 1, 1, 0, 0)),
169 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 0, 0, 0, 0)),
170 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0, 0)),
171 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)),
172 MPP_VAR_FUNCTION(0xb, "lcd", "d1", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200173 MPP_MODE(22,
Chris Packhameed43e72019-06-18 09:54:57 +1200174 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
175 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1, 0, 0)),
176 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 1, 1, 1, 0, 0)),
177 MPP_VAR_FUNCTION(0x3, "ge1", "txd2", V(0, 1, 1, 1, 1, 0, 0)),
178 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 0, 0, 0, 0)),
179 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 1, 1, 1, 0, 0)),
180 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0, 0)),
181 MPP_VAR_FUNCTION(0xb, "lcd", "d2", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200182 MPP_MODE(23,
Chris Packhameed43e72019-06-18 09:54:57 +1200183 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
184 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1, 0, 0)),
185 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 1, 1, 1, 0, 0)),
186 MPP_VAR_FUNCTION(0x3, "ge1", "txd3", V(0, 1, 1, 1, 1, 0, 0)),
187 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 0, 0, 0, 0, 0)),
188 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 1, 1, 1, 0, 0)),
189 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0, 0)),
190 MPP_VAR_FUNCTION(0xb, "lcd", "d3", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200191 MPP_MODE(24,
Chris Packhameed43e72019-06-18 09:54:57 +1200192 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
193 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1, 0, 0)),
194 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 1, 1, 1, 0, 0)),
195 MPP_VAR_FUNCTION(0x3, "ge1", "rxd0", V(0, 1, 1, 1, 1, 0, 0)),
196 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 0, 0, 0, 0, 0)),
197 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 1, 1, 1, 0, 0)),
198 MPP_VAR_FUNCTION(0xb, "lcd", "d4", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200199 MPP_MODE(25,
Chris Packhameed43e72019-06-18 09:54:57 +1200200 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
201 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1, 0, 0)),
202 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 1, 1, 1, 0, 0)),
203 MPP_VAR_FUNCTION(0x3, "ge1", "rxd1", V(0, 1, 1, 1, 1, 0, 0)),
204 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 0, 0, 0, 0, 0)),
205 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 1, 1, 1, 0, 0)),
206 MPP_VAR_FUNCTION(0xb, "lcd", "d5", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200207 MPP_MODE(26,
Chris Packhameed43e72019-06-18 09:54:57 +1200208 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
209 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1, 0, 0)),
210 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0, 0)),
211 MPP_VAR_FUNCTION(0x3, "ge1", "rxd2", V(0, 1, 1, 1, 1, 0, 0)),
212 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 0, 0, 0, 0, 0)),
213 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 1, 1, 1, 0, 0)),
214 MPP_VAR_FUNCTION(0xb, "lcd", "d6", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200215 MPP_MODE(27,
Chris Packhameed43e72019-06-18 09:54:57 +1200216 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
217 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1, 0, 0)),
218 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0, 0)),
219 MPP_VAR_FUNCTION(0x3, "ge1", "rxd3", V(0, 1, 1, 1, 1, 0, 0)),
220 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 0, 0, 0, 0, 0)),
221 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 1, 1, 1, 0, 0)),
222 MPP_VAR_FUNCTION(0xb, "lcd", "d7", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200223 MPP_MODE(28,
Chris Packhameed43e72019-06-18 09:54:57 +1200224 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 0)),
225 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1, 0, 0)),
226 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 1, 1, 1, 0, 0)),
227 MPP_VAR_FUNCTION(0x3, "ge1", "col", V(0, 1, 1, 1, 1, 0, 0)),
228 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 0, 0, 0, 0, 0)),
229 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0, 0)),
230 MPP_VAR_FUNCTION(0xb, "lcd", "d8", V(0, 0, 0, 0, 1, 0, 0)),
231 MPP_VAR_FUNCTION(0x1, "nand", "ren", V(0, 0, 0, 0, 0, 0, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200232 MPP_MODE(29,
Chris Packhameed43e72019-06-18 09:54:57 +1200233 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 0)),
234 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1, 0, 0)),
235 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 1, 1, 1, 0, 0)),
236 MPP_VAR_FUNCTION(0x3, "ge1", "txclk", V(0, 1, 1, 1, 1, 0, 0)),
237 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 0, 0, 0, 0)),
238 MPP_VAR_FUNCTION(0xb, "lcd", "d9", V(0, 0, 0, 0, 1, 0, 0)),
239 MPP_VAR_FUNCTION(0x1, "nand", "wen", V(0, 0, 0, 0, 0, 0, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200240 MPP_MODE(30,
Chris Packhameed43e72019-06-18 09:54:57 +1200241 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
242 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1, 0, 0)),
243 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 1, 1, 1, 0, 0)),
244 MPP_VAR_FUNCTION(0x3, "ge1", "rxctl", V(0, 1, 1, 1, 1, 0, 0)),
245 MPP_VAR_FUNCTION(0xb, "lcd", "d10", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200246 MPP_MODE(31,
Chris Packhameed43e72019-06-18 09:54:57 +1200247 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
248 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1, 0, 0)),
249 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 1, 1, 1, 0, 0)),
250 MPP_VAR_FUNCTION(0x3, "ge1", "rxclk", V(0, 1, 1, 1, 1, 0, 0)),
251 MPP_VAR_FUNCTION(0xb, "lcd", "d11", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200252 MPP_MODE(32,
Chris Packhameed43e72019-06-18 09:54:57 +1200253 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0, 1)),
254 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1, 0, 0)),
255 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 1, 1, 1, 0, 0)),
256 MPP_VAR_FUNCTION(0x3, "ge1", "txclko", V(0, 1, 1, 1, 1, 0, 0)),
257 MPP_VAR_FUNCTION(0xb, "lcd", "d12", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200258 MPP_MODE(33,
Chris Packhameed43e72019-06-18 09:54:57 +1200259 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 1, 1, 1, 1, 0, 1)),
260 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 1, 1, 1, 0, 0)),
261 MPP_VAR_FUNCTION(0x3, "ge1", "txctl", V(0, 1, 1, 1, 1, 0, 0)),
262 MPP_VAR_FUNCTION(0xb, "lcd", "d13", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200263 MPP_MODE(34,
Chris Packhameed43e72019-06-18 09:54:57 +1200264 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 1, 1)),
265 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 1, 1, 1, 0, 0)),
266 MPP_VAR_FUNCTION(0x3, "ge1", "txen", V(0, 1, 1, 1, 1, 0, 0)),
267 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 0, 1, 1, 0, 0)),
268 MPP_VAR_FUNCTION(0xb, "lcd", "d14", V(0, 0, 0, 0, 1, 0, 0)),
269 MPP_VAR_FUNCTION(0x1, "nand", "ale", V(0, 0, 0, 0, 0, 0, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200270 MPP_MODE(35,
Chris Packhameed43e72019-06-18 09:54:57 +1200271 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1, 1)),
272 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0, 0)),
273 MPP_VAR_FUNCTION(0x3, "ge1", "rxerr", V(0, 1, 1, 1, 1, 0, 0)),
274 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0, 0)),
275 MPP_VAR_FUNCTION(0xb, "lcd", "d15", V(0, 0, 0, 0, 1, 0, 0)),
276 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(1, 1, 1, 1, 1, 0, 0)),
277 MPP_VAR_FUNCTION(0x1, "nand", "cen", V(0, 0, 0, 0, 0, 0, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200278 MPP_MODE(36,
Chris Packhameed43e72019-06-18 09:54:57 +1200279 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
280 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1, 0, 0)),
281 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 0, 1, 1, 0, 0)),
282 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 1, 1, 0, 0)),
283 MPP_VAR_FUNCTION(0xb, "twsi1", "sda", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200284 MPP_MODE(37,
Chris Packhameed43e72019-06-18 09:54:57 +1200285 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
286 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1, 0, 0)),
287 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 0, 1, 1, 0, 0)),
288 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 1, 1, 0, 0)),
289 MPP_VAR_FUNCTION(0xb, "twsi1", "sck", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200290 MPP_MODE(38,
Chris Packhameed43e72019-06-18 09:54:57 +1200291 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
292 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1, 0, 0)),
293 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 0, 1, 1, 0, 0)),
294 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(1, 0, 0, 1, 1, 0, 0)),
295 MPP_VAR_FUNCTION(0xb, "lcd", "d18", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200296 MPP_MODE(39,
Chris Packhameed43e72019-06-18 09:54:57 +1200297 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
298 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1, 0, 0)),
299 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 0, 1, 1, 0, 0)),
300 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(1, 0, 0, 1, 1, 0, 0)),
301 MPP_VAR_FUNCTION(0xb, "lcd", "d19", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200302 MPP_MODE(40,
Chris Packhameed43e72019-06-18 09:54:57 +1200303 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
304 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1, 0, 0)),
305 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 0, 1, 1, 0, 0)),
306 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(1, 0, 0, 1, 1, 0, 0)),
307 MPP_VAR_FUNCTION(0xb, "lcd", "d20", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200308 MPP_MODE(41,
Chris Packhameed43e72019-06-18 09:54:57 +1200309 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
310 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1, 0, 0)),
311 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0, 0)),
312 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(1, 0, 0, 1, 1, 0, 0)),
313 MPP_VAR_FUNCTION(0xb, "lcd", "d21", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200314 MPP_MODE(42,
Chris Packhameed43e72019-06-18 09:54:57 +1200315 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
316 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1, 0, 0)),
317 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0, 0)),
318 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(1, 0, 0, 1, 1, 0, 0)),
319 MPP_VAR_FUNCTION(0xb, "lcd", "d22", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200320 MPP_MODE(43,
Chris Packhameed43e72019-06-18 09:54:57 +1200321 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
322 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1, 0, 0)),
323 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 0, 1, 1, 0, 0)),
324 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(1, 0, 0, 1, 1, 0, 0)),
325 MPP_VAR_FUNCTION(0xb, "lcd", "d23", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200326 MPP_MODE(44,
Chris Packhameed43e72019-06-18 09:54:57 +1200327 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1, 1)),
328 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1, 0, 0)),
329 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 0, 1, 1, 0, 0)),
330 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 1, 1, 0, 0)),
331 MPP_VAR_FUNCTION(0xb, "lcd", "clk", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200332 MPP_MODE(45,
Chris Packhameed43e72019-06-18 09:54:57 +1200333 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1, 1)),
334 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1, 0, 0)),
335 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 0, 1, 1, 0, 0)),
336 MPP_VAR_FUNCTION(0xb, "lcd", "e", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200337 MPP_MODE(46,
Chris Packhameed43e72019-06-18 09:54:57 +1200338 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0, 0)),
339 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1, 0, 0)),
340 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 0, 1, 1, 0, 0)),
341 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200342 MPP_MODE(47,
Chris Packhameed43e72019-06-18 09:54:57 +1200343 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0, 0)),
344 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1, 0, 0)),
345 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 0, 1, 1, 0, 0)),
346 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200347 MPP_MODE(48,
Chris Packhameed43e72019-06-18 09:54:57 +1200348 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0, 0)),
349 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1, 0, 0)),
350 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 0, 1, 1, 0, 0)),
351 MPP_VAR_FUNCTION(0xb, "lcd", "d16", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200352 MPP_MODE(49,
Chris Packhameed43e72019-06-18 09:54:57 +1200353 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 1, 1)),
354 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 0, 0, 0, 1, 0, 0)),
355 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0, 0, 0)),
356 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 0, 1, 1, 0, 0)),
357 MPP_VAR_FUNCTION(0x5, "ptp", "clk", V(0, 0, 0, 1, 0, 0, 0)),
358 MPP_VAR_FUNCTION(0xa, "pex", "clkreq", V(0, 0, 0, 0, 1, 0, 0)),
359 MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200360};
361
Russell King30be3fb2017-01-13 11:03:15 +0000362static const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
Russell Kingad9ec4e2017-01-13 11:03:30 +0000363 MPP_FUNC_CTRL(0, 44, NULL, mvebu_mmio_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200364};
365
366static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
Andreas Klinger9573e792016-07-16 17:07:04 +0200367 MPP_GPIO_RANGE(0, 0, 0, 20),
368 MPP_GPIO_RANGE(1, 35, 35, 10),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200369};
370
Russell King30be3fb2017-01-13 11:03:15 +0000371static const struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
Russell Kingad9ec4e2017-01-13 11:03:30 +0000372 MPP_FUNC_CTRL(0, 35, NULL, mvebu_mmio_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200373};
374
375static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
376 MPP_GPIO_RANGE(0, 0, 0, 32),
377 MPP_GPIO_RANGE(1, 32, 32, 4),
378};
379
Russell King30be3fb2017-01-13 11:03:15 +0000380static const struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
Russell Kingad9ec4e2017-01-13 11:03:30 +0000381 MPP_FUNC_CTRL(0, 49, NULL, mvebu_mmio_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200382};
383
384static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
385 MPP_GPIO_RANGE(0, 0, 0, 32),
386 MPP_GPIO_RANGE(1, 32, 32, 18),
387};
388
389static struct mvebu_pinctrl_soc_info mv88f6180_info = {
390 .variant = VARIANT_MV88F6180,
391 .controls = mv88f6180_mpp_controls,
392 .ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
393 .modes = mv88f6xxx_mpp_modes,
394 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
395 .gpioranges = mv88f6180_gpio_ranges,
396 .ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
397};
398
399static struct mvebu_pinctrl_soc_info mv88f6190_info = {
400 .variant = VARIANT_MV88F6190,
401 .controls = mv88f619x_mpp_controls,
402 .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
403 .modes = mv88f6xxx_mpp_modes,
404 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
405 .gpioranges = mv88f619x_gpio_ranges,
406 .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
407};
408
409static struct mvebu_pinctrl_soc_info mv88f6192_info = {
410 .variant = VARIANT_MV88F6192,
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 mv88f6281_info = {
420 .variant = VARIANT_MV88F6281,
421 .controls = mv88f628x_mpp_controls,
422 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
423 .modes = mv88f6xxx_mpp_modes,
424 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
425 .gpioranges = mv88f628x_gpio_ranges,
426 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
427};
428
429static struct mvebu_pinctrl_soc_info mv88f6282_info = {
430 .variant = VARIANT_MV88F6282,
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
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100439static struct mvebu_pinctrl_soc_info mv98dx4122_info = {
440 .variant = VARIANT_MV98DX4122,
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
Chris Packhameed43e72019-06-18 09:54:57 +1200449static struct mvebu_pinctrl_soc_info mv98dx1135_info = {
450 .variant = VARIANT_MV98DX1135,
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
459
Fabian Frederickbaa9946e2015-03-16 20:59:09 +0100460static const struct of_device_id kirkwood_pinctrl_of_match[] = {
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200461 { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
462 { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
463 { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
464 { .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
465 { .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100466 { .compatible = "marvell,98dx4122-pinctrl", .data = &mv98dx4122_info },
Chris Packhameed43e72019-06-18 09:54:57 +1200467 { .compatible = "marvell,98dx1135-pinctrl", .data = &mv98dx1135_info },
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200468 { }
469};
470
Greg Kroah-Hartman150632b2012-12-21 13:10:23 -0800471static int kirkwood_pinctrl_probe(struct platform_device *pdev)
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200472{
473 const struct of_device_id *match =
474 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
Russell Kingad9ec4e2017-01-13 11:03:30 +0000475
Andrew Lunn16fa36b2013-01-09 19:28:09 +0100476 pdev->dev.platform_data = (void *)match->data;
Sebastian Hesselbarth1217b792014-01-31 01:48:48 +0100477
Russell Kingad9ec4e2017-01-13 11:03:30 +0000478 return mvebu_pinctrl_simple_mmio_probe(pdev);
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200479}
480
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200481static struct platform_driver kirkwood_pinctrl_driver = {
482 .driver = {
483 .name = "kirkwood-pinctrl",
Sachin Kamatf2e93942013-10-21 14:47:14 +0530484 .of_match_table = kirkwood_pinctrl_of_match,
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200485 },
486 .probe = kirkwood_pinctrl_probe,
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200487};
Paul Gortmakerfdbde812017-02-06 03:03:50 -0500488builtin_platform_driver(kirkwood_pinctrl_driver);