18c2ecf20Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0+
28c2ecf20Sopenharmony_ci//
38c2ecf20Sopenharmony_ci// VF610 pinctrl driver based on imx pinmux and pinconf core
48c2ecf20Sopenharmony_ci//
58c2ecf20Sopenharmony_ci// Copyright 2013 Freescale Semiconductor, Inc.
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#include <linux/err.h>
88c2ecf20Sopenharmony_ci#include <linux/init.h>
98c2ecf20Sopenharmony_ci#include <linux/io.h>
108c2ecf20Sopenharmony_ci#include <linux/of.h>
118c2ecf20Sopenharmony_ci#include <linux/of_device.h>
128c2ecf20Sopenharmony_ci#include <linux/pinctrl/pinctrl.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#include "pinctrl-imx.h"
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_cienum vf610_pads {
178c2ecf20Sopenharmony_ci	VF610_PAD_PTA6 = 0,
188c2ecf20Sopenharmony_ci	VF610_PAD_PTA8 = 1,
198c2ecf20Sopenharmony_ci	VF610_PAD_PTA9 = 2,
208c2ecf20Sopenharmony_ci	VF610_PAD_PTA10 = 3,
218c2ecf20Sopenharmony_ci	VF610_PAD_PTA11 = 4,
228c2ecf20Sopenharmony_ci	VF610_PAD_PTA12 = 5,
238c2ecf20Sopenharmony_ci	VF610_PAD_PTA16 = 6,
248c2ecf20Sopenharmony_ci	VF610_PAD_PTA17 = 7,
258c2ecf20Sopenharmony_ci	VF610_PAD_PTA18 = 8,
268c2ecf20Sopenharmony_ci	VF610_PAD_PTA19 = 9,
278c2ecf20Sopenharmony_ci	VF610_PAD_PTA20 = 10,
288c2ecf20Sopenharmony_ci	VF610_PAD_PTA21 = 11,
298c2ecf20Sopenharmony_ci	VF610_PAD_PTA22 = 12,
308c2ecf20Sopenharmony_ci	VF610_PAD_PTA23 = 13,
318c2ecf20Sopenharmony_ci	VF610_PAD_PTA24 = 14,
328c2ecf20Sopenharmony_ci	VF610_PAD_PTA25 = 15,
338c2ecf20Sopenharmony_ci	VF610_PAD_PTA26 = 16,
348c2ecf20Sopenharmony_ci	VF610_PAD_PTA27 = 17,
358c2ecf20Sopenharmony_ci	VF610_PAD_PTA28 = 18,
368c2ecf20Sopenharmony_ci	VF610_PAD_PTA29 = 19,
378c2ecf20Sopenharmony_ci	VF610_PAD_PTA30 = 20,
388c2ecf20Sopenharmony_ci	VF610_PAD_PTA31 = 21,
398c2ecf20Sopenharmony_ci	VF610_PAD_PTB0 = 22,
408c2ecf20Sopenharmony_ci	VF610_PAD_PTB1 = 23,
418c2ecf20Sopenharmony_ci	VF610_PAD_PTB2 = 24,
428c2ecf20Sopenharmony_ci	VF610_PAD_PTB3 = 25,
438c2ecf20Sopenharmony_ci	VF610_PAD_PTB4 = 26,
448c2ecf20Sopenharmony_ci	VF610_PAD_PTB5 = 27,
458c2ecf20Sopenharmony_ci	VF610_PAD_PTB6 = 28,
468c2ecf20Sopenharmony_ci	VF610_PAD_PTB7 = 29,
478c2ecf20Sopenharmony_ci	VF610_PAD_PTB8 = 30,
488c2ecf20Sopenharmony_ci	VF610_PAD_PTB9 = 31,
498c2ecf20Sopenharmony_ci	VF610_PAD_PTB10 = 32,
508c2ecf20Sopenharmony_ci	VF610_PAD_PTB11 = 33,
518c2ecf20Sopenharmony_ci	VF610_PAD_PTB12 = 34,
528c2ecf20Sopenharmony_ci	VF610_PAD_PTB13 = 35,
538c2ecf20Sopenharmony_ci	VF610_PAD_PTB14 = 36,
548c2ecf20Sopenharmony_ci	VF610_PAD_PTB15 = 37,
558c2ecf20Sopenharmony_ci	VF610_PAD_PTB16 = 38,
568c2ecf20Sopenharmony_ci	VF610_PAD_PTB17 = 39,
578c2ecf20Sopenharmony_ci	VF610_PAD_PTB18 = 40,
588c2ecf20Sopenharmony_ci	VF610_PAD_PTB19 = 41,
598c2ecf20Sopenharmony_ci	VF610_PAD_PTB20 = 42,
608c2ecf20Sopenharmony_ci	VF610_PAD_PTB21 = 43,
618c2ecf20Sopenharmony_ci	VF610_PAD_PTB22 = 44,
628c2ecf20Sopenharmony_ci	VF610_PAD_PTC0 = 45,
638c2ecf20Sopenharmony_ci	VF610_PAD_PTC1 = 46,
648c2ecf20Sopenharmony_ci	VF610_PAD_PTC2 = 47,
658c2ecf20Sopenharmony_ci	VF610_PAD_PTC3 = 48,
668c2ecf20Sopenharmony_ci	VF610_PAD_PTC4 = 49,
678c2ecf20Sopenharmony_ci	VF610_PAD_PTC5 = 50,
688c2ecf20Sopenharmony_ci	VF610_PAD_PTC6 = 51,
698c2ecf20Sopenharmony_ci	VF610_PAD_PTC7 = 52,
708c2ecf20Sopenharmony_ci	VF610_PAD_PTC8 = 53,
718c2ecf20Sopenharmony_ci	VF610_PAD_PTC9 = 54,
728c2ecf20Sopenharmony_ci	VF610_PAD_PTC10 = 55,
738c2ecf20Sopenharmony_ci	VF610_PAD_PTC11 = 56,
748c2ecf20Sopenharmony_ci	VF610_PAD_PTC12 = 57,
758c2ecf20Sopenharmony_ci	VF610_PAD_PTC13 = 58,
768c2ecf20Sopenharmony_ci	VF610_PAD_PTC14 = 59,
778c2ecf20Sopenharmony_ci	VF610_PAD_PTC15 = 60,
788c2ecf20Sopenharmony_ci	VF610_PAD_PTC16 = 61,
798c2ecf20Sopenharmony_ci	VF610_PAD_PTC17 = 62,
808c2ecf20Sopenharmony_ci	VF610_PAD_PTD31 = 63,
818c2ecf20Sopenharmony_ci	VF610_PAD_PTD30 = 64,
828c2ecf20Sopenharmony_ci	VF610_PAD_PTD29 = 65,
838c2ecf20Sopenharmony_ci	VF610_PAD_PTD28 = 66,
848c2ecf20Sopenharmony_ci	VF610_PAD_PTD27 = 67,
858c2ecf20Sopenharmony_ci	VF610_PAD_PTD26 = 68,
868c2ecf20Sopenharmony_ci	VF610_PAD_PTD25 = 69,
878c2ecf20Sopenharmony_ci	VF610_PAD_PTD24 = 70,
888c2ecf20Sopenharmony_ci	VF610_PAD_PTD23 = 71,
898c2ecf20Sopenharmony_ci	VF610_PAD_PTD22 = 72,
908c2ecf20Sopenharmony_ci	VF610_PAD_PTD21 = 73,
918c2ecf20Sopenharmony_ci	VF610_PAD_PTD20 = 74,
928c2ecf20Sopenharmony_ci	VF610_PAD_PTD19 = 75,
938c2ecf20Sopenharmony_ci	VF610_PAD_PTD18 = 76,
948c2ecf20Sopenharmony_ci	VF610_PAD_PTD17 = 77,
958c2ecf20Sopenharmony_ci	VF610_PAD_PTD16 = 78,
968c2ecf20Sopenharmony_ci	VF610_PAD_PTD0 = 79,
978c2ecf20Sopenharmony_ci	VF610_PAD_PTD1 = 80,
988c2ecf20Sopenharmony_ci	VF610_PAD_PTD2 = 81,
998c2ecf20Sopenharmony_ci	VF610_PAD_PTD3 = 82,
1008c2ecf20Sopenharmony_ci	VF610_PAD_PTD4 = 83,
1018c2ecf20Sopenharmony_ci	VF610_PAD_PTD5 = 84,
1028c2ecf20Sopenharmony_ci	VF610_PAD_PTD6 = 85,
1038c2ecf20Sopenharmony_ci	VF610_PAD_PTD7 = 86,
1048c2ecf20Sopenharmony_ci	VF610_PAD_PTD8 = 87,
1058c2ecf20Sopenharmony_ci	VF610_PAD_PTD9 = 88,
1068c2ecf20Sopenharmony_ci	VF610_PAD_PTD10 = 89,
1078c2ecf20Sopenharmony_ci	VF610_PAD_PTD11 = 90,
1088c2ecf20Sopenharmony_ci	VF610_PAD_PTD12 = 91,
1098c2ecf20Sopenharmony_ci	VF610_PAD_PTD13 = 92,
1108c2ecf20Sopenharmony_ci	VF610_PAD_PTB23 = 93,
1118c2ecf20Sopenharmony_ci	VF610_PAD_PTB24 = 94,
1128c2ecf20Sopenharmony_ci	VF610_PAD_PTB25 = 95,
1138c2ecf20Sopenharmony_ci	VF610_PAD_PTB26 = 96,
1148c2ecf20Sopenharmony_ci	VF610_PAD_PTB27 = 97,
1158c2ecf20Sopenharmony_ci	VF610_PAD_PTB28 = 98,
1168c2ecf20Sopenharmony_ci	VF610_PAD_PTC26 = 99,
1178c2ecf20Sopenharmony_ci	VF610_PAD_PTC27 = 100,
1188c2ecf20Sopenharmony_ci	VF610_PAD_PTC28 = 101,
1198c2ecf20Sopenharmony_ci	VF610_PAD_PTC29 = 102,
1208c2ecf20Sopenharmony_ci	VF610_PAD_PTC30 = 103,
1218c2ecf20Sopenharmony_ci	VF610_PAD_PTC31 = 104,
1228c2ecf20Sopenharmony_ci	VF610_PAD_PTE0 = 105,
1238c2ecf20Sopenharmony_ci	VF610_PAD_PTE1 = 106,
1248c2ecf20Sopenharmony_ci	VF610_PAD_PTE2 = 107,
1258c2ecf20Sopenharmony_ci	VF610_PAD_PTE3 = 108,
1268c2ecf20Sopenharmony_ci	VF610_PAD_PTE4 = 109,
1278c2ecf20Sopenharmony_ci	VF610_PAD_PTE5 = 110,
1288c2ecf20Sopenharmony_ci	VF610_PAD_PTE6 = 111,
1298c2ecf20Sopenharmony_ci	VF610_PAD_PTE7 = 112,
1308c2ecf20Sopenharmony_ci	VF610_PAD_PTE8 = 113,
1318c2ecf20Sopenharmony_ci	VF610_PAD_PTE9 = 114,
1328c2ecf20Sopenharmony_ci	VF610_PAD_PTE10 = 115,
1338c2ecf20Sopenharmony_ci	VF610_PAD_PTE11 = 116,
1348c2ecf20Sopenharmony_ci	VF610_PAD_PTE12 = 117,
1358c2ecf20Sopenharmony_ci	VF610_PAD_PTE13 = 118,
1368c2ecf20Sopenharmony_ci	VF610_PAD_PTE14 = 119,
1378c2ecf20Sopenharmony_ci	VF610_PAD_PTE15 = 120,
1388c2ecf20Sopenharmony_ci	VF610_PAD_PTE16 = 121,
1398c2ecf20Sopenharmony_ci	VF610_PAD_PTE17 = 122,
1408c2ecf20Sopenharmony_ci	VF610_PAD_PTE18 = 123,
1418c2ecf20Sopenharmony_ci	VF610_PAD_PTE19 = 124,
1428c2ecf20Sopenharmony_ci	VF610_PAD_PTE20 = 125,
1438c2ecf20Sopenharmony_ci	VF610_PAD_PTE21 = 126,
1448c2ecf20Sopenharmony_ci	VF610_PAD_PTE22 = 127,
1458c2ecf20Sopenharmony_ci	VF610_PAD_PTE23 = 128,
1468c2ecf20Sopenharmony_ci	VF610_PAD_PTE24 = 129,
1478c2ecf20Sopenharmony_ci	VF610_PAD_PTE25 = 130,
1488c2ecf20Sopenharmony_ci	VF610_PAD_PTE26 = 131,
1498c2ecf20Sopenharmony_ci	VF610_PAD_PTE27 = 132,
1508c2ecf20Sopenharmony_ci	VF610_PAD_PTE28 = 133,
1518c2ecf20Sopenharmony_ci	VF610_PAD_PTA7 = 134,
1528c2ecf20Sopenharmony_ci};
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci/* Pad names for the pinmux subsystem */
1558c2ecf20Sopenharmony_cistatic const struct pinctrl_pin_desc vf610_pinctrl_pads[] = {
1568c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA6),
1578c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA8),
1588c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA9),
1598c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA10),
1608c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA11),
1618c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA12),
1628c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA16),
1638c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA17),
1648c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA18),
1658c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA19),
1668c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA20),
1678c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA21),
1688c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA22),
1698c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA23),
1708c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA24),
1718c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA25),
1728c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA26),
1738c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA27),
1748c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA28),
1758c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA29),
1768c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA30),
1778c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA31),
1788c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB0),
1798c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB1),
1808c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB2),
1818c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB3),
1828c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB4),
1838c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB5),
1848c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB6),
1858c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB7),
1868c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB8),
1878c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB9),
1888c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB10),
1898c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB11),
1908c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB12),
1918c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB13),
1928c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB14),
1938c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB15),
1948c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB16),
1958c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB17),
1968c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB18),
1978c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB19),
1988c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB20),
1998c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB21),
2008c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB22),
2018c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC0),
2028c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC1),
2038c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC2),
2048c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC3),
2058c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC4),
2068c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC5),
2078c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC6),
2088c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC7),
2098c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC8),
2108c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC9),
2118c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC10),
2128c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC11),
2138c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC12),
2148c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC13),
2158c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC14),
2168c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC15),
2178c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC16),
2188c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC17),
2198c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD31),
2208c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD30),
2218c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD29),
2228c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD28),
2238c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD27),
2248c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD26),
2258c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD25),
2268c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD24),
2278c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD23),
2288c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD22),
2298c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD21),
2308c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD20),
2318c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD19),
2328c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD18),
2338c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD17),
2348c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD16),
2358c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD0),
2368c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD1),
2378c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD2),
2388c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD3),
2398c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD4),
2408c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD5),
2418c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD6),
2428c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD7),
2438c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD8),
2448c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD9),
2458c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD10),
2468c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD11),
2478c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD12),
2488c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTD13),
2498c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB23),
2508c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB24),
2518c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB25),
2528c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB26),
2538c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB27),
2548c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTB28),
2558c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC26),
2568c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC27),
2578c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC28),
2588c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC29),
2598c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC30),
2608c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTC31),
2618c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE0),
2628c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE1),
2638c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE2),
2648c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE3),
2658c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE4),
2668c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE5),
2678c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE6),
2688c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE7),
2698c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE8),
2708c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE9),
2718c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE10),
2728c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE11),
2738c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE12),
2748c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE13),
2758c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE14),
2768c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE15),
2778c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE16),
2788c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE17),
2798c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE18),
2808c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE19),
2818c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE20),
2828c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE21),
2838c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE22),
2848c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE23),
2858c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE24),
2868c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE25),
2878c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE26),
2888c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE27),
2898c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTE28),
2908c2ecf20Sopenharmony_ci	IMX_PINCTRL_PIN(VF610_PAD_PTA7),
2918c2ecf20Sopenharmony_ci};
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_cistatic int vf610_pmx_gpio_set_direction(struct pinctrl_dev *pctldev,
2948c2ecf20Sopenharmony_ci					struct pinctrl_gpio_range *range,
2958c2ecf20Sopenharmony_ci					unsigned offset, bool input)
2968c2ecf20Sopenharmony_ci{
2978c2ecf20Sopenharmony_ci	struct imx_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev);
2988c2ecf20Sopenharmony_ci	const struct imx_pin_reg *pin_reg;
2998c2ecf20Sopenharmony_ci	u32 reg;
3008c2ecf20Sopenharmony_ci
3018c2ecf20Sopenharmony_ci	pin_reg = &ipctl->pin_regs[offset];
3028c2ecf20Sopenharmony_ci	if (pin_reg->mux_reg == -1)
3038c2ecf20Sopenharmony_ci		return -EINVAL;
3048c2ecf20Sopenharmony_ci
3058c2ecf20Sopenharmony_ci	/* IBE always enabled allows us to read the value "on the wire" */
3068c2ecf20Sopenharmony_ci	reg = readl(ipctl->base + pin_reg->mux_reg);
3078c2ecf20Sopenharmony_ci	if (input)
3088c2ecf20Sopenharmony_ci		reg &= ~0x2;
3098c2ecf20Sopenharmony_ci	else
3108c2ecf20Sopenharmony_ci		reg |= 0x2;
3118c2ecf20Sopenharmony_ci	writel(reg, ipctl->base + pin_reg->mux_reg);
3128c2ecf20Sopenharmony_ci
3138c2ecf20Sopenharmony_ci	return 0;
3148c2ecf20Sopenharmony_ci}
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_cistatic const struct imx_pinctrl_soc_info vf610_pinctrl_info = {
3178c2ecf20Sopenharmony_ci	.pins = vf610_pinctrl_pads,
3188c2ecf20Sopenharmony_ci	.npins = ARRAY_SIZE(vf610_pinctrl_pads),
3198c2ecf20Sopenharmony_ci	.flags = SHARE_MUX_CONF_REG | ZERO_OFFSET_VALID,
3208c2ecf20Sopenharmony_ci	.gpio_set_direction = vf610_pmx_gpio_set_direction,
3218c2ecf20Sopenharmony_ci	.mux_mask = 0x700000,
3228c2ecf20Sopenharmony_ci	.mux_shift = 20,
3238c2ecf20Sopenharmony_ci};
3248c2ecf20Sopenharmony_ci
3258c2ecf20Sopenharmony_cistatic const struct of_device_id vf610_pinctrl_of_match[] = {
3268c2ecf20Sopenharmony_ci	{ .compatible = "fsl,vf610-iomuxc", },
3278c2ecf20Sopenharmony_ci	{ /* sentinel */ }
3288c2ecf20Sopenharmony_ci};
3298c2ecf20Sopenharmony_ci
3308c2ecf20Sopenharmony_cistatic int vf610_pinctrl_probe(struct platform_device *pdev)
3318c2ecf20Sopenharmony_ci{
3328c2ecf20Sopenharmony_ci	return imx_pinctrl_probe(pdev, &vf610_pinctrl_info);
3338c2ecf20Sopenharmony_ci}
3348c2ecf20Sopenharmony_ci
3358c2ecf20Sopenharmony_cistatic struct platform_driver vf610_pinctrl_driver = {
3368c2ecf20Sopenharmony_ci	.driver = {
3378c2ecf20Sopenharmony_ci		.name = "vf610-pinctrl",
3388c2ecf20Sopenharmony_ci		.of_match_table = vf610_pinctrl_of_match,
3398c2ecf20Sopenharmony_ci	},
3408c2ecf20Sopenharmony_ci	.probe = vf610_pinctrl_probe,
3418c2ecf20Sopenharmony_ci};
3428c2ecf20Sopenharmony_ci
3438c2ecf20Sopenharmony_cistatic int __init vf610_pinctrl_init(void)
3448c2ecf20Sopenharmony_ci{
3458c2ecf20Sopenharmony_ci	return platform_driver_register(&vf610_pinctrl_driver);
3468c2ecf20Sopenharmony_ci}
3478c2ecf20Sopenharmony_ciarch_initcall(vf610_pinctrl_init);
348