106763c74SThomas Petazzoni /*
206763c74SThomas Petazzoni  * Marvell Kirkwood pinctrl driver based on mvebu pinctrl core
306763c74SThomas Petazzoni  *
406763c74SThomas Petazzoni  * Author: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
506763c74SThomas Petazzoni  *
606763c74SThomas Petazzoni  * This program is free software; you can redistribute it and/or modify
706763c74SThomas Petazzoni  * it under the terms of the GNU General Public License as published by
806763c74SThomas Petazzoni  * the Free Software Foundation; either version 2 of the License, or
906763c74SThomas Petazzoni  * (at your option) any later version.
1006763c74SThomas Petazzoni  */
1106763c74SThomas Petazzoni 
1206763c74SThomas Petazzoni #include <linux/err.h>
1306763c74SThomas Petazzoni #include <linux/init.h>
1406763c74SThomas Petazzoni #include <linux/io.h>
1506763c74SThomas Petazzoni #include <linux/module.h>
1606763c74SThomas Petazzoni #include <linux/platform_device.h>
1706763c74SThomas Petazzoni #include <linux/clk.h>
1806763c74SThomas Petazzoni #include <linux/of.h>
1906763c74SThomas Petazzoni #include <linux/of_device.h>
2006763c74SThomas Petazzoni #include <linux/pinctrl/pinctrl.h>
2106763c74SThomas Petazzoni 
2206763c74SThomas Petazzoni #include "pinctrl-mvebu.h"
2306763c74SThomas Petazzoni 
2406763c74SThomas Petazzoni #define V(f6180, f6190, f6192, f6281, f6282)		\
2506763c74SThomas Petazzoni 	((f6180 << 0) | (f6190 << 1) | (f6192 << 2) |	\
2606763c74SThomas Petazzoni 	 (f6281 << 3) | (f6282 << 4))
2706763c74SThomas Petazzoni 
2806763c74SThomas Petazzoni enum kirkwood_variant {
2906763c74SThomas Petazzoni 	VARIANT_MV88F6180 = V(1, 0, 0, 0, 0),
3006763c74SThomas Petazzoni 	VARIANT_MV88F6190 = V(0, 1, 0, 0, 0),
3106763c74SThomas Petazzoni 	VARIANT_MV88F6192 = V(0, 0, 1, 0, 0),
3206763c74SThomas Petazzoni 	VARIANT_MV88F6281 = V(0, 0, 0, 1, 0),
3306763c74SThomas Petazzoni 	VARIANT_MV88F6282 = V(0, 0, 0, 0, 1),
3406763c74SThomas Petazzoni };
3506763c74SThomas Petazzoni 
3606763c74SThomas Petazzoni static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
3706763c74SThomas Petazzoni 	MPP_MODE(0,
3806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
3906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io2",     V(1, 1, 1, 1, 1)),
4006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1))),
4106763c74SThomas Petazzoni 	MPP_MODE(1,
4206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
4306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io3",     V(1, 1, 1, 1, 1)),
4406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1))),
4506763c74SThomas Petazzoni 	MPP_MODE(2,
4606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
4706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io4",     V(1, 1, 1, 1, 1)),
4806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1))),
4906763c74SThomas Petazzoni 	MPP_MODE(3,
5006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
5106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io5",     V(1, 1, 1, 1, 1)),
5206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1))),
5306763c74SThomas Petazzoni 	MPP_MODE(4,
5406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
5506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io6",     V(1, 1, 1, 1, 1)),
5606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "uart0", "rxd",    V(1, 1, 1, 1, 1)),
5706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1)),
5806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1)),
5906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0))),
6006763c74SThomas Petazzoni 	MPP_MODE(5,
6106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
6206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io7",     V(1, 1, 1, 1, 1)),
6306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "uart0", "txd",    V(1, 1, 1, 1, 1)),
6406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "ptp", "trig",     V(1, 1, 1, 1, 0)),
6506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1)),
6606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1))),
6706763c74SThomas Petazzoni 	MPP_MODE(6,
6806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "sysrst", "out",   V(1, 1, 1, 1, 1)),
6906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "spi", "mosi",     V(1, 1, 1, 1, 1)),
7006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "ptp", "trig",     V(1, 1, 1, 1, 0))),
7106763c74SThomas Petazzoni 	MPP_MODE(7,
7206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
7306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "pex", "rsto",     V(1, 1, 1, 1, 0)),
7406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1)),
7506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0)),
7606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1))),
7706763c74SThomas Petazzoni 	MPP_MODE(8,
7806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
7906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "twsi0", "sda",    V(1, 1, 1, 1, 1)),
8006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1)),
8106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "uart1", "rts",    V(1, 1, 1, 1, 1)),
8206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr",  V(0, 1, 1, 1, 1)),
8306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1)),
8406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xc, "ptp", "clk",      V(1, 1, 1, 1, 0)),
8506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1))),
8606763c74SThomas Petazzoni 	MPP_MODE(9,
8706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
8806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "twsi0", "sck",    V(1, 1, 1, 1, 1)),
8906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1)),
9006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "uart1", "cts",    V(1, 1, 1, 1, 1)),
9106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1)),
9206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xc, "ptp", "evreq",    V(1, 1, 1, 1, 0)),
9306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1))),
9406763c74SThomas Petazzoni 	MPP_MODE(10,
9506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
9606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1)),
9706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0X3, "uart0", "txd",    V(1, 1, 1, 1, 1)),
9806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1)),
9906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xc, "ptp", "trig",     V(1, 1, 1, 1, 0))),
10006763c74SThomas Petazzoni 	MPP_MODE(11,
10106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
10206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1)),
10306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "uart0", "rxd",    V(1, 1, 1, 1, 1)),
10406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq",  V(1, 1, 1, 1, 0)),
10506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xc, "ptp-2", "trig",   V(1, 1, 1, 1, 0)),
10606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0)),
10706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1))),
10806763c74SThomas Petazzoni 	MPP_MODE(12,
10906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 0, 1)),
11006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0)),
11106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "sdio", "clk",     V(1, 1, 1, 1, 1)),
11206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1)),
11306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "spi", "mosi",     V(0, 0, 0, 0, 1)),
11406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "twsi1", "sda",    V(0, 0, 0, 0, 1))),
11506763c74SThomas Petazzoni 	MPP_MODE(13,
11606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
11706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "sdio", "cmd",     V(1, 1, 1, 1, 1)),
11806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1)),
11906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xa, "audio", "rmclk",  V(0, 0, 0, 0, 1)),
12006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1))),
12106763c74SThomas Petazzoni 	MPP_MODE(14,
12206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
12306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "sdio", "d0",      V(1, 1, 1, 1, 1)),
12406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1)),
12506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "sata1", "prsnt",  V(0, 0, 1, 1, 1)),
12606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1)),
12706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "audio-1", "sdi",  V(0, 0, 0, 0, 1)),
12806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1))),
12906763c74SThomas Petazzoni 	MPP_MODE(15,
13006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
13106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "sdio", "d1",      V(1, 1, 1, 1, 1)),
13206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1)),
13306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1)),
13406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "sata0", "act",    V(0, 1, 1, 1, 1)),
13506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "spi", "cs",       V(0, 0, 0, 0, 1))),
13606763c74SThomas Petazzoni 	MPP_MODE(16,
13706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
13806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "sdio", "d2",      V(1, 1, 1, 1, 1)),
13906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1)),
14006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1)),
14106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "sata1", "act",    V(0, 0, 1, 1, 1)),
14206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "extclk",   V(0, 0, 0, 0, 1)),
14306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1))),
14406763c74SThomas Petazzoni 	MPP_MODE(17,
14506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
14606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "sdio", "d3",      V(1, 1, 1, 1, 1)),
14706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "sata0", "prsnt",  V(0, 1, 1, 1, 1)),
14806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xa, "sata1", "act",    V(0, 0, 0, 0, 1)),
14906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xd, "twsi1", "sck",    V(0, 0, 0, 0, 1))),
15006763c74SThomas Petazzoni 	MPP_MODE(18,
15106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
15206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io0",     V(1, 1, 1, 1, 1)),
15306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "pex", "clkreq",   V(0, 0, 0, 0, 1))),
15406763c74SThomas Petazzoni 	MPP_MODE(19,
15506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1)),
15606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "nand", "io1",     V(1, 1, 1, 1, 1))),
15706763c74SThomas Petazzoni 	MPP_MODE(20,
15806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
15906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 1, 1, 1)),
16006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1)),
16106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txd0",     V(0, 1, 1, 1, 1)),
16206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1)),
16306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1)),
16406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d0",       V(0, 0, 0, 0, 1)),
16506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(1, 0, 0, 0, 0))),
16606763c74SThomas Petazzoni 	MPP_MODE(21,
16706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
16806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 1, 1, 1)),
16906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 1, 1, 1)),
17006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txd1",     V(0, 1, 1, 1, 1)),
17106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 0, 0)),
17206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1)),
17306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1)),
17406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d1",       V(0, 0, 0, 0, 1))),
17506763c74SThomas Petazzoni 	MPP_MODE(22,
17606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
17706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 1, 1, 1)),
17806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 1, 1, 1)),
17906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txd2",     V(0, 1, 1, 1, 1)),
18006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 0, 0)),
18106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 1, 1, 1)),
18206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1)),
18306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d2",       V(0, 0, 0, 0, 1))),
18406763c74SThomas Petazzoni 	MPP_MODE(23,
18506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
18606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 1, 1, 1)),
18706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 1, 1, 1)),
18806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txd3",     V(0, 1, 1, 1, 1)),
18906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(1, 0, 0, 0, 0)),
19006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 1, 1, 1)),
19106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1)),
19206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d3",       V(0, 0, 0, 0, 1))),
19306763c74SThomas Petazzoni 	MPP_MODE(24,
19406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
19506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 1, 1, 1)),
19606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 1, 1, 1)),
19706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd0",     V(0, 1, 1, 1, 1)),
19806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(1, 0, 0, 0, 0)),
19906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 1, 1, 1)),
20006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d4",       V(0, 0, 0, 0, 1))),
20106763c74SThomas Petazzoni 	MPP_MODE(25,
20206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
20306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 1, 1, 1)),
20406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 1, 1, 1)),
20506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd1",     V(0, 1, 1, 1, 1)),
20606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(1, 0, 0, 0, 0)),
20706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 1, 1, 1)),
20806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d5",       V(0, 0, 0, 0, 1))),
20906763c74SThomas Petazzoni 	MPP_MODE(26,
21006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
21106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 1, 1, 1)),
21206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1)),
21306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd2",     V(0, 1, 1, 1, 1)),
21406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(1, 0, 0, 0, 0)),
21506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 1, 1, 1)),
21606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d6",       V(0, 0, 0, 0, 1))),
21706763c74SThomas Petazzoni 	MPP_MODE(27,
21806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
21906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 1, 1, 1)),
22006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1)),
22106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd3",     V(0, 1, 1, 1, 1)),
22206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(1, 0, 0, 0, 0)),
22306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 1, 1, 1)),
22406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d7",       V(0, 0, 0, 0, 1))),
22506763c74SThomas Petazzoni 	MPP_MODE(28,
22606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
22706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 1, 1, 1)),
22806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 1, 1, 1)),
22906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "col",      V(0, 1, 1, 1, 1)),
23006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(1, 0, 0, 0, 0)),
23106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1)),
23206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d8",       V(0, 0, 0, 0, 1))),
23306763c74SThomas Petazzoni 	MPP_MODE(29,
23406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1)),
23506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 1, 1, 1)),
23606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 1, 1, 1)),
23706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txclk",    V(0, 1, 1, 1, 1)),
23806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 0, 0)),
23906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d9",       V(0, 0, 0, 0, 1))),
24006763c74SThomas Petazzoni 	MPP_MODE(30,
24106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1)),
24206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 1, 1, 1)),
24306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 1, 1, 1)),
24406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "rxctl",    V(0, 1, 1, 1, 1)),
24506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d10",      V(0, 0, 0, 0, 1))),
24606763c74SThomas Petazzoni 	MPP_MODE(31,
24706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1)),
24806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 1, 1, 1)),
24906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 1, 1, 1)),
25006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "rxclk",    V(0, 1, 1, 1, 1)),
25106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d11",      V(0, 0, 0, 0, 1))),
25206763c74SThomas Petazzoni 	MPP_MODE(32,
25306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1)),
25406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 1, 1, 1)),
25506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 1, 1, 1)),
25606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txclko",   V(0, 1, 1, 1, 1)),
25706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d12",      V(0, 0, 0, 0, 1))),
25806763c74SThomas Petazzoni 	MPP_MODE(33,
25906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 1, 1, 1, 1)),
26006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 1, 1, 1)),
26106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txctl",    V(0, 1, 1, 1, 1)),
26206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d13",      V(0, 0, 0, 0, 1))),
26306763c74SThomas Petazzoni 	MPP_MODE(34,
26406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1)),
26506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 1, 1, 1)),
26606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "txen",     V(0, 1, 1, 1, 1)),
26706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 0, 1, 1)),
26806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d14",      V(0, 0, 0, 0, 1))),
26906763c74SThomas Petazzoni 	MPP_MODE(35,
27006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1)),
27106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1)),
27206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x3, "ge1", "rxerr",    V(0, 1, 1, 1, 1)),
27306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1)),
27406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d15",      V(0, 0, 0, 0, 1)),
27506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(0, 1, 1, 1, 1))),
27606763c74SThomas Petazzoni 	MPP_MODE(36,
27706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
27806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 0, 1, 1)),
27906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 0, 1, 1)),
28006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 1, 1)),
28106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "twsi1", "sda",    V(0, 0, 0, 0, 1))),
28206763c74SThomas Petazzoni 	MPP_MODE(37,
28306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
28406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 0, 1, 1)),
28506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 0, 1, 1)),
28606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 1, 1)),
28706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "twsi1", "sck",    V(0, 0, 0, 0, 1))),
28806763c74SThomas Petazzoni 	MPP_MODE(38,
28906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
29006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 0, 1, 1)),
29106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 0, 1, 1)),
29206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 0, 1, 1)),
29306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d18",      V(0, 0, 0, 0, 1))),
29406763c74SThomas Petazzoni 	MPP_MODE(39,
29506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
29606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 0, 1, 1)),
29706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 0, 1, 1)),
29806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 0, 1, 1)),
29906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d19",      V(0, 0, 0, 0, 1))),
30006763c74SThomas Petazzoni 	MPP_MODE(40,
30106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
30206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 0, 1, 1)),
30306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 0, 1, 1)),
30406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 0, 1, 1)),
30506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d20",      V(0, 0, 0, 0, 1))),
30606763c74SThomas Petazzoni 	MPP_MODE(41,
30706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
30806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 0, 1, 1)),
30906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1)),
31006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 0, 1, 1)),
31106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d21",      V(0, 0, 0, 0, 1))),
31206763c74SThomas Petazzoni 	MPP_MODE(42,
31306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
31406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 0, 1, 1)),
31506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1)),
31606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 0, 1, 1)),
31706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d22",      V(0, 0, 0, 0, 1))),
31806763c74SThomas Petazzoni 	MPP_MODE(43,
31906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
32006763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 0, 1, 1)),
32106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 0, 1, 1)),
32206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 0, 1, 1)),
32306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d23",      V(0, 0, 0, 0, 1))),
32406763c74SThomas Petazzoni 	MPP_MODE(44,
32506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
32606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 0, 1, 1)),
32706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 0, 1, 1)),
32806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 1, 1)),
32906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "clk",      V(0, 0, 0, 0, 1))),
33006763c74SThomas Petazzoni 	MPP_MODE(45,
33106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
33206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 1)),
33306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 0, 1, 1)),
33406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "e",        V(0, 0, 0, 0, 1))),
33506763c74SThomas Petazzoni 	MPP_MODE(46,
33606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
33706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 0, 1, 1)),
33806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 0, 1, 1)),
33906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1))),
34006763c74SThomas Petazzoni 	MPP_MODE(47,
34106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
34206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 0, 1, 1)),
34306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 0, 1, 1)),
34406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1))),
34506763c74SThomas Petazzoni 	MPP_MODE(48,
34606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1)),
34706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 0, 1, 1)),
34806763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 0, 1, 1)),
34906763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d16",      V(0, 0, 0, 0, 1))),
35006763c74SThomas Petazzoni 	MPP_MODE(49,
35106763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0)),
35206763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 0, 0, 0, 1)),
35306763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 0)),
35406763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 0, 1, 1)),
35506763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0x5, "ptp", "clk",      V(0, 0, 0, 1, 0)),
35606763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xa, "pex", "clkreq",   V(0, 0, 0, 0, 1)),
35706763c74SThomas Petazzoni 		MPP_VAR_FUNCTION(0xb, "lcd", "d17",      V(0, 0, 0, 0, 1))),
35806763c74SThomas Petazzoni };
35906763c74SThomas Petazzoni 
36006763c74SThomas Petazzoni static struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
36106763c74SThomas Petazzoni 	MPP_REG_CTRL(0, 29),
36206763c74SThomas Petazzoni };
36306763c74SThomas Petazzoni 
36406763c74SThomas Petazzoni static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
36506763c74SThomas Petazzoni 	MPP_GPIO_RANGE(0, 0, 0, 30),
36606763c74SThomas Petazzoni };
36706763c74SThomas Petazzoni 
36806763c74SThomas Petazzoni static struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
36906763c74SThomas Petazzoni 	MPP_REG_CTRL(0, 35),
37006763c74SThomas Petazzoni };
37106763c74SThomas Petazzoni 
37206763c74SThomas Petazzoni static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
37306763c74SThomas Petazzoni 	MPP_GPIO_RANGE(0,  0,  0, 32),
37406763c74SThomas Petazzoni 	MPP_GPIO_RANGE(1, 32, 32,  4),
37506763c74SThomas Petazzoni };
37606763c74SThomas Petazzoni 
37706763c74SThomas Petazzoni static struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
37806763c74SThomas Petazzoni 	MPP_REG_CTRL(0, 49),
37906763c74SThomas Petazzoni };
38006763c74SThomas Petazzoni 
38106763c74SThomas Petazzoni static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
38206763c74SThomas Petazzoni 	MPP_GPIO_RANGE(0,  0,  0, 32),
38306763c74SThomas Petazzoni 	MPP_GPIO_RANGE(1, 32, 32, 18),
38406763c74SThomas Petazzoni };
38506763c74SThomas Petazzoni 
38606763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6180_info = {
38706763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6180,
38806763c74SThomas Petazzoni 	.controls = mv88f6180_mpp_controls,
38906763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
39006763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
39106763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
39206763c74SThomas Petazzoni 	.gpioranges = mv88f6180_gpio_ranges,
39306763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
39406763c74SThomas Petazzoni };
39506763c74SThomas Petazzoni 
39606763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6190_info = {
39706763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6190,
39806763c74SThomas Petazzoni 	.controls = mv88f619x_mpp_controls,
39906763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
40006763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
40106763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
40206763c74SThomas Petazzoni 	.gpioranges = mv88f619x_gpio_ranges,
40306763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
40406763c74SThomas Petazzoni };
40506763c74SThomas Petazzoni 
40606763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6192_info = {
40706763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6192,
40806763c74SThomas Petazzoni 	.controls = mv88f619x_mpp_controls,
40906763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
41006763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
41106763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
41206763c74SThomas Petazzoni 	.gpioranges = mv88f619x_gpio_ranges,
41306763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
41406763c74SThomas Petazzoni };
41506763c74SThomas Petazzoni 
41606763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6281_info = {
41706763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6281,
41806763c74SThomas Petazzoni 	.controls = mv88f628x_mpp_controls,
41906763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
42006763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
42106763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
42206763c74SThomas Petazzoni 	.gpioranges = mv88f628x_gpio_ranges,
42306763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
42406763c74SThomas Petazzoni };
42506763c74SThomas Petazzoni 
42606763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6282_info = {
42706763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6282,
42806763c74SThomas Petazzoni 	.controls = mv88f628x_mpp_controls,
42906763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
43006763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
43106763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
43206763c74SThomas Petazzoni 	.gpioranges = mv88f628x_gpio_ranges,
43306763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
43406763c74SThomas Petazzoni };
43506763c74SThomas Petazzoni 
43606763c74SThomas Petazzoni static struct of_device_id kirkwood_pinctrl_of_match[] __devinitdata = {
43706763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
43806763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
43906763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
44006763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
44106763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
44206763c74SThomas Petazzoni 	{ }
44306763c74SThomas Petazzoni };
44406763c74SThomas Petazzoni 
44506763c74SThomas Petazzoni static int __devinit kirkwood_pinctrl_probe(struct platform_device *pdev)
44606763c74SThomas Petazzoni {
44706763c74SThomas Petazzoni 	const struct of_device_id *match =
44806763c74SThomas Petazzoni 		of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
44906763c74SThomas Petazzoni 	pdev->dev.platform_data = match->data;
45006763c74SThomas Petazzoni 	return mvebu_pinctrl_probe(pdev);
45106763c74SThomas Petazzoni }
45206763c74SThomas Petazzoni 
45306763c74SThomas Petazzoni static int __devexit kirkwood_pinctrl_remove(struct platform_device *pdev)
45406763c74SThomas Petazzoni {
45506763c74SThomas Petazzoni 	return mvebu_pinctrl_remove(pdev);
45606763c74SThomas Petazzoni }
45706763c74SThomas Petazzoni 
45806763c74SThomas Petazzoni static struct platform_driver kirkwood_pinctrl_driver = {
45906763c74SThomas Petazzoni 	.driver = {
46006763c74SThomas Petazzoni 		.name = "kirkwood-pinctrl",
46106763c74SThomas Petazzoni 		.owner = THIS_MODULE,
46206763c74SThomas Petazzoni 		.of_match_table = of_match_ptr(kirkwood_pinctrl_of_match),
46306763c74SThomas Petazzoni 	},
46406763c74SThomas Petazzoni 	.probe = kirkwood_pinctrl_probe,
46506763c74SThomas Petazzoni 	.remove = __devexit_p(kirkwood_pinctrl_remove),
46606763c74SThomas Petazzoni };
46706763c74SThomas Petazzoni 
46806763c74SThomas Petazzoni module_platform_driver(kirkwood_pinctrl_driver);
46906763c74SThomas Petazzoni 
47006763c74SThomas Petazzoni MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
47106763c74SThomas Petazzoni MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
47206763c74SThomas Petazzoni MODULE_LICENSE("GPL v2");
473