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 
243a25f9f2SSebastian Hesselbarth static void __iomem *mpp_base;
253a25f9f2SSebastian Hesselbarth 
263a25f9f2SSebastian Hesselbarth static int kirkwood_mpp_ctrl_get(unsigned pid, unsigned long *config)
273a25f9f2SSebastian Hesselbarth {
283a25f9f2SSebastian Hesselbarth 	return default_mpp_ctrl_get(mpp_base, pid, config);
293a25f9f2SSebastian Hesselbarth }
303a25f9f2SSebastian Hesselbarth 
313a25f9f2SSebastian Hesselbarth static int kirkwood_mpp_ctrl_set(unsigned pid, unsigned long config)
323a25f9f2SSebastian Hesselbarth {
333a25f9f2SSebastian Hesselbarth 	return default_mpp_ctrl_set(mpp_base, pid, config);
343a25f9f2SSebastian Hesselbarth }
353a25f9f2SSebastian Hesselbarth 
364e5bc99cSValentin Longchamp #define V(f6180, f6190, f6192, f6281, f6282, dx4122)	\
3706763c74SThomas Petazzoni 	((f6180 << 0) | (f6190 << 1) | (f6192 << 2) |	\
384e5bc99cSValentin Longchamp 	 (f6281 << 3) | (f6282 << 4) | (dx4122 << 5))
3906763c74SThomas Petazzoni 
4006763c74SThomas Petazzoni enum kirkwood_variant {
414e5bc99cSValentin Longchamp 	VARIANT_MV88F6180	= V(1, 0, 0, 0, 0, 0),
424e5bc99cSValentin Longchamp 	VARIANT_MV88F6190	= V(0, 1, 0, 0, 0, 0),
434e5bc99cSValentin Longchamp 	VARIANT_MV88F6192	= V(0, 0, 1, 0, 0, 0),
444e5bc99cSValentin Longchamp 	VARIANT_MV88F6281	= V(0, 0, 0, 1, 0, 0),
454e5bc99cSValentin Longchamp 	VARIANT_MV88F6282	= V(0, 0, 0, 0, 1, 0),
464e5bc99cSValentin Longchamp 	VARIANT_MV98DX4122	= V(0, 0, 0, 0, 0, 1),
4706763c74SThomas Petazzoni };
4806763c74SThomas Petazzoni 
4906763c74SThomas Petazzoni static struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
5006763c74SThomas Petazzoni 	MPP_MODE(0,
514e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
524e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io2",     V(1, 1, 1, 1, 1, 1)),
534e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1, 1))),
5406763c74SThomas Petazzoni 	MPP_MODE(1,
554e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
564e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io3",     V(1, 1, 1, 1, 1, 1)),
574e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1, 1))),
5806763c74SThomas Petazzoni 	MPP_MODE(2,
594e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
604e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io4",     V(1, 1, 1, 1, 1, 1)),
614e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1, 1))),
6206763c74SThomas Petazzoni 	MPP_MODE(3,
634e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
644e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io5",     V(1, 1, 1, 1, 1, 1)),
654e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1, 1))),
6606763c74SThomas Petazzoni 	MPP_MODE(4,
674e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
684e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io6",     V(1, 1, 1, 1, 1, 1)),
694e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "uart0", "rxd",    V(1, 1, 1, 1, 1, 1)),
704e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0)),
714e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1, 0)),
724e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0, 0))),
7306763c74SThomas Petazzoni 	MPP_MODE(5,
744e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
754e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io7",     V(1, 1, 1, 1, 1, 1)),
764e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "uart0", "txd",    V(1, 1, 1, 1, 1, 1)),
774e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "ptp", "trig",     V(1, 1, 1, 1, 0, 0)),
784e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0)),
794e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1, 0))),
8006763c74SThomas Petazzoni 	MPP_MODE(6,
81889c5d3eSSimon Guinot 		MPP_VAR_FUNCTION(0x1, "sysrst", "out",   V(1, 1, 1, 1, 1, 1)),
82889c5d3eSSimon Guinot 		MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1, 1)),
83889c5d3eSSimon Guinot 		MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0, 0))),
8406763c74SThomas Petazzoni 	MPP_MODE(7,
854e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
864e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "pex", "rsto",     V(1, 1, 1, 1, 0, 1)),
874e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1, 1)),
884e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0, 0)),
894e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1, 0))),
9006763c74SThomas Petazzoni 	MPP_MODE(8,
914e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
924e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "twsi0", "sda",    V(1, 1, 1, 1, 1, 1)),
934e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1, 1)),
944e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "uart1", "rts",    V(1, 1, 1, 1, 1, 1)),
954e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr",  V(0, 1, 1, 1, 1, 0)),
964e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0)),
974e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xc, "ptp", "clk",      V(1, 1, 1, 1, 0, 0)),
984e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1, 0))),
9906763c74SThomas Petazzoni 	MPP_MODE(9,
1004e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
1014e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "twsi0", "sck",    V(1, 1, 1, 1, 1, 1)),
1024e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1, 1)),
1034e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "uart1", "cts",    V(1, 1, 1, 1, 1, 1)),
1044e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0)),
1054e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xc, "ptp", "evreq",    V(1, 1, 1, 1, 0, 0)),
1064e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1, 0))),
10706763c74SThomas Petazzoni 	MPP_MODE(10,
1084e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
1094e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1, 1)),
1104e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0X3, "uart0", "txd",    V(1, 1, 1, 1, 1, 1)),
1114e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0)),
1124e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xc, "ptp", "trig",     V(1, 1, 1, 1, 0, 0))),
11306763c74SThomas Petazzoni 	MPP_MODE(11,
1144e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
1154e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1, 1)),
1164e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "uart0", "rxd",    V(1, 1, 1, 1, 1, 1)),
1174e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq",  V(1, 1, 1, 1, 0, 0)),
1184e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xc, "ptp-2", "trig",   V(1, 1, 1, 1, 0, 0)),
1194e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0, 0)),
1204e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0))),
12106763c74SThomas Petazzoni 	MPP_MODE(12,
1224e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 0, 1, 0)),
1234e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0, 0)),
1244e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "sdio", "clk",     V(1, 1, 1, 1, 1, 0)),
1254e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0)),
1264e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "spi", "mosi",     V(0, 0, 0, 0, 1, 0)),
1274e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "twsi1", "sda",    V(0, 0, 0, 0, 1, 0))),
12806763c74SThomas Petazzoni 	MPP_MODE(13,
1294e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
1304e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "sdio", "cmd",     V(1, 1, 1, 1, 1, 0)),
1314e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1, 1)),
1324e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xa, "audio", "rmclk",  V(0, 0, 0, 0, 1, 0)),
1334e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1, 0))),
13406763c74SThomas Petazzoni 	MPP_MODE(14,
1354e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
1364e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "sdio", "d0",      V(1, 1, 1, 1, 1, 0)),
1374e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1, 1)),
1384e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0)),
1394e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0)),
1404e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "audio-1", "sdi",  V(0, 0, 0, 0, 1, 0)),
1414e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1, 0))),
14206763c74SThomas Petazzoni 	MPP_MODE(15,
1434e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
1444e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "sdio", "d1",      V(1, 1, 1, 1, 1, 0)),
1454e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1, 1)),
1464e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1, 0)),
1474e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "sata0", "act",    V(0, 1, 1, 1, 1, 0)),
1484e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "spi", "cs",       V(0, 0, 0, 0, 1, 0))),
14906763c74SThomas Petazzoni 	MPP_MODE(16,
1504e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
1514e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "sdio", "d2",      V(1, 1, 1, 1, 1, 0)),
1524e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1, 1)),
1534e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1, 0)),
1544e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "sata1", "act",    V(0, 0, 1, 1, 1, 0)),
1554e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "extclk",   V(0, 0, 0, 0, 1, 0)),
1564e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1, 0))),
15706763c74SThomas Petazzoni 	MPP_MODE(17,
1584e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 0)),
1594e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "sdio", "d3",      V(1, 1, 1, 1, 1, 0)),
1604e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0)),
1614e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xa, "sata1", "act",    V(0, 0, 0, 0, 1, 0)),
1624e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xd, "twsi1", "sck",    V(0, 0, 0, 0, 1, 0))),
16306763c74SThomas Petazzoni 	MPP_MODE(18,
1644e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
1654e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io0",     V(1, 1, 1, 1, 1, 1)),
1664e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "pex", "clkreq",   V(0, 0, 0, 0, 1, 0))),
16706763c74SThomas Petazzoni 	MPP_MODE(19,
1684e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1)),
1694e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "nand", "io1",     V(1, 1, 1, 1, 1, 1))),
17006763c74SThomas Petazzoni 	MPP_MODE(20,
1719573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
1724e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 1, 1, 1, 0)),
1734e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1, 0)),
1744e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txd0",     V(0, 1, 1, 1, 1, 0)),
1754e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0)),
1764e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0)),
1774e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d0",       V(0, 0, 0, 0, 1, 0)),
1789573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(0, 0, 0, 0, 0, 0))),
17906763c74SThomas Petazzoni 	MPP_MODE(21,
1809573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
1814e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 1, 1, 1, 0)),
1824e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 1, 1, 1, 0)),
1834e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txd1",     V(0, 1, 1, 1, 1, 0)),
1849573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 0, 0, 0)),
1854e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0)),
1864e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0)),
1874e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d1",       V(0, 0, 0, 0, 1, 0))),
18806763c74SThomas Petazzoni 	MPP_MODE(22,
1899573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
1904e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 1, 1, 1, 0)),
1914e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 1, 1, 1, 0)),
1924e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txd2",     V(0, 1, 1, 1, 1, 0)),
1939573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 0, 0, 0)),
1944e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 1, 1, 1, 0)),
1954e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0)),
1964e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d2",       V(0, 0, 0, 0, 1, 0))),
19706763c74SThomas Petazzoni 	MPP_MODE(23,
1989573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
1994e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 1, 1, 1, 0)),
2004e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 1, 1, 1, 0)),
2014e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txd3",     V(0, 1, 1, 1, 1, 0)),
2029573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 0, 0, 0, 0)),
2034e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 1, 1, 1, 0)),
2044e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0)),
2054e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d3",       V(0, 0, 0, 0, 1, 0))),
20606763c74SThomas Petazzoni 	MPP_MODE(24,
2079573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2084e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 1, 1, 1, 0)),
2094e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 1, 1, 1, 0)),
2104e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd0",     V(0, 1, 1, 1, 1, 0)),
2119573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 0, 0, 0, 0)),
2124e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 1, 1, 1, 0)),
2134e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d4",       V(0, 0, 0, 0, 1, 0))),
21406763c74SThomas Petazzoni 	MPP_MODE(25,
2159573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2164e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 1, 1, 1, 0)),
2174e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 1, 1, 1, 0)),
2184e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd1",     V(0, 1, 1, 1, 1, 0)),
2199573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 0, 0, 0, 0)),
2204e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 1, 1, 1, 0)),
2214e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d5",       V(0, 0, 0, 0, 1, 0))),
22206763c74SThomas Petazzoni 	MPP_MODE(26,
2239573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2244e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 1, 1, 1, 0)),
2254e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0)),
2264e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd2",     V(0, 1, 1, 1, 1, 0)),
2279573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 0, 0, 0, 0)),
2284e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 1, 1, 1, 0)),
2294e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d6",       V(0, 0, 0, 0, 1, 0))),
23006763c74SThomas Petazzoni 	MPP_MODE(27,
2319573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2324e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 1, 1, 1, 0)),
2334e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0)),
2344e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "rxd3",     V(0, 1, 1, 1, 1, 0)),
2359573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 0, 0, 0, 0)),
2364e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 1, 1, 1, 0)),
2374e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d7",       V(0, 0, 0, 0, 1, 0))),
23806763c74SThomas Petazzoni 	MPP_MODE(28,
2399573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2404e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 1, 1, 1, 0)),
2414e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 1, 1, 1, 0)),
2424e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "col",      V(0, 1, 1, 1, 1, 0)),
2439573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 0, 0, 0, 0)),
2444e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0)),
2454e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d8",       V(0, 0, 0, 0, 1, 0))),
24606763c74SThomas Petazzoni 	MPP_MODE(29,
2479573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2484e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 1, 1, 1, 0)),
2494e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 1, 1, 1, 0)),
2504e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txclk",    V(0, 1, 1, 1, 1, 0)),
2519573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 0, 0, 0)),
2524e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d9",       V(0, 0, 0, 0, 1, 0))),
25306763c74SThomas Petazzoni 	MPP_MODE(30,
2544e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2554e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 1, 1, 1, 0)),
2564e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 1, 1, 1, 0)),
2574e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "rxctl",    V(0, 1, 1, 1, 1, 0)),
2584e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d10",      V(0, 0, 0, 0, 1, 0))),
25906763c74SThomas Petazzoni 	MPP_MODE(31,
2604e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2614e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 1, 1, 1, 0)),
2624e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 1, 1, 1, 0)),
2634e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "rxclk",    V(0, 1, 1, 1, 1, 0)),
2644e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d11",      V(0, 0, 0, 0, 1, 0))),
26506763c74SThomas Petazzoni 	MPP_MODE(32,
2664e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0)),
2674e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 1, 1, 1, 0)),
2684e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 1, 1, 1, 0)),
2694e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txclko",   V(0, 1, 1, 1, 1, 0)),
2704e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d12",      V(0, 0, 0, 0, 1, 0))),
27106763c74SThomas Petazzoni 	MPP_MODE(33,
2724e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 1, 1, 1, 1, 0)),
2734e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 1, 1, 1, 0)),
2744e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txctl",    V(0, 1, 1, 1, 1, 0)),
2754e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d13",      V(0, 0, 0, 0, 1, 0))),
27606763c74SThomas Petazzoni 	MPP_MODE(34,
2774e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 1)),
2784e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 1, 1, 1, 0)),
2794e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "txen",     V(0, 1, 1, 1, 1, 0)),
2804e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 0, 1, 1, 0)),
2814e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d14",      V(0, 0, 0, 0, 1, 0))),
28206763c74SThomas Petazzoni 	MPP_MODE(35,
2839573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1)),
2844e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1, 0)),
2854e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x3, "ge1", "rxerr",    V(0, 1, 1, 1, 1, 0)),
2864e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0)),
2874e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d15",      V(0, 0, 0, 0, 1, 0)),
2889573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(1, 1, 1, 1, 1, 0))),
28906763c74SThomas Petazzoni 	MPP_MODE(36,
2909573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
2914e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 0, 1, 1, 0)),
2924e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 0, 1, 1, 0)),
2939573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 1, 1, 0)),
2944e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "twsi1", "sda",    V(0, 0, 0, 0, 1, 0))),
29506763c74SThomas Petazzoni 	MPP_MODE(37,
2969573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
2974e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 0, 1, 1, 0)),
2984e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 0, 1, 1, 0)),
2999573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 1, 1, 0)),
3004e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "twsi1", "sck",    V(0, 0, 0, 0, 1, 0))),
30106763c74SThomas Petazzoni 	MPP_MODE(38,
3029573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
3034e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 0, 1, 1, 0)),
3044e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 0, 1, 1, 0)),
3059573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(1, 0, 0, 1, 1, 0)),
3064e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d18",      V(0, 0, 0, 0, 1, 0))),
30706763c74SThomas Petazzoni 	MPP_MODE(39,
3089573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
3094e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 0, 1, 1, 0)),
3104e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 0, 1, 1, 0)),
3119573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(1, 0, 0, 1, 1, 0)),
3124e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d19",      V(0, 0, 0, 0, 1, 0))),
31306763c74SThomas Petazzoni 	MPP_MODE(40,
3149573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
3154e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 0, 1, 1, 0)),
3164e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 0, 1, 1, 0)),
3179573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(1, 0, 0, 1, 1, 0)),
3184e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d20",      V(0, 0, 0, 0, 1, 0))),
31906763c74SThomas Petazzoni 	MPP_MODE(41,
3209573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
3214e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 0, 1, 1, 0)),
3224e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0)),
3239573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(1, 0, 0, 1, 1, 0)),
3244e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d21",      V(0, 0, 0, 0, 1, 0))),
32506763c74SThomas Petazzoni 	MPP_MODE(42,
3269573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
3274e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 0, 1, 1, 0)),
3284e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0)),
3299573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(1, 0, 0, 1, 1, 0)),
3304e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d22",      V(0, 0, 0, 0, 1, 0))),
33106763c74SThomas Petazzoni 	MPP_MODE(43,
3329573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
3334e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 0, 1, 1, 0)),
3344e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 0, 1, 1, 0)),
3359573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(1, 0, 0, 1, 1, 0)),
3364e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d23",      V(0, 0, 0, 0, 1, 0))),
33706763c74SThomas Petazzoni 	MPP_MODE(44,
3389573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1)),
3394e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 0, 1, 1, 0)),
3404e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 0, 1, 1, 0)),
3419573e792SAndreas Klinger 		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 1, 1, 0)),
3424e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "clk",      V(0, 0, 0, 0, 1, 0))),
34306763c74SThomas Petazzoni 	MPP_MODE(45,
3444e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 1)),
3454e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 1, 0)),
3464e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 0, 1, 1, 0)),
3474e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "e",        V(0, 0, 0, 0, 1, 0))),
34806763c74SThomas Petazzoni 	MPP_MODE(46,
3494e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0)),
3504e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 0, 1, 1, 0)),
3514e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 0, 1, 1, 0)),
3524e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1, 0))),
35306763c74SThomas Petazzoni 	MPP_MODE(47,
3544e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0)),
3554e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 0, 1, 1, 0)),
3564e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 0, 1, 1, 0)),
3574e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1, 0))),
35806763c74SThomas Petazzoni 	MPP_MODE(48,
3594e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0)),
3604e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 0, 1, 1, 0)),
3614e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 0, 1, 1, 0)),
3624e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d16",      V(0, 0, 0, 0, 1, 0))),
36306763c74SThomas Petazzoni 	MPP_MODE(49,
3644e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0, 1)),
3654e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 0, 0, 0, 1, 0)),
3664e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 0, 0)),
3674e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 0, 1, 1, 0)),
3684e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0x5, "ptp", "clk",      V(0, 0, 0, 1, 0, 0)),
3694e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xa, "pex", "clkreq",   V(0, 0, 0, 0, 1, 0)),
3704e5bc99cSValentin Longchamp 		MPP_VAR_FUNCTION(0xb, "lcd", "d17",      V(0, 0, 0, 0, 1, 0))),
37106763c74SThomas Petazzoni };
37206763c74SThomas Petazzoni 
37330be3fb9SRussell King static const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
3749573e792SAndreas Klinger 	MPP_FUNC_CTRL(0, 44, NULL, kirkwood_mpp_ctrl),
37506763c74SThomas Petazzoni };
37606763c74SThomas Petazzoni 
37706763c74SThomas Petazzoni static struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
3789573e792SAndreas Klinger 	MPP_GPIO_RANGE(0,  0,  0, 20),
3799573e792SAndreas Klinger 	MPP_GPIO_RANGE(1, 35, 35, 10),
38006763c74SThomas Petazzoni };
38106763c74SThomas Petazzoni 
38230be3fb9SRussell King static const struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
3831217b790SSebastian Hesselbarth 	MPP_FUNC_CTRL(0, 35, NULL, kirkwood_mpp_ctrl),
38406763c74SThomas Petazzoni };
38506763c74SThomas Petazzoni 
38606763c74SThomas Petazzoni static struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
38706763c74SThomas Petazzoni 	MPP_GPIO_RANGE(0,  0,  0, 32),
38806763c74SThomas Petazzoni 	MPP_GPIO_RANGE(1, 32, 32,  4),
38906763c74SThomas Petazzoni };
39006763c74SThomas Petazzoni 
39130be3fb9SRussell King static const struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
3921217b790SSebastian Hesselbarth 	MPP_FUNC_CTRL(0, 49, NULL, kirkwood_mpp_ctrl),
39306763c74SThomas Petazzoni };
39406763c74SThomas Petazzoni 
39506763c74SThomas Petazzoni static struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
39606763c74SThomas Petazzoni 	MPP_GPIO_RANGE(0,  0,  0, 32),
39706763c74SThomas Petazzoni 	MPP_GPIO_RANGE(1, 32, 32, 18),
39806763c74SThomas Petazzoni };
39906763c74SThomas Petazzoni 
40006763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6180_info = {
40106763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6180,
40206763c74SThomas Petazzoni 	.controls = mv88f6180_mpp_controls,
40306763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
40406763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
40506763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
40606763c74SThomas Petazzoni 	.gpioranges = mv88f6180_gpio_ranges,
40706763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
40806763c74SThomas Petazzoni };
40906763c74SThomas Petazzoni 
41006763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6190_info = {
41106763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6190,
41206763c74SThomas Petazzoni 	.controls = mv88f619x_mpp_controls,
41306763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
41406763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
41506763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
41606763c74SThomas Petazzoni 	.gpioranges = mv88f619x_gpio_ranges,
41706763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
41806763c74SThomas Petazzoni };
41906763c74SThomas Petazzoni 
42006763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6192_info = {
42106763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6192,
42206763c74SThomas Petazzoni 	.controls = mv88f619x_mpp_controls,
42306763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
42406763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
42506763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
42606763c74SThomas Petazzoni 	.gpioranges = mv88f619x_gpio_ranges,
42706763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
42806763c74SThomas Petazzoni };
42906763c74SThomas Petazzoni 
43006763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6281_info = {
43106763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6281,
43206763c74SThomas Petazzoni 	.controls = mv88f628x_mpp_controls,
43306763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
43406763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
43506763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
43606763c74SThomas Petazzoni 	.gpioranges = mv88f628x_gpio_ranges,
43706763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
43806763c74SThomas Petazzoni };
43906763c74SThomas Petazzoni 
44006763c74SThomas Petazzoni static struct mvebu_pinctrl_soc_info mv88f6282_info = {
44106763c74SThomas Petazzoni 	.variant = VARIANT_MV88F6282,
44206763c74SThomas Petazzoni 	.controls = mv88f628x_mpp_controls,
44306763c74SThomas Petazzoni 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
44406763c74SThomas Petazzoni 	.modes = mv88f6xxx_mpp_modes,
44506763c74SThomas Petazzoni 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
44606763c74SThomas Petazzoni 	.gpioranges = mv88f628x_gpio_ranges,
44706763c74SThomas Petazzoni 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
44806763c74SThomas Petazzoni };
44906763c74SThomas Petazzoni 
4504e5bc99cSValentin Longchamp static struct mvebu_pinctrl_soc_info mv98dx4122_info = {
4514e5bc99cSValentin Longchamp 	.variant = VARIANT_MV98DX4122,
4524e5bc99cSValentin Longchamp 	.controls = mv88f628x_mpp_controls,
4534e5bc99cSValentin Longchamp 	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
4544e5bc99cSValentin Longchamp 	.modes = mv88f6xxx_mpp_modes,
4554e5bc99cSValentin Longchamp 	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
4564e5bc99cSValentin Longchamp 	.gpioranges = mv88f628x_gpio_ranges,
4574e5bc99cSValentin Longchamp 	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
4584e5bc99cSValentin Longchamp };
4594e5bc99cSValentin Longchamp 
460baa9946eSFabian Frederick static const struct of_device_id kirkwood_pinctrl_of_match[] = {
46106763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
46206763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
46306763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
46406763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
46506763c74SThomas Petazzoni 	{ .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
4664e5bc99cSValentin Longchamp 	{ .compatible = "marvell,98dx4122-pinctrl", .data = &mv98dx4122_info },
46706763c74SThomas Petazzoni 	{ }
46806763c74SThomas Petazzoni };
46906763c74SThomas Petazzoni 
470150632b0SGreg Kroah-Hartman static int kirkwood_pinctrl_probe(struct platform_device *pdev)
47106763c74SThomas Petazzoni {
4721217b790SSebastian Hesselbarth 	struct resource *res;
47306763c74SThomas Petazzoni 	const struct of_device_id *match =
47406763c74SThomas Petazzoni 		of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
47516fa36beSAndrew Lunn 	pdev->dev.platform_data = (void *)match->data;
4761217b790SSebastian Hesselbarth 
4771217b790SSebastian Hesselbarth 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
4781217b790SSebastian Hesselbarth 	mpp_base = devm_ioremap_resource(&pdev->dev, res);
4791217b790SSebastian Hesselbarth 	if (IS_ERR(mpp_base))
4801217b790SSebastian Hesselbarth 		return PTR_ERR(mpp_base);
4811217b790SSebastian Hesselbarth 
48206763c74SThomas Petazzoni 	return mvebu_pinctrl_probe(pdev);
48306763c74SThomas Petazzoni }
48406763c74SThomas Petazzoni 
48506763c74SThomas Petazzoni static struct platform_driver kirkwood_pinctrl_driver = {
48606763c74SThomas Petazzoni 	.driver = {
48706763c74SThomas Petazzoni 		.name = "kirkwood-pinctrl",
488f2e9394dSSachin Kamat 		.of_match_table = kirkwood_pinctrl_of_match,
48906763c74SThomas Petazzoni 	},
49006763c74SThomas Petazzoni 	.probe = kirkwood_pinctrl_probe,
49106763c74SThomas Petazzoni };
49206763c74SThomas Petazzoni 
49306763c74SThomas Petazzoni module_platform_driver(kirkwood_pinctrl_driver);
49406763c74SThomas Petazzoni 
49506763c74SThomas Petazzoni MODULE_AUTHOR("Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>");
49606763c74SThomas Petazzoni MODULE_DESCRIPTION("Marvell Kirkwood pinctrl driver");
49706763c74SThomas Petazzoni MODULE_LICENSE("GPL v2");
498