1838adb57SIcenowy Zheng /* 2838adb57SIcenowy Zheng * Allwinner H5 SoC pinctrl driver. 3838adb57SIcenowy Zheng * 4838adb57SIcenowy Zheng * Copyright (C) 2016 Icenowy Zheng <icenowy@aosc.xyz> 5838adb57SIcenowy Zheng * 6838adb57SIcenowy Zheng * Based on pinctrl-sun8i-h3.c, which is: 7838adb57SIcenowy Zheng * Copyright (C) 2015 Jens Kuske <jenskuske@gmail.com> 8838adb57SIcenowy Zheng * 9838adb57SIcenowy Zheng * Based on pinctrl-sun8i-a23.c, which is: 10838adb57SIcenowy Zheng * Copyright (C) 2014 Chen-Yu Tsai <wens@csie.org> 11838adb57SIcenowy Zheng * Copyright (C) 2014 Maxime Ripard <maxime.ripard@free-electrons.com> 12838adb57SIcenowy Zheng * 13838adb57SIcenowy Zheng * This file is licensed under the terms of the GNU General Public 14838adb57SIcenowy Zheng * License version 2. This program is licensed "as is" without any 15838adb57SIcenowy Zheng * warranty of any kind, whether express or implied. 16838adb57SIcenowy Zheng */ 17838adb57SIcenowy Zheng 18838adb57SIcenowy Zheng #include <linux/module.h> 19838adb57SIcenowy Zheng #include <linux/platform_device.h> 20838adb57SIcenowy Zheng #include <linux/of.h> 21838adb57SIcenowy Zheng #include <linux/of_device.h> 221899ccc0SIcenowy Zheng #include <linux/of_irq.h> 23838adb57SIcenowy Zheng #include <linux/pinctrl/pinctrl.h> 24838adb57SIcenowy Zheng 25838adb57SIcenowy Zheng #include "pinctrl-sunxi.h" 26838adb57SIcenowy Zheng 27838adb57SIcenowy Zheng static const struct sunxi_desc_pin sun50i_h5_pins[] = { 28838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 0), 29838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 30838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 31838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart2"), /* TX */ 32838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* MS */ 33838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 0)), /* PA_EINT0 */ 34838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 1), 35838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 36838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 37838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart2"), /* RX */ 38838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* CK */ 39838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 1)), /* PA_EINT1 */ 40838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 2), 41838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 42838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 43838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart2"), /* RTS */ 44838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* DO */ 45838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 2)), /* PA_EINT2 */ 46838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 3), 47838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 48838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 49838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart2"), /* CTS */ 50838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* DI */ 51838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 3)), /* PA_EINT3 */ 52838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 4), 53838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 54838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 55838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart0"), /* TX */ 56838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 4)), /* PA_EINT4 */ 57838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 5), 58838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 59838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 60838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart0"), /* RX */ 61838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "pwm0"), 62838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 5)), /* PA_EINT5 */ 63838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 6), 64838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 65838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 66838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "sim"), /* PWREN */ 67838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 6)), /* PA_EINT6 */ 68838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 7), 69838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 70838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 71838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "sim"), /* CLK */ 72838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 7)), /* PA_EINT7 */ 73838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 8), 74838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 75838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 76838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "sim"), /* DATA */ 77838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 8)), /* PA_EINT8 */ 78838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 9), 79838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 80838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 81838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "sim"), /* RST */ 82838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 9)), /* PA_EINT9 */ 83838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 10), 84838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 85838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 86838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "sim"), /* DET */ 87838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 10)), /* PA_EINT10 */ 88838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 11), 89838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 90838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 91838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2c0"), /* SCK */ 92838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "di"), /* TX */ 93838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 11)), /* PA_EINT11 */ 94838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 12), 95838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 96838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 97838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2c0"), /* SDA */ 98838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "di"), /* RX */ 99838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 12)), /* PA_EINT12 */ 100838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 13), 101838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 102838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 103838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "spi1"), /* CS */ 104838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "uart3"), /* TX */ 105838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 13)), /* PA_EINT13 */ 106838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 14), 107838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 108838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 109838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "spi1"), /* CLK */ 110838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "uart3"), /* RX */ 111838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 14)), /* PA_EINT14 */ 112838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 15), 113838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 114838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 115838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "spi1"), /* MOSI */ 116838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "uart3"), /* RTS */ 117838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 15)), /* PA_EINT15 */ 118838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 16), 119838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 120838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 121838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "spi1"), /* MISO */ 122838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "uart3"), /* CTS */ 123838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 16)), /* PA_EINT16 */ 124838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 17), 125838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 126838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 127838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "spdif"), /* OUT */ 128838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 17)), /* PA_EINT17 */ 129838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 18), 130838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 131838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 132838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s0"), /* SYNC */ 133838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "i2c1"), /* SCK */ 134838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 18)), /* PA_EINT18 */ 135838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 19), 136838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 137838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 138838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s0"), /* CLK */ 139838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "i2c1"), /* SDA */ 140838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 19)), /* PA_EINT19 */ 141838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 20), 142838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 143838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 144838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s0"), /* DOUT */ 145838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "sim"), /* VPPEN */ 146838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 20)), /* PA_EINT20 */ 147838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(A, 21), 148838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 149838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 150838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s0"), /* DIN */ 151838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "sim"), /* VPPPP */ 152838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 0, 21)), /* PA_EINT21 */ 153838adb57SIcenowy Zheng /* Hole */ 154838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 0), 155838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 156838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 157838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* WE */ 158838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "spi0")), /* MOSI */ 159838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 1), 160838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 161838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 162838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* ALE */ 163838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "spi0"), /* MISO */ 164838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "mmc2")), /* DS */ 165838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 2), 166838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 167838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 168838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* CLE */ 169838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "spi0")), /* CLK */ 170838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 3), 171838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 172838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 173838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* CE1 */ 174838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "spi0")), /* CS */ 175838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 4), 176838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 177838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 178838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* CE0 */ 179838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "spi0")), /* MISO */ 180838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 5), 181838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 182838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 183838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* RE */ 184838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* CLK */ 185838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 6), 186838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 187838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 188838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* RB0 */ 189838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* CMD */ 190838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 7), 191838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 192838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 193838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0")), /* RB1 */ 194838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 8), 195838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 196838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 197838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ0 */ 198838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D0 */ 199838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 9), 200838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 201838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 202838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ1 */ 203838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D1 */ 204838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 10), 205838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 206838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 207838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ2 */ 208838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D2 */ 209838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 11), 210838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 211838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 212838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ3 */ 213838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D3 */ 214838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 12), 215838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 216838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 217838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ4 */ 218838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D4 */ 219838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 13), 220838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 221838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 222838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ5 */ 223838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D5 */ 224838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 14), 225838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 226838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 227838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ6 */ 228838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D6 */ 229838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 15), 230838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 231838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 232838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQ7 */ 233838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* D7 */ 234838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(C, 16), 235838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 236838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 237838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "nand0"), /* DQS */ 238838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "mmc2")), /* RST */ 239838adb57SIcenowy Zheng /* Hole */ 240838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 0), 241838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 242838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 243838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* RXD3 */ 244838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "di"), /* TX */ 245838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2")), /* CLK */ 246838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 1), 247838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 248838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 249838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* RXD2 */ 250838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "di"), /* RX */ 251838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2")), /* ERR */ 252838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 2), 253838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 254838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 255838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* RXD1 */ 256838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2")), /* SYNC */ 257838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 3), 258838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 259838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 260838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* RXD0 */ 261838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2")), /* DVLD */ 262838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 4), 263838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 264838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 265838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* RXCK */ 266838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2")), /* D0 */ 267838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 5), 268838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 269838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 270838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* RXCTL/RXDV */ 271838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2")), /* D1 */ 272838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 6), 273838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 274838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 275838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* RXERR */ 276838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2")), /* D2 */ 277838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 7), 278838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 279838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 280838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* TXD3 */ 281838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2"), /* D3 */ 282838adb57SIcenowy Zheng SUNXI_FUNCTION(0x5, "ts3")), /* CLK */ 283838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 8), 284838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 285838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 286838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* TXD2 */ 287838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2"), /* D4 */ 288838adb57SIcenowy Zheng SUNXI_FUNCTION(0x5, "ts3")), /* ERR */ 289838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 9), 290838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 291838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 292838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* TXD1 */ 293838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2"), /* D5 */ 294838adb57SIcenowy Zheng SUNXI_FUNCTION(0x5, "ts3")), /* SYNC */ 295838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 10), 296838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 297838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 298838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* TXD0 */ 299838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2"), /* D6 */ 300838adb57SIcenowy Zheng SUNXI_FUNCTION(0x5, "ts3")), /* DVLD */ 301838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 11), 302838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 303838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 304838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* CRS */ 305838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts2"), /* D7 */ 306838adb57SIcenowy Zheng SUNXI_FUNCTION(0x5, "ts3")), /* D0 */ 307838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 12), 308838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 309838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 310838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* TXCK */ 311838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "sim")), /* PWREN */ 312838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 13), 313838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 314838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 315838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* TXCTL/TXEN */ 316838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "sim")), /* CLK */ 317838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 14), 318838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 319838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 320838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* TXERR */ 321838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "sim")), /* DATA */ 322838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 15), 323838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 324838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 325838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* CLKIN/COL */ 326838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "sim")), /* RST */ 327838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 16), 328838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 329838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 330838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac"), /* MDC */ 331838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "sim")), /* DET */ 332838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(D, 17), 333838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 334838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 335838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "emac")), /* MDIO */ 336838adb57SIcenowy Zheng /* Hole */ 337838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 0), 338838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 339838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 340838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* PCLK */ 341838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0")), /* CLK */ 342838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 1), 343838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 344838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 345838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* MCLK */ 346838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0")), /* ERR */ 347838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 2), 348838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 349838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 350838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* HSYNC */ 351838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0")), /* SYNC */ 352838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 3), 353838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 354838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 355838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* VSYNC */ 356838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0")), /* DVLD */ 357838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 4), 358838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 359838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 360838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D0 */ 361838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0")), /* D0 */ 362838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 5), 363838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 364838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 365838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D1 */ 366838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0")), /* D1 */ 367838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 6), 368838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 369838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 370838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D2 */ 371838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0")), /* D2 */ 372838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 7), 373838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 374838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 375838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D3 */ 376838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0"), /* D3 */ 377838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts1")), /* CLK */ 378838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 8), 379838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 380838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 381838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D4 */ 382838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0"), /* D4 */ 383838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts1")), /* ERR */ 384838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 9), 385838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 386838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 387838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D5 */ 388838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0"), /* D5 */ 389838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts1")), /* SYNC */ 390838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 10), 391838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 392838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 393838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D6 */ 394838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts0"), /* D6 */ 395838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts1")), /* DVLD */ 396838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 11), 397838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 398838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 399838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* D7 */ 400838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "ts"), /* D7 */ 401838adb57SIcenowy Zheng SUNXI_FUNCTION(0x4, "ts1")), /* D0 */ 402838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 12), 403838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 404838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 405838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* SCK */ 406838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "i2c2")), /* SCK */ 407838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 13), 408838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 409838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 410838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "csi"), /* SDA */ 411838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "i2c2")), /* SDA */ 412838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 14), 413838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 414838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 415838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "sim")), /* VPPEN */ 416838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(E, 15), 417838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 418838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 419838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "sim")), /* VPPPP */ 420838adb57SIcenowy Zheng /* Hole */ 421838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 0), 422838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 423838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 424838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc0"), /* D1 */ 425838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* MS */ 426838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 0)), /* PF_EINT0 */ 427838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 1), 428838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 429838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 430838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc0"), /* D0 */ 431838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* DI */ 432838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 1)), /* PF_EINT1 */ 433838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 2), 434838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 435838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 436838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc0"), /* CLK */ 437838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "uart0"), /* TX */ 438838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 2)), /* PF_EINT2 */ 439838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 3), 440838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 441838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 442838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc0"), /* CMD */ 443838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* DO */ 444838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 3)), /* PF_EINT3 */ 445838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 4), 446838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 447838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 448838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc0"), /* D3 */ 449838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "uart0"), /* RX */ 450838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 4)), /* PF_EINT4 */ 451838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 5), 452838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 453838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 454838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc0"), /* D2 */ 455838adb57SIcenowy Zheng SUNXI_FUNCTION(0x3, "jtag"), /* CK */ 456838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 5)), /* PF_EINT5 */ 457838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(F, 6), 458838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 459838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 460838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 1, 6)), /* PF_EINT6 */ 461838adb57SIcenowy Zheng /* Hole */ 462838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 0), 463838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 464838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 465838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc1"), /* CLK */ 466838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 0)), /* PG_EINT0 */ 467838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 1), 468838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 469838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 470838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc1"), /* CMD */ 471838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 1)), /* PG_EINT1 */ 472838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 2), 473838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 474838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 475838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc1"), /* D0 */ 476838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 2)), /* PG_EINT2 */ 477838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 3), 478838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 479838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 480838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc1"), /* D1 */ 481838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 3)), /* PG_EINT3 */ 482838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 4), 483838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 484838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 485838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc1"), /* D2 */ 486838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 4)), /* PG_EINT4 */ 487838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 5), 488838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 489838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 490838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "mmc1"), /* D3 */ 491838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 5)), /* PG_EINT5 */ 492838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 6), 493838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 494838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 495838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart1"), /* TX */ 496838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 6)), /* PG_EINT6 */ 497838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 7), 498838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 499838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 500838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart1"), /* RX */ 501838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 7)), /* PG_EINT7 */ 502838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 8), 503838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 504838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 505838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart1"), /* RTS */ 506838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 8)), /* PG_EINT8 */ 507838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 9), 508838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 509838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 510838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "uart1"), /* CTS */ 511838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 9)), /* PG_EINT9 */ 512838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 10), 513838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 514838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 515838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s1"), /* SYNC */ 516838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 10)), /* PG_EINT10 */ 517838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 11), 518838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 519838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 520838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s1"), /* CLK */ 521838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 11)), /* PG_EINT11 */ 522838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 12), 523838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 524838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 525838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s1"), /* DOUT */ 526838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 12)), /* PG_EINT12 */ 527838adb57SIcenowy Zheng SUNXI_PIN(SUNXI_PINCTRL_PIN(G, 13), 528838adb57SIcenowy Zheng SUNXI_FUNCTION(0x0, "gpio_in"), 529838adb57SIcenowy Zheng SUNXI_FUNCTION(0x1, "gpio_out"), 530838adb57SIcenowy Zheng SUNXI_FUNCTION(0x2, "i2s1"), /* DIN */ 531838adb57SIcenowy Zheng SUNXI_FUNCTION_IRQ_BANK(0x6, 2, 13)), /* PG_EINT13 */ 532838adb57SIcenowy Zheng }; 533838adb57SIcenowy Zheng 5341899ccc0SIcenowy Zheng static const struct sunxi_pinctrl_desc sun50i_h5_pinctrl_data_broken = { 535838adb57SIcenowy Zheng .pins = sun50i_h5_pins, 536838adb57SIcenowy Zheng .npins = ARRAY_SIZE(sun50i_h5_pins), 537838adb57SIcenowy Zheng .irq_banks = 2, 538*07c43a38SAndre Przywara .irq_read_needs_mux = true, 539*07c43a38SAndre Przywara .disable_strict_mode = true, 540838adb57SIcenowy Zheng }; 541838adb57SIcenowy Zheng 5421899ccc0SIcenowy Zheng static const struct sunxi_pinctrl_desc sun50i_h5_pinctrl_data = { 5431899ccc0SIcenowy Zheng .pins = sun50i_h5_pins, 5441899ccc0SIcenowy Zheng .npins = ARRAY_SIZE(sun50i_h5_pins), 5451899ccc0SIcenowy Zheng .irq_banks = 3, 546*07c43a38SAndre Przywara .irq_read_needs_mux = true, 547*07c43a38SAndre Przywara .disable_strict_mode = true, 5481899ccc0SIcenowy Zheng }; 5491899ccc0SIcenowy Zheng 550838adb57SIcenowy Zheng static int sun50i_h5_pinctrl_probe(struct platform_device *pdev) 551838adb57SIcenowy Zheng { 5521899ccc0SIcenowy Zheng switch (of_irq_count(pdev->dev.of_node)) { 5531899ccc0SIcenowy Zheng case 2: 5541899ccc0SIcenowy Zheng dev_warn(&pdev->dev, 5551899ccc0SIcenowy Zheng "Your device tree's pinctrl node is broken, which has no IRQ of PG bank routed.\n"); 5561899ccc0SIcenowy Zheng dev_warn(&pdev->dev, 5571899ccc0SIcenowy Zheng "Please update the device tree, otherwise PG bank IRQ won't work.\n"); 5581899ccc0SIcenowy Zheng return sunxi_pinctrl_init(pdev, 5591899ccc0SIcenowy Zheng &sun50i_h5_pinctrl_data_broken); 5601899ccc0SIcenowy Zheng case 3: 561838adb57SIcenowy Zheng return sunxi_pinctrl_init(pdev, 562838adb57SIcenowy Zheng &sun50i_h5_pinctrl_data); 5631899ccc0SIcenowy Zheng default: 5641899ccc0SIcenowy Zheng return -EINVAL; 5651899ccc0SIcenowy Zheng } 566838adb57SIcenowy Zheng } 567838adb57SIcenowy Zheng 568838adb57SIcenowy Zheng static const struct of_device_id sun50i_h5_pinctrl_match[] = { 569838adb57SIcenowy Zheng { .compatible = "allwinner,sun50i-h5-pinctrl", }, 570838adb57SIcenowy Zheng {} 571838adb57SIcenowy Zheng }; 572838adb57SIcenowy Zheng 573838adb57SIcenowy Zheng static struct platform_driver sun50i_h5_pinctrl_driver = { 574838adb57SIcenowy Zheng .probe = sun50i_h5_pinctrl_probe, 575838adb57SIcenowy Zheng .driver = { 576838adb57SIcenowy Zheng .name = "sun50i-h5-pinctrl", 577838adb57SIcenowy Zheng .of_match_table = sun50i_h5_pinctrl_match, 578838adb57SIcenowy Zheng }, 579838adb57SIcenowy Zheng }; 580838adb57SIcenowy Zheng builtin_platform_driver(sun50i_h5_pinctrl_driver); 581