18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
28c2ecf20Sopenharmony_ci#include <linux/kernel.h>
38c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
48c2ecf20Sopenharmony_ci#include "pinctrl-nomadik.h"
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci/* All the pins that can be used for GPIO and some other functions */
78c2ecf20Sopenharmony_ci#define _GPIO(offset)		(offset)
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#define STN8815_PIN_B4		_GPIO(0)
108c2ecf20Sopenharmony_ci#define STN8815_PIN_D5		_GPIO(1)
118c2ecf20Sopenharmony_ci#define STN8815_PIN_C5		_GPIO(2)
128c2ecf20Sopenharmony_ci#define STN8815_PIN_A4		_GPIO(3)
138c2ecf20Sopenharmony_ci#define STN8815_PIN_B5		_GPIO(4)
148c2ecf20Sopenharmony_ci#define STN8815_PIN_D6		_GPIO(5)
158c2ecf20Sopenharmony_ci#define STN8815_PIN_C6		_GPIO(6)
168c2ecf20Sopenharmony_ci#define STN8815_PIN_B6		_GPIO(7)
178c2ecf20Sopenharmony_ci#define STN8815_PIN_B10		_GPIO(8)
188c2ecf20Sopenharmony_ci#define STN8815_PIN_A10		_GPIO(9)
198c2ecf20Sopenharmony_ci#define STN8815_PIN_C11		_GPIO(10)
208c2ecf20Sopenharmony_ci#define STN8815_PIN_B11		_GPIO(11)
218c2ecf20Sopenharmony_ci#define STN8815_PIN_A11		_GPIO(12)
228c2ecf20Sopenharmony_ci#define STN8815_PIN_C12		_GPIO(13)
238c2ecf20Sopenharmony_ci#define STN8815_PIN_B12		_GPIO(14)
248c2ecf20Sopenharmony_ci#define STN8815_PIN_A12		_GPIO(15)
258c2ecf20Sopenharmony_ci#define STN8815_PIN_C13		_GPIO(16)
268c2ecf20Sopenharmony_ci#define STN8815_PIN_B13		_GPIO(17)
278c2ecf20Sopenharmony_ci#define STN8815_PIN_A13		_GPIO(18)
288c2ecf20Sopenharmony_ci#define STN8815_PIN_D13		_GPIO(19)
298c2ecf20Sopenharmony_ci#define STN8815_PIN_C14		_GPIO(20)
308c2ecf20Sopenharmony_ci#define STN8815_PIN_B14		_GPIO(21)
318c2ecf20Sopenharmony_ci#define STN8815_PIN_A14		_GPIO(22)
328c2ecf20Sopenharmony_ci#define STN8815_PIN_D15		_GPIO(23)
338c2ecf20Sopenharmony_ci#define STN8815_PIN_C15		_GPIO(24)
348c2ecf20Sopenharmony_ci#define STN8815_PIN_B15		_GPIO(25)
358c2ecf20Sopenharmony_ci#define STN8815_PIN_A15		_GPIO(26)
368c2ecf20Sopenharmony_ci#define STN8815_PIN_C16		_GPIO(27)
378c2ecf20Sopenharmony_ci#define STN8815_PIN_B16		_GPIO(28)
388c2ecf20Sopenharmony_ci#define STN8815_PIN_A16		_GPIO(29)
398c2ecf20Sopenharmony_ci#define STN8815_PIN_D17		_GPIO(30)
408c2ecf20Sopenharmony_ci#define STN8815_PIN_C17		_GPIO(31)
418c2ecf20Sopenharmony_ci#define STN8815_PIN_AB6		_GPIO(32)
428c2ecf20Sopenharmony_ci#define STN8815_PIN_AA6		_GPIO(33)
438c2ecf20Sopenharmony_ci#define STN8815_PIN_Y6		_GPIO(34)
448c2ecf20Sopenharmony_ci#define STN8815_PIN_Y5		_GPIO(35)
458c2ecf20Sopenharmony_ci#define STN8815_PIN_AA5		_GPIO(36)
468c2ecf20Sopenharmony_ci#define STN8815_PIN_AB5		_GPIO(37)
478c2ecf20Sopenharmony_ci#define STN8815_PIN_AB4		_GPIO(38)
488c2ecf20Sopenharmony_ci#define STN8815_PIN_Y4		_GPIO(39)
498c2ecf20Sopenharmony_ci#define STN8815_PIN_R1		_GPIO(40)
508c2ecf20Sopenharmony_ci#define STN8815_PIN_R2		_GPIO(41)
518c2ecf20Sopenharmony_ci#define STN8815_PIN_R3		_GPIO(42)
528c2ecf20Sopenharmony_ci#define STN8815_PIN_P1		_GPIO(43)
538c2ecf20Sopenharmony_ci#define STN8815_PIN_P2		_GPIO(44)
548c2ecf20Sopenharmony_ci#define STN8815_PIN_P3		_GPIO(45)
558c2ecf20Sopenharmony_ci#define STN8815_PIN_N1		_GPIO(46)
568c2ecf20Sopenharmony_ci#define STN8815_PIN_N2		_GPIO(47)
578c2ecf20Sopenharmony_ci#define STN8815_PIN_N3		_GPIO(48)
588c2ecf20Sopenharmony_ci#define STN8815_PIN_M1		_GPIO(49)
598c2ecf20Sopenharmony_ci#define STN8815_PIN_M3		_GPIO(50)
608c2ecf20Sopenharmony_ci#define STN8815_PIN_M2		_GPIO(51)
618c2ecf20Sopenharmony_ci#define STN8815_PIN_L1		_GPIO(52)
628c2ecf20Sopenharmony_ci#define STN8815_PIN_L4		_GPIO(53)
638c2ecf20Sopenharmony_ci#define STN8815_PIN_L3		_GPIO(54)
648c2ecf20Sopenharmony_ci#define STN8815_PIN_L2		_GPIO(55)
658c2ecf20Sopenharmony_ci#define STN8815_PIN_F3		_GPIO(56)
668c2ecf20Sopenharmony_ci#define STN8815_PIN_F2		_GPIO(57)
678c2ecf20Sopenharmony_ci#define STN8815_PIN_E1		_GPIO(58)
688c2ecf20Sopenharmony_ci#define STN8815_PIN_E3		_GPIO(59)
698c2ecf20Sopenharmony_ci#define STN8815_PIN_E2		_GPIO(60)
708c2ecf20Sopenharmony_ci#define STN8815_PIN_E4		_GPIO(61)
718c2ecf20Sopenharmony_ci#define STN8815_PIN_D3		_GPIO(62)
728c2ecf20Sopenharmony_ci#define STN8815_PIN_D2		_GPIO(63)
738c2ecf20Sopenharmony_ci#define STN8815_PIN_F21		_GPIO(64)
748c2ecf20Sopenharmony_ci#define STN8815_PIN_F20		_GPIO(65)
758c2ecf20Sopenharmony_ci#define STN8815_PIN_E22		_GPIO(66)
768c2ecf20Sopenharmony_ci#define STN8815_PIN_D22		_GPIO(67)
778c2ecf20Sopenharmony_ci#define STN8815_PIN_E21		_GPIO(68)
788c2ecf20Sopenharmony_ci#define STN8815_PIN_E20		_GPIO(69)
798c2ecf20Sopenharmony_ci#define STN8815_PIN_C22		_GPIO(70)
808c2ecf20Sopenharmony_ci#define STN8815_PIN_D21		_GPIO(71)
818c2ecf20Sopenharmony_ci#define STN8815_PIN_D20		_GPIO(72)
828c2ecf20Sopenharmony_ci#define STN8815_PIN_C21		_GPIO(73)
838c2ecf20Sopenharmony_ci#define STN8815_PIN_C20		_GPIO(74)
848c2ecf20Sopenharmony_ci#define STN8815_PIN_C19		_GPIO(75)
858c2ecf20Sopenharmony_ci#define STN8815_PIN_B20		_GPIO(76)
868c2ecf20Sopenharmony_ci#define STN8815_PIN_B8		_GPIO(77)
878c2ecf20Sopenharmony_ci#define STN8815_PIN_A8		_GPIO(78)
888c2ecf20Sopenharmony_ci#define STN8815_PIN_C9		_GPIO(79)
898c2ecf20Sopenharmony_ci#define STN8815_PIN_B9		_GPIO(80)
908c2ecf20Sopenharmony_ci#define STN8815_PIN_A9		_GPIO(81)
918c2ecf20Sopenharmony_ci#define STN8815_PIN_C10		_GPIO(82)
928c2ecf20Sopenharmony_ci#define STN8815_PIN_K1		_GPIO(83)
938c2ecf20Sopenharmony_ci#define STN8815_PIN_K3		_GPIO(84)
948c2ecf20Sopenharmony_ci#define STN8815_PIN_K2		_GPIO(85)
958c2ecf20Sopenharmony_ci#define STN8815_PIN_J1		_GPIO(86)
968c2ecf20Sopenharmony_ci#define STN8815_PIN_J3		_GPIO(87)
978c2ecf20Sopenharmony_ci#define STN8815_PIN_J2		_GPIO(88)
988c2ecf20Sopenharmony_ci#define STN8815_PIN_H1		_GPIO(89)
998c2ecf20Sopenharmony_ci#define STN8815_PIN_H3		_GPIO(90)
1008c2ecf20Sopenharmony_ci#define STN8815_PIN_H2		_GPIO(91)
1018c2ecf20Sopenharmony_ci#define STN8815_PIN_G1		_GPIO(92)
1028c2ecf20Sopenharmony_ci#define STN8815_PIN_G3		_GPIO(93)
1038c2ecf20Sopenharmony_ci#define STN8815_PIN_G2		_GPIO(94)
1048c2ecf20Sopenharmony_ci#define STN8815_PIN_F1		_GPIO(95)
1058c2ecf20Sopenharmony_ci#define STN8815_PIN_T20		_GPIO(96)
1068c2ecf20Sopenharmony_ci#define STN8815_PIN_R21		_GPIO(97)
1078c2ecf20Sopenharmony_ci#define STN8815_PIN_R20		_GPIO(98)
1088c2ecf20Sopenharmony_ci#define STN8815_PIN_U22		_GPIO(99)
1098c2ecf20Sopenharmony_ci#define STN8815_PIN_N21		_GPIO(100)
1108c2ecf20Sopenharmony_ci#define STN8815_PIN_N20		_GPIO(101)
1118c2ecf20Sopenharmony_ci#define STN8815_PIN_P22		_GPIO(102)
1128c2ecf20Sopenharmony_ci#define STN8815_PIN_N22		_GPIO(103)
1138c2ecf20Sopenharmony_ci#define STN8815_PIN_V22		_GPIO(104)
1148c2ecf20Sopenharmony_ci#define STN8815_PIN_V21		_GPIO(105)
1158c2ecf20Sopenharmony_ci#define STN8815_PIN_K22		_GPIO(106)
1168c2ecf20Sopenharmony_ci#define STN8815_PIN_K21		_GPIO(107)
1178c2ecf20Sopenharmony_ci#define STN8815_PIN_H20		_GPIO(108)
1188c2ecf20Sopenharmony_ci#define STN8815_PIN_G20		_GPIO(109)
1198c2ecf20Sopenharmony_ci#define STN8815_PIN_L21		_GPIO(110)
1208c2ecf20Sopenharmony_ci#define STN8815_PIN_H21		_GPIO(111)
1218c2ecf20Sopenharmony_ci#define STN8815_PIN_J21		_GPIO(112)
1228c2ecf20Sopenharmony_ci#define STN8815_PIN_H22		_GPIO(113)
1238c2ecf20Sopenharmony_ci#define STN8815_PIN_K20		_GPIO(114)
1248c2ecf20Sopenharmony_ci#define STN8815_PIN_L22		_GPIO(115)
1258c2ecf20Sopenharmony_ci#define STN8815_PIN_G21		_GPIO(116)
1268c2ecf20Sopenharmony_ci#define STN8815_PIN_J20		_GPIO(117)
1278c2ecf20Sopenharmony_ci#define STN8815_PIN_G22		_GPIO(118)
1288c2ecf20Sopenharmony_ci#define STN8815_PIN_U19		_GPIO(119)
1298c2ecf20Sopenharmony_ci#define STN8815_PIN_G19		_GPIO(120)
1308c2ecf20Sopenharmony_ci#define STN8815_PIN_M22		_GPIO(121)
1318c2ecf20Sopenharmony_ci#define STN8815_PIN_M19		_GPIO(122)
1328c2ecf20Sopenharmony_ci#define STN8815_PIN_J22		_GPIO(123)
1338c2ecf20Sopenharmony_ci/* GPIOs 124-127 not routed to pins */
1348c2ecf20Sopenharmony_ci
1358c2ecf20Sopenharmony_ci/*
1368c2ecf20Sopenharmony_ci * The names of the pins are denoted by GPIO number and ball name, even
1378c2ecf20Sopenharmony_ci * though they can be used for other things than GPIO, this is the first
1388c2ecf20Sopenharmony_ci * column in the table of the data sheet and often used on schematics and
1398c2ecf20Sopenharmony_ci * such.
1408c2ecf20Sopenharmony_ci */
1418c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc nmk_stn8815_pins[] = {
1428c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B4, "GPIO0_B4"),
1438c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D5, "GPIO1_D5"),
1448c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C5, "GPIO2_C5"),
1458c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A4, "GPIO3_A4"),
1468c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B5, "GPIO4_B5"),
1478c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D6, "GPIO5_D6"),
1488c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C6, "GPIO6_C6"),
1498c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B6, "GPIO7_B6"),
1508c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B10, "GPIO8_B10"),
1518c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A10, "GPIO9_A10"),
1528c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C11, "GPIO10_C11"),
1538c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B11, "GPIO11_B11"),
1548c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A11, "GPIO12_A11"),
1558c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C12, "GPIO13_C12"),
1568c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B12, "GPIO14_B12"),
1578c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A12, "GPIO15_A12"),
1588c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C13, "GPIO16_C13"),
1598c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B13, "GPIO17_B13"),
1608c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A13, "GPIO18_A13"),
1618c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D13, "GPIO19_D13"),
1628c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C14, "GPIO20_C14"),
1638c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B14, "GPIO21_B14"),
1648c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A14, "GPIO22_A14"),
1658c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D15, "GPIO23_D15"),
1668c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C15, "GPIO24_C15"),
1678c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B15, "GPIO25_B15"),
1688c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A15, "GPIO26_A15"),
1698c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C16, "GPIO27_C16"),
1708c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B16, "GPIO28_B16"),
1718c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A16, "GPIO29_A16"),
1728c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D17, "GPIO30_D17"),
1738c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C17, "GPIO31_C17"),
1748c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_AB6, "GPIO32_AB6"),
1758c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_AA6, "GPIO33_AA6"),
1768c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_Y6, "GPIO34_Y6"),
1778c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_Y5, "GPIO35_Y5"),
1788c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_AA5, "GPIO36_AA5"),
1798c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_AB5, "GPIO37_AB5"),
1808c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_AB4, "GPIO38_AB4"),
1818c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_Y4, "GPIO39_Y4"),
1828c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_R1, "GPIO40_R1"),
1838c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_R2, "GPIO41_R2"),
1848c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_R3, "GPIO42_R3"),
1858c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_P1, "GPIO43_P1"),
1868c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_P2, "GPIO44_P2"),
1878c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_P3, "GPIO45_P3"),
1888c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_N1, "GPIO46_N1"),
1898c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_N2, "GPIO47_N2"),
1908c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_N3, "GPIO48_N3"),
1918c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_M1, "GPIO49_M1"),
1928c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_M3, "GPIO50_M3"),
1938c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_M2, "GPIO51_M2"),
1948c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_L1, "GPIO52_L1"),
1958c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_L4, "GPIO53_L4"),
1968c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_L3, "GPIO54_L3"),
1978c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_L2, "GPIO55_L2"),
1988c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_F3, "GPIO56_F3"),
1998c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_F2, "GPIO57_F2"),
2008c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_E1, "GPIO58_E1"),
2018c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_E3, "GPIO59_E3"),
2028c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_E2, "GPIO60_E2"),
2038c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_E4, "GPIO61_E4"),
2048c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D3, "GPIO62_D3"),
2058c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D2, "GPIO63_D2"),
2068c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_F21, "GPIO64_F21"),
2078c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_F20, "GPIO65_F20"),
2088c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_E22, "GPIO66_E22"),
2098c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D22, "GPIO67_D22"),
2108c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_E21, "GPIO68_E21"),
2118c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_E20, "GPIO69_E20"),
2128c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C22, "GPIO70_C22"),
2138c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D21, "GPIO71_D21"),
2148c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_D20, "GPIO72_D20"),
2158c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C21, "GPIO73_C21"),
2168c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C20, "GPIO74_C20"),
2178c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C19, "GPIO75_C19"),
2188c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B20, "GPIO76_B20"),
2198c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B8, "GPIO77_B8"),
2208c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A8, "GPIO78_A8"),
2218c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C9, "GPIO79_C9"),
2228c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_B9, "GPIO80_B9"),
2238c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_A9, "GPIO81_A9"),
2248c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_C10, "GPIO82_C10"),
2258c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_K1, "GPIO83_K1"),
2268c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_K3, "GPIO84_K3"),
2278c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_K2, "GPIO85_K2"),
2288c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_J1, "GPIO86_J1"),
2298c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_J3, "GPIO87_J3"),
2308c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_J2, "GPIO88_J2"),
2318c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_H1, "GPIO89_H1"),
2328c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_H3, "GPIO90_H3"),
2338c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_H2, "GPIO91_H2"),
2348c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_G1, "GPIO92_G1"),
2358c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_G3, "GPIO93_G3"),
2368c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_G2, "GPIO94_G2"),
2378c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_F1, "GPIO95_F1"),
2388c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_T20, "GPIO96_T20"),
2398c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_R21, "GPIO97_R21"),
2408c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_R20, "GPIO98_R20"),
2418c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_U22, "GPIO99_U22"),
2428c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_N21, "GPIO100_N21"),
2438c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_N20, "GPIO101_N20"),
2448c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_P22, "GPIO102_P22"),
2458c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_N22, "GPIO103_N22"),
2468c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_V22, "GPIO104_V22"),
2478c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_V21, "GPIO105_V21"),
2488c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_K22, "GPIO106_K22"),
2498c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_K21, "GPIO107_K21"),
2508c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_H20, "GPIO108_H20"),
2518c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_G20, "GPIO109_G20"),
2528c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_L21, "GPIO110_L21"),
2538c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_H21, "GPIO111_H21"),
2548c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_J21, "GPIO112_J21"),
2558c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_H22, "GPIO113_H22"),
2568c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_K20, "GPIO114_K20"),
2578c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_L22, "GPIO115_L22"),
2588c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_G21, "GPIO116_G21"),
2598c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_J20, "GPIO117_J20"),
2608c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_G22, "GPIO118_G22"),
2618c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_U19, "GPIO119_U19"),
2628c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_G19, "GPIO120_G19"),
2638c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_M22, "GPIO121_M22"),
2648c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_M19, "GPIO122_M19"),
2658c2ecf20Sopenharmony_ci	PINCTRL_PIN(STN8815_PIN_J22, "GPIO123_J22"),
2668c2ecf20Sopenharmony_ci};
2678c2ecf20Sopenharmony_ci
2688c2ecf20Sopenharmony_ci/*
2698c2ecf20Sopenharmony_ci * Read the pin group names like this:
2708c2ecf20Sopenharmony_ci * u0_a_1    = first groups of pins for uart0 on alt function a
2718c2ecf20Sopenharmony_ci * i2c2_b_2  = second group of pins for i2c2 on alt function b
2728c2ecf20Sopenharmony_ci */
2738c2ecf20Sopenharmony_ci
2748c2ecf20Sopenharmony_ci/* Altfunction A */
2758c2ecf20Sopenharmony_cistatic const unsigned u0txrx_a_1_pins[] = { STN8815_PIN_B4, STN8815_PIN_D5 };
2768c2ecf20Sopenharmony_cistatic const unsigned u0ctsrts_a_1_pins[] = { STN8815_PIN_C5, STN8815_PIN_B6 };
2778c2ecf20Sopenharmony_ci/* Modem pins: DCD, DSR, RI, DTR */
2788c2ecf20Sopenharmony_cistatic const unsigned u0modem_a_1_pins[] = { STN8815_PIN_A4, STN8815_PIN_B5,
2798c2ecf20Sopenharmony_ci	STN8815_PIN_D6, STN8815_PIN_C6 };
2808c2ecf20Sopenharmony_cistatic const unsigned mmcsd_a_1_pins[] = { STN8815_PIN_B10, STN8815_PIN_A10,
2818c2ecf20Sopenharmony_ci	STN8815_PIN_C11, STN8815_PIN_B11, STN8815_PIN_A11, STN8815_PIN_C12,
2828c2ecf20Sopenharmony_ci	STN8815_PIN_B12, STN8815_PIN_A12, STN8815_PIN_C13, STN8815_PIN_C15 };
2838c2ecf20Sopenharmony_cistatic const unsigned mmcsd_b_1_pins[] = { STN8815_PIN_D15 };
2848c2ecf20Sopenharmony_cistatic const unsigned u1_a_1_pins[] = { STN8815_PIN_M2, STN8815_PIN_L1,
2858c2ecf20Sopenharmony_ci					STN8815_PIN_F3, STN8815_PIN_F2 };
2868c2ecf20Sopenharmony_cistatic const unsigned i2c1_a_1_pins[] = { STN8815_PIN_L4, STN8815_PIN_L3 };
2878c2ecf20Sopenharmony_cistatic const unsigned i2c0_a_1_pins[] = { STN8815_PIN_D3, STN8815_PIN_D2 };
2888c2ecf20Sopenharmony_ci/* Altfunction B */
2898c2ecf20Sopenharmony_cistatic const unsigned u1_b_1_pins[] = { STN8815_PIN_B16, STN8815_PIN_A16 };
2908c2ecf20Sopenharmony_cistatic const unsigned i2cusb_b_1_pins[] = { STN8815_PIN_C21, STN8815_PIN_C20 };
2918c2ecf20Sopenharmony_cistatic const unsigned clcd_16_23_b_1_pins[] = { STN8815_PIN_AB6,
2928c2ecf20Sopenharmony_ci	STN8815_PIN_AA6, STN8815_PIN_Y6, STN8815_PIN_Y5, STN8815_PIN_AA5,
2938c2ecf20Sopenharmony_ci	STN8815_PIN_AB5, STN8815_PIN_AB4, STN8815_PIN_Y4 };
2948c2ecf20Sopenharmony_ci/* Full-speed and high-speed USB pins */
2958c2ecf20Sopenharmony_cistatic const unsigned usbfs_b_1_pins[] = { STN8815_PIN_E21, STN8815_PIN_E20,
2968c2ecf20Sopenharmony_ci					   STN8815_PIN_C22, STN8815_PIN_D21,
2978c2ecf20Sopenharmony_ci					   STN8815_PIN_D20, STN8815_PIN_C21,
2988c2ecf20Sopenharmony_ci					   STN8815_PIN_C20 };
2998c2ecf20Sopenharmony_cistatic const unsigned usbhs_c_1_pins[] = { STN8815_PIN_E21, STN8815_PIN_E20,
3008c2ecf20Sopenharmony_ci					   STN8815_PIN_C20, STN8815_PIN_C19,
3018c2ecf20Sopenharmony_ci					   STN8815_PIN_C22, STN8815_PIN_D21,
3028c2ecf20Sopenharmony_ci					   STN8815_PIN_D20, STN8815_PIN_C21,
3038c2ecf20Sopenharmony_ci					   STN8815_PIN_C16, STN8815_PIN_A15,
3048c2ecf20Sopenharmony_ci					   STN8815_PIN_D17, STN8815_PIN_C17 };
3058c2ecf20Sopenharmony_ci
3068c2ecf20Sopenharmony_ci#define STN8815_PIN_GROUP(a, b) { .name = #a, .pins = a##_pins,		\
3078c2ecf20Sopenharmony_ci			.npins = ARRAY_SIZE(a##_pins), .altsetting = b }
3088c2ecf20Sopenharmony_ci
3098c2ecf20Sopenharmony_cistatic const struct nmk_pingroup nmk_stn8815_groups[] = {
3108c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(u0txrx_a_1, NMK_GPIO_ALT_A),
3118c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(u0ctsrts_a_1, NMK_GPIO_ALT_A),
3128c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(u0modem_a_1, NMK_GPIO_ALT_A),
3138c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A),
3148c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(mmcsd_b_1, NMK_GPIO_ALT_B),
3158c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A),
3168c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(i2c1_a_1, NMK_GPIO_ALT_A),
3178c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
3188c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(u1_b_1, NMK_GPIO_ALT_B),
3198c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(i2cusb_b_1, NMK_GPIO_ALT_B),
3208c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(clcd_16_23_b_1, NMK_GPIO_ALT_B),
3218c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(usbfs_b_1, NMK_GPIO_ALT_B),
3228c2ecf20Sopenharmony_ci	STN8815_PIN_GROUP(usbhs_c_1, NMK_GPIO_ALT_C),
3238c2ecf20Sopenharmony_ci};
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_ci/* We use this macro to define the groups applicable to a function */
3268c2ecf20Sopenharmony_ci#define STN8815_FUNC_GROUPS(a, b...)	   \
3278c2ecf20Sopenharmony_cistatic const char * const a##_groups[] = { b };
3288c2ecf20Sopenharmony_ci
3298c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(u0, "u0txrx_a_1", "u0ctsrts_a_1", "u0modem_a_1");
3308c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(mmcsd, "mmcsd_a_1", "mmcsd_b_1");
3318c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(u1, "u1_a_1", "u1_b_1");
3328c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(i2c1, "i2c1_a_1");
3338c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(i2c0, "i2c0_a_1");
3348c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(i2cusb, "i2cusb_b_1");
3358c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(clcd, "clcd_16_23_b_1");
3368c2ecf20Sopenharmony_ciSTN8815_FUNC_GROUPS(usb, "usbfs_b_1", "usbhs_c_1");
3378c2ecf20Sopenharmony_ci
3388c2ecf20Sopenharmony_ci#define FUNCTION(fname)					\
3398c2ecf20Sopenharmony_ci	{						\
3408c2ecf20Sopenharmony_ci		.name = #fname,				\
3418c2ecf20Sopenharmony_ci		.groups = fname##_groups,		\
3428c2ecf20Sopenharmony_ci		.ngroups = ARRAY_SIZE(fname##_groups),	\
3438c2ecf20Sopenharmony_ci	}
3448c2ecf20Sopenharmony_ci
3458c2ecf20Sopenharmony_cistatic const struct nmk_function nmk_stn8815_functions[] = {
3468c2ecf20Sopenharmony_ci	FUNCTION(u0),
3478c2ecf20Sopenharmony_ci	FUNCTION(mmcsd),
3488c2ecf20Sopenharmony_ci	FUNCTION(u1),
3498c2ecf20Sopenharmony_ci	FUNCTION(i2c1),
3508c2ecf20Sopenharmony_ci	FUNCTION(i2c0),
3518c2ecf20Sopenharmony_ci	FUNCTION(i2cusb),
3528c2ecf20Sopenharmony_ci	FUNCTION(clcd),
3538c2ecf20Sopenharmony_ci	FUNCTION(usb),
3548c2ecf20Sopenharmony_ci};
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_cistatic const struct nmk_pinctrl_soc_data nmk_stn8815_soc = {
3578c2ecf20Sopenharmony_ci	.pins = nmk_stn8815_pins,
3588c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(nmk_stn8815_pins),
3598c2ecf20Sopenharmony_ci	.functions = nmk_stn8815_functions,
3608c2ecf20Sopenharmony_ci	.nfunctions = ARRAY_SIZE(nmk_stn8815_functions),
3618c2ecf20Sopenharmony_ci	.groups = nmk_stn8815_groups,
3628c2ecf20Sopenharmony_ci	.ngroups = ARRAY_SIZE(nmk_stn8815_groups),
3638c2ecf20Sopenharmony_ci};
3648c2ecf20Sopenharmony_ci
3658c2ecf20Sopenharmony_civoid nmk_pinctrl_stn8815_init(const struct nmk_pinctrl_soc_data **soc)
3668c2ecf20Sopenharmony_ci{
3678c2ecf20Sopenharmony_ci	*soc = &nmk_stn8815_soc;
3688c2ecf20Sopenharmony_ci}
369