18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0-only 28c2ecf20Sopenharmony_ci/* 38c2ecf20Sopenharmony_ci * Pinctrl data for Wondermedia WM8650 SoC 48c2ecf20Sopenharmony_ci * 58c2ecf20Sopenharmony_ci * Copyright (c) 2013 Tony Prisk <linux@prisktech.co.nz> 68c2ecf20Sopenharmony_ci */ 78c2ecf20Sopenharmony_ci 88c2ecf20Sopenharmony_ci#include <linux/io.h> 98c2ecf20Sopenharmony_ci#include <linux/init.h> 108c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h> 118c2ecf20Sopenharmony_ci#include <linux/platform_device.h> 128c2ecf20Sopenharmony_ci#include <linux/slab.h> 138c2ecf20Sopenharmony_ci 148c2ecf20Sopenharmony_ci#include "pinctrl-wmt.h" 158c2ecf20Sopenharmony_ci 168c2ecf20Sopenharmony_ci/* 178c2ecf20Sopenharmony_ci * Describe the register offsets within the GPIO memory space 188c2ecf20Sopenharmony_ci * The dedicated external GPIO's should always be listed in bank 0 198c2ecf20Sopenharmony_ci * so they are exported in the 0..31 range which is what users 208c2ecf20Sopenharmony_ci * expect. 218c2ecf20Sopenharmony_ci * 228c2ecf20Sopenharmony_ci * Do not reorder these banks as it will change the pin numbering 238c2ecf20Sopenharmony_ci */ 248c2ecf20Sopenharmony_cistatic const struct wmt_pinctrl_bank_registers wm8650_banks[] = { 258c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x40, 0x80, 0xC0, 0x00, 0x480, 0x4C0), /* 0 */ 268c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x44, 0x84, 0xC4, 0x04, 0x484, 0x4C4), /* 1 */ 278c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x48, 0x88, 0xC8, 0x08, 0x488, 0x4C8), /* 2 */ 288c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x4C, 0x8C, 0xCC, 0x0C, 0x48C, 0x4CC), /* 3 */ 298c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x50, 0x90, 0xD0, 0x10, 0x490, 0x4D0), /* 4 */ 308c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x54, 0x94, 0xD4, 0x14, 0x494, 0x4D4), /* 5 */ 318c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x58, 0x98, 0xD8, 0x18, 0x498, 0x4D8), /* 6 */ 328c2ecf20Sopenharmony_ci WMT_PINCTRL_BANK(0x5C, 0x9C, 0xDC, 0x1C, 0x49C, 0x4DC), /* 7 */ 338c2ecf20Sopenharmony_ci}; 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci/* Please keep sorted by bank/bit */ 368c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO0 WMT_PIN(0, 0) 378c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO1 WMT_PIN(0, 1) 388c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO2 WMT_PIN(0, 2) 398c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO3 WMT_PIN(0, 3) 408c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO4 WMT_PIN(0, 4) 418c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO5 WMT_PIN(0, 5) 428c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO6 WMT_PIN(0, 6) 438c2ecf20Sopenharmony_ci#define WMT_PIN_EXTGPIO7 WMT_PIN(0, 7) 448c2ecf20Sopenharmony_ci#define WMT_PIN_WAKEUP0 WMT_PIN(0, 16) 458c2ecf20Sopenharmony_ci#define WMT_PIN_WAKEUP1 WMT_PIN(0, 17) 468c2ecf20Sopenharmony_ci#define WMT_PIN_SUSGPIO0 WMT_PIN(0, 21) 478c2ecf20Sopenharmony_ci#define WMT_PIN_SD0CD WMT_PIN(0, 28) 488c2ecf20Sopenharmony_ci#define WMT_PIN_SD1CD WMT_PIN(0, 29) 498c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT0 WMT_PIN(1, 0) 508c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT1 WMT_PIN(1, 1) 518c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT2 WMT_PIN(1, 2) 528c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT3 WMT_PIN(1, 3) 538c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT4 WMT_PIN(1, 4) 548c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT5 WMT_PIN(1, 5) 558c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT6 WMT_PIN(1, 6) 568c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT7 WMT_PIN(1, 7) 578c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT8 WMT_PIN(1, 8) 588c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT9 WMT_PIN(1, 9) 598c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT10 WMT_PIN(1, 10) 608c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT11 WMT_PIN(1, 11) 618c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT12 WMT_PIN(1, 12) 628c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT13 WMT_PIN(1, 13) 638c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT14 WMT_PIN(1, 14) 648c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT15 WMT_PIN(1, 15) 658c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT16 WMT_PIN(1, 16) 668c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT17 WMT_PIN(1, 17) 678c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT18 WMT_PIN(1, 18) 688c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT19 WMT_PIN(1, 19) 698c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT20 WMT_PIN(1, 20) 708c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT21 WMT_PIN(1, 21) 718c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT22 WMT_PIN(1, 22) 728c2ecf20Sopenharmony_ci#define WMT_PIN_VDOUT23 WMT_PIN(1, 23) 738c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN0 WMT_PIN(2, 0) 748c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN1 WMT_PIN(2, 1) 758c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN2 WMT_PIN(2, 2) 768c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN3 WMT_PIN(2, 3) 778c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN4 WMT_PIN(2, 4) 788c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN5 WMT_PIN(2, 5) 798c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN6 WMT_PIN(2, 6) 808c2ecf20Sopenharmony_ci#define WMT_PIN_VDIN7 WMT_PIN(2, 7) 818c2ecf20Sopenharmony_ci#define WMT_PIN_I2C1SCL WMT_PIN(2, 12) 828c2ecf20Sopenharmony_ci#define WMT_PIN_I2C1SDA WMT_PIN(2, 13) 838c2ecf20Sopenharmony_ci#define WMT_PIN_SPI0MOSI WMT_PIN(2, 24) 848c2ecf20Sopenharmony_ci#define WMT_PIN_SPI0MISO WMT_PIN(2, 25) 858c2ecf20Sopenharmony_ci#define WMT_PIN_SPI0SS0 WMT_PIN(2, 26) 868c2ecf20Sopenharmony_ci#define WMT_PIN_SPI0CLK WMT_PIN(2, 27) 878c2ecf20Sopenharmony_ci#define WMT_PIN_SD0DATA0 WMT_PIN(3, 8) 888c2ecf20Sopenharmony_ci#define WMT_PIN_SD0DATA1 WMT_PIN(3, 9) 898c2ecf20Sopenharmony_ci#define WMT_PIN_SD0DATA2 WMT_PIN(3, 10) 908c2ecf20Sopenharmony_ci#define WMT_PIN_SD0DATA3 WMT_PIN(3, 11) 918c2ecf20Sopenharmony_ci#define WMT_PIN_SD0CLK WMT_PIN(3, 12) 928c2ecf20Sopenharmony_ci#define WMT_PIN_SD0WP WMT_PIN(3, 13) 938c2ecf20Sopenharmony_ci#define WMT_PIN_SD0CMD WMT_PIN(3, 14) 948c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA0 WMT_PIN(3, 24) 958c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA1 WMT_PIN(3, 25) 968c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA2 WMT_PIN(3, 26) 978c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA3 WMT_PIN(3, 27) 988c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA4 WMT_PIN(3, 28) 998c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA5 WMT_PIN(3, 29) 1008c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA6 WMT_PIN(3, 30) 1018c2ecf20Sopenharmony_ci#define WMT_PIN_SD1DATA7 WMT_PIN(3, 31) 1028c2ecf20Sopenharmony_ci#define WMT_PIN_I2C0SCL WMT_PIN(5, 8) 1038c2ecf20Sopenharmony_ci#define WMT_PIN_I2C0SDA WMT_PIN(5, 9) 1048c2ecf20Sopenharmony_ci#define WMT_PIN_UART0RTS WMT_PIN(5, 16) 1058c2ecf20Sopenharmony_ci#define WMT_PIN_UART0TXD WMT_PIN(5, 17) 1068c2ecf20Sopenharmony_ci#define WMT_PIN_UART0CTS WMT_PIN(5, 18) 1078c2ecf20Sopenharmony_ci#define WMT_PIN_UART0RXD WMT_PIN(5, 19) 1088c2ecf20Sopenharmony_ci#define WMT_PIN_UART1RTS WMT_PIN(5, 20) 1098c2ecf20Sopenharmony_ci#define WMT_PIN_UART1TXD WMT_PIN(5, 21) 1108c2ecf20Sopenharmony_ci#define WMT_PIN_UART1CTS WMT_PIN(5, 22) 1118c2ecf20Sopenharmony_ci#define WMT_PIN_UART1RXD WMT_PIN(5, 23) 1128c2ecf20Sopenharmony_ci#define WMT_PIN_UART2RTS WMT_PIN(5, 24) 1138c2ecf20Sopenharmony_ci#define WMT_PIN_UART2TXD WMT_PIN(5, 25) 1148c2ecf20Sopenharmony_ci#define WMT_PIN_UART2CTS WMT_PIN(5, 26) 1158c2ecf20Sopenharmony_ci#define WMT_PIN_UART2RXD WMT_PIN(5, 27) 1168c2ecf20Sopenharmony_ci#define WMT_PIN_UART3RTS WMT_PIN(5, 28) 1178c2ecf20Sopenharmony_ci#define WMT_PIN_UART3TXD WMT_PIN(5, 29) 1188c2ecf20Sopenharmony_ci#define WMT_PIN_UART3CTS WMT_PIN(5, 30) 1198c2ecf20Sopenharmony_ci#define WMT_PIN_UART3RXD WMT_PIN(5, 31) 1208c2ecf20Sopenharmony_ci#define WMT_PIN_KPADROW0 WMT_PIN(6, 16) 1218c2ecf20Sopenharmony_ci#define WMT_PIN_KPADROW1 WMT_PIN(6, 17) 1228c2ecf20Sopenharmony_ci#define WMT_PIN_KPADCOL0 WMT_PIN(6, 18) 1238c2ecf20Sopenharmony_ci#define WMT_PIN_KPADCOL1 WMT_PIN(6, 19) 1248c2ecf20Sopenharmony_ci#define WMT_PIN_SD1CLK WMT_PIN(7, 0) 1258c2ecf20Sopenharmony_ci#define WMT_PIN_SD1CMD WMT_PIN(7, 1) 1268c2ecf20Sopenharmony_ci#define WMT_PIN_SD1WP WMT_PIN(7, 13) 1278c2ecf20Sopenharmony_ci 1288c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc wm8650_pins[] = { 1298c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO0, "extgpio0"), 1308c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO1, "extgpio1"), 1318c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO2, "extgpio2"), 1328c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO3, "extgpio3"), 1338c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO4, "extgpio4"), 1348c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO5, "extgpio5"), 1358c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO6, "extgpio6"), 1368c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_EXTGPIO7, "extgpio7"), 1378c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_WAKEUP0, "wakeup0"), 1388c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_WAKEUP1, "wakeup1"), 1398c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SUSGPIO0, "susgpio0"), 1408c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0CD, "sd0_cd"), 1418c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1CD, "sd1_cd"), 1428c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT0, "vdout0"), 1438c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT1, "vdout1"), 1448c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT2, "vdout2"), 1458c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT3, "vdout3"), 1468c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT4, "vdout4"), 1478c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT5, "vdout5"), 1488c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT6, "vdout6"), 1498c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT7, "vdout7"), 1508c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT8, "vdout8"), 1518c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT9, "vdout9"), 1528c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT10, "vdout10"), 1538c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT11, "vdout11"), 1548c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT12, "vdout12"), 1558c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT13, "vdout13"), 1568c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT14, "vdout14"), 1578c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT15, "vdout15"), 1588c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT16, "vdout16"), 1598c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT17, "vdout17"), 1608c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT18, "vdout18"), 1618c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT19, "vdout19"), 1628c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT20, "vdout20"), 1638c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT21, "vdout21"), 1648c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT22, "vdout22"), 1658c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDOUT23, "vdout23"), 1668c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN0, "vdin0"), 1678c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN1, "vdin1"), 1688c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN2, "vdin2"), 1698c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN3, "vdin3"), 1708c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN4, "vdin4"), 1718c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN5, "vdin5"), 1728c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN6, "vdin6"), 1738c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_VDIN7, "vdin7"), 1748c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_I2C1SCL, "i2c1_scl"), 1758c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_I2C1SDA, "i2c1_sda"), 1768c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SPI0MOSI, "spi0_mosi"), 1778c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SPI0MISO, "spi0_miso"), 1788c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SPI0SS0, "spi0_ss0"), 1798c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SPI0CLK, "spi0_clk"), 1808c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0DATA0, "sd0_data0"), 1818c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0DATA1, "sd0_data1"), 1828c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0DATA2, "sd0_data2"), 1838c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0DATA3, "sd0_data3"), 1848c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0CLK, "sd0_clk"), 1858c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0WP, "sd0_wp"), 1868c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD0CMD, "sd0_cmd"), 1878c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA0, "sd1_data0"), 1888c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA1, "sd1_data1"), 1898c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA2, "sd1_data2"), 1908c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA3, "sd1_data3"), 1918c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA4, "sd1_data4"), 1928c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA5, "sd1_data5"), 1938c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA6, "sd1_data6"), 1948c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1DATA7, "sd1_data7"), 1958c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_I2C0SCL, "i2c0_scl"), 1968c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_I2C0SDA, "i2c0_sda"), 1978c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART0RTS, "uart0_rts"), 1988c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART0TXD, "uart0_txd"), 1998c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART0CTS, "uart0_cts"), 2008c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART0RXD, "uart0_rxd"), 2018c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART1RTS, "uart1_rts"), 2028c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART1TXD, "uart1_txd"), 2038c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART1CTS, "uart1_cts"), 2048c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART1RXD, "uart1_rxd"), 2058c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART2RTS, "uart2_rts"), 2068c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART2TXD, "uart2_txd"), 2078c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART2CTS, "uart2_cts"), 2088c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART2RXD, "uart2_rxd"), 2098c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART3RTS, "uart3_rts"), 2108c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART3TXD, "uart3_txd"), 2118c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART3CTS, "uart3_cts"), 2128c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_UART3RXD, "uart3_rxd"), 2138c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_KPADROW0, "kpadrow0"), 2148c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_KPADROW1, "kpadrow1"), 2158c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_KPADCOL0, "kpadcol0"), 2168c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_KPADCOL1, "kpadcol1"), 2178c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1CLK, "sd1_clk"), 2188c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1CMD, "sd1_cmd"), 2198c2ecf20Sopenharmony_ci PINCTRL_PIN(WMT_PIN_SD1WP, "sd1_wp"), 2208c2ecf20Sopenharmony_ci}; 2218c2ecf20Sopenharmony_ci 2228c2ecf20Sopenharmony_ci/* Order of these names must match the above list */ 2238c2ecf20Sopenharmony_cistatic const char * const wm8650_groups[] = { 2248c2ecf20Sopenharmony_ci "extgpio0", 2258c2ecf20Sopenharmony_ci "extgpio1", 2268c2ecf20Sopenharmony_ci "extgpio2", 2278c2ecf20Sopenharmony_ci "extgpio3", 2288c2ecf20Sopenharmony_ci "extgpio4", 2298c2ecf20Sopenharmony_ci "extgpio5", 2308c2ecf20Sopenharmony_ci "extgpio6", 2318c2ecf20Sopenharmony_ci "extgpio7", 2328c2ecf20Sopenharmony_ci "wakeup0", 2338c2ecf20Sopenharmony_ci "wakeup1", 2348c2ecf20Sopenharmony_ci "susgpio0", 2358c2ecf20Sopenharmony_ci "sd0_cd", 2368c2ecf20Sopenharmony_ci "sd1_cd", 2378c2ecf20Sopenharmony_ci "vdout0", 2388c2ecf20Sopenharmony_ci "vdout1", 2398c2ecf20Sopenharmony_ci "vdout2", 2408c2ecf20Sopenharmony_ci "vdout3", 2418c2ecf20Sopenharmony_ci "vdout4", 2428c2ecf20Sopenharmony_ci "vdout5", 2438c2ecf20Sopenharmony_ci "vdout6", 2448c2ecf20Sopenharmony_ci "vdout7", 2458c2ecf20Sopenharmony_ci "vdout8", 2468c2ecf20Sopenharmony_ci "vdout9", 2478c2ecf20Sopenharmony_ci "vdout10", 2488c2ecf20Sopenharmony_ci "vdout11", 2498c2ecf20Sopenharmony_ci "vdout12", 2508c2ecf20Sopenharmony_ci "vdout13", 2518c2ecf20Sopenharmony_ci "vdout14", 2528c2ecf20Sopenharmony_ci "vdout15", 2538c2ecf20Sopenharmony_ci "vdout16", 2548c2ecf20Sopenharmony_ci "vdout17", 2558c2ecf20Sopenharmony_ci "vdout18", 2568c2ecf20Sopenharmony_ci "vdout19", 2578c2ecf20Sopenharmony_ci "vdout20", 2588c2ecf20Sopenharmony_ci "vdout21", 2598c2ecf20Sopenharmony_ci "vdout22", 2608c2ecf20Sopenharmony_ci "vdout23", 2618c2ecf20Sopenharmony_ci "vdin0", 2628c2ecf20Sopenharmony_ci "vdin1", 2638c2ecf20Sopenharmony_ci "vdin2", 2648c2ecf20Sopenharmony_ci "vdin3", 2658c2ecf20Sopenharmony_ci "vdin4", 2668c2ecf20Sopenharmony_ci "vdin5", 2678c2ecf20Sopenharmony_ci "vdin6", 2688c2ecf20Sopenharmony_ci "vdin7", 2698c2ecf20Sopenharmony_ci "i2c1_scl", 2708c2ecf20Sopenharmony_ci "i2c1_sda", 2718c2ecf20Sopenharmony_ci "spi0_mosi", 2728c2ecf20Sopenharmony_ci "spi0_miso", 2738c2ecf20Sopenharmony_ci "spi0_ss0", 2748c2ecf20Sopenharmony_ci "spi0_clk", 2758c2ecf20Sopenharmony_ci "sd0_data0", 2768c2ecf20Sopenharmony_ci "sd0_data1", 2778c2ecf20Sopenharmony_ci "sd0_data2", 2788c2ecf20Sopenharmony_ci "sd0_data3", 2798c2ecf20Sopenharmony_ci "sd0_clk", 2808c2ecf20Sopenharmony_ci "sd0_wp", 2818c2ecf20Sopenharmony_ci "sd0_cmd", 2828c2ecf20Sopenharmony_ci "sd1_data0", 2838c2ecf20Sopenharmony_ci "sd1_data1", 2848c2ecf20Sopenharmony_ci "sd1_data2", 2858c2ecf20Sopenharmony_ci "sd1_data3", 2868c2ecf20Sopenharmony_ci "sd1_data4", 2878c2ecf20Sopenharmony_ci "sd1_data5", 2888c2ecf20Sopenharmony_ci "sd1_data6", 2898c2ecf20Sopenharmony_ci "sd1_data7", 2908c2ecf20Sopenharmony_ci "i2c0_scl", 2918c2ecf20Sopenharmony_ci "i2c0_sda", 2928c2ecf20Sopenharmony_ci "uart0_rts", 2938c2ecf20Sopenharmony_ci "uart0_txd", 2948c2ecf20Sopenharmony_ci "uart0_cts", 2958c2ecf20Sopenharmony_ci "uart0_rxd", 2968c2ecf20Sopenharmony_ci "uart1_rts", 2978c2ecf20Sopenharmony_ci "uart1_txd", 2988c2ecf20Sopenharmony_ci "uart1_cts", 2998c2ecf20Sopenharmony_ci "uart1_rxd", 3008c2ecf20Sopenharmony_ci "uart2_rts", 3018c2ecf20Sopenharmony_ci "uart2_txd", 3028c2ecf20Sopenharmony_ci "uart2_cts", 3038c2ecf20Sopenharmony_ci "uart2_rxd", 3048c2ecf20Sopenharmony_ci "uart3_rts", 3058c2ecf20Sopenharmony_ci "uart3_txd", 3068c2ecf20Sopenharmony_ci "uart3_cts", 3078c2ecf20Sopenharmony_ci "uart3_rxd", 3088c2ecf20Sopenharmony_ci "kpadrow0", 3098c2ecf20Sopenharmony_ci "kpadrow1", 3108c2ecf20Sopenharmony_ci "kpadcol0", 3118c2ecf20Sopenharmony_ci "kpadcol1", 3128c2ecf20Sopenharmony_ci "sd1_clk", 3138c2ecf20Sopenharmony_ci "sd1_cmd", 3148c2ecf20Sopenharmony_ci "sd1_wp", 3158c2ecf20Sopenharmony_ci}; 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_cistatic int wm8650_pinctrl_probe(struct platform_device *pdev) 3188c2ecf20Sopenharmony_ci{ 3198c2ecf20Sopenharmony_ci struct wmt_pinctrl_data *data; 3208c2ecf20Sopenharmony_ci 3218c2ecf20Sopenharmony_ci data = devm_kzalloc(&pdev->dev, sizeof(*data), GFP_KERNEL); 3228c2ecf20Sopenharmony_ci if (!data) 3238c2ecf20Sopenharmony_ci return -ENOMEM; 3248c2ecf20Sopenharmony_ci 3258c2ecf20Sopenharmony_ci data->banks = wm8650_banks; 3268c2ecf20Sopenharmony_ci data->nbanks = ARRAY_SIZE(wm8650_banks); 3278c2ecf20Sopenharmony_ci data->pins = wm8650_pins; 3288c2ecf20Sopenharmony_ci data->npins = ARRAY_SIZE(wm8650_pins); 3298c2ecf20Sopenharmony_ci data->groups = wm8650_groups; 3308c2ecf20Sopenharmony_ci data->ngroups = ARRAY_SIZE(wm8650_groups); 3318c2ecf20Sopenharmony_ci 3328c2ecf20Sopenharmony_ci return wmt_pinctrl_probe(pdev, data); 3338c2ecf20Sopenharmony_ci} 3348c2ecf20Sopenharmony_ci 3358c2ecf20Sopenharmony_cistatic const struct of_device_id wmt_pinctrl_of_match[] = { 3368c2ecf20Sopenharmony_ci { .compatible = "wm,wm8650-pinctrl" }, 3378c2ecf20Sopenharmony_ci { /* sentinel */ }, 3388c2ecf20Sopenharmony_ci}; 3398c2ecf20Sopenharmony_ci 3408c2ecf20Sopenharmony_cistatic struct platform_driver wmt_pinctrl_driver = { 3418c2ecf20Sopenharmony_ci .probe = wm8650_pinctrl_probe, 3428c2ecf20Sopenharmony_ci .driver = { 3438c2ecf20Sopenharmony_ci .name = "pinctrl-wm8650", 3448c2ecf20Sopenharmony_ci .of_match_table = wmt_pinctrl_of_match, 3458c2ecf20Sopenharmony_ci .suppress_bind_attrs = true, 3468c2ecf20Sopenharmony_ci }, 3478c2ecf20Sopenharmony_ci}; 3488c2ecf20Sopenharmony_cibuiltin_platform_driver(wmt_pinctrl_driver); 349