blob: 5995a19abde5abc5e1034f2734d48400bdf6b885 [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>
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020015#include <linux/platform_device.h>
16#include <linux/clk.h>
17#include <linux/of.h>
18#include <linux/of_device.h>
19#include <linux/pinctrl/pinctrl.h>
20
21#include "pinctrl-mvebu.h"
22
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010023#define V(f6180, f6190, f6192, f6281, f6282, dx4122) \
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020024 ((f6180 << 0) | (f6190 << 1) | (f6192 << 2) | \
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010025 (f6281 << 3) | (f6282 << 4) | (dx4122 << 5))
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020026
27enum kirkwood_variant {
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010028 VARIANT_MV88F6180 = V(1, 0, 0, 0, 0, 0),
29 VARIANT_MV88F6190 = V(0, 1, 0, 0, 0, 0),
30 VARIANT_MV88F6192 = V(0, 0, 1, 0, 0, 0),
31 VARIANT_MV88F6281 = V(0, 0, 0, 1, 0, 0),
32 VARIANT_MV88F6282 = V(0, 0, 0, 0, 1, 0),
33 VARIANT_MV98DX4122 = V(0, 0, 0, 0, 0, 1),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020034};
35
36static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
37 MPP_MODE(0,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010038 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
39 MPP_VAR_FUNCTION(0x1, "nand", "io2", V(1, 1, 1, 1, 1, 1)),
40 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020041 MPP_MODE(1,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010042 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
43 MPP_VAR_FUNCTION(0x1, "nand", "io3", V(1, 1, 1, 1, 1, 1)),
44 MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020045 MPP_MODE(2,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010046 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
47 MPP_VAR_FUNCTION(0x1, "nand", "io4", V(1, 1, 1, 1, 1, 1)),
48 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020049 MPP_MODE(3,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010050 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
51 MPP_VAR_FUNCTION(0x1, "nand", "io5", V(1, 1, 1, 1, 1, 1)),
52 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020053 MPP_MODE(4,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010054 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
55 MPP_VAR_FUNCTION(0x1, "nand", "io6", V(1, 1, 1, 1, 1, 1)),
56 MPP_VAR_FUNCTION(0x2, "uart0", "rxd", V(1, 1, 1, 1, 1, 1)),
57 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
58 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0)),
59 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020060 MPP_MODE(5,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010061 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
62 MPP_VAR_FUNCTION(0x1, "nand", "io7", V(1, 1, 1, 1, 1, 1)),
63 MPP_VAR_FUNCTION(0x2, "uart0", "txd", V(1, 1, 1, 1, 1, 1)),
64 MPP_VAR_FUNCTION(0x4, "ptp", "trig", V(1, 1, 1, 1, 0, 0)),
65 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
66 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020067 MPP_MODE(6,
Simon Guinot889c5d32013-01-08 22:37:04 +010068 MPP_VAR_FUNCTION(0x1, "sysrst", "out", V(1, 1, 1, 1, 1, 1)),
69 MPP_VAR_FUNCTION(0x2, "spi", "mosi", V(1, 1, 1, 1, 1, 1)),
70 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020071 MPP_MODE(7,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010072 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
73 MPP_VAR_FUNCTION(0x1, "pex", "rsto", V(1, 1, 1, 1, 0, 1)),
74 MPP_VAR_FUNCTION(0x2, "spi", "cs", V(1, 1, 1, 1, 1, 1)),
75 MPP_VAR_FUNCTION(0x3, "ptp", "trig", V(1, 1, 1, 1, 0, 0)),
76 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020077 MPP_MODE(8,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010078 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
79 MPP_VAR_FUNCTION(0x1, "twsi0", "sda", V(1, 1, 1, 1, 1, 1)),
80 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1)),
81 MPP_VAR_FUNCTION(0x3, "uart1", "rts", V(1, 1, 1, 1, 1, 1)),
82 MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr", V(0, 1, 1, 1, 1, 0)),
83 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)),
84 MPP_VAR_FUNCTION(0xc, "ptp", "clk", V(1, 1, 1, 1, 0, 0)),
85 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020086 MPP_MODE(9,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010087 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
88 MPP_VAR_FUNCTION(0x1, "twsi0", "sck", V(1, 1, 1, 1, 1, 1)),
89 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1)),
90 MPP_VAR_FUNCTION(0x3, "uart1", "cts", V(1, 1, 1, 1, 1, 1)),
91 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)),
92 MPP_VAR_FUNCTION(0xc, "ptp", "evreq", V(1, 1, 1, 1, 0, 0)),
93 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +020094 MPP_MODE(10,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +010095 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
96 MPP_VAR_FUNCTION(0x2, "spi", "sck", V(1, 1, 1, 1, 1, 1)),
97 MPP_VAR_FUNCTION(0X3, "uart0", "txd", V(1, 1, 1, 1, 1, 1)),
98 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
99 MPP_VAR_FUNCTION(0xc, "ptp", "trig", V(1, 1, 1, 1, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200100 MPP_MODE(11,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100101 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
102 MPP_VAR_FUNCTION(0x2, "spi", "miso", V(1, 1, 1, 1, 1, 1)),
103 MPP_VAR_FUNCTION(0x3, "uart0", "rxd", V(1, 1, 1, 1, 1, 1)),
104 MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq", V(1, 1, 1, 1, 0, 0)),
105 MPP_VAR_FUNCTION(0xc, "ptp-2", "trig", V(1, 1, 1, 1, 0, 0)),
106 MPP_VAR_FUNCTION(0xd, "ptp", "clk", V(1, 1, 1, 1, 0, 0)),
107 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200108 MPP_MODE(12,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100109 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 0, 1, 0)),
110 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 0)),
111 MPP_VAR_FUNCTION(0x1, "sdio", "clk", V(1, 1, 1, 1, 1, 0)),
112 MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0)),
113 MPP_VAR_FUNCTION(0xb, "spi", "mosi", V(0, 0, 0, 0, 1, 0)),
114 MPP_VAR_FUNCTION(0xd, "twsi1", "sda", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200115 MPP_MODE(13,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100116 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
117 MPP_VAR_FUNCTION(0x1, "sdio", "cmd", V(1, 1, 1, 1, 1, 0)),
118 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 1)),
119 MPP_VAR_FUNCTION(0xa, "audio", "rmclk", V(0, 0, 0, 0, 1, 0)),
120 MPP_VAR_FUNCTION(0xb, "lcd", "pwm", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200121 MPP_MODE(14,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100122 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
123 MPP_VAR_FUNCTION(0x1, "sdio", "d0", V(1, 1, 1, 1, 1, 0)),
124 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 1)),
125 MPP_VAR_FUNCTION(0x4, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)),
126 MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0)),
127 MPP_VAR_FUNCTION(0xb, "audio-1", "sdi", V(0, 0, 0, 0, 1, 0)),
128 MPP_VAR_FUNCTION(0xd, "mii", "col", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200129 MPP_MODE(15,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100130 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
131 MPP_VAR_FUNCTION(0x1, "sdio", "d1", V(1, 1, 1, 1, 1, 0)),
132 MPP_VAR_FUNCTION(0x2, "uart0", "rts", V(1, 1, 1, 1, 1, 1)),
133 MPP_VAR_FUNCTION(0x3, "uart1", "txd", V(1, 1, 1, 1, 1, 0)),
134 MPP_VAR_FUNCTION(0x4, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
135 MPP_VAR_FUNCTION(0xb, "spi", "cs", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200136 MPP_MODE(16,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100137 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
138 MPP_VAR_FUNCTION(0x1, "sdio", "d2", V(1, 1, 1, 1, 1, 0)),
139 MPP_VAR_FUNCTION(0x2, "uart0", "cts", V(1, 1, 1, 1, 1, 1)),
140 MPP_VAR_FUNCTION(0x3, "uart1", "rxd", V(1, 1, 1, 1, 1, 0)),
141 MPP_VAR_FUNCTION(0x4, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
142 MPP_VAR_FUNCTION(0xb, "lcd", "extclk", V(0, 0, 0, 0, 1, 0)),
143 MPP_VAR_FUNCTION(0xd, "mii", "crs", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200144 MPP_MODE(17,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100145 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 0)),
146 MPP_VAR_FUNCTION(0x1, "sdio", "d3", V(1, 1, 1, 1, 1, 0)),
147 MPP_VAR_FUNCTION(0x4, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)),
148 MPP_VAR_FUNCTION(0xa, "sata1", "act", V(0, 0, 0, 0, 1, 0)),
149 MPP_VAR_FUNCTION(0xd, "twsi1", "sck", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200150 MPP_MODE(18,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100151 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
152 MPP_VAR_FUNCTION(0x1, "nand", "io0", V(1, 1, 1, 1, 1, 1)),
153 MPP_VAR_FUNCTION(0x2, "pex", "clkreq", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200154 MPP_MODE(19,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100155 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(1, 1, 1, 1, 1, 1)),
156 MPP_VAR_FUNCTION(0x1, "nand", "io1", V(1, 1, 1, 1, 1, 1))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200157 MPP_MODE(20,
Andreas Klinger9573e792016-07-16 17:07:04 +0200158 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100159 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 1, 1, 1, 0)),
160 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0)),
161 MPP_VAR_FUNCTION(0x3, "ge1", "txd0", V(0, 1, 1, 1, 1, 0)),
162 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0)),
163 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 1, 1, 1, 0)),
164 MPP_VAR_FUNCTION(0xb, "lcd", "d0", V(0, 0, 0, 0, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200165 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(0, 0, 0, 0, 0, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200166 MPP_MODE(21,
Andreas Klinger9573e792016-07-16 17:07:04 +0200167 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100168 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 1, 1, 1, 0)),
169 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 1, 1, 1, 0)),
170 MPP_VAR_FUNCTION(0x3, "ge1", "txd1", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200171 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100172 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0)),
173 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
174 MPP_VAR_FUNCTION(0xb, "lcd", "d1", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200175 MPP_MODE(22,
Andreas Klinger9573e792016-07-16 17:07:04 +0200176 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100177 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 1, 1, 1, 0)),
178 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 1, 1, 1, 0)),
179 MPP_VAR_FUNCTION(0x3, "ge1", "txd2", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200180 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100181 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 1, 1, 1, 0)),
182 MPP_VAR_FUNCTION(0x5, "sata1", "prsnt", V(0, 0, 1, 1, 1, 0)),
183 MPP_VAR_FUNCTION(0xb, "lcd", "d2", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200184 MPP_MODE(23,
Andreas Klinger9573e792016-07-16 17:07:04 +0200185 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100186 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 1, 1, 1, 0)),
187 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 1, 1, 1, 0)),
188 MPP_VAR_FUNCTION(0x3, "ge1", "txd3", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200189 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100190 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 1, 1, 1, 0)),
191 MPP_VAR_FUNCTION(0x5, "sata0", "prsnt", V(0, 1, 1, 1, 1, 0)),
192 MPP_VAR_FUNCTION(0xb, "lcd", "d3", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200193 MPP_MODE(24,
Andreas Klinger9573e792016-07-16 17:07:04 +0200194 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100195 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 1, 1, 1, 0)),
196 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 1, 1, 1, 0)),
197 MPP_VAR_FUNCTION(0x3, "ge1", "rxd0", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200198 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100199 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 1, 1, 1, 0)),
200 MPP_VAR_FUNCTION(0xb, "lcd", "d4", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200201 MPP_MODE(25,
Andreas Klinger9573e792016-07-16 17:07:04 +0200202 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100203 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 1, 1, 1, 0)),
204 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 1, 1, 1, 0)),
205 MPP_VAR_FUNCTION(0x3, "ge1", "rxd1", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200206 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100207 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 1, 1, 1, 0)),
208 MPP_VAR_FUNCTION(0xb, "lcd", "d5", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200209 MPP_MODE(26,
Andreas Klinger9573e792016-07-16 17:07:04 +0200210 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100211 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 1, 1, 1, 0)),
212 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0)),
213 MPP_VAR_FUNCTION(0x3, "ge1", "rxd2", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200214 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100215 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 1, 1, 1, 0)),
216 MPP_VAR_FUNCTION(0xb, "lcd", "d6", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200217 MPP_MODE(27,
Andreas Klinger9573e792016-07-16 17:07:04 +0200218 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100219 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 1, 1, 1, 0)),
220 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0)),
221 MPP_VAR_FUNCTION(0x3, "ge1", "rxd3", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200222 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100223 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 1, 1, 1, 0)),
224 MPP_VAR_FUNCTION(0xb, "lcd", "d7", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200225 MPP_MODE(28,
Andreas Klinger9573e792016-07-16 17:07:04 +0200226 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100227 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 1, 1, 1, 0)),
228 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 1, 1, 1, 0)),
229 MPP_VAR_FUNCTION(0x3, "ge1", "col", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200230 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100231 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0)),
232 MPP_VAR_FUNCTION(0xb, "lcd", "d8", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200233 MPP_MODE(29,
Andreas Klinger9573e792016-07-16 17:07:04 +0200234 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100235 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 1, 1, 1, 0)),
236 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 1, 1, 1, 0)),
237 MPP_VAR_FUNCTION(0x3, "ge1", "txclk", V(0, 1, 1, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200238 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 0, 0, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100239 MPP_VAR_FUNCTION(0xb, "lcd", "d9", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200240 MPP_MODE(30,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100241 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
242 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 1, 1, 1, 0)),
243 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 1, 1, 1, 0)),
244 MPP_VAR_FUNCTION(0x3, "ge1", "rxctl", V(0, 1, 1, 1, 1, 0)),
245 MPP_VAR_FUNCTION(0xb, "lcd", "d10", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200246 MPP_MODE(31,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100247 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
248 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 1, 1, 1, 0)),
249 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 1, 1, 1, 0)),
250 MPP_VAR_FUNCTION(0x3, "ge1", "rxclk", V(0, 1, 1, 1, 1, 0)),
251 MPP_VAR_FUNCTION(0xb, "lcd", "d11", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200252 MPP_MODE(32,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100253 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 0)),
254 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 1, 1, 1, 0)),
255 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 1, 1, 1, 0)),
256 MPP_VAR_FUNCTION(0x3, "ge1", "txclko", V(0, 1, 1, 1, 1, 0)),
257 MPP_VAR_FUNCTION(0xb, "lcd", "d12", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200258 MPP_MODE(33,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100259 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 1, 1, 1, 1, 0)),
260 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 1, 1, 1, 0)),
261 MPP_VAR_FUNCTION(0x3, "ge1", "txctl", V(0, 1, 1, 1, 1, 0)),
262 MPP_VAR_FUNCTION(0xb, "lcd", "d13", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200263 MPP_MODE(34,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100264 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 1, 1, 1, 1, 1)),
265 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 1, 1, 1, 0)),
266 MPP_VAR_FUNCTION(0x3, "ge1", "txen", V(0, 1, 1, 1, 1, 0)),
267 MPP_VAR_FUNCTION(0x5, "sata1", "act", V(0, 0, 0, 1, 1, 0)),
268 MPP_VAR_FUNCTION(0xb, "lcd", "d14", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200269 MPP_MODE(35,
Andreas Klinger9573e792016-07-16 17:07:04 +0200270 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 1, 1, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100271 MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql", V(0, 0, 1, 1, 1, 0)),
272 MPP_VAR_FUNCTION(0x3, "ge1", "rxerr", V(0, 1, 1, 1, 1, 0)),
273 MPP_VAR_FUNCTION(0x5, "sata0", "act", V(0, 1, 1, 1, 1, 0)),
274 MPP_VAR_FUNCTION(0xb, "lcd", "d15", V(0, 0, 0, 0, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200275 MPP_VAR_FUNCTION(0xc, "mii", "rxerr", V(1, 1, 1, 1, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200276 MPP_MODE(36,
Andreas Klinger9573e792016-07-16 17:07:04 +0200277 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100278 MPP_VAR_FUNCTION(0x1, "ts", "mp0", V(0, 0, 0, 1, 1, 0)),
279 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200280 MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100281 MPP_VAR_FUNCTION(0xb, "twsi1", "sda", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200282 MPP_MODE(37,
Andreas Klinger9573e792016-07-16 17:07:04 +0200283 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100284 MPP_VAR_FUNCTION(0x1, "ts", "mp1", V(0, 0, 0, 1, 1, 0)),
285 MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200286 MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100287 MPP_VAR_FUNCTION(0xb, "twsi1", "sck", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200288 MPP_MODE(38,
Andreas Klinger9573e792016-07-16 17:07:04 +0200289 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100290 MPP_VAR_FUNCTION(0x1, "ts", "mp2", V(0, 0, 0, 1, 1, 0)),
291 MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200292 MPP_VAR_FUNCTION(0x4, "audio", "rmclk", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100293 MPP_VAR_FUNCTION(0xb, "lcd", "d18", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200294 MPP_MODE(39,
Andreas Klinger9573e792016-07-16 17:07:04 +0200295 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100296 MPP_VAR_FUNCTION(0x1, "ts", "mp3", V(0, 0, 0, 1, 1, 0)),
297 MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200298 MPP_VAR_FUNCTION(0x4, "audio", "bclk", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100299 MPP_VAR_FUNCTION(0xb, "lcd", "d19", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200300 MPP_MODE(40,
Andreas Klinger9573e792016-07-16 17:07:04 +0200301 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100302 MPP_VAR_FUNCTION(0x1, "ts", "mp4", V(0, 0, 0, 1, 1, 0)),
303 MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200304 MPP_VAR_FUNCTION(0x4, "audio", "sdo", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100305 MPP_VAR_FUNCTION(0xb, "lcd", "d20", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200306 MPP_MODE(41,
Andreas Klinger9573e792016-07-16 17:07:04 +0200307 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100308 MPP_VAR_FUNCTION(0x1, "ts", "mp5", V(0, 0, 0, 1, 1, 0)),
309 MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200310 MPP_VAR_FUNCTION(0x4, "audio", "lrclk", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100311 MPP_VAR_FUNCTION(0xb, "lcd", "d21", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200312 MPP_MODE(42,
Andreas Klinger9573e792016-07-16 17:07:04 +0200313 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100314 MPP_VAR_FUNCTION(0x1, "ts", "mp6", V(0, 0, 0, 1, 1, 0)),
315 MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200316 MPP_VAR_FUNCTION(0x4, "audio", "mclk", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100317 MPP_VAR_FUNCTION(0xb, "lcd", "d22", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200318 MPP_MODE(43,
Andreas Klinger9573e792016-07-16 17:07:04 +0200319 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100320 MPP_VAR_FUNCTION(0x1, "ts", "mp7", V(0, 0, 0, 1, 1, 0)),
321 MPP_VAR_FUNCTION(0x2, "tdm", "int", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200322 MPP_VAR_FUNCTION(0x4, "audio", "sdi", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100323 MPP_VAR_FUNCTION(0xb, "lcd", "d23", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200324 MPP_MODE(44,
Andreas Klinger9573e792016-07-16 17:07:04 +0200325 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(1, 0, 0, 1, 1, 1)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100326 MPP_VAR_FUNCTION(0x1, "ts", "mp8", V(0, 0, 0, 1, 1, 0)),
327 MPP_VAR_FUNCTION(0x2, "tdm", "rst", V(0, 0, 0, 1, 1, 0)),
Andreas Klinger9573e792016-07-16 17:07:04 +0200328 MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 1, 1, 0)),
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100329 MPP_VAR_FUNCTION(0xb, "lcd", "clk", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200330 MPP_MODE(45,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100331 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 1)),
332 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 1, 0)),
333 MPP_VAR_FUNCTION(0x2, "tdm", "pclk", V(0, 0, 0, 1, 1, 0)),
334 MPP_VAR_FUNCTION(0xb, "lcd", "e", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200335 MPP_MODE(46,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100336 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)),
337 MPP_VAR_FUNCTION(0x1, "ts", "mp10", V(0, 0, 0, 1, 1, 0)),
338 MPP_VAR_FUNCTION(0x2, "tdm", "fs", V(0, 0, 0, 1, 1, 0)),
339 MPP_VAR_FUNCTION(0xb, "lcd", "hsync", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200340 MPP_MODE(47,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100341 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)),
342 MPP_VAR_FUNCTION(0x1, "ts", "mp11", V(0, 0, 0, 1, 1, 0)),
343 MPP_VAR_FUNCTION(0x2, "tdm", "drx", V(0, 0, 0, 1, 1, 0)),
344 MPP_VAR_FUNCTION(0xb, "lcd", "vsync", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200345 MPP_MODE(48,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100346 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 1, 0)),
347 MPP_VAR_FUNCTION(0x1, "ts", "mp12", V(0, 0, 0, 1, 1, 0)),
348 MPP_VAR_FUNCTION(0x2, "tdm", "dtx", V(0, 0, 0, 1, 1, 0)),
349 MPP_VAR_FUNCTION(0xb, "lcd", "d16", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200350 MPP_MODE(49,
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100351 MPP_VAR_FUNCTION(0x0, "gpio", NULL, V(0, 0, 0, 1, 0, 1)),
352 MPP_VAR_FUNCTION(0x0, "gpo", NULL, V(0, 0, 0, 0, 1, 0)),
353 MPP_VAR_FUNCTION(0x1, "ts", "mp9", V(0, 0, 0, 1, 0, 0)),
354 MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql", V(0, 0, 0, 1, 1, 0)),
355 MPP_VAR_FUNCTION(0x5, "ptp", "clk", V(0, 0, 0, 1, 0, 0)),
356 MPP_VAR_FUNCTION(0xa, "pex", "clkreq", V(0, 0, 0, 0, 1, 0)),
357 MPP_VAR_FUNCTION(0xb, "lcd", "d17", V(0, 0, 0, 0, 1, 0))),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200358};
359
Russell King30be3fb2017-01-13 11:03:15 +0000360static const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
Russell Kingad9ec4e2017-01-13 11:03:30 +0000361 MPP_FUNC_CTRL(0, 44, NULL, mvebu_mmio_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200362};
363
364static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
Andreas Klinger9573e792016-07-16 17:07:04 +0200365 MPP_GPIO_RANGE(0, 0, 0, 20),
366 MPP_GPIO_RANGE(1, 35, 35, 10),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200367};
368
Russell King30be3fb2017-01-13 11:03:15 +0000369static const struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
Russell Kingad9ec4e2017-01-13 11:03:30 +0000370 MPP_FUNC_CTRL(0, 35, NULL, mvebu_mmio_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200371};
372
373static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
374 MPP_GPIO_RANGE(0, 0, 0, 32),
375 MPP_GPIO_RANGE(1, 32, 32, 4),
376};
377
Russell King30be3fb2017-01-13 11:03:15 +0000378static const struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
Russell Kingad9ec4e2017-01-13 11:03:30 +0000379 MPP_FUNC_CTRL(0, 49, NULL, mvebu_mmio_mpp_ctrl),
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200380};
381
382static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
383 MPP_GPIO_RANGE(0, 0, 0, 32),
384 MPP_GPIO_RANGE(1, 32, 32, 18),
385};
386
387static struct mvebu_pinctrl_soc_info mv88f6180_info = {
388 .variant = VARIANT_MV88F6180,
389 .controls = mv88f6180_mpp_controls,
390 .ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
391 .modes = mv88f6xxx_mpp_modes,
392 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
393 .gpioranges = mv88f6180_gpio_ranges,
394 .ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
395};
396
397static struct mvebu_pinctrl_soc_info mv88f6190_info = {
398 .variant = VARIANT_MV88F6190,
399 .controls = mv88f619x_mpp_controls,
400 .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
401 .modes = mv88f6xxx_mpp_modes,
402 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
403 .gpioranges = mv88f619x_gpio_ranges,
404 .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
405};
406
407static struct mvebu_pinctrl_soc_info mv88f6192_info = {
408 .variant = VARIANT_MV88F6192,
409 .controls = mv88f619x_mpp_controls,
410 .ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
411 .modes = mv88f6xxx_mpp_modes,
412 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
413 .gpioranges = mv88f619x_gpio_ranges,
414 .ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
415};
416
417static struct mvebu_pinctrl_soc_info mv88f6281_info = {
418 .variant = VARIANT_MV88F6281,
419 .controls = mv88f628x_mpp_controls,
420 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
421 .modes = mv88f6xxx_mpp_modes,
422 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
423 .gpioranges = mv88f628x_gpio_ranges,
424 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
425};
426
427static struct mvebu_pinctrl_soc_info mv88f6282_info = {
428 .variant = VARIANT_MV88F6282,
429 .controls = mv88f628x_mpp_controls,
430 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
431 .modes = mv88f6xxx_mpp_modes,
432 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
433 .gpioranges = mv88f628x_gpio_ranges,
434 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
435};
436
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100437static struct mvebu_pinctrl_soc_info mv98dx4122_info = {
438 .variant = VARIANT_MV98DX4122,
439 .controls = mv88f628x_mpp_controls,
440 .ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
441 .modes = mv88f6xxx_mpp_modes,
442 .nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
443 .gpioranges = mv88f628x_gpio_ranges,
444 .ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
445};
446
Fabian Frederickbaa9946e2015-03-16 20:59:09 +0100447static const struct of_device_id kirkwood_pinctrl_of_match[] = {
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200448 { .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
449 { .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
450 { .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
451 { .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
452 { .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
Valentin Longchamp4e5bc992012-11-17 17:00:55 +0100453 { .compatible = "marvell,98dx4122-pinctrl", .data = &mv98dx4122_info },
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200454 { }
455};
456
Greg Kroah-Hartman150632b2012-12-21 13:10:23 -0800457static int kirkwood_pinctrl_probe(struct platform_device *pdev)
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200458{
459 const struct of_device_id *match =
460 of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
Russell Kingad9ec4e2017-01-13 11:03:30 +0000461
Andrew Lunn16fa36b2013-01-09 19:28:09 +0100462 pdev->dev.platform_data = (void *)match->data;
Sebastian Hesselbarth1217b792014-01-31 01:48:48 +0100463
Russell Kingad9ec4e2017-01-13 11:03:30 +0000464 return mvebu_pinctrl_simple_mmio_probe(pdev);
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200465}
466
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200467static struct platform_driver kirkwood_pinctrl_driver = {
468 .driver = {
469 .name = "kirkwood-pinctrl",
Sachin Kamatf2e93942013-10-21 14:47:14 +0530470 .of_match_table = kirkwood_pinctrl_of_match,
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200471 },
472 .probe = kirkwood_pinctrl_probe,
Sebastian Hesselbarth9d4b1632012-09-13 17:41:45 +0200473};
Paul Gortmakerfdbde812017-02-06 03:03:50 -0500474builtin_platform_driver(kirkwood_pinctrl_driver);