162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-or-later
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Marvell Kirkwood pinctrl driver based on mvebu pinctrl core
462306a36Sopenharmony_ci *
562306a36Sopenharmony_ci * Author: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
662306a36Sopenharmony_ci */
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci#include <linux/err.h>
962306a36Sopenharmony_ci#include <linux/init.h>
1062306a36Sopenharmony_ci#include <linux/io.h>
1162306a36Sopenharmony_ci#include <linux/platform_device.h>
1262306a36Sopenharmony_ci#include <linux/clk.h>
1362306a36Sopenharmony_ci#include <linux/of.h>
1462306a36Sopenharmony_ci#include <linux/of_device.h>
1562306a36Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_ci#include "pinctrl-mvebu.h"
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci#define V(f6180, f6190, f6192, f6281, f6282, dx4122, dx1135)	\
2062306a36Sopenharmony_ci	((f6180 << 0) | (f6190 << 1) | (f6192 << 2) |	\
2162306a36Sopenharmony_ci	 (f6281 << 3) | (f6282 << 4) | (dx4122 << 5) |	\
2262306a36Sopenharmony_ci	 (dx1135 << 6))
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_cienum kirkwood_variant {
2562306a36Sopenharmony_ci	VARIANT_MV88F6180	= V(1, 0, 0, 0, 0, 0, 0),
2662306a36Sopenharmony_ci	VARIANT_MV88F6190	= V(0, 1, 0, 0, 0, 0, 0),
2762306a36Sopenharmony_ci	VARIANT_MV88F6192	= V(0, 0, 1, 0, 0, 0, 0),
2862306a36Sopenharmony_ci	VARIANT_MV88F6281	= V(0, 0, 0, 1, 0, 0, 0),
2962306a36Sopenharmony_ci	VARIANT_MV88F6282	= V(0, 0, 0, 0, 1, 0, 0),
3062306a36Sopenharmony_ci	VARIANT_MV98DX4122	= V(0, 0, 0, 0, 0, 1, 0),
3162306a36Sopenharmony_ci	VARIANT_MV98DX1135	= V(0, 0, 0, 0, 0, 0, 1),
3262306a36Sopenharmony_ci};
3362306a36Sopenharmony_ci
3462306a36Sopenharmony_cistatic struct mvebu_mpp_mode mv88f6xxx_mpp_modes[] = {
3562306a36Sopenharmony_ci	MPP_MODE(0,
3662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
3762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io2",     V(1, 1, 1, 1, 1, 1, 1)),
3862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1, 1, 1))),
3962306a36Sopenharmony_ci	MPP_MODE(1,
4062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
4162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io3",     V(1, 1, 1, 1, 1, 1, 1)),
4262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1, 1, 1))),
4362306a36Sopenharmony_ci	MPP_MODE(2,
4462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
4562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io4",     V(1, 1, 1, 1, 1, 1, 1)),
4662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1, 1, 1))),
4762306a36Sopenharmony_ci	MPP_MODE(3,
4862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
4962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io5",     V(1, 1, 1, 1, 1, 1, 1)),
5062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1, 1, 1))),
5162306a36Sopenharmony_ci	MPP_MODE(4,
5262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
5362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io6",     V(1, 1, 1, 1, 1, 1, 1)),
5462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "uart0", "rxd",    V(1, 1, 1, 1, 1, 1, 1)),
5562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
5662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1, 0, 0)),
5762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0, 0, 0))),
5862306a36Sopenharmony_ci	MPP_MODE(5,
5962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
6062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io7",     V(1, 1, 1, 1, 1, 1, 1)),
6162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "uart0", "txd",    V(1, 1, 1, 1, 1, 1, 1)),
6262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0)),
6362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
6462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1, 0, 0))),
6562306a36Sopenharmony_ci	MPP_MODE(6,
6662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "sysrst", "out",   V(1, 1, 1, 1, 1, 1, 1)),
6762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "mosi",     V(1, 1, 1, 1, 1, 1, 1)),
6862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0))),
6962306a36Sopenharmony_ci	MPP_MODE(7,
7062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
7162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "pex", "rsto",     V(1, 1, 1, 1, 0, 1, 1)),
7262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "cs",       V(1, 1, 1, 1, 1, 1, 1)),
7362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0)),
7462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1, 0, 0))),
7562306a36Sopenharmony_ci	MPP_MODE(8,
7662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
7762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "twsi0", "sda",    V(1, 1, 1, 1, 1, 1, 1)),
7862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1, 1, 1)),
7962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "uart1", "rts",    V(1, 1, 1, 1, 1, 1, 1)),
8062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "mii-1", "rxerr",  V(0, 1, 1, 1, 1, 0, 0)),
8162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0, 0)),
8262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xc, "ptp", "clk",      V(1, 1, 1, 1, 0, 0, 0)),
8362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1, 0, 0))),
8462306a36Sopenharmony_ci	MPP_MODE(9,
8562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
8662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "twsi0", "sck",    V(1, 1, 1, 1, 1, 1, 1)),
8762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1, 1, 1)),
8862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "uart1", "cts",    V(1, 1, 1, 1, 1, 1, 1)),
8962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0, 0)),
9062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xc, "ptp", "evreq",    V(1, 1, 1, 1, 0, 0, 0)),
9162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1, 0, 0))),
9262306a36Sopenharmony_ci	MPP_MODE(10,
9362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
9462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "sck",      V(1, 1, 1, 1, 1, 1, 1)),
9562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0X3, "uart0", "txd",    V(1, 1, 1, 1, 1, 1, 1)),
9662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
9762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xc, "ptp", "trig",     V(1, 1, 1, 1, 0, 0, 0))),
9862306a36Sopenharmony_ci	MPP_MODE(11,
9962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
10062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "spi", "miso",     V(1, 1, 1, 1, 1, 1, 1)),
10162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "uart0", "rxd",    V(1, 1, 1, 1, 1, 1, 1)),
10262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "ptp-1", "evreq",  V(1, 1, 1, 1, 0, 0, 0)),
10362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xc, "ptp-2", "trig",   V(1, 1, 1, 1, 0, 0, 0)),
10462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "ptp", "clk",      V(1, 1, 1, 1, 0, 0, 0)),
10562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0))),
10662306a36Sopenharmony_ci	MPP_MODE(12,
10762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 0, 1, 0, 0)),
10862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0, 0, 0)),
10962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "sdio", "clk",     V(1, 1, 1, 1, 1, 0, 0)),
11062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xa, "audio", "spdifo", V(0, 0, 0, 0, 1, 0, 0)),
11162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "spi", "mosi",     V(0, 0, 0, 0, 1, 0, 0)),
11262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "twsi1", "sda",    V(0, 0, 0, 0, 1, 0, 0))),
11362306a36Sopenharmony_ci	MPP_MODE(13,
11462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
11562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "sdio", "cmd",     V(1, 1, 1, 1, 1, 0, 0)),
11662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1, 1, 1)),
11762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xa, "audio", "rmclk",  V(0, 0, 0, 0, 1, 0, 0)),
11862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "pwm",      V(0, 0, 0, 0, 1, 0, 0))),
11962306a36Sopenharmony_ci	MPP_MODE(14,
12062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
12162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "sdio", "d0",      V(1, 1, 1, 1, 1, 0, 0)),
12262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1, 1, 1)),
12362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0, 0)),
12462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xa, "audio", "spdifi", V(0, 0, 0, 0, 1, 0, 0)),
12562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "audio-1", "sdi",  V(0, 0, 0, 0, 1, 0, 0)),
12662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "mii", "col",      V(1, 1, 1, 1, 1, 0, 0))),
12762306a36Sopenharmony_ci	MPP_MODE(15,
12862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
12962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "sdio", "d1",      V(1, 1, 1, 1, 1, 0, 0)),
13062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "uart0", "rts",    V(1, 1, 1, 1, 1, 1, 1)),
13162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "uart1", "txd",    V(1, 1, 1, 1, 1, 0, 0)),
13262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
13362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "spi", "cs",       V(0, 0, 0, 0, 1, 0, 0))),
13462306a36Sopenharmony_ci	MPP_MODE(16,
13562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
13662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "sdio", "d2",      V(1, 1, 1, 1, 1, 0, 0)),
13762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "uart0", "cts",    V(1, 1, 1, 1, 1, 1, 1)),
13862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "uart1", "rxd",    V(1, 1, 1, 1, 1, 0, 0)),
13962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
14062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "extclk",   V(0, 0, 0, 0, 1, 0, 0)),
14162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "mii", "crs",      V(1, 1, 1, 1, 1, 0, 0))),
14262306a36Sopenharmony_ci	MPP_MODE(17,
14362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 0, 0)),
14462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "sdio", "d3",      V(1, 1, 1, 1, 1, 0, 0)),
14562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0, 0)),
14662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xa, "sata1", "act",    V(0, 0, 0, 0, 1, 0, 0)),
14762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xd, "twsi1", "sck",    V(0, 0, 0, 0, 1, 0, 0))),
14862306a36Sopenharmony_ci	MPP_MODE(18,
14962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
15062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io0",     V(1, 1, 1, 1, 1, 1, 1)),
15162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "pex", "clkreq",   V(0, 0, 0, 0, 1, 0, 0))),
15262306a36Sopenharmony_ci	MPP_MODE(19,
15362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(1, 1, 1, 1, 1, 1, 1)),
15462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "io1",     V(1, 1, 1, 1, 1, 1, 1))),
15562306a36Sopenharmony_ci	MPP_MODE(20,
15662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
15762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 1, 1, 1, 0, 0)),
15862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1, 0, 0)),
15962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txd0",     V(0, 1, 1, 1, 1, 0, 0)),
16062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 1, 1, 1, 0, 0)),
16162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 1, 1, 1, 0, 0)),
16262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d0",       V(0, 0, 0, 0, 1, 0, 0)),
16362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(0, 0, 0, 0, 0, 0, 0))),
16462306a36Sopenharmony_ci	MPP_MODE(21,
16562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
16662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 1, 1, 1, 0, 0)),
16762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 1, 1, 1, 0, 0)),
16862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txd1",     V(0, 1, 1, 1, 1, 0, 0)),
16962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(0, 0, 0, 0, 0, 0, 0)),
17062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 1, 1, 1, 0, 0)),
17162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
17262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d1",       V(0, 0, 0, 0, 1, 0, 0))),
17362306a36Sopenharmony_ci	MPP_MODE(22,
17462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
17562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 1, 1, 1, 0, 0)),
17662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 1, 1, 1, 0, 0)),
17762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txd2",     V(0, 1, 1, 1, 1, 0, 0)),
17862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(0, 0, 0, 0, 0, 0, 0)),
17962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 1, 1, 1, 0, 0)),
18062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata1", "prsnt",  V(0, 0, 1, 1, 1, 0, 0)),
18162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d2",       V(0, 0, 0, 0, 1, 0, 0))),
18262306a36Sopenharmony_ci	MPP_MODE(23,
18362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
18462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 1, 1, 1, 0, 0)),
18562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 1, 1, 1, 0, 0)),
18662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txd3",     V(0, 1, 1, 1, 1, 0, 0)),
18762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(0, 0, 0, 0, 0, 0, 0)),
18862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 1, 1, 1, 0, 0)),
18962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata0", "prsnt",  V(0, 1, 1, 1, 1, 0, 0)),
19062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d3",       V(0, 0, 0, 0, 1, 0, 0))),
19162306a36Sopenharmony_ci	MPP_MODE(24,
19262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
19362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 1, 1, 1, 0, 0)),
19462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 1, 1, 1, 0, 0)),
19562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "rxd0",     V(0, 1, 1, 1, 1, 0, 0)),
19662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(0, 0, 0, 0, 0, 0, 0)),
19762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 1, 1, 1, 0, 0)),
19862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d4",       V(0, 0, 0, 0, 1, 0, 0))),
19962306a36Sopenharmony_ci	MPP_MODE(25,
20062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
20162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 1, 1, 1, 0, 0)),
20262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 1, 1, 1, 0, 0)),
20362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "rxd1",     V(0, 1, 1, 1, 1, 0, 0)),
20462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(0, 0, 0, 0, 0, 0, 0)),
20562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 1, 1, 1, 0, 0)),
20662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d5",       V(0, 0, 0, 0, 1, 0, 0))),
20762306a36Sopenharmony_ci	MPP_MODE(26,
20862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
20962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 1, 1, 1, 0, 0)),
21062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 1, 1, 1, 0, 0)),
21162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "rxd2",     V(0, 1, 1, 1, 1, 0, 0)),
21262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(0, 0, 0, 0, 0, 0, 0)),
21362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 1, 1, 1, 0, 0)),
21462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d6",       V(0, 0, 0, 0, 1, 0, 0))),
21562306a36Sopenharmony_ci	MPP_MODE(27,
21662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
21762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 1, 1, 1, 0, 0)),
21862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 1, 1, 1, 0, 0)),
21962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "rxd3",     V(0, 1, 1, 1, 1, 0, 0)),
22062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(0, 0, 0, 0, 0, 0, 0)),
22162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 1, 1, 1, 0, 0)),
22262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d7",       V(0, 0, 0, 0, 1, 0, 0))),
22362306a36Sopenharmony_ci	MPP_MODE(28,
22462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 0)),
22562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 1, 1, 1, 0, 0)),
22662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 1, 1, 1, 0, 0)),
22762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "col",      V(0, 1, 1, 1, 1, 0, 0)),
22862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(0, 0, 0, 0, 0, 0, 0)),
22962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 1, 1, 1, 0, 0)),
23062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d8",       V(0, 0, 0, 0, 1, 0, 0)),
23162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "ren",     V(0, 0, 0, 0, 0, 0, 1))),
23262306a36Sopenharmony_ci	MPP_MODE(29,
23362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 0)),
23462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 1, 1, 1, 0, 0)),
23562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 1, 1, 1, 0, 0)),
23662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txclk",    V(0, 1, 1, 1, 1, 0, 0)),
23762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(0, 0, 0, 0, 0, 0, 0)),
23862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d9",       V(0, 0, 0, 0, 1, 0, 0)),
23962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "wen",     V(0, 0, 0, 0, 0, 0, 1))),
24062306a36Sopenharmony_ci	MPP_MODE(30,
24162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
24262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 1, 1, 1, 0, 0)),
24362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 1, 1, 1, 0, 0)),
24462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "rxctl",    V(0, 1, 1, 1, 1, 0, 0)),
24562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d10",      V(0, 0, 0, 0, 1, 0, 0))),
24662306a36Sopenharmony_ci	MPP_MODE(31,
24762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
24862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 1, 1, 1, 0, 0)),
24962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 1, 1, 1, 0, 0)),
25062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "rxclk",    V(0, 1, 1, 1, 1, 0, 0)),
25162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d11",      V(0, 0, 0, 0, 1, 0, 0))),
25262306a36Sopenharmony_ci	MPP_MODE(32,
25362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 0, 1)),
25462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 1, 1, 1, 0, 0)),
25562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 1, 1, 1, 0, 0)),
25662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txclko",   V(0, 1, 1, 1, 1, 0, 0)),
25762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d12",      V(0, 0, 0, 0, 1, 0, 0))),
25862306a36Sopenharmony_ci	MPP_MODE(33,
25962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 1, 1, 1, 1, 0, 1)),
26062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 1, 1, 1, 0, 0)),
26162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txctl",    V(0, 1, 1, 1, 1, 0, 0)),
26262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d13",      V(0, 0, 0, 0, 1, 0, 0))),
26362306a36Sopenharmony_ci	MPP_MODE(34,
26462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 1, 1, 1, 1, 1, 1)),
26562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 1, 1, 1, 0, 0)),
26662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "txen",     V(0, 1, 1, 1, 1, 0, 0)),
26762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata1", "act",    V(0, 0, 0, 1, 1, 0, 0)),
26862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d14",      V(0, 0, 0, 0, 1, 0, 0)),
26962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "ale",     V(0, 0, 0, 0, 0, 0, 1))),
27062306a36Sopenharmony_ci	MPP_MODE(35,
27162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 1, 1, 1, 1, 1, 1)),
27262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "tx0ql",    V(0, 0, 1, 1, 1, 0, 0)),
27362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x3, "ge1", "rxerr",    V(0, 1, 1, 1, 1, 0, 0)),
27462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "sata0", "act",    V(0, 1, 1, 1, 1, 0, 0)),
27562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d15",      V(0, 0, 0, 0, 1, 0, 0)),
27662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xc, "mii", "rxerr",    V(1, 1, 1, 1, 1, 0, 0)),
27762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "nand", "cen",     V(0, 0, 0, 0, 0, 0, 1))),
27862306a36Sopenharmony_ci	MPP_MODE(36,
27962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
28062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp0",       V(0, 0, 0, 1, 1, 0, 0)),
28162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs1",  V(0, 0, 0, 1, 1, 0, 0)),
28262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "spdifi", V(1, 0, 0, 1, 1, 0, 0)),
28362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "twsi1", "sda",    V(0, 0, 0, 0, 1, 0, 0))),
28462306a36Sopenharmony_ci	MPP_MODE(37,
28562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
28662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp1",       V(0, 0, 0, 1, 1, 0, 0)),
28762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "tx2ql",    V(0, 0, 0, 1, 1, 0, 0)),
28862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "spdifo", V(1, 0, 0, 1, 1, 0, 0)),
28962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "twsi1", "sck",    V(0, 0, 0, 0, 1, 0, 0))),
29062306a36Sopenharmony_ci	MPP_MODE(38,
29162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
29262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp2",       V(0, 0, 0, 1, 1, 0, 0)),
29362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "rx2ql",    V(0, 0, 0, 1, 1, 0, 0)),
29462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "rmclk",  V(1, 0, 0, 1, 1, 0, 0)),
29562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d18",      V(0, 0, 0, 0, 1, 0, 0))),
29662306a36Sopenharmony_ci	MPP_MODE(39,
29762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
29862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp3",       V(0, 0, 0, 1, 1, 0, 0)),
29962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-cs0",  V(0, 0, 0, 1, 1, 0, 0)),
30062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "bclk",   V(1, 0, 0, 1, 1, 0, 0)),
30162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d19",      V(0, 0, 0, 0, 1, 0, 0))),
30262306a36Sopenharmony_ci	MPP_MODE(40,
30362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
30462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp4",       V(0, 0, 0, 1, 1, 0, 0)),
30562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-sck",  V(0, 0, 0, 1, 1, 0, 0)),
30662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "sdo",    V(1, 0, 0, 1, 1, 0, 0)),
30762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d20",      V(0, 0, 0, 0, 1, 0, 0))),
30862306a36Sopenharmony_ci	MPP_MODE(41,
30962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
31062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp5",       V(0, 0, 0, 1, 1, 0, 0)),
31162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-miso", V(0, 0, 0, 1, 1, 0, 0)),
31262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "lrclk",  V(1, 0, 0, 1, 1, 0, 0)),
31362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d21",      V(0, 0, 0, 0, 1, 0, 0))),
31462306a36Sopenharmony_ci	MPP_MODE(42,
31562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
31662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp6",       V(0, 0, 0, 1, 1, 0, 0)),
31762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "spi-mosi", V(0, 0, 0, 1, 1, 0, 0)),
31862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "mclk",   V(1, 0, 0, 1, 1, 0, 0)),
31962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d22",      V(0, 0, 0, 0, 1, 0, 0))),
32062306a36Sopenharmony_ci	MPP_MODE(43,
32162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
32262306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp7",       V(0, 0, 0, 1, 1, 0, 0)),
32362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "int",      V(0, 0, 0, 1, 1, 0, 0)),
32462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "sdi",    V(1, 0, 0, 1, 1, 0, 0)),
32562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d23",      V(0, 0, 0, 0, 1, 0, 0))),
32662306a36Sopenharmony_ci	MPP_MODE(44,
32762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(1, 0, 0, 1, 1, 1, 1)),
32862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp8",       V(0, 0, 0, 1, 1, 0, 0)),
32962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "rst",      V(0, 0, 0, 1, 1, 0, 0)),
33062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x4, "audio", "extclk", V(1, 0, 0, 1, 1, 0, 0)),
33162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "clk",      V(0, 0, 0, 0, 1, 0, 0))),
33262306a36Sopenharmony_ci	MPP_MODE(45,
33362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 1, 1)),
33462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 1, 0, 0)),
33562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "pclk",     V(0, 0, 0, 1, 1, 0, 0)),
33662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "e",        V(0, 0, 0, 0, 1, 0, 0))),
33762306a36Sopenharmony_ci	MPP_MODE(46,
33862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0, 0)),
33962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp10",      V(0, 0, 0, 1, 1, 0, 0)),
34062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "fs",       V(0, 0, 0, 1, 1, 0, 0)),
34162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "hsync",    V(0, 0, 0, 0, 1, 0, 0))),
34262306a36Sopenharmony_ci	MPP_MODE(47,
34362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0, 0)),
34462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp11",      V(0, 0, 0, 1, 1, 0, 0)),
34562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "drx",      V(0, 0, 0, 1, 1, 0, 0)),
34662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "vsync",    V(0, 0, 0, 0, 1, 0, 0))),
34762306a36Sopenharmony_ci	MPP_MODE(48,
34862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 1, 0, 0)),
34962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp12",      V(0, 0, 0, 1, 1, 0, 0)),
35062306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "dtx",      V(0, 0, 0, 1, 1, 0, 0)),
35162306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d16",      V(0, 0, 0, 0, 1, 0, 0))),
35262306a36Sopenharmony_ci	MPP_MODE(49,
35362306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpio", NULL,      V(0, 0, 0, 1, 0, 1, 1)),
35462306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x0, "gpo", NULL,       V(0, 0, 0, 0, 1, 0, 0)),
35562306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x1, "ts", "mp9",       V(0, 0, 0, 1, 0, 0, 0)),
35662306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x2, "tdm", "rx0ql",    V(0, 0, 0, 1, 1, 0, 0)),
35762306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0x5, "ptp", "clk",      V(0, 0, 0, 1, 0, 0, 0)),
35862306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xa, "pex", "clkreq",   V(0, 0, 0, 0, 1, 0, 0)),
35962306a36Sopenharmony_ci		MPP_VAR_FUNCTION(0xb, "lcd", "d17",      V(0, 0, 0, 0, 1, 0, 0))),
36062306a36Sopenharmony_ci};
36162306a36Sopenharmony_ci
36262306a36Sopenharmony_cistatic const struct mvebu_mpp_ctrl mv88f6180_mpp_controls[] = {
36362306a36Sopenharmony_ci	MPP_FUNC_CTRL(0, 44, NULL, mvebu_mmio_mpp_ctrl),
36462306a36Sopenharmony_ci};
36562306a36Sopenharmony_ci
36662306a36Sopenharmony_cistatic struct pinctrl_gpio_range mv88f6180_gpio_ranges[] = {
36762306a36Sopenharmony_ci	MPP_GPIO_RANGE(0,  0,  0, 20),
36862306a36Sopenharmony_ci	MPP_GPIO_RANGE(1, 35, 35, 10),
36962306a36Sopenharmony_ci};
37062306a36Sopenharmony_ci
37162306a36Sopenharmony_cistatic const struct mvebu_mpp_ctrl mv88f619x_mpp_controls[] = {
37262306a36Sopenharmony_ci	MPP_FUNC_CTRL(0, 35, NULL, mvebu_mmio_mpp_ctrl),
37362306a36Sopenharmony_ci};
37462306a36Sopenharmony_ci
37562306a36Sopenharmony_cistatic struct pinctrl_gpio_range mv88f619x_gpio_ranges[] = {
37662306a36Sopenharmony_ci	MPP_GPIO_RANGE(0,  0,  0, 32),
37762306a36Sopenharmony_ci	MPP_GPIO_RANGE(1, 32, 32,  4),
37862306a36Sopenharmony_ci};
37962306a36Sopenharmony_ci
38062306a36Sopenharmony_cistatic const struct mvebu_mpp_ctrl mv88f628x_mpp_controls[] = {
38162306a36Sopenharmony_ci	MPP_FUNC_CTRL(0, 49, NULL, mvebu_mmio_mpp_ctrl),
38262306a36Sopenharmony_ci};
38362306a36Sopenharmony_ci
38462306a36Sopenharmony_cistatic struct pinctrl_gpio_range mv88f628x_gpio_ranges[] = {
38562306a36Sopenharmony_ci	MPP_GPIO_RANGE(0,  0,  0, 32),
38662306a36Sopenharmony_ci	MPP_GPIO_RANGE(1, 32, 32, 18),
38762306a36Sopenharmony_ci};
38862306a36Sopenharmony_ci
38962306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info mv88f6180_info = {
39062306a36Sopenharmony_ci	.variant = VARIANT_MV88F6180,
39162306a36Sopenharmony_ci	.controls = mv88f6180_mpp_controls,
39262306a36Sopenharmony_ci	.ncontrols = ARRAY_SIZE(mv88f6180_mpp_controls),
39362306a36Sopenharmony_ci	.modes = mv88f6xxx_mpp_modes,
39462306a36Sopenharmony_ci	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
39562306a36Sopenharmony_ci	.gpioranges = mv88f6180_gpio_ranges,
39662306a36Sopenharmony_ci	.ngpioranges = ARRAY_SIZE(mv88f6180_gpio_ranges),
39762306a36Sopenharmony_ci};
39862306a36Sopenharmony_ci
39962306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info mv88f6190_info = {
40062306a36Sopenharmony_ci	.variant = VARIANT_MV88F6190,
40162306a36Sopenharmony_ci	.controls = mv88f619x_mpp_controls,
40262306a36Sopenharmony_ci	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
40362306a36Sopenharmony_ci	.modes = mv88f6xxx_mpp_modes,
40462306a36Sopenharmony_ci	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
40562306a36Sopenharmony_ci	.gpioranges = mv88f619x_gpio_ranges,
40662306a36Sopenharmony_ci	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
40762306a36Sopenharmony_ci};
40862306a36Sopenharmony_ci
40962306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info mv88f6192_info = {
41062306a36Sopenharmony_ci	.variant = VARIANT_MV88F6192,
41162306a36Sopenharmony_ci	.controls = mv88f619x_mpp_controls,
41262306a36Sopenharmony_ci	.ncontrols = ARRAY_SIZE(mv88f619x_mpp_controls),
41362306a36Sopenharmony_ci	.modes = mv88f6xxx_mpp_modes,
41462306a36Sopenharmony_ci	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
41562306a36Sopenharmony_ci	.gpioranges = mv88f619x_gpio_ranges,
41662306a36Sopenharmony_ci	.ngpioranges = ARRAY_SIZE(mv88f619x_gpio_ranges),
41762306a36Sopenharmony_ci};
41862306a36Sopenharmony_ci
41962306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info mv88f6281_info = {
42062306a36Sopenharmony_ci	.variant = VARIANT_MV88F6281,
42162306a36Sopenharmony_ci	.controls = mv88f628x_mpp_controls,
42262306a36Sopenharmony_ci	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
42362306a36Sopenharmony_ci	.modes = mv88f6xxx_mpp_modes,
42462306a36Sopenharmony_ci	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
42562306a36Sopenharmony_ci	.gpioranges = mv88f628x_gpio_ranges,
42662306a36Sopenharmony_ci	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
42762306a36Sopenharmony_ci};
42862306a36Sopenharmony_ci
42962306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info mv88f6282_info = {
43062306a36Sopenharmony_ci	.variant = VARIANT_MV88F6282,
43162306a36Sopenharmony_ci	.controls = mv88f628x_mpp_controls,
43262306a36Sopenharmony_ci	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
43362306a36Sopenharmony_ci	.modes = mv88f6xxx_mpp_modes,
43462306a36Sopenharmony_ci	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
43562306a36Sopenharmony_ci	.gpioranges = mv88f628x_gpio_ranges,
43662306a36Sopenharmony_ci	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
43762306a36Sopenharmony_ci};
43862306a36Sopenharmony_ci
43962306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info mv98dx4122_info = {
44062306a36Sopenharmony_ci	.variant = VARIANT_MV98DX4122,
44162306a36Sopenharmony_ci	.controls = mv88f628x_mpp_controls,
44262306a36Sopenharmony_ci	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
44362306a36Sopenharmony_ci	.modes = mv88f6xxx_mpp_modes,
44462306a36Sopenharmony_ci	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
44562306a36Sopenharmony_ci	.gpioranges = mv88f628x_gpio_ranges,
44662306a36Sopenharmony_ci	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
44762306a36Sopenharmony_ci};
44862306a36Sopenharmony_ci
44962306a36Sopenharmony_cistatic struct mvebu_pinctrl_soc_info mv98dx1135_info = {
45062306a36Sopenharmony_ci	.variant = VARIANT_MV98DX1135,
45162306a36Sopenharmony_ci	.controls = mv88f628x_mpp_controls,
45262306a36Sopenharmony_ci	.ncontrols = ARRAY_SIZE(mv88f628x_mpp_controls),
45362306a36Sopenharmony_ci	.modes = mv88f6xxx_mpp_modes,
45462306a36Sopenharmony_ci	.nmodes = ARRAY_SIZE(mv88f6xxx_mpp_modes),
45562306a36Sopenharmony_ci	.gpioranges = mv88f628x_gpio_ranges,
45662306a36Sopenharmony_ci	.ngpioranges = ARRAY_SIZE(mv88f628x_gpio_ranges),
45762306a36Sopenharmony_ci};
45862306a36Sopenharmony_ci
45962306a36Sopenharmony_ci
46062306a36Sopenharmony_cistatic const struct of_device_id kirkwood_pinctrl_of_match[] = {
46162306a36Sopenharmony_ci	{ .compatible = "marvell,88f6180-pinctrl", .data = &mv88f6180_info },
46262306a36Sopenharmony_ci	{ .compatible = "marvell,88f6190-pinctrl", .data = &mv88f6190_info },
46362306a36Sopenharmony_ci	{ .compatible = "marvell,88f6192-pinctrl", .data = &mv88f6192_info },
46462306a36Sopenharmony_ci	{ .compatible = "marvell,88f6281-pinctrl", .data = &mv88f6281_info },
46562306a36Sopenharmony_ci	{ .compatible = "marvell,88f6282-pinctrl", .data = &mv88f6282_info },
46662306a36Sopenharmony_ci	{ .compatible = "marvell,98dx4122-pinctrl", .data = &mv98dx4122_info },
46762306a36Sopenharmony_ci	{ .compatible = "marvell,98dx1135-pinctrl", .data = &mv98dx1135_info },
46862306a36Sopenharmony_ci	{ }
46962306a36Sopenharmony_ci};
47062306a36Sopenharmony_ci
47162306a36Sopenharmony_cistatic int kirkwood_pinctrl_probe(struct platform_device *pdev)
47262306a36Sopenharmony_ci{
47362306a36Sopenharmony_ci	const struct of_device_id *match =
47462306a36Sopenharmony_ci		of_match_device(kirkwood_pinctrl_of_match, &pdev->dev);
47562306a36Sopenharmony_ci
47662306a36Sopenharmony_ci	pdev->dev.platform_data = (void *)match->data;
47762306a36Sopenharmony_ci
47862306a36Sopenharmony_ci	return mvebu_pinctrl_simple_mmio_probe(pdev);
47962306a36Sopenharmony_ci}
48062306a36Sopenharmony_ci
48162306a36Sopenharmony_cistatic struct platform_driver kirkwood_pinctrl_driver = {
48262306a36Sopenharmony_ci	.driver = {
48362306a36Sopenharmony_ci		.name = "kirkwood-pinctrl",
48462306a36Sopenharmony_ci		.of_match_table = kirkwood_pinctrl_of_match,
48562306a36Sopenharmony_ci	},
48662306a36Sopenharmony_ci	.probe = kirkwood_pinctrl_probe,
48762306a36Sopenharmony_ci};
48862306a36Sopenharmony_cibuiltin_platform_driver(kirkwood_pinctrl_driver);
489