1b2441318SGreg Kroah-Hartman // SPDX-License-Identifier: GPL-2.0
23a198059SLinus Walleij #include <linux/kernel.h>
3*937e7a39SAndy Shevchenko #include <linux/types.h>
4*937e7a39SAndy Shevchenko
53a198059SLinus Walleij #include <linux/pinctrl/pinctrl.h>
6*937e7a39SAndy Shevchenko
73a198059SLinus Walleij #include "pinctrl-nomadik.h"
83a198059SLinus Walleij
93a198059SLinus Walleij /* All the pins that can be used for GPIO and some other functions */
103a198059SLinus Walleij #define _GPIO(offset) (offset)
113a198059SLinus Walleij
123a198059SLinus Walleij #define STN8815_PIN_B4 _GPIO(0)
133a198059SLinus Walleij #define STN8815_PIN_D5 _GPIO(1)
143a198059SLinus Walleij #define STN8815_PIN_C5 _GPIO(2)
153a198059SLinus Walleij #define STN8815_PIN_A4 _GPIO(3)
163a198059SLinus Walleij #define STN8815_PIN_B5 _GPIO(4)
173a198059SLinus Walleij #define STN8815_PIN_D6 _GPIO(5)
183a198059SLinus Walleij #define STN8815_PIN_C6 _GPIO(6)
193a198059SLinus Walleij #define STN8815_PIN_B6 _GPIO(7)
203a198059SLinus Walleij #define STN8815_PIN_B10 _GPIO(8)
213a198059SLinus Walleij #define STN8815_PIN_A10 _GPIO(9)
223a198059SLinus Walleij #define STN8815_PIN_C11 _GPIO(10)
233a198059SLinus Walleij #define STN8815_PIN_B11 _GPIO(11)
243a198059SLinus Walleij #define STN8815_PIN_A11 _GPIO(12)
253a198059SLinus Walleij #define STN8815_PIN_C12 _GPIO(13)
263a198059SLinus Walleij #define STN8815_PIN_B12 _GPIO(14)
273a198059SLinus Walleij #define STN8815_PIN_A12 _GPIO(15)
283a198059SLinus Walleij #define STN8815_PIN_C13 _GPIO(16)
293a198059SLinus Walleij #define STN8815_PIN_B13 _GPIO(17)
303a198059SLinus Walleij #define STN8815_PIN_A13 _GPIO(18)
313a198059SLinus Walleij #define STN8815_PIN_D13 _GPIO(19)
323a198059SLinus Walleij #define STN8815_PIN_C14 _GPIO(20)
333a198059SLinus Walleij #define STN8815_PIN_B14 _GPIO(21)
343a198059SLinus Walleij #define STN8815_PIN_A14 _GPIO(22)
353a198059SLinus Walleij #define STN8815_PIN_D15 _GPIO(23)
363a198059SLinus Walleij #define STN8815_PIN_C15 _GPIO(24)
373a198059SLinus Walleij #define STN8815_PIN_B15 _GPIO(25)
383a198059SLinus Walleij #define STN8815_PIN_A15 _GPIO(26)
393a198059SLinus Walleij #define STN8815_PIN_C16 _GPIO(27)
403a198059SLinus Walleij #define STN8815_PIN_B16 _GPIO(28)
413a198059SLinus Walleij #define STN8815_PIN_A16 _GPIO(29)
423a198059SLinus Walleij #define STN8815_PIN_D17 _GPIO(30)
433a198059SLinus Walleij #define STN8815_PIN_C17 _GPIO(31)
443a198059SLinus Walleij #define STN8815_PIN_AB6 _GPIO(32)
453a198059SLinus Walleij #define STN8815_PIN_AA6 _GPIO(33)
463a198059SLinus Walleij #define STN8815_PIN_Y6 _GPIO(34)
473a198059SLinus Walleij #define STN8815_PIN_Y5 _GPIO(35)
483a198059SLinus Walleij #define STN8815_PIN_AA5 _GPIO(36)
493a198059SLinus Walleij #define STN8815_PIN_AB5 _GPIO(37)
503a198059SLinus Walleij #define STN8815_PIN_AB4 _GPIO(38)
513a198059SLinus Walleij #define STN8815_PIN_Y4 _GPIO(39)
523a198059SLinus Walleij #define STN8815_PIN_R1 _GPIO(40)
533a198059SLinus Walleij #define STN8815_PIN_R2 _GPIO(41)
543a198059SLinus Walleij #define STN8815_PIN_R3 _GPIO(42)
553a198059SLinus Walleij #define STN8815_PIN_P1 _GPIO(43)
563a198059SLinus Walleij #define STN8815_PIN_P2 _GPIO(44)
573a198059SLinus Walleij #define STN8815_PIN_P3 _GPIO(45)
583a198059SLinus Walleij #define STN8815_PIN_N1 _GPIO(46)
593a198059SLinus Walleij #define STN8815_PIN_N2 _GPIO(47)
603a198059SLinus Walleij #define STN8815_PIN_N3 _GPIO(48)
613a198059SLinus Walleij #define STN8815_PIN_M1 _GPIO(49)
623a198059SLinus Walleij #define STN8815_PIN_M3 _GPIO(50)
633a198059SLinus Walleij #define STN8815_PIN_M2 _GPIO(51)
643a198059SLinus Walleij #define STN8815_PIN_L1 _GPIO(52)
653a198059SLinus Walleij #define STN8815_PIN_L4 _GPIO(53)
663a198059SLinus Walleij #define STN8815_PIN_L3 _GPIO(54)
673a198059SLinus Walleij #define STN8815_PIN_L2 _GPIO(55)
683a198059SLinus Walleij #define STN8815_PIN_F3 _GPIO(56)
693a198059SLinus Walleij #define STN8815_PIN_F2 _GPIO(57)
703a198059SLinus Walleij #define STN8815_PIN_E1 _GPIO(58)
713a198059SLinus Walleij #define STN8815_PIN_E3 _GPIO(59)
723a198059SLinus Walleij #define STN8815_PIN_E2 _GPIO(60)
733a198059SLinus Walleij #define STN8815_PIN_E4 _GPIO(61)
743a198059SLinus Walleij #define STN8815_PIN_D3 _GPIO(62)
753a198059SLinus Walleij #define STN8815_PIN_D2 _GPIO(63)
763a198059SLinus Walleij #define STN8815_PIN_F21 _GPIO(64)
773a198059SLinus Walleij #define STN8815_PIN_F20 _GPIO(65)
783a198059SLinus Walleij #define STN8815_PIN_E22 _GPIO(66)
793a198059SLinus Walleij #define STN8815_PIN_D22 _GPIO(67)
803a198059SLinus Walleij #define STN8815_PIN_E21 _GPIO(68)
813a198059SLinus Walleij #define STN8815_PIN_E20 _GPIO(69)
823a198059SLinus Walleij #define STN8815_PIN_C22 _GPIO(70)
833a198059SLinus Walleij #define STN8815_PIN_D21 _GPIO(71)
843a198059SLinus Walleij #define STN8815_PIN_D20 _GPIO(72)
853a198059SLinus Walleij #define STN8815_PIN_C21 _GPIO(73)
863a198059SLinus Walleij #define STN8815_PIN_C20 _GPIO(74)
873a198059SLinus Walleij #define STN8815_PIN_C19 _GPIO(75)
883a198059SLinus Walleij #define STN8815_PIN_B20 _GPIO(76)
893a198059SLinus Walleij #define STN8815_PIN_B8 _GPIO(77)
903a198059SLinus Walleij #define STN8815_PIN_A8 _GPIO(78)
913a198059SLinus Walleij #define STN8815_PIN_C9 _GPIO(79)
923a198059SLinus Walleij #define STN8815_PIN_B9 _GPIO(80)
933a198059SLinus Walleij #define STN8815_PIN_A9 _GPIO(81)
943a198059SLinus Walleij #define STN8815_PIN_C10 _GPIO(82)
953a198059SLinus Walleij #define STN8815_PIN_K1 _GPIO(83)
963a198059SLinus Walleij #define STN8815_PIN_K3 _GPIO(84)
973a198059SLinus Walleij #define STN8815_PIN_K2 _GPIO(85)
983a198059SLinus Walleij #define STN8815_PIN_J1 _GPIO(86)
993a198059SLinus Walleij #define STN8815_PIN_J3 _GPIO(87)
1003a198059SLinus Walleij #define STN8815_PIN_J2 _GPIO(88)
1013a198059SLinus Walleij #define STN8815_PIN_H1 _GPIO(89)
1023a198059SLinus Walleij #define STN8815_PIN_H3 _GPIO(90)
1033a198059SLinus Walleij #define STN8815_PIN_H2 _GPIO(91)
1043a198059SLinus Walleij #define STN8815_PIN_G1 _GPIO(92)
1053a198059SLinus Walleij #define STN8815_PIN_G3 _GPIO(93)
1063a198059SLinus Walleij #define STN8815_PIN_G2 _GPIO(94)
1073a198059SLinus Walleij #define STN8815_PIN_F1 _GPIO(95)
1083a198059SLinus Walleij #define STN8815_PIN_T20 _GPIO(96)
1093a198059SLinus Walleij #define STN8815_PIN_R21 _GPIO(97)
1103a198059SLinus Walleij #define STN8815_PIN_R20 _GPIO(98)
1113a198059SLinus Walleij #define STN8815_PIN_U22 _GPIO(99)
1123a198059SLinus Walleij #define STN8815_PIN_N21 _GPIO(100)
1133a198059SLinus Walleij #define STN8815_PIN_N20 _GPIO(101)
1143a198059SLinus Walleij #define STN8815_PIN_P22 _GPIO(102)
1153a198059SLinus Walleij #define STN8815_PIN_N22 _GPIO(103)
1163a198059SLinus Walleij #define STN8815_PIN_V22 _GPIO(104)
1173a198059SLinus Walleij #define STN8815_PIN_V21 _GPIO(105)
1183a198059SLinus Walleij #define STN8815_PIN_K22 _GPIO(106)
1193a198059SLinus Walleij #define STN8815_PIN_K21 _GPIO(107)
1203a198059SLinus Walleij #define STN8815_PIN_H20 _GPIO(108)
1213a198059SLinus Walleij #define STN8815_PIN_G20 _GPIO(109)
1223a198059SLinus Walleij #define STN8815_PIN_L21 _GPIO(110)
1233a198059SLinus Walleij #define STN8815_PIN_H21 _GPIO(111)
1243a198059SLinus Walleij #define STN8815_PIN_J21 _GPIO(112)
1253a198059SLinus Walleij #define STN8815_PIN_H22 _GPIO(113)
1263a198059SLinus Walleij #define STN8815_PIN_K20 _GPIO(114)
1273a198059SLinus Walleij #define STN8815_PIN_L22 _GPIO(115)
1283a198059SLinus Walleij #define STN8815_PIN_G21 _GPIO(116)
1293a198059SLinus Walleij #define STN8815_PIN_J20 _GPIO(117)
1303a198059SLinus Walleij #define STN8815_PIN_G22 _GPIO(118)
1313a198059SLinus Walleij #define STN8815_PIN_U19 _GPIO(119)
1323a198059SLinus Walleij #define STN8815_PIN_G19 _GPIO(120)
1333a198059SLinus Walleij #define STN8815_PIN_M22 _GPIO(121)
1343a198059SLinus Walleij #define STN8815_PIN_M19 _GPIO(122)
1353a198059SLinus Walleij #define STN8815_PIN_J22 _GPIO(123)
1363a198059SLinus Walleij /* GPIOs 124-127 not routed to pins */
1373a198059SLinus Walleij
1383a198059SLinus Walleij /*
1393a198059SLinus Walleij * The names of the pins are denoted by GPIO number and ball name, even
1403a198059SLinus Walleij * though they can be used for other things than GPIO, this is the first
1413a198059SLinus Walleij * column in the table of the data sheet and often used on schematics and
1423a198059SLinus Walleij * such.
1433a198059SLinus Walleij */
1443a198059SLinus Walleij static const struct pinctrl_pin_desc nmk_stn8815_pins[] = {
1453a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B4, "GPIO0_B4"),
1463a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D5, "GPIO1_D5"),
1473a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C5, "GPIO2_C5"),
1483a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A4, "GPIO3_A4"),
1493a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B5, "GPIO4_B5"),
1503a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D6, "GPIO5_D6"),
1513a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C6, "GPIO6_C6"),
1523a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B6, "GPIO7_B6"),
1533a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B10, "GPIO8_B10"),
1543a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A10, "GPIO9_A10"),
1553a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C11, "GPIO10_C11"),
1563a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B11, "GPIO11_B11"),
1573a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A11, "GPIO12_A11"),
1583a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C12, "GPIO13_C12"),
1593a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B12, "GPIO14_B12"),
1603a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A12, "GPIO15_A12"),
1613a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C13, "GPIO16_C13"),
1623a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B13, "GPIO17_B13"),
1633a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A13, "GPIO18_A13"),
1643a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D13, "GPIO19_D13"),
1653a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C14, "GPIO20_C14"),
1663a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B14, "GPIO21_B14"),
1673a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A14, "GPIO22_A14"),
1683a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D15, "GPIO23_D15"),
1693a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C15, "GPIO24_C15"),
1703a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B15, "GPIO25_B15"),
1713a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A15, "GPIO26_A15"),
1723a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C16, "GPIO27_C16"),
1733a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B16, "GPIO28_B16"),
1743a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A16, "GPIO29_A16"),
1753a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D17, "GPIO30_D17"),
1763a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C17, "GPIO31_C17"),
1773a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_AB6, "GPIO32_AB6"),
1783a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_AA6, "GPIO33_AA6"),
1793a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_Y6, "GPIO34_Y6"),
1803a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_Y5, "GPIO35_Y5"),
1813a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_AA5, "GPIO36_AA5"),
1823a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_AB5, "GPIO37_AB5"),
1833a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_AB4, "GPIO38_AB4"),
1843a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_Y4, "GPIO39_Y4"),
1853a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_R1, "GPIO40_R1"),
1863a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_R2, "GPIO41_R2"),
1873a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_R3, "GPIO42_R3"),
1883a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_P1, "GPIO43_P1"),
1893a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_P2, "GPIO44_P2"),
1903a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_P3, "GPIO45_P3"),
1913a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_N1, "GPIO46_N1"),
1923a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_N2, "GPIO47_N2"),
1933a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_N3, "GPIO48_N3"),
1943a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_M1, "GPIO49_M1"),
1953a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_M3, "GPIO50_M3"),
1963a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_M2, "GPIO51_M2"),
1973a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_L1, "GPIO52_L1"),
1983a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_L4, "GPIO53_L4"),
1993a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_L3, "GPIO54_L3"),
2003a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_L2, "GPIO55_L2"),
2013a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_F3, "GPIO56_F3"),
2023a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_F2, "GPIO57_F2"),
2033a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_E1, "GPIO58_E1"),
2043a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_E3, "GPIO59_E3"),
2053a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_E2, "GPIO60_E2"),
2063a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_E4, "GPIO61_E4"),
2073a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D3, "GPIO62_D3"),
2083a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D2, "GPIO63_D2"),
2093a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_F21, "GPIO64_F21"),
2103a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_F20, "GPIO65_F20"),
2113a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_E22, "GPIO66_E22"),
2123a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D22, "GPIO67_D22"),
2133a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_E21, "GPIO68_E21"),
2143a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_E20, "GPIO69_E20"),
2153a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C22, "GPIO70_C22"),
2163a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D21, "GPIO71_D21"),
2173a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_D20, "GPIO72_D20"),
2183a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C21, "GPIO73_C21"),
2193a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C20, "GPIO74_C20"),
2203a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C19, "GPIO75_C19"),
2213a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B20, "GPIO76_B20"),
2223a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B8, "GPIO77_B8"),
2233a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A8, "GPIO78_A8"),
2243a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C9, "GPIO79_C9"),
2253a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_B9, "GPIO80_B9"),
2263a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_A9, "GPIO81_A9"),
2273a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_C10, "GPIO82_C10"),
2283a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_K1, "GPIO83_K1"),
2293a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_K3, "GPIO84_K3"),
2303a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_K2, "GPIO85_K2"),
2313a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_J1, "GPIO86_J1"),
2323a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_J3, "GPIO87_J3"),
2333a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_J2, "GPIO88_J2"),
2343a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_H1, "GPIO89_H1"),
2353a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_H3, "GPIO90_H3"),
2363a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_H2, "GPIO91_H2"),
2373a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_G1, "GPIO92_G1"),
2383a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_G3, "GPIO93_G3"),
2393a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_G2, "GPIO94_G2"),
2403a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_F1, "GPIO95_F1"),
2413a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_T20, "GPIO96_T20"),
2423a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_R21, "GPIO97_R21"),
2433a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_R20, "GPIO98_R20"),
2443a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_U22, "GPIO99_U22"),
2453a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_N21, "GPIO100_N21"),
2463a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_N20, "GPIO101_N20"),
2473a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_P22, "GPIO102_P22"),
2483a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_N22, "GPIO103_N22"),
2493a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_V22, "GPIO104_V22"),
2503a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_V21, "GPIO105_V21"),
2513a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_K22, "GPIO106_K22"),
2523a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_K21, "GPIO107_K21"),
2533a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_H20, "GPIO108_H20"),
2543a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_G20, "GPIO109_G20"),
2553a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_L21, "GPIO110_L21"),
2563a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_H21, "GPIO111_H21"),
2573a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_J21, "GPIO112_J21"),
2583a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_H22, "GPIO113_H22"),
2593a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_K20, "GPIO114_K20"),
2603a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_L22, "GPIO115_L22"),
2613a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_G21, "GPIO116_G21"),
2623a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_J20, "GPIO117_J20"),
2633a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_G22, "GPIO118_G22"),
2643a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_U19, "GPIO119_U19"),
2653a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_G19, "GPIO120_G19"),
2663a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_M22, "GPIO121_M22"),
2673a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_M19, "GPIO122_M19"),
2683a198059SLinus Walleij PINCTRL_PIN(STN8815_PIN_J22, "GPIO123_J22"),
2693a198059SLinus Walleij };
2703a198059SLinus Walleij
2713a198059SLinus Walleij /*
2723a198059SLinus Walleij * Read the pin group names like this:
2733a198059SLinus Walleij * u0_a_1 = first groups of pins for uart0 on alt function a
2743a198059SLinus Walleij * i2c2_b_2 = second group of pins for i2c2 on alt function b
2753a198059SLinus Walleij */
2763a198059SLinus Walleij
2773a198059SLinus Walleij /* Altfunction A */
2781051fadeSLinus Walleij static const unsigned u0txrx_a_1_pins[] = { STN8815_PIN_B4, STN8815_PIN_D5 };
2791051fadeSLinus Walleij static const unsigned u0ctsrts_a_1_pins[] = { STN8815_PIN_C5, STN8815_PIN_B6 };
2801051fadeSLinus Walleij /* Modem pins: DCD, DSR, RI, DTR */
2811051fadeSLinus Walleij static const unsigned u0modem_a_1_pins[] = { STN8815_PIN_A4, STN8815_PIN_B5,
2821051fadeSLinus Walleij STN8815_PIN_D6, STN8815_PIN_C6 };
2833a198059SLinus Walleij static const unsigned mmcsd_a_1_pins[] = { STN8815_PIN_B10, STN8815_PIN_A10,
2843a198059SLinus Walleij STN8815_PIN_C11, STN8815_PIN_B11, STN8815_PIN_A11, STN8815_PIN_C12,
2853a198059SLinus Walleij STN8815_PIN_B12, STN8815_PIN_A12, STN8815_PIN_C13, STN8815_PIN_C15 };
286dc603c65SLinus Walleij static const unsigned mmcsd_b_1_pins[] = { STN8815_PIN_D15 };
2873a198059SLinus Walleij static const unsigned u1_a_1_pins[] = { STN8815_PIN_M2, STN8815_PIN_L1,
2883a198059SLinus Walleij STN8815_PIN_F3, STN8815_PIN_F2 };
2893a198059SLinus Walleij static const unsigned i2c1_a_1_pins[] = { STN8815_PIN_L4, STN8815_PIN_L3 };
2903a198059SLinus Walleij static const unsigned i2c0_a_1_pins[] = { STN8815_PIN_D3, STN8815_PIN_D2 };
2913a198059SLinus Walleij /* Altfunction B */
2923a198059SLinus Walleij static const unsigned u1_b_1_pins[] = { STN8815_PIN_B16, STN8815_PIN_A16 };
2933a198059SLinus Walleij static const unsigned i2cusb_b_1_pins[] = { STN8815_PIN_C21, STN8815_PIN_C20 };
294411a1fb8SLinus Walleij static const unsigned clcd_16_23_b_1_pins[] = { STN8815_PIN_AB6,
295411a1fb8SLinus Walleij STN8815_PIN_AA6, STN8815_PIN_Y6, STN8815_PIN_Y5, STN8815_PIN_AA5,
296411a1fb8SLinus Walleij STN8815_PIN_AB5, STN8815_PIN_AB4, STN8815_PIN_Y4 };
2975da2bd5aSLinus Walleij /* Full-speed and high-speed USB pins */
2985da2bd5aSLinus Walleij static const unsigned usbfs_b_1_pins[] = { STN8815_PIN_E21, STN8815_PIN_E20,
2995da2bd5aSLinus Walleij STN8815_PIN_C22, STN8815_PIN_D21,
3005da2bd5aSLinus Walleij STN8815_PIN_D20, STN8815_PIN_C21,
3015da2bd5aSLinus Walleij STN8815_PIN_C20 };
3025da2bd5aSLinus Walleij static const unsigned usbhs_c_1_pins[] = { STN8815_PIN_E21, STN8815_PIN_E20,
3035da2bd5aSLinus Walleij STN8815_PIN_C20, STN8815_PIN_C19,
3045da2bd5aSLinus Walleij STN8815_PIN_C22, STN8815_PIN_D21,
3055da2bd5aSLinus Walleij STN8815_PIN_D20, STN8815_PIN_C21,
3065da2bd5aSLinus Walleij STN8815_PIN_C16, STN8815_PIN_A15,
3075da2bd5aSLinus Walleij STN8815_PIN_D17, STN8815_PIN_C17 };
3083a198059SLinus Walleij
3093a198059SLinus Walleij static const struct nmk_pingroup nmk_stn8815_groups[] = {
31039b707faSAndy Shevchenko NMK_PIN_GROUP(u0txrx_a_1, NMK_GPIO_ALT_A),
31139b707faSAndy Shevchenko NMK_PIN_GROUP(u0ctsrts_a_1, NMK_GPIO_ALT_A),
31239b707faSAndy Shevchenko NMK_PIN_GROUP(u0modem_a_1, NMK_GPIO_ALT_A),
31339b707faSAndy Shevchenko NMK_PIN_GROUP(mmcsd_a_1, NMK_GPIO_ALT_A),
31439b707faSAndy Shevchenko NMK_PIN_GROUP(mmcsd_b_1, NMK_GPIO_ALT_B),
31539b707faSAndy Shevchenko NMK_PIN_GROUP(u1_a_1, NMK_GPIO_ALT_A),
31639b707faSAndy Shevchenko NMK_PIN_GROUP(i2c1_a_1, NMK_GPIO_ALT_A),
31739b707faSAndy Shevchenko NMK_PIN_GROUP(i2c0_a_1, NMK_GPIO_ALT_A),
31839b707faSAndy Shevchenko NMK_PIN_GROUP(u1_b_1, NMK_GPIO_ALT_B),
31939b707faSAndy Shevchenko NMK_PIN_GROUP(i2cusb_b_1, NMK_GPIO_ALT_B),
32039b707faSAndy Shevchenko NMK_PIN_GROUP(clcd_16_23_b_1, NMK_GPIO_ALT_B),
32139b707faSAndy Shevchenko NMK_PIN_GROUP(usbfs_b_1, NMK_GPIO_ALT_B),
32239b707faSAndy Shevchenko NMK_PIN_GROUP(usbhs_c_1, NMK_GPIO_ALT_C),
3233a198059SLinus Walleij };
3243a198059SLinus Walleij
3253a198059SLinus Walleij /* We use this macro to define the groups applicable to a function */
3263a198059SLinus Walleij #define STN8815_FUNC_GROUPS(a, b...) \
3273a198059SLinus Walleij static const char * const a##_groups[] = { b };
3283a198059SLinus Walleij
3291051fadeSLinus Walleij STN8815_FUNC_GROUPS(u0, "u0txrx_a_1", "u0ctsrts_a_1", "u0modem_a_1");
330dc603c65SLinus Walleij STN8815_FUNC_GROUPS(mmcsd, "mmcsd_a_1", "mmcsd_b_1");
3313a198059SLinus Walleij STN8815_FUNC_GROUPS(u1, "u1_a_1", "u1_b_1");
3323a198059SLinus Walleij STN8815_FUNC_GROUPS(i2c1, "i2c1_a_1");
3333a198059SLinus Walleij STN8815_FUNC_GROUPS(i2c0, "i2c0_a_1");
3343a198059SLinus Walleij STN8815_FUNC_GROUPS(i2cusb, "i2cusb_b_1");
335411a1fb8SLinus Walleij STN8815_FUNC_GROUPS(clcd, "clcd_16_23_b_1");
3365da2bd5aSLinus Walleij STN8815_FUNC_GROUPS(usb, "usbfs_b_1", "usbhs_c_1");
3373a198059SLinus Walleij
3383a198059SLinus Walleij #define FUNCTION(fname) \
3393a198059SLinus Walleij { \
3403a198059SLinus Walleij .name = #fname, \
3413a198059SLinus Walleij .groups = fname##_groups, \
3423a198059SLinus Walleij .ngroups = ARRAY_SIZE(fname##_groups), \
3433a198059SLinus Walleij }
3443a198059SLinus Walleij
3453a198059SLinus Walleij static const struct nmk_function nmk_stn8815_functions[] = {
3463a198059SLinus Walleij FUNCTION(u0),
3473a198059SLinus Walleij FUNCTION(mmcsd),
3483a198059SLinus Walleij FUNCTION(u1),
3493a198059SLinus Walleij FUNCTION(i2c1),
3503a198059SLinus Walleij FUNCTION(i2c0),
3513a198059SLinus Walleij FUNCTION(i2cusb),
352411a1fb8SLinus Walleij FUNCTION(clcd),
3535da2bd5aSLinus Walleij FUNCTION(usb),
3543a198059SLinus Walleij };
3553a198059SLinus Walleij
3563a198059SLinus Walleij static const struct nmk_pinctrl_soc_data nmk_stn8815_soc = {
3573a198059SLinus Walleij .pins = nmk_stn8815_pins,
3583a198059SLinus Walleij .npins = ARRAY_SIZE(nmk_stn8815_pins),
3593a198059SLinus Walleij .functions = nmk_stn8815_functions,
3603a198059SLinus Walleij .nfunctions = ARRAY_SIZE(nmk_stn8815_functions),
3613a198059SLinus Walleij .groups = nmk_stn8815_groups,
3623a198059SLinus Walleij .ngroups = ARRAY_SIZE(nmk_stn8815_groups),
3633a198059SLinus Walleij };
3643a198059SLinus Walleij
nmk_pinctrl_stn8815_init(const struct nmk_pinctrl_soc_data ** soc)3653a198059SLinus Walleij void nmk_pinctrl_stn8815_init(const struct nmk_pinctrl_soc_data **soc)
3663a198059SLinus Walleij {
3673a198059SLinus Walleij *soc = &nmk_stn8815_soc;
3683a198059SLinus Walleij }
369