pinctrl-atlas7.c 197 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911 2912 2913 2914 2915 2916 2917 2918 2919 2920 2921 2922 2923 2924 2925 2926 2927 2928 2929 2930 2931 2932 2933 2934 2935 2936 2937 2938 2939 2940 2941 2942 2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976 2977 2978 2979 2980 2981 2982 2983 2984 2985 2986 2987 2988 2989 2990 2991 2992 2993 2994 2995 2996 2997 2998 2999 3000 3001 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 3028 3029 3030 3031 3032 3033 3034 3035 3036 3037 3038 3039 3040 3041 3042 3043 3044 3045 3046 3047 3048 3049 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 3090 3091 3092 3093 3094 3095 3096 3097 3098 3099 3100 3101 3102 3103 3104 3105 3106 3107 3108 3109 3110 3111 3112 3113 3114 3115 3116 3117 3118 3119 3120 3121 3122 3123 3124 3125 3126 3127 3128 3129 3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 3160 3161 3162 3163 3164 3165 3166 3167 3168 3169 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 3190 3191 3192 3193 3194 3195 3196 3197 3198 3199 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 3220 3221 3222 3223 3224 3225 3226 3227 3228 3229 3230 3231 3232 3233 3234 3235 3236 3237 3238 3239 3240 3241 3242 3243 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142
/*
 * pinctrl pads, groups, functions for CSR SiRFatlasVII
 *
 * Copyright (c) 2011 - 2014 Cambridge Silicon Radio Limited, a CSR plc group
 * company.
 *
 * Licensed under GPLv2 or later.
 */

#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/io.h>
#include <linux/bitops.h>
#include <linux/irq.h>
#include <linux/slab.h>
#include <linux/clk.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/of_device.h>
#include <linux/of_platform.h>
#include <linux/of_irq.h>
#include <linux/of_gpio.h>
#include <linux/pinctrl/machine.h>
#include <linux/pinctrl/pinconf.h>
#include <linux/pinctrl/pinctrl.h>
#include <linux/pinctrl/pinmux.h>
#include <linux/pinctrl/consumer.h>
#include <linux/pinctrl/pinconf-generic.h>
#include <linux/gpio.h>

/* Definition of Pad&Mux Properties */
#define N 0

/* The Bank contains input-disable regisgers */
#define BANK_DS	0

/* Clear Register offset */
#define CLR_REG(r)	((r) + 0x04)

/* Definition of multiple function select register */
#define FUNC_CLEAR_MASK		0x7
#define FUNC_GPIO		0
#define FUNC_ANALOGUE		0x8
#define ANA_CLEAR_MASK		0x1

/* The Atlas7's Pad Type List */
enum altas7_pad_type {
	PAD_T_4WE_PD = 0,	/* ZIO_PAD3V_4WE_PD */
	PAD_T_4WE_PU,		/* ZIO_PAD3V_4WE_PD */
	PAD_T_16ST,		/* ZIO_PAD3V_SDCLK_PD */
	PAD_T_M31_0204_PD,	/* PRDW0204SDGZ_M311311_PD */
	PAD_T_M31_0204_PU,	/* PRDW0204SDGZ_M311311_PU */
	PAD_T_M31_0610_PD,	/* PRUW0610SDGZ_M311311_PD */
	PAD_T_M31_0610_PU,	/* PRUW0610SDGZ_M311311_PU */
	PAD_T_AD,		/* PRDWUWHW08SCDG_HZ */
};

/* Raw value of Driver-Strength Bits */
#define DS3	BIT(3)
#define DS2	BIT(2)
#define DS1	BIT(1)
#define DS0	BIT(0)
#define DSZ	0

/* Drive-Strength Intermediate Values */
#define DS_NULL		-1
#define DS_1BIT_IM_VAL  DS0
#define DS_1BIT_MASK	0x1
#define DS_2BIT_IM_VAL  (DS1 | DS0)
#define DS_2BIT_MASK	0x3
#define DS_4BIT_IM_VAL	(DS3 | DS2 | DS1 | DS0)
#define DS_4BIT_MASK	0xf

/* The Drive-Strength of 4WE Pad		 DS1  0  CO */
#define DS_4WE_3   (DS1 | DS0)			/* 1  1  3  */
#define DS_4WE_2   (DS1)			/* 1  0  2  */
#define DS_4WE_1   (DS0)			/* 0  1  1  */
#define DS_4WE_0   (DSZ)			/* 0  0  0  */

/* The Drive-Strength of 16st Pad		 DS3  2  1  0  CO */
#define DS_16ST_15  (DS3 | DS2 | DS1 | DS0)	/* 1  1  1  1  15 */
#define DS_16ST_14  (DS3 | DS2 | DS0)		/* 1  1  0  1  13 */
#define DS_16ST_13  (DS3 | DS2 | DS1)		/* 1  1  1  0  14 */
#define DS_16ST_12  (DS2 | DS1 | DS0)		/* 0  1  1  1  7  */
#define DS_16ST_11  (DS2 | DS0)			/* 0  1  0  1  5  */
#define DS_16ST_10  (DS3 | DS1 | DS0)		/* 1  0  1  1  11 */
#define DS_16ST_9   (DS3 | DS0)			/* 1  0  0  1  9  */
#define DS_16ST_8   (DS1 | DS0)			/* 0  0  1  1  3  */
#define DS_16ST_7   (DS2 | DS1)			/* 0  1  1  0  6  */
#define DS_16ST_6   (DS3 | DS2)			/* 1  1  0  0  12 */
#define DS_16ST_5   (DS2)			/* 0  1  0  0  4  */
#define DS_16ST_4   (DS3 | DS1)			/* 1  0  1  0  10 */
#define DS_16ST_3   (DS1)			/* 0  0  1  0  2  */
#define DS_16ST_2   (DS0)			/* 0  0  0  1  1  */
#define DS_16ST_1   (DSZ)			/* 0  0  0  0  0  */
#define DS_16ST_0   (DS3)			/* 1  0  0  0  8  */

/* The Drive-Strength of M31 Pad		 DS0  CO */
#define DS_M31_0   (DSZ)			/* 0  0  */
#define DS_M31_1   (DS0)			/* 1  1  */

/* Raw values of Pull Option Bits */
#define PUN	BIT(1)
#define PD	BIT(0)
#define PE	BIT(0)
#define PZ	0

/* Definition of Pull Types */
#define PULL_UP		0
#define HIGH_HYSTERESIS 1
#define HIGH_Z		2
#define PULL_DOWN	3
#define PULL_DISABLE	4
#define PULL_ENABLE	5
#define PULL_UNKNOWN	-1

/* Pull Options for 4WE Pad			  PUN  PD  CO */
#define P4WE_PULL_MASK		0x3
#define P4WE_PULL_DOWN		(PUN | PD)	/* 1   1   3  */
#define P4WE_HIGH_Z		(PUN)		/* 1   0   2  */
#define P4WE_HIGH_HYSTERESIS	(PD)		/* 0   1   1  */
#define P4WE_PULL_UP		(PZ)		/* 0   0   0  */

/* Pull Options for 16ST Pad			  PUN  PD  CO */
#define P16ST_PULL_MASK		0x3
#define P16ST_PULL_DOWN		(PUN | PD)	/* 1   1   3  */
#define P16ST_HIGH_Z		(PUN)		/* 1   0   2  */
#define P16ST_PULL_UP		(PZ)		/* 0   0   0  */

/* Pull Options for M31 Pad			  PE */
#define PM31_PULL_MASK		0x1
#define PM31_PULL_ENABLED	(PE)		/* 1 */
#define PM31_PULL_DISABLED	(PZ)		/* 0 */

/* Pull Options for A/D Pad			  PUN  PD  CO */
#define PANGD_PULL_MASK		0x3
#define PANGD_PULL_DOWN		(PUN | PD)	/* 1   1   3  */
#define PANGD_HIGH_Z		(PUN)		/* 1   0   2  */
#define PANGD_PULL_UP		(PZ)		/* 0   0   0  */

/* Definition of Input Disable */
#define DI_MASK		0x1
#define DI_DISABLE	0x1
#define DI_ENABLE	0x0

/* Definition of Input Disable Value */
#define DIV_MASK	0x1
#define DIV_DISABLE	0x1
#define DIV_ENABLE	0x0

/* Number of Function input disable registers */
#define NUM_OF_IN_DISABLE_REG	0x2

/* Offset of Function input disable registers */
#define IN_DISABLE_0_REG_SET		0x0A00
#define IN_DISABLE_0_REG_CLR		0x0A04
#define IN_DISABLE_1_REG_SET		0x0A08
#define IN_DISABLE_1_REG_CLR		0x0A0C
#define IN_DISABLE_VAL_0_REG_SET	0x0A80
#define IN_DISABLE_VAL_0_REG_CLR	0x0A84
#define IN_DISABLE_VAL_1_REG_SET	0x0A88
#define IN_DISABLE_VAL_1_REG_CLR	0x0A8C

struct dt_params {
	const char *property;
	int value;
};

/**
 * struct atlas7_pad_conf - Atlas7 Pad Configuration
 * @id			The ID of this Pad.
 * @type:		The type of this Pad.
 * @mux_reg:		The mux register offset.
 *			This register contains the mux.
 * @pupd_reg:		The pull-up/down register offset.
 * @drvstr_reg:		The drive-strength register offset.
 * @ad_ctrl_reg:	The Analogue/Digital Control register.
 *
 * @mux_bit:		The start bit of mux register.
 * @pupd_bit:		The start bit of pull-up/down register.
 * @drvstr_bit:		The start bit of drive-strength register.
 * @ad_ctrl_bit:	The start bit of analogue/digital register.
 */
struct atlas7_pad_config {
	const u32 id;
	u32 type;
	u32 mux_reg;
	u32 pupd_reg;
	u32 drvstr_reg;
	u32 ad_ctrl_reg;
	/* bits in register */
	u8 mux_bit;
	u8 pupd_bit;
	u8 drvstr_bit;
	u8 ad_ctrl_bit;
};

#define PADCONF(pad, t, mr, pr, dsr, adr, mb, pb, dsb, adb)	\
	{							\
		.id = pad,					\
		.type = t,					\
		.mux_reg = mr,					\
		.pupd_reg = pr,					\
		.drvstr_reg = dsr,				\
		.ad_ctrl_reg = adr,				\
		.mux_bit = mb,					\
		.pupd_bit = pb,					\
		.drvstr_bit = dsb,				\
		.ad_ctrl_bit = adb,				\
	}

/**
 * struct atlas7_pad_status - Atlas7 Pad status
 */
struct atlas7_pad_status {
	u8 func;
	u8 pull;
	u8 dstr;
	u8 reserved;
};

/**
 * struct atlas7_pad_mux - Atlas7 mux
 * @bank:		The bank of this pad's registers on.
 * @pin	:		The ID of this Pad.
 * @func:		The mux func on this Pad.
 * @dinput_reg:		The Input-Disable register offset.
 * @dinput_bit:		The start bit of Input-Disable register.
 * @dinput_val_reg:	The Input-Disable-value register offset.
 *			This register is used to set the value of this pad
 *			if this pad was disabled.
 * @dinput_val_bit:	The start bit of Input-Disable Value register.
 */
struct atlas7_pad_mux {
	u32 bank;
	u32 pin;
	u32 func;
	u32 dinput_reg;
	u32 dinput_bit;
	u32 dinput_val_reg;
	u32 dinput_val_bit;
};

#define MUX(b, pad, f, dr, db, dvr, dvb)	\
	{					\
		.bank = b,			\
		.pin = pad,			\
		.func = f,			\
		.dinput_reg = dr,		\
		.dinput_bit = db,		\
		.dinput_val_reg = dvr,		\
		.dinput_val_bit = dvb,		\
	}

struct atlas7_grp_mux {
	unsigned int group;
	unsigned int pad_mux_count;
	const struct atlas7_pad_mux *pad_mux_list;
};

 /**
 * struct sirfsoc_pin_group - describes a SiRFprimaII pin group
 * @name: the name of this specific pin group
 * @pins: an array of discrete physical pins used in this group, taken
 *	from the driver-local pin enumeration space
 * @num_pins: the number of pins in this group array, i.e. the number of
 *	elements in .pins so we can iterate over that array
 */
struct atlas7_pin_group {
	const char *name;
	const unsigned int *pins;
	const unsigned num_pins;
};

#define GROUP(n, p)  \
	{			\
		.name = n,	\
		.pins = p,	\
		.num_pins = ARRAY_SIZE(p),	\
	}

struct atlas7_pmx_func {
	const char *name;
	const char * const *groups;
	const unsigned num_groups;
	const struct atlas7_grp_mux *grpmux;
};

#define FUNCTION(n, g, m)		\
	{					\
		.name = n,			\
		.groups = g,			\
		.num_groups = ARRAY_SIZE(g),	\
		.grpmux = m,			\
	}

struct atlas7_pinctrl_data {
	struct pinctrl_pin_desc *pads;
	int pads_cnt;
	struct atlas7_pin_group *grps;
	int grps_cnt;
	struct atlas7_pmx_func *funcs;
	int funcs_cnt;
	struct atlas7_pad_config *confs;
	int confs_cnt;
};

/* Platform info of atlas7 pinctrl */
#define ATLAS7_PINCTRL_REG_BANKS	2
#define ATLAS7_PINCTRL_BANK_0_PINS	18
#define ATLAS7_PINCTRL_BANK_1_PINS	141
#define ATLAS7_PINCTRL_TOTAL_PINS	\
	(ATLAS7_PINCTRL_BANK_0_PINS + ATLAS7_PINCTRL_BANK_1_PINS)

/**
 * Atlas7 GPIO Chip
 */

#define NGPIO_OF_BANK		32
#define GPIO_TO_BANK(gpio)	((gpio) / NGPIO_OF_BANK)

/* Registers of GPIO Controllers */
#define ATLAS7_GPIO_BASE(g, b)		((g)->reg + 0x100 * (b))
#define ATLAS7_GPIO_CTRL(b, i)		((b)->base + 4 * (i))
#define ATLAS7_GPIO_INT_STATUS(b)	((b)->base + 0x8C)

/* Definition bits of GPIO Control Registers */
#define ATLAS7_GPIO_CTL_INTR_LOW_MASK		BIT(0)
#define ATLAS7_GPIO_CTL_INTR_HIGH_MASK		BIT(1)
#define ATLAS7_GPIO_CTL_INTR_TYPE_MASK		BIT(2)
#define ATLAS7_GPIO_CTL_INTR_EN_MASK		BIT(3)
#define ATLAS7_GPIO_CTL_INTR_STATUS_MASK	BIT(4)
#define ATLAS7_GPIO_CTL_OUT_EN_MASK		BIT(5)
#define ATLAS7_GPIO_CTL_DATAOUT_MASK		BIT(6)
#define ATLAS7_GPIO_CTL_DATAIN_MASK		BIT(7)

struct atlas7_gpio_bank {
	struct pinctrl_dev *pctldev;
	int id;
	int irq;
	void __iomem *base;
	unsigned int gpio_offset;
	unsigned int ngpio;
	const unsigned int *gpio_pins;
	u32 sleep_data[NGPIO_OF_BANK];
};

struct atlas7_gpio_chip {
	const char *name;
	void __iomem *reg;
	struct clk *clk;
	int nbank;
	spinlock_t lock;
	struct gpio_chip chip;
	struct atlas7_gpio_bank banks[0];
};

static inline struct atlas7_gpio_chip *to_atlas7_gpio(struct gpio_chip *gc)
{
	return container_of(gc, struct atlas7_gpio_chip, chip);
}

/**
 * @dev: a pointer back to containing device
 * @virtbase: the offset to the controller in virtual memory
 */
struct atlas7_pmx {
	struct device *dev;
	struct pinctrl_dev *pctl;
	struct pinctrl_desc pctl_desc;
	struct atlas7_pinctrl_data *pctl_data;
	void __iomem *regs[ATLAS7_PINCTRL_REG_BANKS];
	u32 status_ds[NUM_OF_IN_DISABLE_REG];
	u32 status_dsv[NUM_OF_IN_DISABLE_REG];
	struct atlas7_pad_status sleep_data[ATLAS7_PINCTRL_TOTAL_PINS];
};

/*
 * Pad list for the pinmux subsystem
 * refer to A7DA IO Summary - CS-314158-DD-4E.xls
 */

/*Pads in IOC RTC & TOP */
static const struct pinctrl_pin_desc atlas7_ioc_pads[] = {
	/* RTC PADs */
	PINCTRL_PIN(0, "rtc_gpio_0"),
	PINCTRL_PIN(1, "rtc_gpio_1"),
	PINCTRL_PIN(2, "rtc_gpio_2"),
	PINCTRL_PIN(3, "rtc_gpio_3"),
	PINCTRL_PIN(4, "low_bat_ind_b"),
	PINCTRL_PIN(5, "on_key_b"),
	PINCTRL_PIN(6, "ext_on"),
	PINCTRL_PIN(7, "mem_on"),
	PINCTRL_PIN(8, "core_on"),
	PINCTRL_PIN(9, "io_on"),
	PINCTRL_PIN(10, "can0_tx"),
	PINCTRL_PIN(11, "can0_rx"),
	PINCTRL_PIN(12, "spi0_clk"),
	PINCTRL_PIN(13, "spi0_cs_b"),
	PINCTRL_PIN(14, "spi0_io_0"),
	PINCTRL_PIN(15, "spi0_io_1"),
	PINCTRL_PIN(16, "spi0_io_2"),
	PINCTRL_PIN(17, "spi0_io_3"),

	/* TOP PADs */
	PINCTRL_PIN(18, "spi1_en"),
	PINCTRL_PIN(19, "spi1_clk"),
	PINCTRL_PIN(20, "spi1_din"),
	PINCTRL_PIN(21, "spi1_dout"),
	PINCTRL_PIN(22, "trg_spi_clk"),
	PINCTRL_PIN(23, "trg_spi_di"),
	PINCTRL_PIN(24, "trg_spi_do"),
	PINCTRL_PIN(25, "trg_spi_cs_b"),
	PINCTRL_PIN(26, "trg_acq_d1"),
	PINCTRL_PIN(27, "trg_irq_b"),
	PINCTRL_PIN(28, "trg_acq_d0"),
	PINCTRL_PIN(29, "trg_acq_clk"),
	PINCTRL_PIN(30, "trg_shutdown_b_out"),
	PINCTRL_PIN(31, "sdio2_clk"),
	PINCTRL_PIN(32, "sdio2_cmd"),
	PINCTRL_PIN(33, "sdio2_dat_0"),
	PINCTRL_PIN(34, "sdio2_dat_1"),
	PINCTRL_PIN(35, "sdio2_dat_2"),
	PINCTRL_PIN(36, "sdio2_dat_3"),
	PINCTRL_PIN(37, "df_ad_7"),
	PINCTRL_PIN(38, "df_ad_6"),
	PINCTRL_PIN(39, "df_ad_5"),
	PINCTRL_PIN(40, "df_ad_4"),
	PINCTRL_PIN(41, "df_ad_3"),
	PINCTRL_PIN(42, "df_ad_2"),
	PINCTRL_PIN(43, "df_ad_1"),
	PINCTRL_PIN(44, "df_ad_0"),
	PINCTRL_PIN(45, "df_dqs"),
	PINCTRL_PIN(46, "df_cle"),
	PINCTRL_PIN(47, "df_ale"),
	PINCTRL_PIN(48, "df_we_b"),
	PINCTRL_PIN(49, "df_re_b"),
	PINCTRL_PIN(50, "df_ry_by"),
	PINCTRL_PIN(51, "df_cs_b_1"),
	PINCTRL_PIN(52, "df_cs_b_0"),
	PINCTRL_PIN(53, "l_pclk"),
	PINCTRL_PIN(54, "l_lck"),
	PINCTRL_PIN(55, "l_fck"),
	PINCTRL_PIN(56, "l_de"),
	PINCTRL_PIN(57, "ldd_0"),
	PINCTRL_PIN(58, "ldd_1"),
	PINCTRL_PIN(59, "ldd_2"),
	PINCTRL_PIN(60, "ldd_3"),
	PINCTRL_PIN(61, "ldd_4"),
	PINCTRL_PIN(62, "ldd_5"),
	PINCTRL_PIN(63, "ldd_6"),
	PINCTRL_PIN(64, "ldd_7"),
	PINCTRL_PIN(65, "ldd_8"),
	PINCTRL_PIN(66, "ldd_9"),
	PINCTRL_PIN(67, "ldd_10"),
	PINCTRL_PIN(68, "ldd_11"),
	PINCTRL_PIN(69, "ldd_12"),
	PINCTRL_PIN(70, "ldd_13"),
	PINCTRL_PIN(71, "ldd_14"),
	PINCTRL_PIN(72, "ldd_15"),
	PINCTRL_PIN(73, "lcd_gpio_20"),
	PINCTRL_PIN(74, "vip_0"),
	PINCTRL_PIN(75, "vip_1"),
	PINCTRL_PIN(76, "vip_2"),
	PINCTRL_PIN(77, "vip_3"),
	PINCTRL_PIN(78, "vip_4"),
	PINCTRL_PIN(79, "vip_5"),
	PINCTRL_PIN(80, "vip_6"),
	PINCTRL_PIN(81, "vip_7"),
	PINCTRL_PIN(82, "vip_pxclk"),
	PINCTRL_PIN(83, "vip_hsync"),
	PINCTRL_PIN(84, "vip_vsync"),
	PINCTRL_PIN(85, "sdio3_clk"),
	PINCTRL_PIN(86, "sdio3_cmd"),
	PINCTRL_PIN(87, "sdio3_dat_0"),
	PINCTRL_PIN(88, "sdio3_dat_1"),
	PINCTRL_PIN(89, "sdio3_dat_2"),
	PINCTRL_PIN(90, "sdio3_dat_3"),
	PINCTRL_PIN(91, "sdio5_clk"),
	PINCTRL_PIN(92, "sdio5_cmd"),
	PINCTRL_PIN(93, "sdio5_dat_0"),
	PINCTRL_PIN(94, "sdio5_dat_1"),
	PINCTRL_PIN(95, "sdio5_dat_2"),
	PINCTRL_PIN(96, "sdio5_dat_3"),
	PINCTRL_PIN(97, "rgmii_txd_0"),
	PINCTRL_PIN(98, "rgmii_txd_1"),
	PINCTRL_PIN(99, "rgmii_txd_2"),
	PINCTRL_PIN(100, "rgmii_txd_3"),
	PINCTRL_PIN(101, "rgmii_txclk"),
	PINCTRL_PIN(102, "rgmii_tx_ctl"),
	PINCTRL_PIN(103, "rgmii_rxd_0"),
	PINCTRL_PIN(104, "rgmii_rxd_1"),
	PINCTRL_PIN(105, "rgmii_rxd_2"),
	PINCTRL_PIN(106, "rgmii_rxd_3"),
	PINCTRL_PIN(107, "rgmii_rx_clk"),
	PINCTRL_PIN(108, "rgmii_rxc_ctl"),
	PINCTRL_PIN(109, "rgmii_mdio"),
	PINCTRL_PIN(110, "rgmii_mdc"),
	PINCTRL_PIN(111, "rgmii_intr_n"),
	PINCTRL_PIN(112, "i2s_mclk"),
	PINCTRL_PIN(113, "i2s_bclk"),
	PINCTRL_PIN(114, "i2s_ws"),
	PINCTRL_PIN(115, "i2s_dout0"),
	PINCTRL_PIN(116, "i2s_dout1"),
	PINCTRL_PIN(117, "i2s_dout2"),
	PINCTRL_PIN(118, "i2s_din"),
	PINCTRL_PIN(119, "gpio_0"),
	PINCTRL_PIN(120, "gpio_1"),
	PINCTRL_PIN(121, "gpio_2"),
	PINCTRL_PIN(122, "gpio_3"),
	PINCTRL_PIN(123, "gpio_4"),
	PINCTRL_PIN(124, "gpio_5"),
	PINCTRL_PIN(125, "gpio_6"),
	PINCTRL_PIN(126, "gpio_7"),
	PINCTRL_PIN(127, "sda_0"),
	PINCTRL_PIN(128, "scl_0"),
	PINCTRL_PIN(129, "coex_pio_0"),
	PINCTRL_PIN(130, "coex_pio_1"),
	PINCTRL_PIN(131, "coex_pio_2"),
	PINCTRL_PIN(132, "coex_pio_3"),
	PINCTRL_PIN(133, "uart0_tx"),
	PINCTRL_PIN(134, "uart0_rx"),
	PINCTRL_PIN(135, "uart1_tx"),
	PINCTRL_PIN(136, "uart1_rx"),
	PINCTRL_PIN(137, "uart3_tx"),
	PINCTRL_PIN(138, "uart3_rx"),
	PINCTRL_PIN(139, "uart4_tx"),
	PINCTRL_PIN(140, "uart4_rx"),
	PINCTRL_PIN(141, "usp0_clk"),
	PINCTRL_PIN(142, "usp0_tx"),
	PINCTRL_PIN(143, "usp0_rx"),
	PINCTRL_PIN(144, "usp0_fs"),
	PINCTRL_PIN(145, "usp1_clk"),
	PINCTRL_PIN(146, "usp1_tx"),
	PINCTRL_PIN(147, "usp1_rx"),
	PINCTRL_PIN(148, "usp1_fs"),
	PINCTRL_PIN(149, "lvds_tx0d4p"),
	PINCTRL_PIN(150, "lvds_tx0d4n"),
	PINCTRL_PIN(151, "lvds_tx0d3p"),
	PINCTRL_PIN(152, "lvds_tx0d3n"),
	PINCTRL_PIN(153, "lvds_tx0d2p"),
	PINCTRL_PIN(154, "lvds_tx0d2n"),
	PINCTRL_PIN(155, "lvds_tx0d1p"),
	PINCTRL_PIN(156, "lvds_tx0d1n"),
	PINCTRL_PIN(157, "lvds_tx0d0p"),
	PINCTRL_PIN(158, "lvds_tx0d0n"),
	PINCTRL_PIN(159, "jtag_tdo"),
	PINCTRL_PIN(160, "jtag_tms"),
	PINCTRL_PIN(161, "jtag_tck"),
	PINCTRL_PIN(162, "jtag_tdi"),
	PINCTRL_PIN(163, "jtag_trstn"),
};

struct atlas7_pad_config atlas7_ioc_pad_confs[] = {
	/* The Configuration of IOC_RTC Pads */
	PADCONF(0, 3, 0x0, 0x100, 0x200, -1, 0, 0, 0, 0),
	PADCONF(1, 3, 0x0, 0x100, 0x200, -1, 4, 2, 2, 0),
	PADCONF(2, 3, 0x0, 0x100, 0x200, -1, 8, 4, 4, 0),
	PADCONF(3, 5, 0x0, 0x100, 0x200, -1, 12, 6, 6, 0),
	PADCONF(4, 4, 0x0, 0x100, 0x200, -1, 16, 8, 8, 0),
	PADCONF(5, 4, 0x0, 0x100, 0x200, -1, 20, 10, 10, 0),
	PADCONF(6, 3, 0x0, 0x100, 0x200, -1, 24, 12, 12, 0),
	PADCONF(7, 3, 0x0, 0x100, 0x200, -1, 28, 14, 14, 0),
	PADCONF(8, 3, 0x8, 0x100, 0x200, -1, 0, 16, 16, 0),
	PADCONF(9, 3, 0x8, 0x100, 0x200, -1, 4, 18, 18, 0),
	PADCONF(10, 4, 0x8, 0x100, 0x200, -1, 8, 20, 20, 0),
	PADCONF(11, 4, 0x8, 0x100, 0x200, -1, 12, 22, 22, 0),
	PADCONF(12, 5, 0x8, 0x100, 0x200, -1, 16, 24, 24, 0),
	PADCONF(13, 6, 0x8, 0x100, 0x200, -1, 20, 26, 26, 0),
	PADCONF(14, 5, 0x8, 0x100, 0x200, -1, 24, 28, 28, 0),
	PADCONF(15, 5, 0x8, 0x100, 0x200, -1, 28, 30, 30, 0),
	PADCONF(16, 5, 0x10, 0x108, 0x208, -1, 0, 0, 0, 0),
	PADCONF(17, 5, 0x10, 0x108, 0x208, -1, 4, 2, 2, 0),
	/* The Configuration of IOC_TOP Pads */
	PADCONF(18, 5, 0x80, 0x180, 0x300, -1, 0, 0, 0, 0),
	PADCONF(19, 5, 0x80, 0x180, 0x300, -1, 4, 2, 2, 0),
	PADCONF(20, 5, 0x80, 0x180, 0x300, -1, 8, 4, 4, 0),
	PADCONF(21, 5, 0x80, 0x180, 0x300, -1, 12, 6, 6, 0),
	PADCONF(22, 5, 0x88, 0x188, 0x308, -1, 0, 0, 0, 0),
	PADCONF(23, 5, 0x88, 0x188, 0x308, -1, 4, 2, 2, 0),
	PADCONF(24, 5, 0x88, 0x188, 0x308, -1, 8, 4, 4, 0),
	PADCONF(25, 6, 0x88, 0x188, 0x308, -1, 12, 6, 6, 0),
	PADCONF(26, 5, 0x88, 0x188, 0x308, -1, 16, 8, 8, 0),
	PADCONF(27, 6, 0x88, 0x188, 0x308, -1, 20, 10, 10, 0),
	PADCONF(28, 5, 0x88, 0x188, 0x308, -1, 24, 12, 12, 0),
	PADCONF(29, 5, 0x88, 0x188, 0x308, -1, 28, 14, 14, 0),
	PADCONF(30, 5, 0x90, 0x188, 0x308, -1, 0, 16, 16, 0),
	PADCONF(31, 2, 0x98, 0x190, 0x310, -1, 0, 0, 0, 0),
	PADCONF(32, 1, 0x98, 0x190, 0x310, -1, 4, 2, 4, 0),
	PADCONF(33, 1, 0x98, 0x190, 0x310, -1, 8, 4, 6, 0),
	PADCONF(34, 1, 0x98, 0x190, 0x310, -1, 12, 6, 8, 0),
	PADCONF(35, 1, 0x98, 0x190, 0x310, -1, 16, 8, 10, 0),
	PADCONF(36, 1, 0x98, 0x190, 0x310, -1, 20, 10, 12, 0),
	PADCONF(37, 1, 0xa0, 0x198, 0x318, -1, 0, 0, 0, 0),
	PADCONF(38, 1, 0xa0, 0x198, 0x318, -1, 4, 2, 2, 0),
	PADCONF(39, 1, 0xa0, 0x198, 0x318, -1, 8, 4, 4, 0),
	PADCONF(40, 1, 0xa0, 0x198, 0x318, -1, 12, 6, 6, 0),
	PADCONF(41, 1, 0xa0, 0x198, 0x318, -1, 16, 8, 8, 0),
	PADCONF(42, 1, 0xa0, 0x198, 0x318, -1, 20, 10, 10, 0),
	PADCONF(43, 1, 0xa0, 0x198, 0x318, -1, 24, 12, 12, 0),
	PADCONF(44, 1, 0xa0, 0x198, 0x318, -1, 28, 14, 14, 0),
	PADCONF(45, 0, 0xa8, 0x198, 0x318, -1, 0, 16, 16, 0),
	PADCONF(46, 0, 0xa8, 0x198, 0x318, -1, 4, 18, 18, 0),
	PADCONF(47, 1, 0xa8, 0x198, 0x318, -1, 8, 20, 20, 0),
	PADCONF(48, 1, 0xa8, 0x198, 0x318, -1, 12, 22, 22, 0),
	PADCONF(49, 1, 0xa8, 0x198, 0x318, -1, 16, 24, 24, 0),
	PADCONF(50, 1, 0xa8, 0x198, 0x318, -1, 20, 26, 26, 0),
	PADCONF(51, 1, 0xa8, 0x198, 0x318, -1, 24, 28, 28, 0),
	PADCONF(52, 1, 0xa8, 0x198, 0x318, -1, 28, 30, 30, 0),
	PADCONF(53, 0, 0xb0, 0x1a0, 0x320, -1, 0, 0, 0, 0),
	PADCONF(54, 0, 0xb0, 0x1a0, 0x320, -1, 4, 2, 2, 0),
	PADCONF(55, 0, 0xb0, 0x1a0, 0x320, -1, 8, 4, 4, 0),
	PADCONF(56, 0, 0xb0, 0x1a0, 0x320, -1, 12, 6, 6, 0),
	PADCONF(57, 0, 0xb0, 0x1a0, 0x320, -1, 16, 8, 8, 0),
	PADCONF(58, 0, 0xb0, 0x1a0, 0x320, -1, 20, 10, 10, 0),
	PADCONF(59, 0, 0xb0, 0x1a0, 0x320, -1, 24, 12, 12, 0),
	PADCONF(60, 0, 0xb0, 0x1a0, 0x320, -1, 28, 14, 14, 0),
	PADCONF(61, 0, 0xb8, 0x1a0, 0x320, -1, 0, 16, 16, 0),
	PADCONF(62, 0, 0xb8, 0x1a0, 0x320, -1, 4, 18, 18, 0),
	PADCONF(63, 0, 0xb8, 0x1a0, 0x320, -1, 8, 20, 20, 0),
	PADCONF(64, 0, 0xb8, 0x1a0, 0x320, -1, 12, 22, 22, 0),
	PADCONF(65, 0, 0xb8, 0x1a0, 0x320, -1, 16, 24, 24, 0),
	PADCONF(66, 0, 0xb8, 0x1a0, 0x320, -1, 20, 26, 26, 0),
	PADCONF(67, 0, 0xb8, 0x1a0, 0x320, -1, 24, 28, 28, 0),
	PADCONF(68, 0, 0xb8, 0x1a0, 0x320, -1, 28, 30, 30, 0),
	PADCONF(69, 0, 0xc0, 0x1a8, 0x328, -1, 0, 0, 0, 0),
	PADCONF(70, 0, 0xc0, 0x1a8, 0x328, -1, 4, 2, 2, 0),
	PADCONF(71, 0, 0xc0, 0x1a8, 0x328, -1, 8, 4, 4, 0),
	PADCONF(72, 0, 0xc0, 0x1a8, 0x328, -1, 12, 6, 6, 0),
	PADCONF(73, 0, 0xc0, 0x1a8, 0x328, -1, 16, 8, 8, 0),
	PADCONF(74, 0, 0xc8, 0x1b0, 0x330, -1, 0, 0, 0, 0),
	PADCONF(75, 0, 0xc8, 0x1b0, 0x330, -1, 4, 2, 2, 0),
	PADCONF(76, 0, 0xc8, 0x1b0, 0x330, -1, 8, 4, 4, 0),
	PADCONF(77, 0, 0xc8, 0x1b0, 0x330, -1, 12, 6, 6, 0),
	PADCONF(78, 0, 0xc8, 0x1b0, 0x330, -1, 16, 8, 8, 0),
	PADCONF(79, 0, 0xc8, 0x1b0, 0x330, -1, 20, 10, 10, 0),
	PADCONF(80, 0, 0xc8, 0x1b0, 0x330, -1, 24, 12, 12, 0),
	PADCONF(81, 0, 0xc8, 0x1b0, 0x330, -1, 28, 14, 14, 0),
	PADCONF(82, 0, 0xd0, 0x1b0, 0x330, -1, 0, 16, 16, 0),
	PADCONF(83, 0, 0xd0, 0x1b0, 0x330, -1, 4, 18, 18, 0),
	PADCONF(84, 0, 0xd0, 0x1b0, 0x330, -1, 8, 20, 20, 0),
	PADCONF(85, 2, 0xd8, 0x1b8, 0x338, -1, 0, 0, 0, 0),
	PADCONF(86, 1, 0xd8, 0x1b8, 0x338, -1, 4, 4, 4, 0),
	PADCONF(87, 1, 0xd8, 0x1b8, 0x338, -1, 8, 6, 6, 0),
	PADCONF(88, 1, 0xd8, 0x1b8, 0x338, -1, 12, 8, 8, 0),
	PADCONF(89, 1, 0xd8, 0x1b8, 0x338, -1, 16, 10, 10, 0),
	PADCONF(90, 1, 0xd8, 0x1b8, 0x338, -1, 20, 12, 12, 0),
	PADCONF(91, 2, 0xe0, 0x1c0, 0x340, -1, 0, 0, 0, 0),
	PADCONF(92, 1, 0xe0, 0x1c0, 0x340, -1, 4, 4, 4, 0),
	PADCONF(93, 1, 0xe0, 0x1c0, 0x340, -1, 8, 6, 6, 0),
	PADCONF(94, 1, 0xe0, 0x1c0, 0x340, -1, 12, 8, 8, 0),
	PADCONF(95, 1, 0xe0, 0x1c0, 0x340, -1, 16, 10, 10, 0),
	PADCONF(96, 1, 0xe0, 0x1c0, 0x340, -1, 20, 12, 12, 0),
	PADCONF(97, 0, 0xe8, 0x1c8, 0x348, -1, 0, 0, 0, 0),
	PADCONF(98, 0, 0xe8, 0x1c8, 0x348, -1, 4, 2, 2, 0),
	PADCONF(99, 0, 0xe8, 0x1c8, 0x348, -1, 8, 4, 4, 0),
	PADCONF(100, 0, 0xe8, 0x1c8, 0x348, -1, 12, 6, 6, 0),
	PADCONF(101, 2, 0xe8, 0x1c8, 0x348, -1, 16, 8, 8, 0),
	PADCONF(102, 0, 0xe8, 0x1c8, 0x348, -1, 20, 12, 12, 0),
	PADCONF(103, 0, 0xe8, 0x1c8, 0x348, -1, 24, 14, 14, 0),
	PADCONF(104, 0, 0xe8, 0x1c8, 0x348, -1, 28, 16, 16, 0),
	PADCONF(105, 0, 0xf0, 0x1c8, 0x348, -1, 0, 18, 18, 0),
	PADCONF(106, 0, 0xf0, 0x1c8, 0x348, -1, 4, 20, 20, 0),
	PADCONF(107, 0, 0xf0, 0x1c8, 0x348, -1, 8, 22, 22, 0),
	PADCONF(108, 0, 0xf0, 0x1c8, 0x348, -1, 12, 24, 24, 0),
	PADCONF(109, 1, 0xf0, 0x1c8, 0x348, -1, 16, 26, 26, 0),
	PADCONF(110, 0, 0xf0, 0x1c8, 0x348, -1, 20, 28, 28, 0),
	PADCONF(111, 1, 0xf0, 0x1c8, 0x348, -1, 24, 30, 30, 0),
	PADCONF(112, 5, 0xf8, 0x200, 0x350, -1, 0, 0, 0, 0),
	PADCONF(113, 5, 0xf8, 0x200, 0x350, -1, 4, 2, 2, 0),
	PADCONF(114, 5, 0xf8, 0x200, 0x350, -1, 8, 4, 4, 0),
	PADCONF(115, 5, 0xf8, 0x200, 0x350, -1, 12, 6, 6, 0),
	PADCONF(116, 5, 0xf8, 0x200, 0x350, -1, 16, 8, 8, 0),
	PADCONF(117, 5, 0xf8, 0x200, 0x350, -1, 20, 10, 10, 0),
	PADCONF(118, 5, 0xf8, 0x200, 0x350, -1, 24, 12, 12, 0),
	PADCONF(119, 5, 0x100, 0x250, 0x358, -1, 0, 0, 0, 0),
	PADCONF(120, 5, 0x100, 0x250, 0x358, -1, 4, 2, 2, 0),
	PADCONF(121, 5, 0x100, 0x250, 0x358, -1, 8, 4, 4, 0),
	PADCONF(122, 5, 0x100, 0x250, 0x358, -1, 12, 6, 6, 0),
	PADCONF(123, 6, 0x100, 0x250, 0x358, -1, 16, 8, 8, 0),
	PADCONF(124, 6, 0x100, 0x250, 0x358, -1, 20, 10, 10, 0),
	PADCONF(125, 6, 0x100, 0x250, 0x358, -1, 24, 12, 12, 0),
	PADCONF(126, 6, 0x100, 0x250, 0x358, -1, 28, 14, 14, 0),
	PADCONF(127, 6, 0x108, 0x250, 0x358, -1, 16, 24, 24, 0),
	PADCONF(128, 6, 0x108, 0x250, 0x358, -1, 20, 26, 26, 0),
	PADCONF(129, 0, 0x110, 0x258, 0x360, -1, 0, 0, 0, 0),
	PADCONF(130, 0, 0x110, 0x258, 0x360, -1, 4, 2, 2, 0),
	PADCONF(131, 0, 0x110, 0x258, 0x360, -1, 8, 4, 4, 0),
	PADCONF(132, 0, 0x110, 0x258, 0x360, -1, 12, 6, 6, 0),
	PADCONF(133, 6, 0x118, 0x260, 0x368, -1, 0, 0, 0, 0),
	PADCONF(134, 6, 0x118, 0x260, 0x368, -1, 4, 2, 2, 0),
	PADCONF(135, 6, 0x118, 0x260, 0x368, -1, 16, 8, 8, 0),
	PADCONF(136, 6, 0x118, 0x260, 0x368, -1, 20, 10, 10, 0),
	PADCONF(137, 6, 0x118, 0x260, 0x368, -1, 24, 12, 12, 0),
	PADCONF(138, 6, 0x118, 0x260, 0x368, -1, 28, 14, 14, 0),
	PADCONF(139, 6, 0x120, 0x260, 0x368, -1, 0, 16, 16, 0),
	PADCONF(140, 6, 0x120, 0x260, 0x368, -1, 4, 18, 18, 0),
	PADCONF(141, 5, 0x128, 0x268, 0x378, -1, 0, 0, 0, 0),
	PADCONF(142, 5, 0x128, 0x268, 0x378, -1, 4, 2, 2, 0),
	PADCONF(143, 5, 0x128, 0x268, 0x378, -1, 8, 4, 4, 0),
	PADCONF(144, 5, 0x128, 0x268, 0x378, -1, 12, 6, 6, 0),
	PADCONF(145, 5, 0x128, 0x268, 0x378, -1, 16, 8, 8, 0),
	PADCONF(146, 5, 0x128, 0x268, 0x378, -1, 20, 10, 10, 0),
	PADCONF(147, 5, 0x128, 0x268, 0x378, -1, 24, 12, 12, 0),
	PADCONF(148, 5, 0x128, 0x268, 0x378, -1, 28, 14, 14, 0),
	PADCONF(149, 7, 0x130, 0x270, -1, 0x480, 0, 0, 0, 0),
	PADCONF(150, 7, 0x130, 0x270, -1, 0x480, 4, 2, 0, 1),
	PADCONF(151, 7, 0x130, 0x270, -1, 0x480, 8, 4, 0, 2),
	PADCONF(152, 7, 0x130, 0x270, -1, 0x480, 12, 6, 0, 3),
	PADCONF(153, 7, 0x130, 0x270, -1, 0x480, 16, 8, 0, 4),
	PADCONF(154, 7, 0x130, 0x270, -1, 0x480, 20, 10, 0, 5),
	PADCONF(155, 7, 0x130, 0x270, -1, 0x480, 24, 12, 0, 6),
	PADCONF(156, 7, 0x130, 0x270, -1, 0x480, 28, 14, 0, 7),
	PADCONF(157, 7, 0x138, 0x278, -1, 0x480, 0, 0, 0, 8),
	PADCONF(158, 7, 0x138, 0x278, -1, 0x480, 4, 2, 0, 9),
	PADCONF(159, 5, 0x140, 0x280, 0x380, -1, 0, 0, 0, 0),
	PADCONF(160, 6, 0x140, 0x280, 0x380, -1, 4, 2, 2, 0),
	PADCONF(161, 5, 0x140, 0x280, 0x380, -1, 8, 4, 4, 0),
	PADCONF(162, 6, 0x140, 0x280, 0x380, -1, 12, 6, 6, 0),
	PADCONF(163, 6, 0x140, 0x280, 0x380, -1, 16, 8, 8, 0),
};

/* pin list of each pin group */
static const unsigned int gnss_gpio_pins[] = { 119, 120, 121, 122, 123, 124,
		125, 126, 127, 128, 22, 23, 24, 25, 26, 27, 28, 29, 30, };
static const unsigned int lcd_vip_gpio_pins[] = { 74, 75, 76, 77, 78, 79, 80,
		81, 82, 83, 84, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
		64, 65, 66, 67, 68, 69, 70, 71, 72, 73, };
static const unsigned int sdio_i2s_gpio_pins[] = { 31, 32, 33, 34, 35, 36,
		85, 86, 87, 88, 89, 90, 129, 130, 131, 132, 91, 92, 93, 94,
		95, 96, 112, 113, 114, 115, 116, 117, 118, };
static const unsigned int sp_rgmii_gpio_pins[] = { 97, 98, 99, 100, 101, 102,
		103, 104, 105, 106, 107, 108, 109, 110, 111, 18, 19, 20, 21,
		141, 142, 143, 144, 145, 146, 147, 148, };
static const unsigned int lvds_gpio_pins[] = { 157, 158, 155, 156, 153, 154,
		151, 152, 149, 150, };
static const unsigned int jtag_uart_nand_gpio_pins[] = { 44, 43, 42, 41, 40,
		39, 38, 37, 46, 47, 48, 49, 50, 52, 51, 45, 133, 134, 135,
		136, 137, 138, 139, 140, 159, 160, 161, 162, 163, };
static const unsigned int rtc_gpio_pins[] = { 0, 1, 2, 3, 4, 10, 11, 12, 13,
		14, 15, 16, 17, 9, };
static const unsigned int audio_ac97_pins[] = { 113, 118, 115, 114, };
static const unsigned int audio_digmic_pins0[] = { 51, };
static const unsigned int audio_digmic_pins1[] = { 122, };
static const unsigned int audio_digmic_pins2[] = { 161, };
static const unsigned int audio_func_dbg_pins[] = { 141, 144, 44, 43, 42, 41,
		40, 39, 38, 37, 74, 75, 76, 77, 78, 79, 81, 113, 114, 118,
		115, 49, 50, 142, 143, 80, };
static const unsigned int audio_i2s_pins[] = { 118, 115, 116, 117, 112, 113,
		114, };
static const unsigned int audio_i2s_2ch_pins[] = { 118, 115, 112, 113, 114, };
static const unsigned int audio_i2s_extclk_pins[] = { 112, };
static const unsigned int audio_spdif_out_pins0[] = { 112, };
static const unsigned int audio_spdif_out_pins1[] = { 116, };
static const unsigned int audio_spdif_out_pins2[] = { 142, };
static const unsigned int audio_uart0_basic_pins[] = { 143, 142, 141, 144, };
static const unsigned int audio_uart0_urfs_pins0[] = { 117, };
static const unsigned int audio_uart0_urfs_pins1[] = { 139, };
static const unsigned int audio_uart0_urfs_pins2[] = { 163, };
static const unsigned int audio_uart0_urfs_pins3[] = { 162, };
static const unsigned int audio_uart1_basic_pins[] = { 147, 146, 145, 148, };
static const unsigned int audio_uart1_urfs_pins0[] = { 117, };
static const unsigned int audio_uart1_urfs_pins1[] = { 140, };
static const unsigned int audio_uart1_urfs_pins2[] = { 163, };
static const unsigned int audio_uart2_urfs_pins0[] = { 139, };
static const unsigned int audio_uart2_urfs_pins1[] = { 163, };
static const unsigned int audio_uart2_urfs_pins2[] = { 96, };
static const unsigned int audio_uart2_urxd_pins0[] = { 20, };
static const unsigned int audio_uart2_urxd_pins1[] = { 109, };
static const unsigned int audio_uart2_urxd_pins2[] = { 93, };
static const unsigned int audio_uart2_usclk_pins0[] = { 19, };
static const unsigned int audio_uart2_usclk_pins1[] = { 101, };
static const unsigned int audio_uart2_usclk_pins2[] = { 91, };
static const unsigned int audio_uart2_utfs_pins0[] = { 18, };
static const unsigned int audio_uart2_utfs_pins1[] = { 111, };
static const unsigned int audio_uart2_utfs_pins2[] = { 94, };
static const unsigned int audio_uart2_utxd_pins0[] = { 21, };
static const unsigned int audio_uart2_utxd_pins1[] = { 110, };
static const unsigned int audio_uart2_utxd_pins2[] = { 92, };
static const unsigned int c_can_trnsvr_en_pins0[] = { 2, };
static const unsigned int c_can_trnsvr_en_pins1[] = { 0, };
static const unsigned int c_can_trnsvr_intr_pins[] = { 1, };
static const unsigned int c_can_trnsvr_stb_n_pins[] = { 3, };
static const unsigned int c0_can_rxd_trnsv0_pins[] = { 11, };
static const unsigned int c0_can_rxd_trnsv1_pins[] = { 2, };
static const unsigned int c0_can_txd_trnsv0_pins[] = { 10, };
static const unsigned int c0_can_txd_trnsv1_pins[] = { 3, };
static const unsigned int c1_can_rxd_pins0[] = { 138, };
static const unsigned int c1_can_rxd_pins1[] = { 147, };
static const unsigned int c1_can_rxd_pins2[] = { 2, };
static const unsigned int c1_can_rxd_pins3[] = { 162, };
static const unsigned int c1_can_txd_pins0[] = { 137, };
static const unsigned int c1_can_txd_pins1[] = { 146, };
static const unsigned int c1_can_txd_pins2[] = { 3, };
static const unsigned int c1_can_txd_pins3[] = { 161, };
static const unsigned int ca_audio_lpc_pins[] = { 62, 63, 64, 65, 66, 67, 68,
		69, 70, 71, };
static const unsigned int ca_bt_lpc_pins[] = { 85, 86, 87, 88, 89, 90, };
static const unsigned int ca_coex_pins[] = { 129, 130, 131, 132, };
static const unsigned int ca_curator_lpc_pins[] = { 57, 58, 59, 60, };
static const unsigned int ca_pcm_debug_pins[] = { 91, 93, 94, 92, };
static const unsigned int ca_pio_pins[] = { 121, 122, 125, 126, 38, 37, 47,
		49, 50, 54, 55, 56, };
static const unsigned int ca_sdio_debug_pins[] = { 40, 39, 44, 43, 42, 41, };
static const unsigned int ca_spi_pins[] = { 82, 79, 80, 81, };
static const unsigned int ca_trb_pins[] = { 91, 93, 94, 95, 96, 78, 74, 75,
		76, 77, };
static const unsigned int ca_uart_debug_pins[] = { 136, 135, 134, 133, };
static const unsigned int clkc_pins0[] = { 30, 47, };
static const unsigned int clkc_pins1[] = { 78, 54, };
static const unsigned int gn_gnss_i2c_pins[] = { 128, 127, };
static const unsigned int gn_gnss_uart_nopause_pins[] = { 134, 133, };
static const unsigned int gn_gnss_uart_pins[] = { 134, 133, 136, 135, };
static const unsigned int gn_trg_spi_pins0[] = { 22, 25, 23, 24, };
static const unsigned int gn_trg_spi_pins1[] = { 82, 79, 80, 81, };
static const unsigned int cvbs_dbg_pins[] = { 54, 53, 82, 74, 75, 76, 77, 78,
		79, 80, 81, 83, 84, 73, 55, 56, };
static const unsigned int cvbs_dbg_test_pins0[] = { 57, };
static const unsigned int cvbs_dbg_test_pins1[] = { 58, };
static const unsigned int cvbs_dbg_test_pins2[] = { 59, };
static const unsigned int cvbs_dbg_test_pins3[] = { 60, };
static const unsigned int cvbs_dbg_test_pins4[] = { 61, };
static const unsigned int cvbs_dbg_test_pins5[] = { 62, };
static const unsigned int cvbs_dbg_test_pins6[] = { 63, };
static const unsigned int cvbs_dbg_test_pins7[] = { 64, };
static const unsigned int cvbs_dbg_test_pins8[] = { 65, };
static const unsigned int cvbs_dbg_test_pins9[] = { 66, };
static const unsigned int cvbs_dbg_test_pins10[] = { 67, };
static const unsigned int cvbs_dbg_test_pins11[] = { 68, };
static const unsigned int cvbs_dbg_test_pins12[] = { 69, };
static const unsigned int cvbs_dbg_test_pins13[] = { 70, };
static const unsigned int cvbs_dbg_test_pins14[] = { 71, };
static const unsigned int cvbs_dbg_test_pins15[] = { 72, };
static const unsigned int gn_gnss_power_pins[] = { 123, 124, 121, 122, 125,
		120, };
static const unsigned int gn_gnss_sw_status_pins[] = { 57, 58, 59, 60, 61,
		62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 53, 55, 56, 54, };
static const unsigned int gn_gnss_eclk_pins[] = { 113, };
static const unsigned int gn_gnss_irq1_pins0[] = { 112, };
static const unsigned int gn_gnss_irq2_pins0[] = { 118, };
static const unsigned int gn_gnss_tm_pins[] = { 115, };
static const unsigned int gn_gnss_tsync_pins[] = { 114, };
static const unsigned int gn_io_gnsssys_sw_cfg_pins[] = { 44, 43, 42, 41, 40,
		39, 38, 37, 49, 50, 91, 92, 93, 94, 95, 96, };
static const unsigned int gn_trg_pins0[] = { 29, 28, 26, 27, };
static const unsigned int gn_trg_pins1[] = { 77, 76, 74, 75, };
static const unsigned int gn_trg_shutdown_pins0[] = { 30, };
static const unsigned int gn_trg_shutdown_pins1[] = { 83, };
static const unsigned int gn_trg_shutdown_pins2[] = { 117, };
static const unsigned int gn_trg_shutdown_pins3[] = { 123, };
static const unsigned int i2c0_pins[] = { 128, 127, };
static const unsigned int i2c1_pins[] = { 126, 125, };
static const unsigned int i2s0_pins[] = { 91, 93, 94, 92, };
static const unsigned int i2s1_basic_pins[] = { 95, 96, };
static const unsigned int i2s1_rxd0_pins0[] = { 61, };
static const unsigned int i2s1_rxd0_pins1[] = { 131, };
static const unsigned int i2s1_rxd0_pins2[] = { 129, };
static const unsigned int i2s1_rxd0_pins3[] = { 117, };
static const unsigned int i2s1_rxd0_pins4[] = { 83, };
static const unsigned int i2s1_rxd1_pins0[] = { 72, };
static const unsigned int i2s1_rxd1_pins1[] = { 132, };
static const unsigned int i2s1_rxd1_pins2[] = { 130, };
static const unsigned int i2s1_rxd1_pins3[] = { 118, };
static const unsigned int i2s1_rxd1_pins4[] = { 84, };
static const unsigned int jtag_jt_dbg_nsrst_pins[] = { 125, };
static const unsigned int jtag_ntrst_pins0[] = { 4, };
static const unsigned int jtag_ntrst_pins1[] = { 163, };
static const unsigned int jtag_swdiotms_pins0[] = { 2, };
static const unsigned int jtag_swdiotms_pins1[] = { 160, };
static const unsigned int jtag_tck_pins0[] = { 0, };
static const unsigned int jtag_tck_pins1[] = { 161, };
static const unsigned int jtag_tdi_pins0[] = { 1, };
static const unsigned int jtag_tdi_pins1[] = { 162, };
static const unsigned int jtag_tdo_pins0[] = { 3, };
static const unsigned int jtag_tdo_pins1[] = { 159, };
static const unsigned int ks_kas_spi_pins0[] = { 141, 144, 143, 142, };
static const unsigned int ld_ldd_pins[] = { 57, 58, 59, 60, 61, 62, 63, 64,
		65, 66, 67, 68, 69, 70, 71, 72, 74, 75, 76, 77, 78, 79, 80,
		81, 56, 53, };
static const unsigned int ld_ldd_16bit_pins[] = { 57, 58, 59, 60, 61, 62, 63,
		64, 65, 66, 67, 68, 69, 70, 71, 72, 56, 53, };
static const unsigned int ld_ldd_fck_pins[] = { 55, };
static const unsigned int ld_ldd_lck_pins[] = { 54, };
static const unsigned int lr_lcdrom_pins[] = { 73, 54, 57, 58, 59, 60, 61,
		62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 56, 53, 55, };
static const unsigned int lvds_analog_pins[] = { 149, 150, 151, 152, 153, 154,
		155, 156, 157, 158, };
static const unsigned int nd_df_pins[] = { 44, 43, 42, 41, 40, 39, 38, 37,
		47, 46, 52, 51, 45, 49, 50, 48, 124, };
static const unsigned int nd_df_nowp_pins[] = { 44, 43, 42, 41, 40, 39, 38,
		37, 47, 46, 52, 51, 45, 49, 50, 48, };
static const unsigned int ps_pins[] = { 120, 119, 121, };
static const unsigned int pwc_core_on_pins[] = { 8, };
static const unsigned int pwc_ext_on_pins[] = { 6, };
static const unsigned int pwc_gpio3_clk_pins[] = { 3, };
static const unsigned int pwc_io_on_pins[] = { 9, };
static const unsigned int pwc_lowbatt_b_pins0[] = { 4, };
static const unsigned int pwc_mem_on_pins[] = { 7, };
static const unsigned int pwc_on_key_b_pins0[] = { 5, };
static const unsigned int pwc_wakeup_src0_pins[] = { 0, };
static const unsigned int pwc_wakeup_src1_pins[] = { 1, };
static const unsigned int pwc_wakeup_src2_pins[] = { 2, };
static const unsigned int pwc_wakeup_src3_pins[] = { 3, };
static const unsigned int pw_cko0_pins0[] = { 123, };
static const unsigned int pw_cko0_pins1[] = { 101, };
static const unsigned int pw_cko0_pins2[] = { 82, };
static const unsigned int pw_cko0_pins3[] = { 162, };
static const unsigned int pw_cko1_pins0[] = { 124, };
static const unsigned int pw_cko1_pins1[] = { 110, };
static const unsigned int pw_cko1_pins2[] = { 163, };
static const unsigned int pw_i2s01_clk_pins0[] = { 125, };
static const unsigned int pw_i2s01_clk_pins1[] = { 117, };
static const unsigned int pw_i2s01_clk_pins2[] = { 132, };
static const unsigned int pw_pwm0_pins0[] = { 119, };
static const unsigned int pw_pwm0_pins1[] = { 159, };
static const unsigned int pw_pwm1_pins0[] = { 120, };
static const unsigned int pw_pwm1_pins1[] = { 160, };
static const unsigned int pw_pwm1_pins2[] = { 131, };
static const unsigned int pw_pwm2_pins0[] = { 121, };
static const unsigned int pw_pwm2_pins1[] = { 98, };
static const unsigned int pw_pwm2_pins2[] = { 161, };
static const unsigned int pw_pwm3_pins0[] = { 122, };
static const unsigned int pw_pwm3_pins1[] = { 73, };
static const unsigned int pw_pwm_cpu_vol_pins0[] = { 121, };
static const unsigned int pw_pwm_cpu_vol_pins1[] = { 98, };
static const unsigned int pw_pwm_cpu_vol_pins2[] = { 161, };
static const unsigned int pw_backlight_pins0[] = { 122, };
static const unsigned int pw_backlight_pins1[] = { 73, };
static const unsigned int rg_eth_mac_pins[] = { 108, 103, 104, 105, 106, 107,
		102, 97, 98, 99, 100, 101, };
static const unsigned int rg_gmac_phy_intr_n_pins[] = { 111, };
static const unsigned int rg_rgmii_mac_pins[] = { 109, 110, };
static const unsigned int rg_rgmii_phy_ref_clk_pins0[] = { 111, };
static const unsigned int rg_rgmii_phy_ref_clk_pins1[] = { 53, };
static const unsigned int sd0_pins[] = { 46, 47, 44, 43, 42, 41, 40, 39, 38,
		37, };
static const unsigned int sd0_4bit_pins[] = { 46, 47, 44, 43, 42, 41, };
static const unsigned int sd1_pins[] = { 48, 49, 44, 43, 42, 41, 40, 39, 38,
		37, };
static const unsigned int sd1_4bit_pins0[] = { 48, 49, 44, 43, 42, 41, };
static const unsigned int sd1_4bit_pins1[] = { 48, 49, 40, 39, 38, 37, };
static const unsigned int sd2_basic_pins[] = { 31, 32, 33, 34, 35, 36, };
static const unsigned int sd2_cdb_pins0[] = { 124, };
static const unsigned int sd2_cdb_pins1[] = { 161, };
static const unsigned int sd2_wpb_pins0[] = { 123, };
static const unsigned int sd2_wpb_pins1[] = { 163, };
static const unsigned int sd3_pins[] = { 85, 86, 87, 88, 89, 90, };
static const unsigned int sd5_pins[] = { 91, 92, 93, 94, 95, 96, };
static const unsigned int sd6_pins0[] = { 79, 78, 74, 75, 76, 77, };
static const unsigned int sd6_pins1[] = { 101, 99, 100, 110, 109, 111, };
static const unsigned int sp0_ext_ldo_on_pins[] = { 4, };
static const unsigned int sp0_qspi_pins[] = { 12, 13, 14, 15, 16, 17, };
static const unsigned int sp1_spi_pins[] = { 19, 20, 21, 18, };
static const unsigned int tpiu_trace_pins[] = { 53, 56, 57, 58, 59, 60, 61,
		62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, };
static const unsigned int uart0_pins[] = { 121, 120, 134, 133, };
static const unsigned int uart0_nopause_pins[] = { 134, 133, };
static const unsigned int uart1_pins[] = { 136, 135, };
static const unsigned int uart2_cts_pins0[] = { 132, };
static const unsigned int uart2_cts_pins1[] = { 162, };
static const unsigned int uart2_rts_pins0[] = { 131, };
static const unsigned int uart2_rts_pins1[] = { 161, };
static const unsigned int uart2_rxd_pins0[] = { 11, };
static const unsigned int uart2_rxd_pins1[] = { 160, };
static const unsigned int uart2_rxd_pins2[] = { 130, };
static const unsigned int uart2_txd_pins0[] = { 10, };
static const unsigned int uart2_txd_pins1[] = { 159, };
static const unsigned int uart2_txd_pins2[] = { 129, };
static const unsigned int uart3_cts_pins0[] = { 125, };
static const unsigned int uart3_cts_pins1[] = { 111, };
static const unsigned int uart3_cts_pins2[] = { 140, };
static const unsigned int uart3_rts_pins0[] = { 126, };
static const unsigned int uart3_rts_pins1[] = { 109, };
static const unsigned int uart3_rts_pins2[] = { 139, };
static const unsigned int uart3_rxd_pins0[] = { 138, };
static const unsigned int uart3_rxd_pins1[] = { 84, };
static const unsigned int uart3_rxd_pins2[] = { 162, };
static const unsigned int uart3_txd_pins0[] = { 137, };
static const unsigned int uart3_txd_pins1[] = { 83, };
static const unsigned int uart3_txd_pins2[] = { 161, };
static const unsigned int uart4_basic_pins[] = { 140, 139, };
static const unsigned int uart4_cts_pins0[] = { 122, };
static const unsigned int uart4_cts_pins1[] = { 100, };
static const unsigned int uart4_cts_pins2[] = { 117, };
static const unsigned int uart4_rts_pins0[] = { 123, };
static const unsigned int uart4_rts_pins1[] = { 99, };
static const unsigned int uart4_rts_pins2[] = { 116, };
static const unsigned int usb0_drvvbus_pins0[] = { 51, };
static const unsigned int usb0_drvvbus_pins1[] = { 162, };
static const unsigned int usb1_drvvbus_pins0[] = { 134, };
static const unsigned int usb1_drvvbus_pins1[] = { 163, };
static const unsigned int visbus_dout_pins[] = { 57, 58, 59, 60, 61, 62, 63,
		64, 65, 66, 67, 68, 69, 70, 71, 72, 53, 54, 55, 56, 85, 86,
		87, 88, 89, 90, 91, 92, 93, 94, 95, 96, };
static const unsigned int vi_vip1_pins[] = { 74, 75, 76, 77, 78, 79, 80, 81,
		82, 83, 84, 103, 104, 105, 106, 107, 102, 97, 98, };
static const unsigned int vi_vip1_ext_pins[] = { 74, 75, 76, 77, 78, 79, 80,
		81, 82, 83, 84, 108, 103, 104, 105, 106, 107, 102, 97, 98,
		99, 100, };
static const unsigned int vi_vip1_low8bit_pins[] = { 74, 75, 76, 77, 78, 79,
		80, 81, };
static const unsigned int vi_vip1_high8bit_pins[] = { 82, 83, 84, 108, 103,
		104, 105, 106, };

/* definition of pin group table */
struct atlas7_pin_group altas7_pin_groups[] = {
	GROUP("gnss_gpio_grp", gnss_gpio_pins),
	GROUP("lcd_vip_gpio_grp", lcd_vip_gpio_pins),
	GROUP("sdio_i2s_gpio_grp", sdio_i2s_gpio_pins),
	GROUP("sp_rgmii_gpio_grp", sp_rgmii_gpio_pins),
	GROUP("lvds_gpio_grp", lvds_gpio_pins),
	GROUP("jtag_uart_nand_gpio_grp", jtag_uart_nand_gpio_pins),
	GROUP("rtc_gpio_grp", rtc_gpio_pins),
	GROUP("audio_ac97_grp", audio_ac97_pins),
	GROUP("audio_digmic_grp0", audio_digmic_pins0),
	GROUP("audio_digmic_grp1", audio_digmic_pins1),
	GROUP("audio_digmic_grp2", audio_digmic_pins2),
	GROUP("audio_func_dbg_grp", audio_func_dbg_pins),
	GROUP("audio_i2s_grp", audio_i2s_pins),
	GROUP("audio_i2s_2ch_grp", audio_i2s_2ch_pins),
	GROUP("audio_i2s_extclk_grp", audio_i2s_extclk_pins),
	GROUP("audio_spdif_out_grp0", audio_spdif_out_pins0),
	GROUP("audio_spdif_out_grp1", audio_spdif_out_pins1),
	GROUP("audio_spdif_out_grp2", audio_spdif_out_pins2),
	GROUP("audio_uart0_basic_grp", audio_uart0_basic_pins),
	GROUP("audio_uart0_urfs_grp0", audio_uart0_urfs_pins0),
	GROUP("audio_uart0_urfs_grp1", audio_uart0_urfs_pins1),
	GROUP("audio_uart0_urfs_grp2", audio_uart0_urfs_pins2),
	GROUP("audio_uart0_urfs_grp3", audio_uart0_urfs_pins3),
	GROUP("audio_uart1_basic_grp", audio_uart1_basic_pins),
	GROUP("audio_uart1_urfs_grp0", audio_uart1_urfs_pins0),
	GROUP("audio_uart1_urfs_grp1", audio_uart1_urfs_pins1),
	GROUP("audio_uart1_urfs_grp2", audio_uart1_urfs_pins2),
	GROUP("audio_uart2_urfs_grp0", audio_uart2_urfs_pins0),
	GROUP("audio_uart2_urfs_grp1", audio_uart2_urfs_pins1),
	GROUP("audio_uart2_urfs_grp2", audio_uart2_urfs_pins2),
	GROUP("audio_uart2_urxd_grp0", audio_uart2_urxd_pins0),
	GROUP("audio_uart2_urxd_grp1", audio_uart2_urxd_pins1),
	GROUP("audio_uart2_urxd_grp2", audio_uart2_urxd_pins2),
	GROUP("audio_uart2_usclk_grp0", audio_uart2_usclk_pins0),
	GROUP("audio_uart2_usclk_grp1", audio_uart2_usclk_pins1),
	GROUP("audio_uart2_usclk_grp2", audio_uart2_usclk_pins2),
	GROUP("audio_uart2_utfs_grp0", audio_uart2_utfs_pins0),
	GROUP("audio_uart2_utfs_grp1", audio_uart2_utfs_pins1),
	GROUP("audio_uart2_utfs_grp2", audio_uart2_utfs_pins2),
	GROUP("audio_uart2_utxd_grp0", audio_uart2_utxd_pins0),
	GROUP("audio_uart2_utxd_grp1", audio_uart2_utxd_pins1),
	GROUP("audio_uart2_utxd_grp2", audio_uart2_utxd_pins2),
	GROUP("c_can_trnsvr_en_grp0", c_can_trnsvr_en_pins0),
	GROUP("c_can_trnsvr_en_grp1", c_can_trnsvr_en_pins1),
	GROUP("c_can_trnsvr_intr_grp", c_can_trnsvr_intr_pins),
	GROUP("c_can_trnsvr_stb_n_grp", c_can_trnsvr_stb_n_pins),
	GROUP("c0_can_rxd_trnsv0_grp", c0_can_rxd_trnsv0_pins),
	GROUP("c0_can_rxd_trnsv1_grp", c0_can_rxd_trnsv1_pins),
	GROUP("c0_can_txd_trnsv0_grp", c0_can_txd_trnsv0_pins),
	GROUP("c0_can_txd_trnsv1_grp", c0_can_txd_trnsv1_pins),
	GROUP("c1_can_rxd_grp0", c1_can_rxd_pins0),
	GROUP("c1_can_rxd_grp1", c1_can_rxd_pins1),
	GROUP("c1_can_rxd_grp2", c1_can_rxd_pins2),
	GROUP("c1_can_rxd_grp3", c1_can_rxd_pins3),
	GROUP("c1_can_txd_grp0", c1_can_txd_pins0),
	GROUP("c1_can_txd_grp1", c1_can_txd_pins1),
	GROUP("c1_can_txd_grp2", c1_can_txd_pins2),
	GROUP("c1_can_txd_grp3", c1_can_txd_pins3),
	GROUP("ca_audio_lpc_grp", ca_audio_lpc_pins),
	GROUP("ca_bt_lpc_grp", ca_bt_lpc_pins),
	GROUP("ca_coex_grp", ca_coex_pins),
	GROUP("ca_curator_lpc_grp", ca_curator_lpc_pins),
	GROUP("ca_pcm_debug_grp", ca_pcm_debug_pins),
	GROUP("ca_pio_grp", ca_pio_pins),
	GROUP("ca_sdio_debug_grp", ca_sdio_debug_pins),
	GROUP("ca_spi_grp", ca_spi_pins),
	GROUP("ca_trb_grp", ca_trb_pins),
	GROUP("ca_uart_debug_grp", ca_uart_debug_pins),
	GROUP("clkc_grp0", clkc_pins0),
	GROUP("clkc_grp1", clkc_pins1),
	GROUP("gn_gnss_i2c_grp", gn_gnss_i2c_pins),
	GROUP("gn_gnss_uart_nopause_grp", gn_gnss_uart_nopause_pins),
	GROUP("gn_gnss_uart_grp", gn_gnss_uart_pins),
	GROUP("gn_trg_spi_grp0", gn_trg_spi_pins0),
	GROUP("gn_trg_spi_grp1", gn_trg_spi_pins1),
	GROUP("cvbs_dbg_grp", cvbs_dbg_pins),
	GROUP("cvbs_dbg_test_grp0", cvbs_dbg_test_pins0),
	GROUP("cvbs_dbg_test_grp1", cvbs_dbg_test_pins1),
	GROUP("cvbs_dbg_test_grp2", cvbs_dbg_test_pins2),
	GROUP("cvbs_dbg_test_grp3", cvbs_dbg_test_pins3),
	GROUP("cvbs_dbg_test_grp4", cvbs_dbg_test_pins4),
	GROUP("cvbs_dbg_test_grp5", cvbs_dbg_test_pins5),
	GROUP("cvbs_dbg_test_grp6", cvbs_dbg_test_pins6),
	GROUP("cvbs_dbg_test_grp7", cvbs_dbg_test_pins7),
	GROUP("cvbs_dbg_test_grp8", cvbs_dbg_test_pins8),
	GROUP("cvbs_dbg_test_grp9", cvbs_dbg_test_pins9),
	GROUP("cvbs_dbg_test_grp10", cvbs_dbg_test_pins10),
	GROUP("cvbs_dbg_test_grp11", cvbs_dbg_test_pins11),
	GROUP("cvbs_dbg_test_grp12", cvbs_dbg_test_pins12),
	GROUP("cvbs_dbg_test_grp13", cvbs_dbg_test_pins13),
	GROUP("cvbs_dbg_test_grp14", cvbs_dbg_test_pins14),
	GROUP("cvbs_dbg_test_grp15", cvbs_dbg_test_pins15),
	GROUP("gn_gnss_power_grp", gn_gnss_power_pins),
	GROUP("gn_gnss_sw_status_grp", gn_gnss_sw_status_pins),
	GROUP("gn_gnss_eclk_grp", gn_gnss_eclk_pins),
	GROUP("gn_gnss_irq1_grp0", gn_gnss_irq1_pins0),
	GROUP("gn_gnss_irq2_grp0", gn_gnss_irq2_pins0),
	GROUP("gn_gnss_tm_grp", gn_gnss_tm_pins),
	GROUP("gn_gnss_tsync_grp", gn_gnss_tsync_pins),
	GROUP("gn_io_gnsssys_sw_cfg_grp", gn_io_gnsssys_sw_cfg_pins),
	GROUP("gn_trg_grp0", gn_trg_pins0),
	GROUP("gn_trg_grp1", gn_trg_pins1),
	GROUP("gn_trg_shutdown_grp0", gn_trg_shutdown_pins0),
	GROUP("gn_trg_shutdown_grp1", gn_trg_shutdown_pins1),
	GROUP("gn_trg_shutdown_grp2", gn_trg_shutdown_pins2),
	GROUP("gn_trg_shutdown_grp3", gn_trg_shutdown_pins3),
	GROUP("i2c0_grp", i2c0_pins),
	GROUP("i2c1_grp", i2c1_pins),
	GROUP("i2s0_grp", i2s0_pins),
	GROUP("i2s1_basic_grp", i2s1_basic_pins),
	GROUP("i2s1_rxd0_grp0", i2s1_rxd0_pins0),
	GROUP("i2s1_rxd0_grp1", i2s1_rxd0_pins1),
	GROUP("i2s1_rxd0_grp2", i2s1_rxd0_pins2),
	GROUP("i2s1_rxd0_grp3", i2s1_rxd0_pins3),
	GROUP("i2s1_rxd0_grp4", i2s1_rxd0_pins4),
	GROUP("i2s1_rxd1_grp0", i2s1_rxd1_pins0),
	GROUP("i2s1_rxd1_grp1", i2s1_rxd1_pins1),
	GROUP("i2s1_rxd1_grp2", i2s1_rxd1_pins2),
	GROUP("i2s1_rxd1_grp3", i2s1_rxd1_pins3),
	GROUP("i2s1_rxd1_grp4", i2s1_rxd1_pins4),
	GROUP("jtag_jt_dbg_nsrst_grp", jtag_jt_dbg_nsrst_pins),
	GROUP("jtag_ntrst_grp0", jtag_ntrst_pins0),
	GROUP("jtag_ntrst_grp1", jtag_ntrst_pins1),
	GROUP("jtag_swdiotms_grp0", jtag_swdiotms_pins0),
	GROUP("jtag_swdiotms_grp1", jtag_swdiotms_pins1),
	GROUP("jtag_tck_grp0", jtag_tck_pins0),
	GROUP("jtag_tck_grp1", jtag_tck_pins1),
	GROUP("jtag_tdi_grp0", jtag_tdi_pins0),
	GROUP("jtag_tdi_grp1", jtag_tdi_pins1),
	GROUP("jtag_tdo_grp0", jtag_tdo_pins0),
	GROUP("jtag_tdo_grp1", jtag_tdo_pins1),
	GROUP("ks_kas_spi_grp0", ks_kas_spi_pins0),
	GROUP("ld_ldd_grp", ld_ldd_pins),
	GROUP("ld_ldd_16bit_grp", ld_ldd_16bit_pins),
	GROUP("ld_ldd_fck_grp", ld_ldd_fck_pins),
	GROUP("ld_ldd_lck_grp", ld_ldd_lck_pins),
	GROUP("lr_lcdrom_grp", lr_lcdrom_pins),
	GROUP("lvds_analog_grp", lvds_analog_pins),
	GROUP("nd_df_grp", nd_df_pins),
	GROUP("nd_df_nowp_grp", nd_df_nowp_pins),
	GROUP("ps_grp", ps_pins),
	GROUP("pwc_core_on_grp", pwc_core_on_pins),
	GROUP("pwc_ext_on_grp", pwc_ext_on_pins),
	GROUP("pwc_gpio3_clk_grp", pwc_gpio3_clk_pins),
	GROUP("pwc_io_on_grp", pwc_io_on_pins),
	GROUP("pwc_lowbatt_b_grp0", pwc_lowbatt_b_pins0),
	GROUP("pwc_mem_on_grp", pwc_mem_on_pins),
	GROUP("pwc_on_key_b_grp0", pwc_on_key_b_pins0),
	GROUP("pwc_wakeup_src0_grp", pwc_wakeup_src0_pins),
	GROUP("pwc_wakeup_src1_grp", pwc_wakeup_src1_pins),
	GROUP("pwc_wakeup_src2_grp", pwc_wakeup_src2_pins),
	GROUP("pwc_wakeup_src3_grp", pwc_wakeup_src3_pins),
	GROUP("pw_cko0_grp0", pw_cko0_pins0),
	GROUP("pw_cko0_grp1", pw_cko0_pins1),
	GROUP("pw_cko0_grp2", pw_cko0_pins2),
	GROUP("pw_cko0_grp3", pw_cko0_pins3),
	GROUP("pw_cko1_grp0", pw_cko1_pins0),
	GROUP("pw_cko1_grp1", pw_cko1_pins1),
	GROUP("pw_cko1_grp2", pw_cko1_pins2),
	GROUP("pw_i2s01_clk_grp0", pw_i2s01_clk_pins0),
	GROUP("pw_i2s01_clk_grp1", pw_i2s01_clk_pins1),
	GROUP("pw_i2s01_clk_grp2", pw_i2s01_clk_pins2),
	GROUP("pw_pwm0_grp0", pw_pwm0_pins0),
	GROUP("pw_pwm0_grp1", pw_pwm0_pins1),
	GROUP("pw_pwm1_grp0", pw_pwm1_pins0),
	GROUP("pw_pwm1_grp1", pw_pwm1_pins1),
	GROUP("pw_pwm1_grp2", pw_pwm1_pins2),
	GROUP("pw_pwm2_grp0", pw_pwm2_pins0),
	GROUP("pw_pwm2_grp1", pw_pwm2_pins1),
	GROUP("pw_pwm2_grp2", pw_pwm2_pins2),
	GROUP("pw_pwm3_grp0", pw_pwm3_pins0),
	GROUP("pw_pwm3_grp1", pw_pwm3_pins1),
	GROUP("pw_pwm_cpu_vol_grp0", pw_pwm_cpu_vol_pins0),
	GROUP("pw_pwm_cpu_vol_grp1", pw_pwm_cpu_vol_pins1),
	GROUP("pw_pwm_cpu_vol_grp2", pw_pwm_cpu_vol_pins2),
	GROUP("pw_backlight_grp0", pw_backlight_pins0),
	GROUP("pw_backlight_grp1", pw_backlight_pins1),
	GROUP("rg_eth_mac_grp", rg_eth_mac_pins),
	GROUP("rg_gmac_phy_intr_n_grp", rg_gmac_phy_intr_n_pins),
	GROUP("rg_rgmii_mac_grp", rg_rgmii_mac_pins),
	GROUP("rg_rgmii_phy_ref_clk_grp0", rg_rgmii_phy_ref_clk_pins0),
	GROUP("rg_rgmii_phy_ref_clk_grp1", rg_rgmii_phy_ref_clk_pins1),
	GROUP("sd0_grp", sd0_pins),
	GROUP("sd0_4bit_grp", sd0_4bit_pins),
	GROUP("sd1_grp", sd1_pins),
	GROUP("sd1_4bit_grp0", sd1_4bit_pins0),
	GROUP("sd1_4bit_grp1", sd1_4bit_pins1),
	GROUP("sd2_basic_grp", sd2_basic_pins),
	GROUP("sd2_cdb_grp0", sd2_cdb_pins0),
	GROUP("sd2_cdb_grp1", sd2_cdb_pins1),
	GROUP("sd2_wpb_grp0", sd2_wpb_pins0),
	GROUP("sd2_wpb_grp1", sd2_wpb_pins1),
	GROUP("sd3_grp", sd3_pins),
	GROUP("sd5_grp", sd5_pins),
	GROUP("sd6_grp0", sd6_pins0),
	GROUP("sd6_grp1", sd6_pins1),
	GROUP("sp0_ext_ldo_on_grp", sp0_ext_ldo_on_pins),
	GROUP("sp0_qspi_grp", sp0_qspi_pins),
	GROUP("sp1_spi_grp", sp1_spi_pins),
	GROUP("tpiu_trace_grp", tpiu_trace_pins),
	GROUP("uart0_grp", uart0_pins),
	GROUP("uart0_nopause_grp", uart0_nopause_pins),
	GROUP("uart1_grp", uart1_pins),
	GROUP("uart2_cts_grp0", uart2_cts_pins0),
	GROUP("uart2_cts_grp1", uart2_cts_pins1),
	GROUP("uart2_rts_grp0", uart2_rts_pins0),
	GROUP("uart2_rts_grp1", uart2_rts_pins1),
	GROUP("uart2_rxd_grp0", uart2_rxd_pins0),
	GROUP("uart2_rxd_grp1", uart2_rxd_pins1),
	GROUP("uart2_rxd_grp2", uart2_rxd_pins2),
	GROUP("uart2_txd_grp0", uart2_txd_pins0),
	GROUP("uart2_txd_grp1", uart2_txd_pins1),
	GROUP("uart2_txd_grp2", uart2_txd_pins2),
	GROUP("uart3_cts_grp0", uart3_cts_pins0),
	GROUP("uart3_cts_grp1", uart3_cts_pins1),
	GROUP("uart3_cts_grp2", uart3_cts_pins2),
	GROUP("uart3_rts_grp0", uart3_rts_pins0),
	GROUP("uart3_rts_grp1", uart3_rts_pins1),
	GROUP("uart3_rts_grp2", uart3_rts_pins2),
	GROUP("uart3_rxd_grp0", uart3_rxd_pins0),
	GROUP("uart3_rxd_grp1", uart3_rxd_pins1),
	GROUP("uart3_rxd_grp2", uart3_rxd_pins2),
	GROUP("uart3_txd_grp0", uart3_txd_pins0),
	GROUP("uart3_txd_grp1", uart3_txd_pins1),
	GROUP("uart3_txd_grp2", uart3_txd_pins2),
	GROUP("uart4_basic_grp", uart4_basic_pins),
	GROUP("uart4_cts_grp0", uart4_cts_pins0),
	GROUP("uart4_cts_grp1", uart4_cts_pins1),
	GROUP("uart4_cts_grp2", uart4_cts_pins2),
	GROUP("uart4_rts_grp0", uart4_rts_pins0),
	GROUP("uart4_rts_grp1", uart4_rts_pins1),
	GROUP("uart4_rts_grp2", uart4_rts_pins2),
	GROUP("usb0_drvvbus_grp0", usb0_drvvbus_pins0),
	GROUP("usb0_drvvbus_grp1", usb0_drvvbus_pins1),
	GROUP("usb1_drvvbus_grp0", usb1_drvvbus_pins0),
	GROUP("usb1_drvvbus_grp1", usb1_drvvbus_pins1),
	GROUP("visbus_dout_grp", visbus_dout_pins),
	GROUP("vi_vip1_grp", vi_vip1_pins),
	GROUP("vi_vip1_ext_grp", vi_vip1_ext_pins),
	GROUP("vi_vip1_low8bit_grp", vi_vip1_low8bit_pins),
	GROUP("vi_vip1_high8bit_grp", vi_vip1_high8bit_pins),
};

/* How many groups that a function can use */
static const char * const gnss_gpio_grp[] = { "gnss_gpio_grp", };
static const char * const lcd_vip_gpio_grp[] = { "lcd_vip_gpio_grp", };
static const char * const sdio_i2s_gpio_grp[] = { "sdio_i2s_gpio_grp", };
static const char * const sp_rgmii_gpio_grp[] = { "sp_rgmii_gpio_grp", };
static const char * const lvds_gpio_grp[] = { "lvds_gpio_grp", };
static const char * const jtag_uart_nand_gpio_grp[] = {
				"jtag_uart_nand_gpio_grp", };
static const char * const rtc_gpio_grp[] = { "rtc_gpio_grp", };
static const char * const audio_ac97_grp[] = { "audio_ac97_grp", };
static const char * const audio_digmic_grp0[] = { "audio_digmic_grp0", };
static const char * const audio_digmic_grp1[] = { "audio_digmic_grp1", };
static const char * const audio_digmic_grp2[] = { "audio_digmic_grp2", };
static const char * const audio_func_dbg_grp[] = { "audio_func_dbg_grp", };
static const char * const audio_i2s_grp[] = { "audio_i2s_grp", };
static const char * const audio_i2s_2ch_grp[] = { "audio_i2s_2ch_grp", };
static const char * const audio_i2s_extclk_grp[] = { "audio_i2s_extclk_grp", };
static const char * const audio_spdif_out_grp0[] = { "audio_spdif_out_grp0", };
static const char * const audio_spdif_out_grp1[] = { "audio_spdif_out_grp1", };
static const char * const audio_spdif_out_grp2[] = { "audio_spdif_out_grp2", };
static const char * const audio_uart0_basic_grp[] = {
				"audio_uart0_basic_grp", };
static const char * const audio_uart0_urfs_grp0[] = {
				"audio_uart0_urfs_grp0", };
static const char * const audio_uart0_urfs_grp1[] = {
				"audio_uart0_urfs_grp1", };
static const char * const audio_uart0_urfs_grp2[] = {
				"audio_uart0_urfs_grp2", };
static const char * const audio_uart0_urfs_grp3[] = {
				"audio_uart0_urfs_grp3", };
static const char * const audio_uart1_basic_grp[] = {
				"audio_uart1_basic_grp", };
static const char * const audio_uart1_urfs_grp0[] = {
				"audio_uart1_urfs_grp0", };
static const char * const audio_uart1_urfs_grp1[] = {
				"audio_uart1_urfs_grp1", };
static const char * const audio_uart1_urfs_grp2[] = {
				"audio_uart1_urfs_grp2", };
static const char * const audio_uart2_urfs_grp0[] = {
				"audio_uart2_urfs_grp0", };
static const char * const audio_uart2_urfs_grp1[] = {
				"audio_uart2_urfs_grp1", };
static const char * const audio_uart2_urfs_grp2[] = {
				"audio_uart2_urfs_grp2", };
static const char * const audio_uart2_urxd_grp0[] = {
				"audio_uart2_urxd_grp0", };
static const char * const audio_uart2_urxd_grp1[] = {
				"audio_uart2_urxd_grp1", };
static const char * const audio_uart2_urxd_grp2[] = {
				"audio_uart2_urxd_grp2", };
static const char * const audio_uart2_usclk_grp0[] = {
				"audio_uart2_usclk_grp0", };
static const char * const audio_uart2_usclk_grp1[] = {
				"audio_uart2_usclk_grp1", };
static const char * const audio_uart2_usclk_grp2[] = {
				"audio_uart2_usclk_grp2", };
static const char * const audio_uart2_utfs_grp0[] = {
				"audio_uart2_utfs_grp0", };
static const char * const audio_uart2_utfs_grp1[] = {
				"audio_uart2_utfs_grp1", };
static const char * const audio_uart2_utfs_grp2[] = {
				"audio_uart2_utfs_grp2", };
static const char * const audio_uart2_utxd_grp0[] = {
				"audio_uart2_utxd_grp0", };
static const char * const audio_uart2_utxd_grp1[] = {
				"audio_uart2_utxd_grp1", };
static const char * const audio_uart2_utxd_grp2[] = {
				"audio_uart2_utxd_grp2", };
static const char * const c_can_trnsvr_en_grp0[] = { "c_can_trnsvr_en_grp0", };
static const char * const c_can_trnsvr_en_grp1[] = { "c_can_trnsvr_en_grp1", };
static const char * const c_can_trnsvr_intr_grp[] = {
				"c_can_trnsvr_intr_grp", };
static const char * const c_can_trnsvr_stb_n_grp[] = {
				"c_can_trnsvr_stb_n_grp", };
static const char * const c0_can_rxd_trnsv0_grp[] = {
				"c0_can_rxd_trnsv0_grp", };
static const char * const c0_can_rxd_trnsv1_grp[] = {
				"c0_can_rxd_trnsv1_grp", };
static const char * const c0_can_txd_trnsv0_grp[] = {
				"c0_can_txd_trnsv0_grp", };
static const char * const c0_can_txd_trnsv1_grp[] = {
				"c0_can_txd_trnsv1_grp", };
static const char * const c1_can_rxd_grp0[] = { "c1_can_rxd_grp0", };
static const char * const c1_can_rxd_grp1[] = { "c1_can_rxd_grp1", };
static const char * const c1_can_rxd_grp2[] = { "c1_can_rxd_grp2", };
static const char * const c1_can_rxd_grp3[] = { "c1_can_rxd_grp3", };
static const char * const c1_can_txd_grp0[] = { "c1_can_txd_grp0", };
static const char * const c1_can_txd_grp1[] = { "c1_can_txd_grp1", };
static const char * const c1_can_txd_grp2[] = { "c1_can_txd_grp2", };
static const char * const c1_can_txd_grp3[] = { "c1_can_txd_grp3", };
static const char * const ca_audio_lpc_grp[] = { "ca_audio_lpc_grp", };
static const char * const ca_bt_lpc_grp[] = { "ca_bt_lpc_grp", };
static const char * const ca_coex_grp[] = { "ca_coex_grp", };
static const char * const ca_curator_lpc_grp[] = { "ca_curator_lpc_grp", };
static const char * const ca_pcm_debug_grp[] = { "ca_pcm_debug_grp", };
static const char * const ca_pio_grp[] = { "ca_pio_grp", };
static const char * const ca_sdio_debug_grp[] = { "ca_sdio_debug_grp", };
static const char * const ca_spi_grp[] = { "ca_spi_grp", };
static const char * const ca_trb_grp[] = { "ca_trb_grp", };
static const char * const ca_uart_debug_grp[] = { "ca_uart_debug_grp", };
static const char * const clkc_grp0[] = { "clkc_grp0", };
static const char * const clkc_grp1[] = { "clkc_grp1", };
static const char * const gn_gnss_i2c_grp[] = { "gn_gnss_i2c_grp", };
static const char * const gn_gnss_uart_nopause_grp[] = {
				"gn_gnss_uart_nopause_grp", };
static const char * const gn_gnss_uart_grp[] = { "gn_gnss_uart_grp", };
static const char * const gn_trg_spi_grp0[] = { "gn_trg_spi_grp0", };
static const char * const gn_trg_spi_grp1[] = { "gn_trg_spi_grp1", };
static const char * const cvbs_dbg_grp[] = { "cvbs_dbg_grp", };
static const char * const cvbs_dbg_test_grp0[] = { "cvbs_dbg_test_grp0", };
static const char * const cvbs_dbg_test_grp1[] = { "cvbs_dbg_test_grp1", };
static const char * const cvbs_dbg_test_grp2[] = { "cvbs_dbg_test_grp2", };
static const char * const cvbs_dbg_test_grp3[] = { "cvbs_dbg_test_grp3", };
static const char * const cvbs_dbg_test_grp4[] = { "cvbs_dbg_test_grp4", };
static const char * const cvbs_dbg_test_grp5[] = { "cvbs_dbg_test_grp5", };
static const char * const cvbs_dbg_test_grp6[] = { "cvbs_dbg_test_grp6", };
static const char * const cvbs_dbg_test_grp7[] = { "cvbs_dbg_test_grp7", };
static const char * const cvbs_dbg_test_grp8[] = { "cvbs_dbg_test_grp8", };
static const char * const cvbs_dbg_test_grp9[] = { "cvbs_dbg_test_grp9", };
static const char * const cvbs_dbg_test_grp10[] = { "cvbs_dbg_test_grp10", };
static const char * const cvbs_dbg_test_grp11[] = { "cvbs_dbg_test_grp11", };
static const char * const cvbs_dbg_test_grp12[] = { "cvbs_dbg_test_grp12", };
static const char * const cvbs_dbg_test_grp13[] = { "cvbs_dbg_test_grp13", };
static const char * const cvbs_dbg_test_grp14[] = { "cvbs_dbg_test_grp14", };
static const char * const cvbs_dbg_test_grp15[] = { "cvbs_dbg_test_grp15", };
static const char * const gn_gnss_power_grp[] = { "gn_gnss_power_grp", };
static const char * const gn_gnss_sw_status_grp[] = {
				"gn_gnss_sw_status_grp", };
static const char * const gn_gnss_eclk_grp[] = { "gn_gnss_eclk_grp", };
static const char * const gn_gnss_irq1_grp0[] = { "gn_gnss_irq1_grp0", };
static const char * const gn_gnss_irq2_grp0[] = { "gn_gnss_irq2_grp0", };
static const char * const gn_gnss_tm_grp[] = { "gn_gnss_tm_grp", };
static const char * const gn_gnss_tsync_grp[] = { "gn_gnss_tsync_grp", };
static const char * const gn_io_gnsssys_sw_cfg_grp[] = {
				"gn_io_gnsssys_sw_cfg_grp", };
static const char * const gn_trg_grp0[] = { "gn_trg_grp0", };
static const char * const gn_trg_grp1[] = { "gn_trg_grp1", };
static const char * const gn_trg_shutdown_grp0[] = { "gn_trg_shutdown_grp0", };
static const char * const gn_trg_shutdown_grp1[] = { "gn_trg_shutdown_grp1", };
static const char * const gn_trg_shutdown_grp2[] = { "gn_trg_shutdown_grp2", };
static const char * const gn_trg_shutdown_grp3[] = { "gn_trg_shutdown_grp3", };
static const char * const i2c0_grp[] = { "i2c0_grp", };
static const char * const i2c1_grp[] = { "i2c1_grp", };
static const char * const i2s0_grp[] = { "i2s0_grp", };
static const char * const i2s1_basic_grp[] = { "i2s1_basic_grp", };
static const char * const i2s1_rxd0_grp0[] = { "i2s1_rxd0_grp0", };
static const char * const i2s1_rxd0_grp1[] = { "i2s1_rxd0_grp1", };
static const char * const i2s1_rxd0_grp2[] = { "i2s1_rxd0_grp2", };
static const char * const i2s1_rxd0_grp3[] = { "i2s1_rxd0_grp3", };
static const char * const i2s1_rxd0_grp4[] = { "i2s1_rxd0_grp4", };
static const char * const i2s1_rxd1_grp0[] = { "i2s1_rxd1_grp0", };
static const char * const i2s1_rxd1_grp1[] = { "i2s1_rxd1_grp1", };
static const char * const i2s1_rxd1_grp2[] = { "i2s1_rxd1_grp2", };
static const char * const i2s1_rxd1_grp3[] = { "i2s1_rxd1_grp3", };
static const char * const i2s1_rxd1_grp4[] = { "i2s1_rxd1_grp4", };
static const char * const jtag_jt_dbg_nsrst_grp[] = {
				"jtag_jt_dbg_nsrst_grp", };
static const char * const jtag_ntrst_grp0[] = { "jtag_ntrst_grp0", };
static const char * const jtag_ntrst_grp1[] = { "jtag_ntrst_grp1", };
static const char * const jtag_swdiotms_grp0[] = { "jtag_swdiotms_grp0", };
static const char * const jtag_swdiotms_grp1[] = { "jtag_swdiotms_grp1", };
static const char * const jtag_tck_grp0[] = { "jtag_tck_grp0", };
static const char * const jtag_tck_grp1[] = { "jtag_tck_grp1", };
static const char * const jtag_tdi_grp0[] = { "jtag_tdi_grp0", };
static const char * const jtag_tdi_grp1[] = { "jtag_tdi_grp1", };
static const char * const jtag_tdo_grp0[] = { "jtag_tdo_grp0", };
static const char * const jtag_tdo_grp1[] = { "jtag_tdo_grp1", };
static const char * const ks_kas_spi_grp0[] = { "ks_kas_spi_grp0", };
static const char * const ld_ldd_grp[] = { "ld_ldd_grp", };
static const char * const ld_ldd_16bit_grp[] = { "ld_ldd_16bit_grp", };
static const char * const ld_ldd_fck_grp[] = { "ld_ldd_fck_grp", };
static const char * const ld_ldd_lck_grp[] = { "ld_ldd_lck_grp", };
static const char * const lr_lcdrom_grp[] = { "lr_lcdrom_grp", };
static const char * const lvds_analog_grp[] = { "lvds_analog_grp", };
static const char * const nd_df_grp[] = { "nd_df_grp", };
static const char * const nd_df_nowp_grp[] = { "nd_df_nowp_grp", };
static const char * const ps_grp[] = { "ps_grp", };
static const char * const pwc_core_on_grp[] = { "pwc_core_on_grp", };
static const char * const pwc_ext_on_grp[] = { "pwc_ext_on_grp", };
static const char * const pwc_gpio3_clk_grp[] = { "pwc_gpio3_clk_grp", };
static const char * const pwc_io_on_grp[] = { "pwc_io_on_grp", };
static const char * const pwc_lowbatt_b_grp0[] = { "pwc_lowbatt_b_grp0", };
static const char * const pwc_mem_on_grp[] = { "pwc_mem_on_grp", };
static const char * const pwc_on_key_b_grp0[] = { "pwc_on_key_b_grp0", };
static const char * const pwc_wakeup_src0_grp[] = { "pwc_wakeup_src0_grp", };
static const char * const pwc_wakeup_src1_grp[] = { "pwc_wakeup_src1_grp", };
static const char * const pwc_wakeup_src2_grp[] = { "pwc_wakeup_src2_grp", };
static const char * const pwc_wakeup_src3_grp[] = { "pwc_wakeup_src3_grp", };
static const char * const pw_cko0_grp0[] = { "pw_cko0_grp0", };
static const char * const pw_cko0_grp1[] = { "pw_cko0_grp1", };
static const char * const pw_cko0_grp2[] = { "pw_cko0_grp2", };
static const char * const pw_cko0_grp3[] = { "pw_cko0_grp3", };
static const char * const pw_cko1_grp0[] = { "pw_cko1_grp0", };
static const char * const pw_cko1_grp1[] = { "pw_cko1_grp1", };
static const char * const pw_cko1_grp2[] = { "pw_cko1_grp2", };
static const char * const pw_i2s01_clk_grp0[] = { "pw_i2s01_clk_grp0", };
static const char * const pw_i2s01_clk_grp1[] = { "pw_i2s01_clk_grp1", };
static const char * const pw_i2s01_clk_grp2[] = { "pw_i2s01_clk_grp2", };
static const char * const pw_pwm0_grp0[] = { "pw_pwm0_grp0", };
static const char * const pw_pwm0_grp1[] = { "pw_pwm0_grp1", };
static const char * const pw_pwm1_grp0[] = { "pw_pwm1_grp0", };
static const char * const pw_pwm1_grp1[] = { "pw_pwm1_grp1", };
static const char * const pw_pwm1_grp2[] = { "pw_pwm1_grp2", };
static const char * const pw_pwm2_grp0[] = { "pw_pwm2_grp0", };
static const char * const pw_pwm2_grp1[] = { "pw_pwm2_grp1", };
static const char * const pw_pwm2_grp2[] = { "pw_pwm2_grp2", };
static const char * const pw_pwm3_grp0[] = { "pw_pwm3_grp0", };
static const char * const pw_pwm3_grp1[] = { "pw_pwm3_grp1", };
static const char * const pw_pwm_cpu_vol_grp0[] = { "pw_pwm_cpu_vol_grp0", };
static const char * const pw_pwm_cpu_vol_grp1[] = { "pw_pwm_cpu_vol_grp1", };
static const char * const pw_pwm_cpu_vol_grp2[] = { "pw_pwm_cpu_vol_grp2", };
static const char * const pw_backlight_grp0[] = { "pw_backlight_grp0", };
static const char * const pw_backlight_grp1[] = { "pw_backlight_grp1", };
static const char * const rg_eth_mac_grp[] = { "rg_eth_mac_grp", };
static const char * const rg_gmac_phy_intr_n_grp[] = {
				"rg_gmac_phy_intr_n_grp", };
static const char * const rg_rgmii_mac_grp[] = { "rg_rgmii_mac_grp", };
static const char * const rg_rgmii_phy_ref_clk_grp0[] = {
				"rg_rgmii_phy_ref_clk_grp0", };
static const char * const rg_rgmii_phy_ref_clk_grp1[] = {
				"rg_rgmii_phy_ref_clk_grp1", };
static const char * const sd0_grp[] = { "sd0_grp", };
static const char * const sd0_4bit_grp[] = { "sd0_4bit_grp", };
static const char * const sd1_grp[] = { "sd1_grp", };
static const char * const sd1_4bit_grp0[] = { "sd1_4bit_grp0", };
static const char * const sd1_4bit_grp1[] = { "sd1_4bit_grp1", };
static const char * const sd2_basic_grp[] = { "sd2_basic_grp", };
static const char * const sd2_cdb_grp0[] = { "sd2_cdb_grp0", };
static const char * const sd2_cdb_grp1[] = { "sd2_cdb_grp1", };
static const char * const sd2_wpb_grp0[] = { "sd2_wpb_grp0", };
static const char * const sd2_wpb_grp1[] = { "sd2_wpb_grp1", };
static const char * const sd3_grp[] = { "sd3_grp", };
static const char * const sd5_grp[] = { "sd5_grp", };
static const char * const sd6_grp0[] = { "sd6_grp0", };
static const char * const sd6_grp1[] = { "sd6_grp1", };
static const char * const sp0_ext_ldo_on_grp[] = { "sp0_ext_ldo_on_grp", };
static const char * const sp0_qspi_grp[] = { "sp0_qspi_grp", };
static const char * const sp1_spi_grp[] = { "sp1_spi_grp", };
static const char * const tpiu_trace_grp[] = { "tpiu_trace_grp", };
static const char * const uart0_grp[] = { "uart0_grp", };
static const char * const uart0_nopause_grp[] = { "uart0_nopause_grp", };
static const char * const uart1_grp[] = { "uart1_grp", };
static const char * const uart2_cts_grp0[] = { "uart2_cts_grp0", };
static const char * const uart2_cts_grp1[] = { "uart2_cts_grp1", };
static const char * const uart2_rts_grp0[] = { "uart2_rts_grp0", };
static const char * const uart2_rts_grp1[] = { "uart2_rts_grp1", };
static const char * const uart2_rxd_grp0[] = { "uart2_rxd_grp0", };
static const char * const uart2_rxd_grp1[] = { "uart2_rxd_grp1", };
static const char * const uart2_rxd_grp2[] = { "uart2_rxd_grp2", };
static const char * const uart2_txd_grp0[] = { "uart2_txd_grp0", };
static const char * const uart2_txd_grp1[] = { "uart2_txd_grp1", };
static const char * const uart2_txd_grp2[] = { "uart2_txd_grp2", };
static const char * const uart3_cts_grp0[] = { "uart3_cts_grp0", };
static const char * const uart3_cts_grp1[] = { "uart3_cts_grp1", };
static const char * const uart3_cts_grp2[] = { "uart3_cts_grp2", };
static const char * const uart3_rts_grp0[] = { "uart3_rts_grp0", };
static const char * const uart3_rts_grp1[] = { "uart3_rts_grp1", };
static const char * const uart3_rts_grp2[] = { "uart3_rts_grp2", };
static const char * const uart3_rxd_grp0[] = { "uart3_rxd_grp0", };
static const char * const uart3_rxd_grp1[] = { "uart3_rxd_grp1", };
static const char * const uart3_rxd_grp2[] = { "uart3_rxd_grp2", };
static const char * const uart3_txd_grp0[] = { "uart3_txd_grp0", };
static const char * const uart3_txd_grp1[] = { "uart3_txd_grp1", };
static const char * const uart3_txd_grp2[] = { "uart3_txd_grp2", };
static const char * const uart4_basic_grp[] = { "uart4_basic_grp", };
static const char * const uart4_cts_grp0[] = { "uart4_cts_grp0", };
static const char * const uart4_cts_grp1[] = { "uart4_cts_grp1", };
static const char * const uart4_cts_grp2[] = { "uart4_cts_grp2", };
static const char * const uart4_rts_grp0[] = { "uart4_rts_grp0", };
static const char * const uart4_rts_grp1[] = { "uart4_rts_grp1", };
static const char * const uart4_rts_grp2[] = { "uart4_rts_grp2", };
static const char * const usb0_drvvbus_grp0[] = { "usb0_drvvbus_grp0", };
static const char * const usb0_drvvbus_grp1[] = { "usb0_drvvbus_grp1", };
static const char * const usb1_drvvbus_grp0[] = { "usb1_drvvbus_grp0", };
static const char * const usb1_drvvbus_grp1[] = { "usb1_drvvbus_grp1", };
static const char * const visbus_dout_grp[] = { "visbus_dout_grp", };
static const char * const vi_vip1_grp[] = { "vi_vip1_grp", };
static const char * const vi_vip1_ext_grp[] = { "vi_vip1_ext_grp", };
static const char * const vi_vip1_low8bit_grp[] = { "vi_vip1_low8bit_grp", };
static const char * const vi_vip1_high8bit_grp[] = { "vi_vip1_high8bit_grp", };

static struct atlas7_pad_mux gnss_gpio_grp_pad_mux[] = {
	MUX(1, 119, 0, N, N, N, N),
	MUX(1, 120, 0, N, N, N, N),
	MUX(1, 121, 0, N, N, N, N),
	MUX(1, 122, 0, N, N, N, N),
	MUX(1, 123, 0, N, N, N, N),
	MUX(1, 124, 0, N, N, N, N),
	MUX(1, 125, 0, N, N, N, N),
	MUX(1, 126, 0, N, N, N, N),
	MUX(1, 127, 0, N, N, N, N),
	MUX(1, 128, 0, N, N, N, N),
	MUX(1, 22, 0, N, N, N, N),
	MUX(1, 23, 0, N, N, N, N),
	MUX(1, 24, 0, N, N, N, N),
	MUX(1, 25, 0, N, N, N, N),
	MUX(1, 26, 0, N, N, N, N),
	MUX(1, 27, 0, N, N, N, N),
	MUX(1, 28, 0, N, N, N, N),
	MUX(1, 29, 0, N, N, N, N),
	MUX(1, 30, 0, N, N, N, N),
};

static struct atlas7_grp_mux gnss_gpio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gnss_gpio_grp_pad_mux),
	.pad_mux_list = gnss_gpio_grp_pad_mux,
};

static struct atlas7_pad_mux lcd_vip_gpio_grp_pad_mux[] = {
	MUX(1, 74, 0, N, N, N, N),
	MUX(1, 75, 0, N, N, N, N),
	MUX(1, 76, 0, N, N, N, N),
	MUX(1, 77, 0, N, N, N, N),
	MUX(1, 78, 0, N, N, N, N),
	MUX(1, 79, 0, N, N, N, N),
	MUX(1, 80, 0, N, N, N, N),
	MUX(1, 81, 0, N, N, N, N),
	MUX(1, 82, 0, N, N, N, N),
	MUX(1, 83, 0, N, N, N, N),
	MUX(1, 84, 0, N, N, N, N),
	MUX(1, 53, 0, N, N, N, N),
	MUX(1, 54, 0, N, N, N, N),
	MUX(1, 55, 0, N, N, N, N),
	MUX(1, 56, 0, N, N, N, N),
	MUX(1, 57, 0, N, N, N, N),
	MUX(1, 58, 0, N, N, N, N),
	MUX(1, 59, 0, N, N, N, N),
	MUX(1, 60, 0, N, N, N, N),
	MUX(1, 61, 0, N, N, N, N),
	MUX(1, 62, 0, N, N, N, N),
	MUX(1, 63, 0, N, N, N, N),
	MUX(1, 64, 0, N, N, N, N),
	MUX(1, 65, 0, N, N, N, N),
	MUX(1, 66, 0, N, N, N, N),
	MUX(1, 67, 0, N, N, N, N),
	MUX(1, 68, 0, N, N, N, N),
	MUX(1, 69, 0, N, N, N, N),
	MUX(1, 70, 0, N, N, N, N),
	MUX(1, 71, 0, N, N, N, N),
	MUX(1, 72, 0, N, N, N, N),
	MUX(1, 73, 0, N, N, N, N),
};

static struct atlas7_grp_mux lcd_vip_gpio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(lcd_vip_gpio_grp_pad_mux),
	.pad_mux_list = lcd_vip_gpio_grp_pad_mux,
};

static struct atlas7_pad_mux sdio_i2s_gpio_grp_pad_mux[] = {
	MUX(1, 31, 0, N, N, N, N),
	MUX(1, 32, 0, N, N, N, N),
	MUX(1, 33, 0, N, N, N, N),
	MUX(1, 34, 0, N, N, N, N),
	MUX(1, 35, 0, N, N, N, N),
	MUX(1, 36, 0, N, N, N, N),
	MUX(1, 85, 0, N, N, N, N),
	MUX(1, 86, 0, N, N, N, N),
	MUX(1, 87, 0, N, N, N, N),
	MUX(1, 88, 0, N, N, N, N),
	MUX(1, 89, 0, N, N, N, N),
	MUX(1, 90, 0, N, N, N, N),
	MUX(1, 129, 0, N, N, N, N),
	MUX(1, 130, 0, N, N, N, N),
	MUX(1, 131, 0, N, N, N, N),
	MUX(1, 132, 0, N, N, N, N),
	MUX(1, 91, 0, N, N, N, N),
	MUX(1, 92, 0, N, N, N, N),
	MUX(1, 93, 0, N, N, N, N),
	MUX(1, 94, 0, N, N, N, N),
	MUX(1, 95, 0, N, N, N, N),
	MUX(1, 96, 0, N, N, N, N),
	MUX(1, 112, 0, N, N, N, N),
	MUX(1, 113, 0, N, N, N, N),
	MUX(1, 114, 0, N, N, N, N),
	MUX(1, 115, 0, N, N, N, N),
	MUX(1, 116, 0, N, N, N, N),
	MUX(1, 117, 0, N, N, N, N),
	MUX(1, 118, 0, N, N, N, N),
};

static struct atlas7_grp_mux sdio_i2s_gpio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sdio_i2s_gpio_grp_pad_mux),
	.pad_mux_list = sdio_i2s_gpio_grp_pad_mux,
};

static struct atlas7_pad_mux sp_rgmii_gpio_grp_pad_mux[] = {
	MUX(1, 97, 0, N, N, N, N),
	MUX(1, 98, 0, N, N, N, N),
	MUX(1, 99, 0, N, N, N, N),
	MUX(1, 100, 0, N, N, N, N),
	MUX(1, 101, 0, N, N, N, N),
	MUX(1, 102, 0, N, N, N, N),
	MUX(1, 103, 0, N, N, N, N),
	MUX(1, 104, 0, N, N, N, N),
	MUX(1, 105, 0, N, N, N, N),
	MUX(1, 106, 0, N, N, N, N),
	MUX(1, 107, 0, N, N, N, N),
	MUX(1, 108, 0, N, N, N, N),
	MUX(1, 109, 0, N, N, N, N),
	MUX(1, 110, 0, N, N, N, N),
	MUX(1, 111, 0, N, N, N, N),
	MUX(1, 18, 0, N, N, N, N),
	MUX(1, 19, 0, N, N, N, N),
	MUX(1, 20, 0, N, N, N, N),
	MUX(1, 21, 0, N, N, N, N),
	MUX(1, 141, 0, N, N, N, N),
	MUX(1, 142, 0, N, N, N, N),
	MUX(1, 143, 0, N, N, N, N),
	MUX(1, 144, 0, N, N, N, N),
	MUX(1, 145, 0, N, N, N, N),
	MUX(1, 146, 0, N, N, N, N),
	MUX(1, 147, 0, N, N, N, N),
	MUX(1, 148, 0, N, N, N, N),
};

static struct atlas7_grp_mux sp_rgmii_gpio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sp_rgmii_gpio_grp_pad_mux),
	.pad_mux_list = sp_rgmii_gpio_grp_pad_mux,
};

static struct atlas7_pad_mux lvds_gpio_grp_pad_mux[] = {
	MUX(1, 157, 0, N, N, N, N),
	MUX(1, 158, 0, N, N, N, N),
	MUX(1, 155, 0, N, N, N, N),
	MUX(1, 156, 0, N, N, N, N),
	MUX(1, 153, 0, N, N, N, N),
	MUX(1, 154, 0, N, N, N, N),
	MUX(1, 151, 0, N, N, N, N),
	MUX(1, 152, 0, N, N, N, N),
	MUX(1, 149, 0, N, N, N, N),
	MUX(1, 150, 0, N, N, N, N),
};

static struct atlas7_grp_mux lvds_gpio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(lvds_gpio_grp_pad_mux),
	.pad_mux_list = lvds_gpio_grp_pad_mux,
};

static struct atlas7_pad_mux jtag_uart_nand_gpio_grp_pad_mux[] = {
	MUX(1, 44, 0, N, N, N, N),
	MUX(1, 43, 0, N, N, N, N),
	MUX(1, 42, 0, N, N, N, N),
	MUX(1, 41, 0, N, N, N, N),
	MUX(1, 40, 0, N, N, N, N),
	MUX(1, 39, 0, N, N, N, N),
	MUX(1, 38, 0, N, N, N, N),
	MUX(1, 37, 0, N, N, N, N),
	MUX(1, 46, 0, N, N, N, N),
	MUX(1, 47, 0, N, N, N, N),
	MUX(1, 48, 0, N, N, N, N),
	MUX(1, 49, 0, N, N, N, N),
	MUX(1, 50, 0, N, N, N, N),
	MUX(1, 52, 0, N, N, N, N),
	MUX(1, 51, 0, N, N, N, N),
	MUX(1, 45, 0, N, N, N, N),
	MUX(1, 133, 0, N, N, N, N),
	MUX(1, 134, 0, N, N, N, N),
	MUX(1, 135, 0, N, N, N, N),
	MUX(1, 136, 0, N, N, N, N),
	MUX(1, 137, 0, N, N, N, N),
	MUX(1, 138, 0, N, N, N, N),
	MUX(1, 139, 0, N, N, N, N),
	MUX(1, 140, 0, N, N, N, N),
	MUX(1, 159, 0, N, N, N, N),
	MUX(1, 160, 0, N, N, N, N),
	MUX(1, 161, 0, N, N, N, N),
	MUX(1, 162, 0, N, N, N, N),
	MUX(1, 163, 0, N, N, N, N),
};

static struct atlas7_grp_mux jtag_uart_nand_gpio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_uart_nand_gpio_grp_pad_mux),
	.pad_mux_list = jtag_uart_nand_gpio_grp_pad_mux,
};

static struct atlas7_pad_mux rtc_gpio_grp_pad_mux[] = {
	MUX(0, 0, 0, N, N, N, N),
	MUX(0, 1, 0, N, N, N, N),
	MUX(0, 2, 0, N, N, N, N),
	MUX(0, 3, 0, N, N, N, N),
	MUX(0, 4, 0, N, N, N, N),
	MUX(0, 10, 0, N, N, N, N),
	MUX(0, 11, 0, N, N, N, N),
	MUX(0, 12, 0, N, N, N, N),
	MUX(0, 13, 0, N, N, N, N),
	MUX(0, 14, 0, N, N, N, N),
	MUX(0, 15, 0, N, N, N, N),
	MUX(0, 16, 0, N, N, N, N),
	MUX(0, 17, 0, N, N, N, N),
	MUX(0, 9, 0, N, N, N, N),
};

static struct atlas7_grp_mux rtc_gpio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(rtc_gpio_grp_pad_mux),
	.pad_mux_list = rtc_gpio_grp_pad_mux,
};

static struct atlas7_pad_mux audio_ac97_grp_pad_mux[] = {
	MUX(1, 113, 2, N, N, N, N),
	MUX(1, 118, 2, N, N, N, N),
	MUX(1, 115, 2, N, N, N, N),
	MUX(1, 114, 2, N, N, N, N),
};

static struct atlas7_grp_mux audio_ac97_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_ac97_grp_pad_mux),
	.pad_mux_list = audio_ac97_grp_pad_mux,
};

static struct atlas7_pad_mux audio_digmic_grp0_pad_mux[] = {
	MUX(1, 51, 3, 0xa10, 20, 0xa90, 20),
};

static struct atlas7_grp_mux audio_digmic_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_digmic_grp0_pad_mux),
	.pad_mux_list = audio_digmic_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_digmic_grp1_pad_mux[] = {
	MUX(1, 122, 5, 0xa10, 20, 0xa90, 20),
};

static struct atlas7_grp_mux audio_digmic_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_digmic_grp1_pad_mux),
	.pad_mux_list = audio_digmic_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_digmic_grp2_pad_mux[] = {
	MUX(1, 161, 7, 0xa10, 20, 0xa90, 20),
};

static struct atlas7_grp_mux audio_digmic_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_digmic_grp2_pad_mux),
	.pad_mux_list = audio_digmic_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_func_dbg_grp_pad_mux[] = {
	MUX(1, 141, 4, N, N, N, N),
	MUX(1, 144, 4, N, N, N, N),
	MUX(1, 44, 6, N, N, N, N),
	MUX(1, 43, 6, N, N, N, N),
	MUX(1, 42, 6, N, N, N, N),
	MUX(1, 41, 6, N, N, N, N),
	MUX(1, 40, 6, N, N, N, N),
	MUX(1, 39, 6, N, N, N, N),
	MUX(1, 38, 6, N, N, N, N),
	MUX(1, 37, 6, N, N, N, N),
	MUX(1, 74, 6, N, N, N, N),
	MUX(1, 75, 6, N, N, N, N),
	MUX(1, 76, 6, N, N, N, N),
	MUX(1, 77, 6, N, N, N, N),
	MUX(1, 78, 6, N, N, N, N),
	MUX(1, 79, 6, N, N, N, N),
	MUX(1, 81, 6, N, N, N, N),
	MUX(1, 113, 6, N, N, N, N),
	MUX(1, 114, 6, N, N, N, N),
	MUX(1, 118, 6, N, N, N, N),
	MUX(1, 115, 6, N, N, N, N),
	MUX(1, 49, 6, N, N, N, N),
	MUX(1, 50, 6, N, N, N, N),
	MUX(1, 142, 4, N, N, N, N),
	MUX(1, 143, 4, N, N, N, N),
	MUX(1, 80, 6, N, N, N, N),
};

static struct atlas7_grp_mux audio_func_dbg_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_func_dbg_grp_pad_mux),
	.pad_mux_list = audio_func_dbg_grp_pad_mux,
};

static struct atlas7_pad_mux audio_i2s_grp_pad_mux[] = {
	MUX(1, 118, 1, N, N, N, N),
	MUX(1, 115, 1, N, N, N, N),
	MUX(1, 116, 1, N, N, N, N),
	MUX(1, 117, 1, N, N, N, N),
	MUX(1, 112, 1, N, N, N, N),
	MUX(1, 113, 1, N, N, N, N),
	MUX(1, 114, 1, N, N, N, N),
};

static struct atlas7_grp_mux audio_i2s_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_i2s_grp_pad_mux),
	.pad_mux_list = audio_i2s_grp_pad_mux,
};

static struct atlas7_pad_mux audio_i2s_2ch_grp_pad_mux[] = {
	MUX(1, 118, 1, N, N, N, N),
	MUX(1, 115, 1, N, N, N, N),
	MUX(1, 112, 1, N, N, N, N),
	MUX(1, 113, 1, N, N, N, N),
	MUX(1, 114, 1, N, N, N, N),
};

static struct atlas7_grp_mux audio_i2s_2ch_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_i2s_2ch_grp_pad_mux),
	.pad_mux_list = audio_i2s_2ch_grp_pad_mux,
};

static struct atlas7_pad_mux audio_i2s_extclk_grp_pad_mux[] = {
	MUX(1, 112, 2, N, N, N, N),
};

static struct atlas7_grp_mux audio_i2s_extclk_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_i2s_extclk_grp_pad_mux),
	.pad_mux_list = audio_i2s_extclk_grp_pad_mux,
};

static struct atlas7_pad_mux audio_spdif_out_grp0_pad_mux[] = {
	MUX(1, 112, 3, N, N, N, N),
};

static struct atlas7_grp_mux audio_spdif_out_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_spdif_out_grp0_pad_mux),
	.pad_mux_list = audio_spdif_out_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_spdif_out_grp1_pad_mux[] = {
	MUX(1, 116, 3, N, N, N, N),
};

static struct atlas7_grp_mux audio_spdif_out_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_spdif_out_grp1_pad_mux),
	.pad_mux_list = audio_spdif_out_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_spdif_out_grp2_pad_mux[] = {
	MUX(1, 142, 3, N, N, N, N),
};

static struct atlas7_grp_mux audio_spdif_out_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_spdif_out_grp2_pad_mux),
	.pad_mux_list = audio_spdif_out_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_uart0_basic_grp_pad_mux[] = {
	MUX(1, 143, 1, N, N, N, N),
	MUX(1, 142, 1, N, N, N, N),
	MUX(1, 141, 1, N, N, N, N),
	MUX(1, 144, 1, N, N, N, N),
};

static struct atlas7_grp_mux audio_uart0_basic_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart0_basic_grp_pad_mux),
	.pad_mux_list = audio_uart0_basic_grp_pad_mux,
};

static struct atlas7_pad_mux audio_uart0_urfs_grp0_pad_mux[] = {
	MUX(1, 117, 5, 0xa10, 28, 0xa90, 28),
};

static struct atlas7_grp_mux audio_uart0_urfs_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp0_pad_mux),
	.pad_mux_list = audio_uart0_urfs_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_uart0_urfs_grp1_pad_mux[] = {
	MUX(1, 139, 3, 0xa10, 28, 0xa90, 28),
};

static struct atlas7_grp_mux audio_uart0_urfs_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp1_pad_mux),
	.pad_mux_list = audio_uart0_urfs_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_uart0_urfs_grp2_pad_mux[] = {
	MUX(1, 163, 3, 0xa10, 28, 0xa90, 28),
};

static struct atlas7_grp_mux audio_uart0_urfs_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp2_pad_mux),
	.pad_mux_list = audio_uart0_urfs_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_uart0_urfs_grp3_pad_mux[] = {
	MUX(1, 162, 6, 0xa10, 28, 0xa90, 28),
};

static struct atlas7_grp_mux audio_uart0_urfs_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart0_urfs_grp3_pad_mux),
	.pad_mux_list = audio_uart0_urfs_grp3_pad_mux,
};

static struct atlas7_pad_mux audio_uart1_basic_grp_pad_mux[] = {
	MUX(1, 147, 1, 0xa10, 24, 0xa90, 24),
	MUX(1, 146, 1, 0xa10, 25, 0xa90, 25),
	MUX(1, 145, 1, 0xa10, 23, 0xa90, 23),
	MUX(1, 148, 1, 0xa10, 22, 0xa90, 22),
};

static struct atlas7_grp_mux audio_uart1_basic_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart1_basic_grp_pad_mux),
	.pad_mux_list = audio_uart1_basic_grp_pad_mux,
};

static struct atlas7_pad_mux audio_uart1_urfs_grp0_pad_mux[] = {
	MUX(1, 117, 6, 0xa10, 29, 0xa90, 29),
};

static struct atlas7_grp_mux audio_uart1_urfs_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart1_urfs_grp0_pad_mux),
	.pad_mux_list = audio_uart1_urfs_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_uart1_urfs_grp1_pad_mux[] = {
	MUX(1, 140, 3, 0xa10, 29, 0xa90, 29),
};

static struct atlas7_grp_mux audio_uart1_urfs_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart1_urfs_grp1_pad_mux),
	.pad_mux_list = audio_uart1_urfs_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_uart1_urfs_grp2_pad_mux[] = {
	MUX(1, 163, 4, 0xa10, 29, 0xa90, 29),
};

static struct atlas7_grp_mux audio_uart1_urfs_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart1_urfs_grp2_pad_mux),
	.pad_mux_list = audio_uart1_urfs_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_urfs_grp0_pad_mux[] = {
	MUX(1, 139, 4, 0xa10, 30, 0xa90, 30),
};

static struct atlas7_grp_mux audio_uart2_urfs_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_urfs_grp0_pad_mux),
	.pad_mux_list = audio_uart2_urfs_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_urfs_grp1_pad_mux[] = {
	MUX(1, 163, 6, 0xa10, 30, 0xa90, 30),
};

static struct atlas7_grp_mux audio_uart2_urfs_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_urfs_grp1_pad_mux),
	.pad_mux_list = audio_uart2_urfs_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_urfs_grp2_pad_mux[] = {
	MUX(1, 96, 3, 0xa10, 30, 0xa90, 30),
};

static struct atlas7_grp_mux audio_uart2_urfs_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_urfs_grp2_pad_mux),
	.pad_mux_list = audio_uart2_urfs_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_urxd_grp0_pad_mux[] = {
	MUX(1, 20, 2, 0xa00, 24, 0xa80, 24),
};

static struct atlas7_grp_mux audio_uart2_urxd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_urxd_grp0_pad_mux),
	.pad_mux_list = audio_uart2_urxd_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_urxd_grp1_pad_mux[] = {
	MUX(1, 109, 2, 0xa00, 24, 0xa80, 24),
};

static struct atlas7_grp_mux audio_uart2_urxd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_urxd_grp1_pad_mux),
	.pad_mux_list = audio_uart2_urxd_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_urxd_grp2_pad_mux[] = {
	MUX(1, 93, 3, 0xa00, 24, 0xa80, 24),
};

static struct atlas7_grp_mux audio_uart2_urxd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_urxd_grp2_pad_mux),
	.pad_mux_list = audio_uart2_urxd_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_usclk_grp0_pad_mux[] = {
	MUX(1, 19, 2, 0xa00, 23, 0xa80, 23),
};

static struct atlas7_grp_mux audio_uart2_usclk_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_usclk_grp0_pad_mux),
	.pad_mux_list = audio_uart2_usclk_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_usclk_grp1_pad_mux[] = {
	MUX(1, 101, 2, 0xa00, 23, 0xa80, 23),
};

static struct atlas7_grp_mux audio_uart2_usclk_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_usclk_grp1_pad_mux),
	.pad_mux_list = audio_uart2_usclk_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_usclk_grp2_pad_mux[] = {
	MUX(1, 91, 3, 0xa00, 23, 0xa80, 23),
};

static struct atlas7_grp_mux audio_uart2_usclk_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_usclk_grp2_pad_mux),
	.pad_mux_list = audio_uart2_usclk_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_utfs_grp0_pad_mux[] = {
	MUX(1, 18, 2, 0xa00, 22, 0xa80, 22),
};

static struct atlas7_grp_mux audio_uart2_utfs_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_utfs_grp0_pad_mux),
	.pad_mux_list = audio_uart2_utfs_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_utfs_grp1_pad_mux[] = {
	MUX(1, 111, 2, 0xa00, 22, 0xa80, 22),
};

static struct atlas7_grp_mux audio_uart2_utfs_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_utfs_grp1_pad_mux),
	.pad_mux_list = audio_uart2_utfs_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_utfs_grp2_pad_mux[] = {
	MUX(1, 94, 3, 0xa00, 22, 0xa80, 22),
};

static struct atlas7_grp_mux audio_uart2_utfs_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_utfs_grp2_pad_mux),
	.pad_mux_list = audio_uart2_utfs_grp2_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_utxd_grp0_pad_mux[] = {
	MUX(1, 21, 2, 0xa00, 25, 0xa80, 25),
};

static struct atlas7_grp_mux audio_uart2_utxd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_utxd_grp0_pad_mux),
	.pad_mux_list = audio_uart2_utxd_grp0_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_utxd_grp1_pad_mux[] = {
	MUX(1, 110, 2, 0xa00, 25, 0xa80, 25),
};

static struct atlas7_grp_mux audio_uart2_utxd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_utxd_grp1_pad_mux),
	.pad_mux_list = audio_uart2_utxd_grp1_pad_mux,
};

static struct atlas7_pad_mux audio_uart2_utxd_grp2_pad_mux[] = {
	MUX(1, 92, 3, 0xa00, 25, 0xa80, 25),
};

static struct atlas7_grp_mux audio_uart2_utxd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(audio_uart2_utxd_grp2_pad_mux),
	.pad_mux_list = audio_uart2_utxd_grp2_pad_mux,
};

static struct atlas7_pad_mux c_can_trnsvr_en_grp0_pad_mux[] = {
	MUX(0, 2, 6, N, N, N, N),
};

static struct atlas7_grp_mux c_can_trnsvr_en_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(c_can_trnsvr_en_grp0_pad_mux),
	.pad_mux_list = c_can_trnsvr_en_grp0_pad_mux,
};

static struct atlas7_pad_mux c_can_trnsvr_en_grp1_pad_mux[] = {
	MUX(0, 0, 2, N, N, N, N),
};

static struct atlas7_grp_mux c_can_trnsvr_en_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(c_can_trnsvr_en_grp1_pad_mux),
	.pad_mux_list = c_can_trnsvr_en_grp1_pad_mux,
};

static struct atlas7_pad_mux c_can_trnsvr_intr_grp_pad_mux[] = {
	MUX(0, 1, 2, N, N, N, N),
};

static struct atlas7_grp_mux c_can_trnsvr_intr_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(c_can_trnsvr_intr_grp_pad_mux),
	.pad_mux_list = c_can_trnsvr_intr_grp_pad_mux,
};

static struct atlas7_pad_mux c_can_trnsvr_stb_n_grp_pad_mux[] = {
	MUX(0, 3, 6, N, N, N, N),
};

static struct atlas7_grp_mux c_can_trnsvr_stb_n_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(c_can_trnsvr_stb_n_grp_pad_mux),
	.pad_mux_list = c_can_trnsvr_stb_n_grp_pad_mux,
};

static struct atlas7_pad_mux c0_can_rxd_trnsv0_grp_pad_mux[] = {
	MUX(0, 11, 1, 0xa08, 9, 0xa88, 9),
};

static struct atlas7_grp_mux c0_can_rxd_trnsv0_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(c0_can_rxd_trnsv0_grp_pad_mux),
	.pad_mux_list = c0_can_rxd_trnsv0_grp_pad_mux,
};

static struct atlas7_pad_mux c0_can_rxd_trnsv1_grp_pad_mux[] = {
	MUX(0, 2, 5, 0xa10, 9, 0xa90, 9),
};

static struct atlas7_grp_mux c0_can_rxd_trnsv1_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(c0_can_rxd_trnsv1_grp_pad_mux),
	.pad_mux_list = c0_can_rxd_trnsv1_grp_pad_mux,
};

static struct atlas7_pad_mux c0_can_txd_trnsv0_grp_pad_mux[] = {
	MUX(0, 10, 1, N, N, N, N),
};

static struct atlas7_grp_mux c0_can_txd_trnsv0_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(c0_can_txd_trnsv0_grp_pad_mux),
	.pad_mux_list = c0_can_txd_trnsv0_grp_pad_mux,
};

static struct atlas7_pad_mux c0_can_txd_trnsv1_grp_pad_mux[] = {
	MUX(0, 3, 5, N, N, N, N),
};

static struct atlas7_grp_mux c0_can_txd_trnsv1_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(c0_can_txd_trnsv1_grp_pad_mux),
	.pad_mux_list = c0_can_txd_trnsv1_grp_pad_mux,
};

static struct atlas7_pad_mux c1_can_rxd_grp0_pad_mux[] = {
	MUX(1, 138, 2, 0xa00, 4, 0xa80, 4),
};

static struct atlas7_grp_mux c1_can_rxd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp0_pad_mux),
	.pad_mux_list = c1_can_rxd_grp0_pad_mux,
};

static struct atlas7_pad_mux c1_can_rxd_grp1_pad_mux[] = {
	MUX(1, 147, 2, 0xa00, 4, 0xa80, 4),
};

static struct atlas7_grp_mux c1_can_rxd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp1_pad_mux),
	.pad_mux_list = c1_can_rxd_grp1_pad_mux,
};

static struct atlas7_pad_mux c1_can_rxd_grp2_pad_mux[] = {
	MUX(0, 2, 2, 0xa00, 4, 0xa80, 4),
};

static struct atlas7_grp_mux c1_can_rxd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp2_pad_mux),
	.pad_mux_list = c1_can_rxd_grp2_pad_mux,
};

static struct atlas7_pad_mux c1_can_rxd_grp3_pad_mux[] = {
	MUX(1, 162, 4, 0xa00, 4, 0xa80, 4),
};

static struct atlas7_grp_mux c1_can_rxd_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_rxd_grp3_pad_mux),
	.pad_mux_list = c1_can_rxd_grp3_pad_mux,
};

static struct atlas7_pad_mux c1_can_txd_grp0_pad_mux[] = {
	MUX(1, 137, 2, N, N, N, N),
};

static struct atlas7_grp_mux c1_can_txd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_txd_grp0_pad_mux),
	.pad_mux_list = c1_can_txd_grp0_pad_mux,
};

static struct atlas7_pad_mux c1_can_txd_grp1_pad_mux[] = {
	MUX(1, 146, 2, N, N, N, N),
};

static struct atlas7_grp_mux c1_can_txd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_txd_grp1_pad_mux),
	.pad_mux_list = c1_can_txd_grp1_pad_mux,
};

static struct atlas7_pad_mux c1_can_txd_grp2_pad_mux[] = {
	MUX(0, 3, 2, N, N, N, N),
};

static struct atlas7_grp_mux c1_can_txd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_txd_grp2_pad_mux),
	.pad_mux_list = c1_can_txd_grp2_pad_mux,
};

static struct atlas7_pad_mux c1_can_txd_grp3_pad_mux[] = {
	MUX(1, 161, 4, N, N, N, N),
};

static struct atlas7_grp_mux c1_can_txd_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(c1_can_txd_grp3_pad_mux),
	.pad_mux_list = c1_can_txd_grp3_pad_mux,
};

static struct atlas7_pad_mux ca_audio_lpc_grp_pad_mux[] = {
	MUX(1, 62, 4, N, N, N, N),
	MUX(1, 63, 4, N, N, N, N),
	MUX(1, 64, 4, N, N, N, N),
	MUX(1, 65, 4, N, N, N, N),
	MUX(1, 66, 4, N, N, N, N),
	MUX(1, 67, 4, N, N, N, N),
	MUX(1, 68, 4, N, N, N, N),
	MUX(1, 69, 4, N, N, N, N),
	MUX(1, 70, 4, N, N, N, N),
	MUX(1, 71, 4, N, N, N, N),
};

static struct atlas7_grp_mux ca_audio_lpc_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_audio_lpc_grp_pad_mux),
	.pad_mux_list = ca_audio_lpc_grp_pad_mux,
};

static struct atlas7_pad_mux ca_bt_lpc_grp_pad_mux[] = {
	MUX(1, 85, 5, N, N, N, N),
	MUX(1, 86, 5, N, N, N, N),
	MUX(1, 87, 5, N, N, N, N),
	MUX(1, 88, 5, N, N, N, N),
	MUX(1, 89, 5, N, N, N, N),
	MUX(1, 90, 5, N, N, N, N),
};

static struct atlas7_grp_mux ca_bt_lpc_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_bt_lpc_grp_pad_mux),
	.pad_mux_list = ca_bt_lpc_grp_pad_mux,
};

static struct atlas7_pad_mux ca_coex_grp_pad_mux[] = {
	MUX(1, 129, 1, N, N, N, N),
	MUX(1, 130, 1, N, N, N, N),
	MUX(1, 131, 1, N, N, N, N),
	MUX(1, 132, 1, N, N, N, N),
};

static struct atlas7_grp_mux ca_coex_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_coex_grp_pad_mux),
	.pad_mux_list = ca_coex_grp_pad_mux,
};

static struct atlas7_pad_mux ca_curator_lpc_grp_pad_mux[] = {
	MUX(1, 57, 4, N, N, N, N),
	MUX(1, 58, 4, N, N, N, N),
	MUX(1, 59, 4, N, N, N, N),
	MUX(1, 60, 4, N, N, N, N),
};

static struct atlas7_grp_mux ca_curator_lpc_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_curator_lpc_grp_pad_mux),
	.pad_mux_list = ca_curator_lpc_grp_pad_mux,
};

static struct atlas7_pad_mux ca_pcm_debug_grp_pad_mux[] = {
	MUX(1, 91, 5, N, N, N, N),
	MUX(1, 93, 5, N, N, N, N),
	MUX(1, 94, 5, N, N, N, N),
	MUX(1, 92, 5, N, N, N, N),
};

static struct atlas7_grp_mux ca_pcm_debug_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_pcm_debug_grp_pad_mux),
	.pad_mux_list = ca_pcm_debug_grp_pad_mux,
};

static struct atlas7_pad_mux ca_pio_grp_pad_mux[] = {
	MUX(1, 121, 2, N, N, N, N),
	MUX(1, 122, 2, N, N, N, N),
	MUX(1, 125, 6, N, N, N, N),
	MUX(1, 126, 6, N, N, N, N),
	MUX(1, 38, 5, N, N, N, N),
	MUX(1, 37, 5, N, N, N, N),
	MUX(1, 47, 5, N, N, N, N),
	MUX(1, 49, 5, N, N, N, N),
	MUX(1, 50, 5, N, N, N, N),
	MUX(1, 54, 4, N, N, N, N),
	MUX(1, 55, 4, N, N, N, N),
	MUX(1, 56, 4, N, N, N, N),
};

static struct atlas7_grp_mux ca_pio_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_pio_grp_pad_mux),
	.pad_mux_list = ca_pio_grp_pad_mux,
};

static struct atlas7_pad_mux ca_sdio_debug_grp_pad_mux[] = {
	MUX(1, 40, 5, N, N, N, N),
	MUX(1, 39, 5, N, N, N, N),
	MUX(1, 44, 5, N, N, N, N),
	MUX(1, 43, 5, N, N, N, N),
	MUX(1, 42, 5, N, N, N, N),
	MUX(1, 41, 5, N, N, N, N),
};

static struct atlas7_grp_mux ca_sdio_debug_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_sdio_debug_grp_pad_mux),
	.pad_mux_list = ca_sdio_debug_grp_pad_mux,
};

static struct atlas7_pad_mux ca_spi_grp_pad_mux[] = {
	MUX(1, 82, 5, N, N, N, N),
	MUX(1, 79, 5, 0xa08, 6, 0xa88, 6),
	MUX(1, 80, 5, N, N, N, N),
	MUX(1, 81, 5, N, N, N, N),
};

static struct atlas7_grp_mux ca_spi_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_spi_grp_pad_mux),
	.pad_mux_list = ca_spi_grp_pad_mux,
};

static struct atlas7_pad_mux ca_trb_grp_pad_mux[] = {
	MUX(1, 91, 4, N, N, N, N),
	MUX(1, 93, 4, N, N, N, N),
	MUX(1, 94, 4, N, N, N, N),
	MUX(1, 95, 4, N, N, N, N),
	MUX(1, 96, 4, N, N, N, N),
	MUX(1, 78, 5, N, N, N, N),
	MUX(1, 74, 5, N, N, N, N),
	MUX(1, 75, 5, N, N, N, N),
	MUX(1, 76, 5, N, N, N, N),
	MUX(1, 77, 5, N, N, N, N),
};

static struct atlas7_grp_mux ca_trb_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_trb_grp_pad_mux),
	.pad_mux_list = ca_trb_grp_pad_mux,
};

static struct atlas7_pad_mux ca_uart_debug_grp_pad_mux[] = {
	MUX(1, 136, 3, N, N, N, N),
	MUX(1, 135, 3, N, N, N, N),
	MUX(1, 134, 3, N, N, N, N),
	MUX(1, 133, 3, N, N, N, N),
};

static struct atlas7_grp_mux ca_uart_debug_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ca_uart_debug_grp_pad_mux),
	.pad_mux_list = ca_uart_debug_grp_pad_mux,
};

static struct atlas7_pad_mux clkc_grp0_pad_mux[] = {
	MUX(1, 30, 2, 0xa08, 14, 0xa88, 14),
	MUX(1, 47, 6, N, N, N, N),
};

static struct atlas7_grp_mux clkc_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(clkc_grp0_pad_mux),
	.pad_mux_list = clkc_grp0_pad_mux,
};

static struct atlas7_pad_mux clkc_grp1_pad_mux[] = {
	MUX(1, 78, 3, 0xa08, 14, 0xa88, 14),
	MUX(1, 54, 5, N, N, N, N),
};

static struct atlas7_grp_mux clkc_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(clkc_grp1_pad_mux),
	.pad_mux_list = clkc_grp1_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_i2c_grp_pad_mux[] = {
	MUX(1, 128, 2, N, N, N, N),
	MUX(1, 127, 2, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_i2c_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_i2c_grp_pad_mux),
	.pad_mux_list = gn_gnss_i2c_grp_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_uart_nopause_grp_pad_mux[] = {
	MUX(1, 134, 4, N, N, N, N),
	MUX(1, 133, 4, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_uart_nopause_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_uart_nopause_grp_pad_mux),
	.pad_mux_list = gn_gnss_uart_nopause_grp_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_uart_grp_pad_mux[] = {
	MUX(1, 134, 4, N, N, N, N),
	MUX(1, 133, 4, N, N, N, N),
	MUX(1, 136, 4, N, N, N, N),
	MUX(1, 135, 4, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_uart_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_uart_grp_pad_mux),
	.pad_mux_list = gn_gnss_uart_grp_pad_mux,
};

static struct atlas7_pad_mux gn_trg_spi_grp0_pad_mux[] = {
	MUX(1, 22, 1, N, N, N, N),
	MUX(1, 25, 1, N, N, N, N),
	MUX(1, 23, 1, 0xa00, 10, 0xa80, 10),
	MUX(1, 24, 1, N, N, N, N),
};

static struct atlas7_grp_mux gn_trg_spi_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_spi_grp0_pad_mux),
	.pad_mux_list = gn_trg_spi_grp0_pad_mux,
};

static struct atlas7_pad_mux gn_trg_spi_grp1_pad_mux[] = {
	MUX(1, 82, 3, N, N, N, N),
	MUX(1, 79, 3, N, N, N, N),
	MUX(1, 80, 3, 0xa00, 10, 0xa80, 10),
	MUX(1, 81, 3, N, N, N, N),
};

static struct atlas7_grp_mux gn_trg_spi_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_spi_grp1_pad_mux),
	.pad_mux_list = gn_trg_spi_grp1_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_grp_pad_mux[] = {
	MUX(1, 54, 3, N, N, N, N),
	MUX(1, 53, 3, N, N, N, N),
	MUX(1, 82, 7, N, N, N, N),
	MUX(1, 74, 7, N, N, N, N),
	MUX(1, 75, 7, N, N, N, N),
	MUX(1, 76, 7, N, N, N, N),
	MUX(1, 77, 7, N, N, N, N),
	MUX(1, 78, 7, N, N, N, N),
	MUX(1, 79, 7, N, N, N, N),
	MUX(1, 80, 7, N, N, N, N),
	MUX(1, 81, 7, N, N, N, N),
	MUX(1, 83, 7, N, N, N, N),
	MUX(1, 84, 7, N, N, N, N),
	MUX(1, 73, 3, N, N, N, N),
	MUX(1, 55, 3, N, N, N, N),
	MUX(1, 56, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_grp_pad_mux),
	.pad_mux_list = cvbs_dbg_grp_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp0_pad_mux[] = {
	MUX(1, 57, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp0_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp0_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp1_pad_mux[] = {
	MUX(1, 58, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp1_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp1_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp2_pad_mux[] = {
	MUX(1, 59, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp2_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp2_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp3_pad_mux[] = {
	MUX(1, 60, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp3_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp3_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp4_pad_mux[] = {
	MUX(1, 61, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp4_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp4_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp4_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp5_pad_mux[] = {
	MUX(1, 62, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp5_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp5_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp5_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp6_pad_mux[] = {
	MUX(1, 63, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp6_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp6_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp6_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp7_pad_mux[] = {
	MUX(1, 64, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp7_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp7_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp7_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp8_pad_mux[] = {
	MUX(1, 65, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp8_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp8_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp8_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp9_pad_mux[] = {
	MUX(1, 66, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp9_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp9_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp9_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp10_pad_mux[] = {
	MUX(1, 67, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp10_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp10_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp10_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp11_pad_mux[] = {
	MUX(1, 68, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp11_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp11_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp11_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp12_pad_mux[] = {
	MUX(1, 69, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp12_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp12_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp12_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp13_pad_mux[] = {
	MUX(1, 70, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp13_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp13_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp13_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp14_pad_mux[] = {
	MUX(1, 71, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp14_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp14_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp14_pad_mux,
};

static struct atlas7_pad_mux cvbs_dbg_test_grp15_pad_mux[] = {
	MUX(1, 72, 3, N, N, N, N),
};

static struct atlas7_grp_mux cvbs_dbg_test_grp15_mux = {
	.pad_mux_count = ARRAY_SIZE(cvbs_dbg_test_grp15_pad_mux),
	.pad_mux_list = cvbs_dbg_test_grp15_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_power_grp_pad_mux[] = {
	MUX(1, 123, 7, N, N, N, N),
	MUX(1, 124, 7, N, N, N, N),
	MUX(1, 121, 7, N, N, N, N),
	MUX(1, 122, 7, N, N, N, N),
	MUX(1, 125, 7, N, N, N, N),
	MUX(1, 120, 7, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_power_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_power_grp_pad_mux),
	.pad_mux_list = gn_gnss_power_grp_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_sw_status_grp_pad_mux[] = {
	MUX(1, 57, 7, N, N, N, N),
	MUX(1, 58, 7, N, N, N, N),
	MUX(1, 59, 7, N, N, N, N),
	MUX(1, 60, 7, N, N, N, N),
	MUX(1, 61, 7, N, N, N, N),
	MUX(1, 62, 7, N, N, N, N),
	MUX(1, 63, 7, N, N, N, N),
	MUX(1, 64, 7, N, N, N, N),
	MUX(1, 65, 7, N, N, N, N),
	MUX(1, 66, 7, N, N, N, N),
	MUX(1, 67, 7, N, N, N, N),
	MUX(1, 68, 7, N, N, N, N),
	MUX(1, 69, 7, N, N, N, N),
	MUX(1, 70, 7, N, N, N, N),
	MUX(1, 71, 7, N, N, N, N),
	MUX(1, 72, 7, N, N, N, N),
	MUX(1, 53, 7, N, N, N, N),
	MUX(1, 55, 7, N, N, N, N),
	MUX(1, 56, 7, 0xa08, 12, 0xa88, 12),
	MUX(1, 54, 7, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_sw_status_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_sw_status_grp_pad_mux),
	.pad_mux_list = gn_gnss_sw_status_grp_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_eclk_grp_pad_mux[] = {
	MUX(1, 113, 4, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_eclk_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_eclk_grp_pad_mux),
	.pad_mux_list = gn_gnss_eclk_grp_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_irq1_grp0_pad_mux[] = {
	MUX(1, 112, 4, 0xa08, 10, 0xa88, 10),
};

static struct atlas7_grp_mux gn_gnss_irq1_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_irq1_grp0_pad_mux),
	.pad_mux_list = gn_gnss_irq1_grp0_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_irq2_grp0_pad_mux[] = {
	MUX(1, 118, 4, 0xa08, 11, 0xa88, 11),
};

static struct atlas7_grp_mux gn_gnss_irq2_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_irq2_grp0_pad_mux),
	.pad_mux_list = gn_gnss_irq2_grp0_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_tm_grp_pad_mux[] = {
	MUX(1, 115, 4, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_tm_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_tm_grp_pad_mux),
	.pad_mux_list = gn_gnss_tm_grp_pad_mux,
};

static struct atlas7_pad_mux gn_gnss_tsync_grp_pad_mux[] = {
	MUX(1, 114, 4, N, N, N, N),
};

static struct atlas7_grp_mux gn_gnss_tsync_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_gnss_tsync_grp_pad_mux),
	.pad_mux_list = gn_gnss_tsync_grp_pad_mux,
};

static struct atlas7_pad_mux gn_io_gnsssys_sw_cfg_grp_pad_mux[] = {
	MUX(1, 44, 7, N, N, N, N),
	MUX(1, 43, 7, N, N, N, N),
	MUX(1, 42, 7, N, N, N, N),
	MUX(1, 41, 7, N, N, N, N),
	MUX(1, 40, 7, N, N, N, N),
	MUX(1, 39, 7, N, N, N, N),
	MUX(1, 38, 7, N, N, N, N),
	MUX(1, 37, 7, N, N, N, N),
	MUX(1, 49, 7, N, N, N, N),
	MUX(1, 50, 7, N, N, N, N),
	MUX(1, 91, 7, N, N, N, N),
	MUX(1, 92, 7, N, N, N, N),
	MUX(1, 93, 7, N, N, N, N),
	MUX(1, 94, 7, N, N, N, N),
	MUX(1, 95, 7, N, N, N, N),
	MUX(1, 96, 7, N, N, N, N),
};

static struct atlas7_grp_mux gn_io_gnsssys_sw_cfg_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_io_gnsssys_sw_cfg_grp_pad_mux),
	.pad_mux_list = gn_io_gnsssys_sw_cfg_grp_pad_mux,
};

static struct atlas7_pad_mux gn_trg_grp0_pad_mux[] = {
	MUX(1, 29, 1, 0xa00, 6, 0xa80, 6),
	MUX(1, 28, 1, 0xa00, 7, 0xa80, 7),
	MUX(1, 26, 1, 0xa00, 8, 0xa80, 8),
	MUX(1, 27, 1, 0xa00, 9, 0xa80, 9),
};

static struct atlas7_grp_mux gn_trg_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_grp0_pad_mux),
	.pad_mux_list = gn_trg_grp0_pad_mux,
};

static struct atlas7_pad_mux gn_trg_grp1_pad_mux[] = {
	MUX(1, 77, 3, 0xa00, 6, 0xa80, 6),
	MUX(1, 76, 3, 0xa00, 7, 0xa80, 7),
	MUX(1, 74, 3, 0xa00, 8, 0xa80, 8),
	MUX(1, 75, 3, 0xa00, 9, 0xa80, 9),
};

static struct atlas7_grp_mux gn_trg_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_grp1_pad_mux),
	.pad_mux_list = gn_trg_grp1_pad_mux,
};

static struct atlas7_pad_mux gn_trg_shutdown_grp0_pad_mux[] = {
	MUX(1, 30, 1, N, N, N, N),
};

static struct atlas7_grp_mux gn_trg_shutdown_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp0_pad_mux),
	.pad_mux_list = gn_trg_shutdown_grp0_pad_mux,
};

static struct atlas7_pad_mux gn_trg_shutdown_grp1_pad_mux[] = {
	MUX(1, 83, 3, N, N, N, N),
};

static struct atlas7_grp_mux gn_trg_shutdown_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp1_pad_mux),
	.pad_mux_list = gn_trg_shutdown_grp1_pad_mux,
};

static struct atlas7_pad_mux gn_trg_shutdown_grp2_pad_mux[] = {
	MUX(1, 117, 4, N, N, N, N),
};

static struct atlas7_grp_mux gn_trg_shutdown_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp2_pad_mux),
	.pad_mux_list = gn_trg_shutdown_grp2_pad_mux,
};

static struct atlas7_pad_mux gn_trg_shutdown_grp3_pad_mux[] = {
	MUX(1, 123, 5, N, N, N, N),
};

static struct atlas7_grp_mux gn_trg_shutdown_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(gn_trg_shutdown_grp3_pad_mux),
	.pad_mux_list = gn_trg_shutdown_grp3_pad_mux,
};

static struct atlas7_pad_mux i2c0_grp_pad_mux[] = {
	MUX(1, 128, 1, N, N, N, N),
	MUX(1, 127, 1, N, N, N, N),
};

static struct atlas7_grp_mux i2c0_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(i2c0_grp_pad_mux),
	.pad_mux_list = i2c0_grp_pad_mux,
};

static struct atlas7_pad_mux i2c1_grp_pad_mux[] = {
	MUX(1, 126, 4, N, N, N, N),
	MUX(1, 125, 4, N, N, N, N),
};

static struct atlas7_grp_mux i2c1_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(i2c1_grp_pad_mux),
	.pad_mux_list = i2c1_grp_pad_mux,
};

static struct atlas7_pad_mux i2s0_grp_pad_mux[] = {
	MUX(1, 91, 2, 0xa10, 12, 0xa90, 12),
	MUX(1, 93, 2, 0xa10, 13, 0xa90, 13),
	MUX(1, 94, 2, 0xa10, 14, 0xa90, 14),
	MUX(1, 92, 2, 0xa10, 15, 0xa90, 15),
};

static struct atlas7_grp_mux i2s0_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s0_grp_pad_mux),
	.pad_mux_list = i2s0_grp_pad_mux,
};

static struct atlas7_pad_mux i2s1_basic_grp_pad_mux[] = {
	MUX(1, 95, 2, 0xa10, 16, 0xa90, 16),
	MUX(1, 96, 2, 0xa10, 19, 0xa90, 19),
};

static struct atlas7_grp_mux i2s1_basic_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_basic_grp_pad_mux),
	.pad_mux_list = i2s1_basic_grp_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd0_grp0_pad_mux[] = {
	MUX(1, 61, 4, 0xa10, 17, 0xa90, 17),
};

static struct atlas7_grp_mux i2s1_rxd0_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp0_pad_mux),
	.pad_mux_list = i2s1_rxd0_grp0_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd0_grp1_pad_mux[] = {
	MUX(1, 131, 4, 0xa10, 17, 0xa90, 17),
};

static struct atlas7_grp_mux i2s1_rxd0_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp1_pad_mux),
	.pad_mux_list = i2s1_rxd0_grp1_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd0_grp2_pad_mux[] = {
	MUX(1, 129, 2, 0xa10, 17, 0xa90, 17),
};

static struct atlas7_grp_mux i2s1_rxd0_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp2_pad_mux),
	.pad_mux_list = i2s1_rxd0_grp2_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd0_grp3_pad_mux[] = {
	MUX(1, 117, 7, 0xa10, 17, 0xa90, 17),
};

static struct atlas7_grp_mux i2s1_rxd0_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp3_pad_mux),
	.pad_mux_list = i2s1_rxd0_grp3_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd0_grp4_pad_mux[] = {
	MUX(1, 83, 4, 0xa10, 17, 0xa90, 17),
};

static struct atlas7_grp_mux i2s1_rxd0_grp4_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd0_grp4_pad_mux),
	.pad_mux_list = i2s1_rxd0_grp4_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd1_grp0_pad_mux[] = {
	MUX(1, 72, 4, 0xa10, 18, 0xa90, 18),
};

static struct atlas7_grp_mux i2s1_rxd1_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp0_pad_mux),
	.pad_mux_list = i2s1_rxd1_grp0_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd1_grp1_pad_mux[] = {
	MUX(1, 132, 4, 0xa10, 18, 0xa90, 18),
};

static struct atlas7_grp_mux i2s1_rxd1_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp1_pad_mux),
	.pad_mux_list = i2s1_rxd1_grp1_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd1_grp2_pad_mux[] = {
	MUX(1, 130, 2, 0xa10, 18, 0xa90, 18),
};

static struct atlas7_grp_mux i2s1_rxd1_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp2_pad_mux),
	.pad_mux_list = i2s1_rxd1_grp2_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd1_grp3_pad_mux[] = {
	MUX(1, 118, 7, 0xa10, 18, 0xa90, 18),
};

static struct atlas7_grp_mux i2s1_rxd1_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp3_pad_mux),
	.pad_mux_list = i2s1_rxd1_grp3_pad_mux,
};

static struct atlas7_pad_mux i2s1_rxd1_grp4_pad_mux[] = {
	MUX(1, 84, 4, 0xa10, 18, 0xa90, 18),
};

static struct atlas7_grp_mux i2s1_rxd1_grp4_mux = {
	.pad_mux_count = ARRAY_SIZE(i2s1_rxd1_grp4_pad_mux),
	.pad_mux_list = i2s1_rxd1_grp4_pad_mux,
};

static struct atlas7_pad_mux jtag_jt_dbg_nsrst_grp_pad_mux[] = {
	MUX(1, 125, 5, 0xa08, 2, 0xa88, 2),
};

static struct atlas7_grp_mux jtag_jt_dbg_nsrst_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_jt_dbg_nsrst_grp_pad_mux),
	.pad_mux_list = jtag_jt_dbg_nsrst_grp_pad_mux,
};

static struct atlas7_pad_mux jtag_ntrst_grp0_pad_mux[] = {
	MUX(0, 4, 3, 0xa08, 3, 0xa88, 3),
};

static struct atlas7_grp_mux jtag_ntrst_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_ntrst_grp0_pad_mux),
	.pad_mux_list = jtag_ntrst_grp0_pad_mux,
};

static struct atlas7_pad_mux jtag_ntrst_grp1_pad_mux[] = {
	MUX(1, 163, 1, 0xa08, 3, 0xa88, 3),
};

static struct atlas7_grp_mux jtag_ntrst_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_ntrst_grp1_pad_mux),
	.pad_mux_list = jtag_ntrst_grp1_pad_mux,
};

static struct atlas7_pad_mux jtag_swdiotms_grp0_pad_mux[] = {
	MUX(0, 2, 3, 0xa10, 10, 0xa90, 10),
};

static struct atlas7_grp_mux jtag_swdiotms_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_swdiotms_grp0_pad_mux),
	.pad_mux_list = jtag_swdiotms_grp0_pad_mux,
};

static struct atlas7_pad_mux jtag_swdiotms_grp1_pad_mux[] = {
	MUX(1, 160, 1, 0xa10, 10, 0xa90, 10),
};

static struct atlas7_grp_mux jtag_swdiotms_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_swdiotms_grp1_pad_mux),
	.pad_mux_list = jtag_swdiotms_grp1_pad_mux,
};

static struct atlas7_pad_mux jtag_tck_grp0_pad_mux[] = {
	MUX(0, 0, 3, 0xa10, 11, 0xa90, 11),
};

static struct atlas7_grp_mux jtag_tck_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_tck_grp0_pad_mux),
	.pad_mux_list = jtag_tck_grp0_pad_mux,
};

static struct atlas7_pad_mux jtag_tck_grp1_pad_mux[] = {
	MUX(1, 161, 1, 0xa10, 11, 0xa90, 11),
};

static struct atlas7_grp_mux jtag_tck_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_tck_grp1_pad_mux),
	.pad_mux_list = jtag_tck_grp1_pad_mux,
};

static struct atlas7_pad_mux jtag_tdi_grp0_pad_mux[] = {
	MUX(0, 1, 3, 0xa10, 31, 0xa90, 31),
};

static struct atlas7_grp_mux jtag_tdi_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_tdi_grp0_pad_mux),
	.pad_mux_list = jtag_tdi_grp0_pad_mux,
};

static struct atlas7_pad_mux jtag_tdi_grp1_pad_mux[] = {
	MUX(1, 162, 1, 0xa10, 31, 0xa90, 31),
};

static struct atlas7_grp_mux jtag_tdi_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_tdi_grp1_pad_mux),
	.pad_mux_list = jtag_tdi_grp1_pad_mux,
};

static struct atlas7_pad_mux jtag_tdo_grp0_pad_mux[] = {
	MUX(0, 3, 3, N, N, N, N),
};

static struct atlas7_grp_mux jtag_tdo_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_tdo_grp0_pad_mux),
	.pad_mux_list = jtag_tdo_grp0_pad_mux,
};

static struct atlas7_pad_mux jtag_tdo_grp1_pad_mux[] = {
	MUX(1, 159, 1, N, N, N, N),
};

static struct atlas7_grp_mux jtag_tdo_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(jtag_tdo_grp1_pad_mux),
	.pad_mux_list = jtag_tdo_grp1_pad_mux,
};

static struct atlas7_pad_mux ks_kas_spi_grp0_pad_mux[] = {
	MUX(1, 141, 2, N, N, N, N),
	MUX(1, 144, 2, 0xa08, 8, 0xa88, 8),
	MUX(1, 143, 2, N, N, N, N),
	MUX(1, 142, 2, N, N, N, N),
};

static struct atlas7_grp_mux ks_kas_spi_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(ks_kas_spi_grp0_pad_mux),
	.pad_mux_list = ks_kas_spi_grp0_pad_mux,
};

static struct atlas7_pad_mux ld_ldd_grp_pad_mux[] = {
	MUX(1, 57, 1, N, N, N, N),
	MUX(1, 58, 1, N, N, N, N),
	MUX(1, 59, 1, N, N, N, N),
	MUX(1, 60, 1, N, N, N, N),
	MUX(1, 61, 1, N, N, N, N),
	MUX(1, 62, 1, N, N, N, N),
	MUX(1, 63, 1, N, N, N, N),
	MUX(1, 64, 1, N, N, N, N),
	MUX(1, 65, 1, N, N, N, N),
	MUX(1, 66, 1, N, N, N, N),
	MUX(1, 67, 1, N, N, N, N),
	MUX(1, 68, 1, N, N, N, N),
	MUX(1, 69, 1, N, N, N, N),
	MUX(1, 70, 1, N, N, N, N),
	MUX(1, 71, 1, N, N, N, N),
	MUX(1, 72, 1, N, N, N, N),
	MUX(1, 74, 2, N, N, N, N),
	MUX(1, 75, 2, N, N, N, N),
	MUX(1, 76, 2, N, N, N, N),
	MUX(1, 77, 2, N, N, N, N),
	MUX(1, 78, 2, N, N, N, N),
	MUX(1, 79, 2, N, N, N, N),
	MUX(1, 80, 2, N, N, N, N),
	MUX(1, 81, 2, N, N, N, N),
	MUX(1, 56, 1, N, N, N, N),
	MUX(1, 53, 1, N, N, N, N),
};

static struct atlas7_grp_mux ld_ldd_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ld_ldd_grp_pad_mux),
	.pad_mux_list = ld_ldd_grp_pad_mux,
};

static struct atlas7_pad_mux ld_ldd_16bit_grp_pad_mux[] = {
	MUX(1, 57, 1, N, N, N, N),
	MUX(1, 58, 1, N, N, N, N),
	MUX(1, 59, 1, N, N, N, N),
	MUX(1, 60, 1, N, N, N, N),
	MUX(1, 61, 1, N, N, N, N),
	MUX(1, 62, 1, N, N, N, N),
	MUX(1, 63, 1, N, N, N, N),
	MUX(1, 64, 1, N, N, N, N),
	MUX(1, 65, 1, N, N, N, N),
	MUX(1, 66, 1, N, N, N, N),
	MUX(1, 67, 1, N, N, N, N),
	MUX(1, 68, 1, N, N, N, N),
	MUX(1, 69, 1, N, N, N, N),
	MUX(1, 70, 1, N, N, N, N),
	MUX(1, 71, 1, N, N, N, N),
	MUX(1, 72, 1, N, N, N, N),
	MUX(1, 56, 1, N, N, N, N),
	MUX(1, 53, 1, N, N, N, N),
};

static struct atlas7_grp_mux ld_ldd_16bit_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ld_ldd_16bit_grp_pad_mux),
	.pad_mux_list = ld_ldd_16bit_grp_pad_mux,
};

static struct atlas7_pad_mux ld_ldd_fck_grp_pad_mux[] = {
	MUX(1, 55, 1, N, N, N, N),
};

static struct atlas7_grp_mux ld_ldd_fck_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ld_ldd_fck_grp_pad_mux),
	.pad_mux_list = ld_ldd_fck_grp_pad_mux,
};

static struct atlas7_pad_mux ld_ldd_lck_grp_pad_mux[] = {
	MUX(1, 54, 1, N, N, N, N),
};

static struct atlas7_grp_mux ld_ldd_lck_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ld_ldd_lck_grp_pad_mux),
	.pad_mux_list = ld_ldd_lck_grp_pad_mux,
};

static struct atlas7_pad_mux lr_lcdrom_grp_pad_mux[] = {
	MUX(1, 73, 2, N, N, N, N),
	MUX(1, 54, 2, N, N, N, N),
	MUX(1, 57, 2, N, N, N, N),
	MUX(1, 58, 2, N, N, N, N),
	MUX(1, 59, 2, N, N, N, N),
	MUX(1, 60, 2, N, N, N, N),
	MUX(1, 61, 2, N, N, N, N),
	MUX(1, 62, 2, N, N, N, N),
	MUX(1, 63, 2, N, N, N, N),
	MUX(1, 64, 2, N, N, N, N),
	MUX(1, 65, 2, N, N, N, N),
	MUX(1, 66, 2, N, N, N, N),
	MUX(1, 67, 2, N, N, N, N),
	MUX(1, 68, 2, N, N, N, N),
	MUX(1, 69, 2, N, N, N, N),
	MUX(1, 70, 2, N, N, N, N),
	MUX(1, 71, 2, N, N, N, N),
	MUX(1, 72, 2, N, N, N, N),
	MUX(1, 56, 2, N, N, N, N),
	MUX(1, 53, 2, N, N, N, N),
	MUX(1, 55, 2, N, N, N, N),
};

static struct atlas7_grp_mux lr_lcdrom_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(lr_lcdrom_grp_pad_mux),
	.pad_mux_list = lr_lcdrom_grp_pad_mux,
};

static struct atlas7_pad_mux lvds_analog_grp_pad_mux[] = {
	MUX(1, 149, 8, N, N, N, N),
	MUX(1, 150, 8, N, N, N, N),
	MUX(1, 151, 8, N, N, N, N),
	MUX(1, 152, 8, N, N, N, N),
	MUX(1, 153, 8, N, N, N, N),
	MUX(1, 154, 8, N, N, N, N),
	MUX(1, 155, 8, N, N, N, N),
	MUX(1, 156, 8, N, N, N, N),
	MUX(1, 157, 8, N, N, N, N),
	MUX(1, 158, 8, N, N, N, N),
};

static struct atlas7_grp_mux lvds_analog_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(lvds_analog_grp_pad_mux),
	.pad_mux_list = lvds_analog_grp_pad_mux,
};

static struct atlas7_pad_mux nd_df_grp_pad_mux[] = {
	MUX(1, 44, 1, N, N, N, N),
	MUX(1, 43, 1, N, N, N, N),
	MUX(1, 42, 1, N, N, N, N),
	MUX(1, 41, 1, N, N, N, N),
	MUX(1, 40, 1, N, N, N, N),
	MUX(1, 39, 1, N, N, N, N),
	MUX(1, 38, 1, N, N, N, N),
	MUX(1, 37, 1, N, N, N, N),
	MUX(1, 47, 1, N, N, N, N),
	MUX(1, 46, 1, N, N, N, N),
	MUX(1, 52, 1, N, N, N, N),
	MUX(1, 51, 1, N, N, N, N),
	MUX(1, 45, 1, N, N, N, N),
	MUX(1, 49, 1, N, N, N, N),
	MUX(1, 50, 1, N, N, N, N),
	MUX(1, 48, 1, N, N, N, N),
	MUX(1, 124, 4, N, N, N, N),
};

static struct atlas7_grp_mux nd_df_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(nd_df_grp_pad_mux),
	.pad_mux_list = nd_df_grp_pad_mux,
};

static struct atlas7_pad_mux nd_df_nowp_grp_pad_mux[] = {
	MUX(1, 44, 1, N, N, N, N),
	MUX(1, 43, 1, N, N, N, N),
	MUX(1, 42, 1, N, N, N, N),
	MUX(1, 41, 1, N, N, N, N),
	MUX(1, 40, 1, N, N, N, N),
	MUX(1, 39, 1, N, N, N, N),
	MUX(1, 38, 1, N, N, N, N),
	MUX(1, 37, 1, N, N, N, N),
	MUX(1, 47, 1, N, N, N, N),
	MUX(1, 46, 1, N, N, N, N),
	MUX(1, 52, 1, N, N, N, N),
	MUX(1, 51, 1, N, N, N, N),
	MUX(1, 45, 1, N, N, N, N),
	MUX(1, 49, 1, N, N, N, N),
	MUX(1, 50, 1, N, N, N, N),
	MUX(1, 48, 1, N, N, N, N),
};

static struct atlas7_grp_mux nd_df_nowp_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(nd_df_nowp_grp_pad_mux),
	.pad_mux_list = nd_df_nowp_grp_pad_mux,
};

static struct atlas7_pad_mux ps_grp_pad_mux[] = {
	MUX(1, 120, 2, N, N, N, N),
	MUX(1, 119, 2, N, N, N, N),
	MUX(1, 121, 5, N, N, N, N),
};

static struct atlas7_grp_mux ps_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(ps_grp_pad_mux),
	.pad_mux_list = ps_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_core_on_grp_pad_mux[] = {
	MUX(0, 8, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_core_on_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_core_on_grp_pad_mux),
	.pad_mux_list = pwc_core_on_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_ext_on_grp_pad_mux[] = {
	MUX(0, 6, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_ext_on_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_ext_on_grp_pad_mux),
	.pad_mux_list = pwc_ext_on_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_gpio3_clk_grp_pad_mux[] = {
	MUX(0, 3, 4, N, N, N, N),
};

static struct atlas7_grp_mux pwc_gpio3_clk_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_gpio3_clk_grp_pad_mux),
	.pad_mux_list = pwc_gpio3_clk_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_io_on_grp_pad_mux[] = {
	MUX(0, 9, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_io_on_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_io_on_grp_pad_mux),
	.pad_mux_list = pwc_io_on_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_lowbatt_b_grp0_pad_mux[] = {
	MUX(0, 4, 1, 0xa08, 4, 0xa88, 4),
};

static struct atlas7_grp_mux pwc_lowbatt_b_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_lowbatt_b_grp0_pad_mux),
	.pad_mux_list = pwc_lowbatt_b_grp0_pad_mux,
};

static struct atlas7_pad_mux pwc_mem_on_grp_pad_mux[] = {
	MUX(0, 7, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_mem_on_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_mem_on_grp_pad_mux),
	.pad_mux_list = pwc_mem_on_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_on_key_b_grp0_pad_mux[] = {
	MUX(0, 5, 1, 0xa08, 5, 0xa88, 5),
};

static struct atlas7_grp_mux pwc_on_key_b_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_on_key_b_grp0_pad_mux),
	.pad_mux_list = pwc_on_key_b_grp0_pad_mux,
};

static struct atlas7_pad_mux pwc_wakeup_src0_grp_pad_mux[] = {
	MUX(0, 0, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_wakeup_src0_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_wakeup_src0_grp_pad_mux),
	.pad_mux_list = pwc_wakeup_src0_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_wakeup_src1_grp_pad_mux[] = {
	MUX(0, 1, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_wakeup_src1_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_wakeup_src1_grp_pad_mux),
	.pad_mux_list = pwc_wakeup_src1_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_wakeup_src2_grp_pad_mux[] = {
	MUX(0, 2, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_wakeup_src2_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_wakeup_src2_grp_pad_mux),
	.pad_mux_list = pwc_wakeup_src2_grp_pad_mux,
};

static struct atlas7_pad_mux pwc_wakeup_src3_grp_pad_mux[] = {
	MUX(0, 3, 1, N, N, N, N),
};

static struct atlas7_grp_mux pwc_wakeup_src3_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(pwc_wakeup_src3_grp_pad_mux),
	.pad_mux_list = pwc_wakeup_src3_grp_pad_mux,
};

static struct atlas7_pad_mux pw_cko0_grp0_pad_mux[] = {
	MUX(1, 123, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_cko0_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_cko0_grp0_pad_mux),
	.pad_mux_list = pw_cko0_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_cko0_grp1_pad_mux[] = {
	MUX(1, 101, 4, N, N, N, N),
};

static struct atlas7_grp_mux pw_cko0_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_cko0_grp1_pad_mux),
	.pad_mux_list = pw_cko0_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_cko0_grp2_pad_mux[] = {
	MUX(1, 82, 2, N, N, N, N),
};

static struct atlas7_grp_mux pw_cko0_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_cko0_grp2_pad_mux),
	.pad_mux_list = pw_cko0_grp2_pad_mux,
};

static struct atlas7_pad_mux pw_cko0_grp3_pad_mux[] = {
	MUX(1, 162, 5, N, N, N, N),
};

static struct atlas7_grp_mux pw_cko0_grp3_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_cko0_grp3_pad_mux),
	.pad_mux_list = pw_cko0_grp3_pad_mux,
};

static struct atlas7_pad_mux pw_cko1_grp0_pad_mux[] = {
	MUX(1, 124, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_cko1_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_cko1_grp0_pad_mux),
	.pad_mux_list = pw_cko1_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_cko1_grp1_pad_mux[] = {
	MUX(1, 110, 4, N, N, N, N),
};

static struct atlas7_grp_mux pw_cko1_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_cko1_grp1_pad_mux),
	.pad_mux_list = pw_cko1_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_cko1_grp2_pad_mux[] = {
	MUX(1, 163, 5, N, N, N, N),
};

static struct atlas7_grp_mux pw_cko1_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_cko1_grp2_pad_mux),
	.pad_mux_list = pw_cko1_grp2_pad_mux,
};

static struct atlas7_pad_mux pw_i2s01_clk_grp0_pad_mux[] = {
	MUX(1, 125, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_i2s01_clk_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp0_pad_mux),
	.pad_mux_list = pw_i2s01_clk_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_i2s01_clk_grp1_pad_mux[] = {
	MUX(1, 117, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_i2s01_clk_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp1_pad_mux),
	.pad_mux_list = pw_i2s01_clk_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_i2s01_clk_grp2_pad_mux[] = {
	MUX(1, 132, 2, N, N, N, N),
};

static struct atlas7_grp_mux pw_i2s01_clk_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_i2s01_clk_grp2_pad_mux),
	.pad_mux_list = pw_i2s01_clk_grp2_pad_mux,
};

static struct atlas7_pad_mux pw_pwm0_grp0_pad_mux[] = {
	MUX(1, 119, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm0_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm0_grp0_pad_mux),
	.pad_mux_list = pw_pwm0_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_pwm0_grp1_pad_mux[] = {
	MUX(1, 159, 5, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm0_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm0_grp1_pad_mux),
	.pad_mux_list = pw_pwm0_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_pwm1_grp0_pad_mux[] = {
	MUX(1, 120, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm1_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm1_grp0_pad_mux),
	.pad_mux_list = pw_pwm1_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_pwm1_grp1_pad_mux[] = {
	MUX(1, 160, 5, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm1_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm1_grp1_pad_mux),
	.pad_mux_list = pw_pwm1_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_pwm1_grp2_pad_mux[] = {
	MUX(1, 131, 2, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm1_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm1_grp2_pad_mux),
	.pad_mux_list = pw_pwm1_grp2_pad_mux,
};

static struct atlas7_pad_mux pw_pwm2_grp0_pad_mux[] = {
	MUX(1, 121, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm2_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm2_grp0_pad_mux),
	.pad_mux_list = pw_pwm2_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_pwm2_grp1_pad_mux[] = {
	MUX(1, 98, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm2_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm2_grp1_pad_mux),
	.pad_mux_list = pw_pwm2_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_pwm2_grp2_pad_mux[] = {
	MUX(1, 161, 5, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm2_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm2_grp2_pad_mux),
	.pad_mux_list = pw_pwm2_grp2_pad_mux,
};

static struct atlas7_pad_mux pw_pwm3_grp0_pad_mux[] = {
	MUX(1, 122, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm3_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm3_grp0_pad_mux),
	.pad_mux_list = pw_pwm3_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_pwm3_grp1_pad_mux[] = {
	MUX(1, 73, 4, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm3_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm3_grp1_pad_mux),
	.pad_mux_list = pw_pwm3_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_pwm_cpu_vol_grp0_pad_mux[] = {
	MUX(1, 121, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm_cpu_vol_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp0_pad_mux),
	.pad_mux_list = pw_pwm_cpu_vol_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_pwm_cpu_vol_grp1_pad_mux[] = {
	MUX(1, 98, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm_cpu_vol_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp1_pad_mux),
	.pad_mux_list = pw_pwm_cpu_vol_grp1_pad_mux,
};

static struct atlas7_pad_mux pw_pwm_cpu_vol_grp2_pad_mux[] = {
	MUX(1, 161, 5, N, N, N, N),
};

static struct atlas7_grp_mux pw_pwm_cpu_vol_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_pwm_cpu_vol_grp2_pad_mux),
	.pad_mux_list = pw_pwm_cpu_vol_grp2_pad_mux,
};

static struct atlas7_pad_mux pw_backlight_grp0_pad_mux[] = {
	MUX(1, 122, 3, N, N, N, N),
};

static struct atlas7_grp_mux pw_backlight_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_backlight_grp0_pad_mux),
	.pad_mux_list = pw_backlight_grp0_pad_mux,
};

static struct atlas7_pad_mux pw_backlight_grp1_pad_mux[] = {
	MUX(1, 73, 4, N, N, N, N),
};

static struct atlas7_grp_mux pw_backlight_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(pw_backlight_grp1_pad_mux),
	.pad_mux_list = pw_backlight_grp1_pad_mux,
};

static struct atlas7_pad_mux rg_eth_mac_grp_pad_mux[] = {
	MUX(1, 108, 1, N, N, N, N),
	MUX(1, 103, 1, N, N, N, N),
	MUX(1, 104, 1, N, N, N, N),
	MUX(1, 105, 1, N, N, N, N),
	MUX(1, 106, 1, N, N, N, N),
	MUX(1, 107, 1, N, N, N, N),
	MUX(1, 102, 1, N, N, N, N),
	MUX(1, 97, 1, N, N, N, N),
	MUX(1, 98, 1, N, N, N, N),
	MUX(1, 99, 1, N, N, N, N),
	MUX(1, 100, 1, N, N, N, N),
	MUX(1, 101, 1, N, N, N, N),
};

static struct atlas7_grp_mux rg_eth_mac_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(rg_eth_mac_grp_pad_mux),
	.pad_mux_list = rg_eth_mac_grp_pad_mux,
};

static struct atlas7_pad_mux rg_gmac_phy_intr_n_grp_pad_mux[] = {
	MUX(1, 111, 1, 0xa08, 13, 0xa88, 13),
};

static struct atlas7_grp_mux rg_gmac_phy_intr_n_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(rg_gmac_phy_intr_n_grp_pad_mux),
	.pad_mux_list = rg_gmac_phy_intr_n_grp_pad_mux,
};

static struct atlas7_pad_mux rg_rgmii_mac_grp_pad_mux[] = {
	MUX(1, 109, 1, N, N, N, N),
	MUX(1, 110, 1, N, N, N, N),
};

static struct atlas7_grp_mux rg_rgmii_mac_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(rg_rgmii_mac_grp_pad_mux),
	.pad_mux_list = rg_rgmii_mac_grp_pad_mux,
};

static struct atlas7_pad_mux rg_rgmii_phy_ref_clk_grp0_pad_mux[] = {
	MUX(1, 111, 5, N, N, N, N),
};

static struct atlas7_grp_mux rg_rgmii_phy_ref_clk_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(rg_rgmii_phy_ref_clk_grp0_pad_mux),
	.pad_mux_list = rg_rgmii_phy_ref_clk_grp0_pad_mux,
};

static struct atlas7_pad_mux rg_rgmii_phy_ref_clk_grp1_pad_mux[] = {
	MUX(1, 53, 4, N, N, N, N),
};

static struct atlas7_grp_mux rg_rgmii_phy_ref_clk_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(rg_rgmii_phy_ref_clk_grp1_pad_mux),
	.pad_mux_list = rg_rgmii_phy_ref_clk_grp1_pad_mux,
};

static struct atlas7_pad_mux sd0_grp_pad_mux[] = {
	MUX(1, 46, 2, N, N, N, N),
	MUX(1, 47, 2, N, N, N, N),
	MUX(1, 44, 2, N, N, N, N),
	MUX(1, 43, 2, N, N, N, N),
	MUX(1, 42, 2, N, N, N, N),
	MUX(1, 41, 2, N, N, N, N),
	MUX(1, 40, 2, N, N, N, N),
	MUX(1, 39, 2, N, N, N, N),
	MUX(1, 38, 2, N, N, N, N),
	MUX(1, 37, 2, N, N, N, N),
};

static struct atlas7_grp_mux sd0_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sd0_grp_pad_mux),
	.pad_mux_list = sd0_grp_pad_mux,
};

static struct atlas7_pad_mux sd0_4bit_grp_pad_mux[] = {
	MUX(1, 46, 2, N, N, N, N),
	MUX(1, 47, 2, N, N, N, N),
	MUX(1, 44, 2, N, N, N, N),
	MUX(1, 43, 2, N, N, N, N),
	MUX(1, 42, 2, N, N, N, N),
	MUX(1, 41, 2, N, N, N, N),
};

static struct atlas7_grp_mux sd0_4bit_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sd0_4bit_grp_pad_mux),
	.pad_mux_list = sd0_4bit_grp_pad_mux,
};

static struct atlas7_pad_mux sd1_grp_pad_mux[] = {
	MUX(1, 48, 3, N, N, N, N),
	MUX(1, 49, 3, N, N, N, N),
	MUX(1, 44, 3, 0xa00, 0, 0xa80, 0),
	MUX(1, 43, 3, 0xa00, 1, 0xa80, 1),
	MUX(1, 42, 3, 0xa00, 2, 0xa80, 2),
	MUX(1, 41, 3, 0xa00, 3, 0xa80, 3),
	MUX(1, 40, 3, N, N, N, N),
	MUX(1, 39, 3, N, N, N, N),
	MUX(1, 38, 3, N, N, N, N),
	MUX(1, 37, 3, N, N, N, N),
};

static struct atlas7_grp_mux sd1_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sd1_grp_pad_mux),
	.pad_mux_list = sd1_grp_pad_mux,
};

static struct atlas7_pad_mux sd1_4bit_grp0_pad_mux[] = {
	MUX(1, 48, 3, N, N, N, N),
	MUX(1, 49, 3, N, N, N, N),
	MUX(1, 44, 3, 0xa00, 0, 0xa80, 0),
	MUX(1, 43, 3, 0xa00, 1, 0xa80, 1),
	MUX(1, 42, 3, 0xa00, 2, 0xa80, 2),
	MUX(1, 41, 3, 0xa00, 3, 0xa80, 3),
};

static struct atlas7_grp_mux sd1_4bit_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(sd1_4bit_grp0_pad_mux),
	.pad_mux_list = sd1_4bit_grp0_pad_mux,
};

static struct atlas7_pad_mux sd1_4bit_grp1_pad_mux[] = {
	MUX(1, 48, 3, N, N, N, N),
	MUX(1, 49, 3, N, N, N, N),
	MUX(1, 40, 4, 0xa00, 0, 0xa80, 0),
	MUX(1, 39, 4, 0xa00, 1, 0xa80, 1),
	MUX(1, 38, 4, 0xa00, 2, 0xa80, 2),
	MUX(1, 37, 4, 0xa00, 3, 0xa80, 3),
};

static struct atlas7_grp_mux sd1_4bit_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(sd1_4bit_grp1_pad_mux),
	.pad_mux_list = sd1_4bit_grp1_pad_mux,
};

static struct atlas7_pad_mux sd2_basic_grp_pad_mux[] = {
	MUX(1, 31, 1, N, N, N, N),
	MUX(1, 32, 1, N, N, N, N),
	MUX(1, 33, 1, N, N, N, N),
	MUX(1, 34, 1, N, N, N, N),
	MUX(1, 35, 1, N, N, N, N),
	MUX(1, 36, 1, N, N, N, N),
};

static struct atlas7_grp_mux sd2_basic_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sd2_basic_grp_pad_mux),
	.pad_mux_list = sd2_basic_grp_pad_mux,
};

static struct atlas7_pad_mux sd2_cdb_grp0_pad_mux[] = {
	MUX(1, 124, 2, 0xa08, 7, 0xa88, 7),
};

static struct atlas7_grp_mux sd2_cdb_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(sd2_cdb_grp0_pad_mux),
	.pad_mux_list = sd2_cdb_grp0_pad_mux,
};

static struct atlas7_pad_mux sd2_cdb_grp1_pad_mux[] = {
	MUX(1, 161, 6, 0xa08, 7, 0xa88, 7),
};

static struct atlas7_grp_mux sd2_cdb_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(sd2_cdb_grp1_pad_mux),
	.pad_mux_list = sd2_cdb_grp1_pad_mux,
};

static struct atlas7_pad_mux sd2_wpb_grp0_pad_mux[] = {
	MUX(1, 123, 2, 0xa10, 6, 0xa90, 6),
};

static struct atlas7_grp_mux sd2_wpb_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(sd2_wpb_grp0_pad_mux),
	.pad_mux_list = sd2_wpb_grp0_pad_mux,
};

static struct atlas7_pad_mux sd2_wpb_grp1_pad_mux[] = {
	MUX(1, 163, 7, 0xa10, 6, 0xa90, 6),
};

static struct atlas7_grp_mux sd2_wpb_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(sd2_wpb_grp1_pad_mux),
	.pad_mux_list = sd2_wpb_grp1_pad_mux,
};

static struct atlas7_pad_mux sd3_grp_pad_mux[] = {
	MUX(1, 85, 1, N, N, N, N),
	MUX(1, 86, 1, N, N, N, N),
	MUX(1, 87, 1, N, N, N, N),
	MUX(1, 88, 1, N, N, N, N),
	MUX(1, 89, 1, N, N, N, N),
	MUX(1, 90, 1, N, N, N, N),
};

static struct atlas7_grp_mux sd3_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sd3_grp_pad_mux),
	.pad_mux_list = sd3_grp_pad_mux,
};

static struct atlas7_pad_mux sd5_grp_pad_mux[] = {
	MUX(1, 91, 1, N, N, N, N),
	MUX(1, 92, 1, N, N, N, N),
	MUX(1, 93, 1, N, N, N, N),
	MUX(1, 94, 1, N, N, N, N),
	MUX(1, 95, 1, N, N, N, N),
	MUX(1, 96, 1, N, N, N, N),
};

static struct atlas7_grp_mux sd5_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sd5_grp_pad_mux),
	.pad_mux_list = sd5_grp_pad_mux,
};

static struct atlas7_pad_mux sd6_grp0_pad_mux[] = {
	MUX(1, 79, 4, 0xa00, 27, 0xa80, 27),
	MUX(1, 78, 4, 0xa00, 26, 0xa80, 26),
	MUX(1, 74, 4, 0xa00, 28, 0xa80, 28),
	MUX(1, 75, 4, 0xa00, 29, 0xa80, 29),
	MUX(1, 76, 4, 0xa00, 30, 0xa80, 30),
	MUX(1, 77, 4, 0xa00, 31, 0xa80, 31),
};

static struct atlas7_grp_mux sd6_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(sd6_grp0_pad_mux),
	.pad_mux_list = sd6_grp0_pad_mux,
};

static struct atlas7_pad_mux sd6_grp1_pad_mux[] = {
	MUX(1, 101, 3, 0xa00, 27, 0xa80, 27),
	MUX(1, 99, 3, 0xa00, 26, 0xa80, 26),
	MUX(1, 100, 3, 0xa00, 28, 0xa80, 28),
	MUX(1, 110, 3, 0xa00, 29, 0xa80, 29),
	MUX(1, 109, 3, 0xa00, 30, 0xa80, 30),
	MUX(1, 111, 3, 0xa00, 31, 0xa80, 31),
};

static struct atlas7_grp_mux sd6_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(sd6_grp1_pad_mux),
	.pad_mux_list = sd6_grp1_pad_mux,
};

static struct atlas7_pad_mux sp0_ext_ldo_on_grp_pad_mux[] = {
	MUX(0, 4, 2, N, N, N, N),
};

static struct atlas7_grp_mux sp0_ext_ldo_on_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sp0_ext_ldo_on_grp_pad_mux),
	.pad_mux_list = sp0_ext_ldo_on_grp_pad_mux,
};

static struct atlas7_pad_mux sp0_qspi_grp_pad_mux[] = {
	MUX(0, 12, 1, N, N, N, N),
	MUX(0, 13, 1, N, N, N, N),
	MUX(0, 14, 1, N, N, N, N),
	MUX(0, 15, 1, N, N, N, N),
	MUX(0, 16, 1, N, N, N, N),
	MUX(0, 17, 1, N, N, N, N),
};

static struct atlas7_grp_mux sp0_qspi_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sp0_qspi_grp_pad_mux),
	.pad_mux_list = sp0_qspi_grp_pad_mux,
};

static struct atlas7_pad_mux sp1_spi_grp_pad_mux[] = {
	MUX(1, 19, 1, N, N, N, N),
	MUX(1, 20, 1, N, N, N, N),
	MUX(1, 21, 1, N, N, N, N),
	MUX(1, 18, 1, N, N, N, N),
};

static struct atlas7_grp_mux sp1_spi_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(sp1_spi_grp_pad_mux),
	.pad_mux_list = sp1_spi_grp_pad_mux,
};

static struct atlas7_pad_mux tpiu_trace_grp_pad_mux[] = {
	MUX(1, 53, 5, N, N, N, N),
	MUX(1, 56, 5, N, N, N, N),
	MUX(1, 57, 5, N, N, N, N),
	MUX(1, 58, 5, N, N, N, N),
	MUX(1, 59, 5, N, N, N, N),
	MUX(1, 60, 5, N, N, N, N),
	MUX(1, 61, 5, N, N, N, N),
	MUX(1, 62, 5, N, N, N, N),
	MUX(1, 63, 5, N, N, N, N),
	MUX(1, 64, 5, N, N, N, N),
	MUX(1, 65, 5, N, N, N, N),
	MUX(1, 66, 5, N, N, N, N),
	MUX(1, 67, 5, N, N, N, N),
	MUX(1, 68, 5, N, N, N, N),
	MUX(1, 69, 5, N, N, N, N),
	MUX(1, 70, 5, N, N, N, N),
	MUX(1, 71, 5, N, N, N, N),
	MUX(1, 72, 5, N, N, N, N),
};

static struct atlas7_grp_mux tpiu_trace_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(tpiu_trace_grp_pad_mux),
	.pad_mux_list = tpiu_trace_grp_pad_mux,
};

static struct atlas7_pad_mux uart0_grp_pad_mux[] = {
	MUX(1, 121, 4, N, N, N, N),
	MUX(1, 120, 4, N, N, N, N),
	MUX(1, 134, 1, N, N, N, N),
	MUX(1, 133, 1, N, N, N, N),
};

static struct atlas7_grp_mux uart0_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(uart0_grp_pad_mux),
	.pad_mux_list = uart0_grp_pad_mux,
};

static struct atlas7_pad_mux uart0_nopause_grp_pad_mux[] = {
	MUX(1, 134, 1, N, N, N, N),
	MUX(1, 133, 1, N, N, N, N),
};

static struct atlas7_grp_mux uart0_nopause_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(uart0_nopause_grp_pad_mux),
	.pad_mux_list = uart0_nopause_grp_pad_mux,
};

static struct atlas7_pad_mux uart1_grp_pad_mux[] = {
	MUX(1, 136, 1, N, N, N, N),
	MUX(1, 135, 1, N, N, N, N),
};

static struct atlas7_grp_mux uart1_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(uart1_grp_pad_mux),
	.pad_mux_list = uart1_grp_pad_mux,
};

static struct atlas7_pad_mux uart2_cts_grp0_pad_mux[] = {
	MUX(1, 132, 3, 0xa10, 2, 0xa90, 2),
};

static struct atlas7_grp_mux uart2_cts_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_cts_grp0_pad_mux),
	.pad_mux_list = uart2_cts_grp0_pad_mux,
};

static struct atlas7_pad_mux uart2_cts_grp1_pad_mux[] = {
	MUX(1, 162, 2, 0xa10, 2, 0xa90, 2),
};

static struct atlas7_grp_mux uart2_cts_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_cts_grp1_pad_mux),
	.pad_mux_list = uart2_cts_grp1_pad_mux,
};

static struct atlas7_pad_mux uart2_rts_grp0_pad_mux[] = {
	MUX(1, 131, 3, N, N, N, N),
};

static struct atlas7_grp_mux uart2_rts_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_rts_grp0_pad_mux),
	.pad_mux_list = uart2_rts_grp0_pad_mux,
};

static struct atlas7_pad_mux uart2_rts_grp1_pad_mux[] = {
	MUX(1, 161, 2, N, N, N, N),
};

static struct atlas7_grp_mux uart2_rts_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_rts_grp1_pad_mux),
	.pad_mux_list = uart2_rts_grp1_pad_mux,
};

static struct atlas7_pad_mux uart2_rxd_grp0_pad_mux[] = {
	MUX(0, 11, 2, 0xa10, 5, 0xa90, 5),
};

static struct atlas7_grp_mux uart2_rxd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_rxd_grp0_pad_mux),
	.pad_mux_list = uart2_rxd_grp0_pad_mux,
};

static struct atlas7_pad_mux uart2_rxd_grp1_pad_mux[] = {
	MUX(1, 160, 2, 0xa10, 5, 0xa90, 5),
};

static struct atlas7_grp_mux uart2_rxd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_rxd_grp1_pad_mux),
	.pad_mux_list = uart2_rxd_grp1_pad_mux,
};

static struct atlas7_pad_mux uart2_rxd_grp2_pad_mux[] = {
	MUX(1, 130, 3, 0xa10, 5, 0xa90, 5),
};

static struct atlas7_grp_mux uart2_rxd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_rxd_grp2_pad_mux),
	.pad_mux_list = uart2_rxd_grp2_pad_mux,
};

static struct atlas7_pad_mux uart2_txd_grp0_pad_mux[] = {
	MUX(0, 10, 2, N, N, N, N),
};

static struct atlas7_grp_mux uart2_txd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_txd_grp0_pad_mux),
	.pad_mux_list = uart2_txd_grp0_pad_mux,
};

static struct atlas7_pad_mux uart2_txd_grp1_pad_mux[] = {
	MUX(1, 159, 2, N, N, N, N),
};

static struct atlas7_grp_mux uart2_txd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_txd_grp1_pad_mux),
	.pad_mux_list = uart2_txd_grp1_pad_mux,
};

static struct atlas7_pad_mux uart2_txd_grp2_pad_mux[] = {
	MUX(1, 129, 3, N, N, N, N),
};

static struct atlas7_grp_mux uart2_txd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart2_txd_grp2_pad_mux),
	.pad_mux_list = uart2_txd_grp2_pad_mux,
};

static struct atlas7_pad_mux uart3_cts_grp0_pad_mux[] = {
	MUX(1, 125, 2, 0xa08, 0, 0xa88, 0),
};

static struct atlas7_grp_mux uart3_cts_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_cts_grp0_pad_mux),
	.pad_mux_list = uart3_cts_grp0_pad_mux,
};

static struct atlas7_pad_mux uart3_cts_grp1_pad_mux[] = {
	MUX(1, 111, 4, 0xa08, 0, 0xa88, 0),
};

static struct atlas7_grp_mux uart3_cts_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_cts_grp1_pad_mux),
	.pad_mux_list = uart3_cts_grp1_pad_mux,
};

static struct atlas7_pad_mux uart3_cts_grp2_pad_mux[] = {
	MUX(1, 140, 2, 0xa08, 0, 0xa88, 0),
};

static struct atlas7_grp_mux uart3_cts_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_cts_grp2_pad_mux),
	.pad_mux_list = uart3_cts_grp2_pad_mux,
};

static struct atlas7_pad_mux uart3_rts_grp0_pad_mux[] = {
	MUX(1, 126, 2, N, N, N, N),
};

static struct atlas7_grp_mux uart3_rts_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_rts_grp0_pad_mux),
	.pad_mux_list = uart3_rts_grp0_pad_mux,
};

static struct atlas7_pad_mux uart3_rts_grp1_pad_mux[] = {
	MUX(1, 109, 4, N, N, N, N),
};

static struct atlas7_grp_mux uart3_rts_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_rts_grp1_pad_mux),
	.pad_mux_list = uart3_rts_grp1_pad_mux,
};

static struct atlas7_pad_mux uart3_rts_grp2_pad_mux[] = {
	MUX(1, 139, 2, N, N, N, N),
};

static struct atlas7_grp_mux uart3_rts_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_rts_grp2_pad_mux),
	.pad_mux_list = uart3_rts_grp2_pad_mux,
};

static struct atlas7_pad_mux uart3_rxd_grp0_pad_mux[] = {
	MUX(1, 138, 1, 0xa00, 5, 0xa80, 5),
};

static struct atlas7_grp_mux uart3_rxd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_rxd_grp0_pad_mux),
	.pad_mux_list = uart3_rxd_grp0_pad_mux,
};

static struct atlas7_pad_mux uart3_rxd_grp1_pad_mux[] = {
	MUX(1, 84, 2, 0xa00, 5, 0xa80, 5),
};

static struct atlas7_grp_mux uart3_rxd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_rxd_grp1_pad_mux),
	.pad_mux_list = uart3_rxd_grp1_pad_mux,
};

static struct atlas7_pad_mux uart3_rxd_grp2_pad_mux[] = {
	MUX(1, 162, 3, 0xa00, 5, 0xa80, 5),
};

static struct atlas7_grp_mux uart3_rxd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_rxd_grp2_pad_mux),
	.pad_mux_list = uart3_rxd_grp2_pad_mux,
};

static struct atlas7_pad_mux uart3_txd_grp0_pad_mux[] = {
	MUX(1, 137, 1, N, N, N, N),
};

static struct atlas7_grp_mux uart3_txd_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_txd_grp0_pad_mux),
	.pad_mux_list = uart3_txd_grp0_pad_mux,
};

static struct atlas7_pad_mux uart3_txd_grp1_pad_mux[] = {
	MUX(1, 83, 2, N, N, N, N),
};

static struct atlas7_grp_mux uart3_txd_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_txd_grp1_pad_mux),
	.pad_mux_list = uart3_txd_grp1_pad_mux,
};

static struct atlas7_pad_mux uart3_txd_grp2_pad_mux[] = {
	MUX(1, 161, 3, N, N, N, N),
};

static struct atlas7_grp_mux uart3_txd_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart3_txd_grp2_pad_mux),
	.pad_mux_list = uart3_txd_grp2_pad_mux,
};

static struct atlas7_pad_mux uart4_basic_grp_pad_mux[] = {
	MUX(1, 140, 1, N, N, N, N),
	MUX(1, 139, 1, N, N, N, N),
};

static struct atlas7_grp_mux uart4_basic_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(uart4_basic_grp_pad_mux),
	.pad_mux_list = uart4_basic_grp_pad_mux,
};

static struct atlas7_pad_mux uart4_cts_grp0_pad_mux[] = {
	MUX(1, 122, 4, 0xa08, 1, 0xa88, 1),
};

static struct atlas7_grp_mux uart4_cts_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart4_cts_grp0_pad_mux),
	.pad_mux_list = uart4_cts_grp0_pad_mux,
};

static struct atlas7_pad_mux uart4_cts_grp1_pad_mux[] = {
	MUX(1, 100, 4, 0xa08, 1, 0xa88, 1),
};

static struct atlas7_grp_mux uart4_cts_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart4_cts_grp1_pad_mux),
	.pad_mux_list = uart4_cts_grp1_pad_mux,
};

static struct atlas7_pad_mux uart4_cts_grp2_pad_mux[] = {
	MUX(1, 117, 2, 0xa08, 1, 0xa88, 1),
};

static struct atlas7_grp_mux uart4_cts_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart4_cts_grp2_pad_mux),
	.pad_mux_list = uart4_cts_grp2_pad_mux,
};

static struct atlas7_pad_mux uart4_rts_grp0_pad_mux[] = {
	MUX(1, 123, 4, N, N, N, N),
};

static struct atlas7_grp_mux uart4_rts_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(uart4_rts_grp0_pad_mux),
	.pad_mux_list = uart4_rts_grp0_pad_mux,
};

static struct atlas7_pad_mux uart4_rts_grp1_pad_mux[] = {
	MUX(1, 99, 4, N, N, N, N),
};

static struct atlas7_grp_mux uart4_rts_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(uart4_rts_grp1_pad_mux),
	.pad_mux_list = uart4_rts_grp1_pad_mux,
};

static struct atlas7_pad_mux uart4_rts_grp2_pad_mux[] = {
	MUX(1, 116, 2, N, N, N, N),
};

static struct atlas7_grp_mux uart4_rts_grp2_mux = {
	.pad_mux_count = ARRAY_SIZE(uart4_rts_grp2_pad_mux),
	.pad_mux_list = uart4_rts_grp2_pad_mux,
};

static struct atlas7_pad_mux usb0_drvvbus_grp0_pad_mux[] = {
	MUX(1, 51, 2, N, N, N, N),
};

static struct atlas7_grp_mux usb0_drvvbus_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(usb0_drvvbus_grp0_pad_mux),
	.pad_mux_list = usb0_drvvbus_grp0_pad_mux,
};

static struct atlas7_pad_mux usb0_drvvbus_grp1_pad_mux[] = {
	MUX(1, 162, 7, N, N, N, N),
};

static struct atlas7_grp_mux usb0_drvvbus_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(usb0_drvvbus_grp1_pad_mux),
	.pad_mux_list = usb0_drvvbus_grp1_pad_mux,
};

static struct atlas7_pad_mux usb1_drvvbus_grp0_pad_mux[] = {
	MUX(1, 134, 2, N, N, N, N),
};

static struct atlas7_grp_mux usb1_drvvbus_grp0_mux = {
	.pad_mux_count = ARRAY_SIZE(usb1_drvvbus_grp0_pad_mux),
	.pad_mux_list = usb1_drvvbus_grp0_pad_mux,
};

static struct atlas7_pad_mux usb1_drvvbus_grp1_pad_mux[] = {
	MUX(1, 163, 2, N, N, N, N),
};

static struct atlas7_grp_mux usb1_drvvbus_grp1_mux = {
	.pad_mux_count = ARRAY_SIZE(usb1_drvvbus_grp1_pad_mux),
	.pad_mux_list = usb1_drvvbus_grp1_pad_mux,
};

static struct atlas7_pad_mux visbus_dout_grp_pad_mux[] = {
	MUX(1, 57, 6, N, N, N, N),
	MUX(1, 58, 6, N, N, N, N),
	MUX(1, 59, 6, N, N, N, N),
	MUX(1, 60, 6, N, N, N, N),
	MUX(1, 61, 6, N, N, N, N),
	MUX(1, 62, 6, N, N, N, N),
	MUX(1, 63, 6, N, N, N, N),
	MUX(1, 64, 6, N, N, N, N),
	MUX(1, 65, 6, N, N, N, N),
	MUX(1, 66, 6, N, N, N, N),
	MUX(1, 67, 6, N, N, N, N),
	MUX(1, 68, 6, N, N, N, N),
	MUX(1, 69, 6, N, N, N, N),
	MUX(1, 70, 6, N, N, N, N),
	MUX(1, 71, 6, N, N, N, N),
	MUX(1, 72, 6, N, N, N, N),
	MUX(1, 53, 6, N, N, N, N),
	MUX(1, 54, 6, N, N, N, N),
	MUX(1, 55, 6, N, N, N, N),
	MUX(1, 56, 6, N, N, N, N),
	MUX(1, 85, 6, N, N, N, N),
	MUX(1, 86, 6, N, N, N, N),
	MUX(1, 87, 6, N, N, N, N),
	MUX(1, 88, 6, N, N, N, N),
	MUX(1, 89, 6, N, N, N, N),
	MUX(1, 90, 6, N, N, N, N),
	MUX(1, 91, 6, N, N, N, N),
	MUX(1, 92, 6, N, N, N, N),
	MUX(1, 93, 6, N, N, N, N),
	MUX(1, 94, 6, N, N, N, N),
	MUX(1, 95, 6, N, N, N, N),
	MUX(1, 96, 6, N, N, N, N),
};

static struct atlas7_grp_mux visbus_dout_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(visbus_dout_grp_pad_mux),
	.pad_mux_list = visbus_dout_grp_pad_mux,
};

static struct atlas7_pad_mux vi_vip1_grp_pad_mux[] = {
	MUX(1, 74, 1, N, N, N, N),
	MUX(1, 75, 1, N, N, N, N),
	MUX(1, 76, 1, N, N, N, N),
	MUX(1, 77, 1, N, N, N, N),
	MUX(1, 78, 1, N, N, N, N),
	MUX(1, 79, 1, N, N, N, N),
	MUX(1, 80, 1, N, N, N, N),
	MUX(1, 81, 1, N, N, N, N),
	MUX(1, 82, 1, N, N, N, N),
	MUX(1, 83, 1, N, N, N, N),
	MUX(1, 84, 1, N, N, N, N),
	MUX(1, 103, 2, N, N, N, N),
	MUX(1, 104, 2, N, N, N, N),
	MUX(1, 105, 2, N, N, N, N),
	MUX(1, 106, 2, N, N, N, N),
	MUX(1, 107, 2, N, N, N, N),
	MUX(1, 102, 2, N, N, N, N),
	MUX(1, 97, 2, N, N, N, N),
	MUX(1, 98, 2, N, N, N, N),
};

static struct atlas7_grp_mux vi_vip1_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(vi_vip1_grp_pad_mux),
	.pad_mux_list = vi_vip1_grp_pad_mux,
};

static struct atlas7_pad_mux vi_vip1_ext_grp_pad_mux[] = {
	MUX(1, 74, 1, N, N, N, N),
	MUX(1, 75, 1, N, N, N, N),
	MUX(1, 76, 1, N, N, N, N),
	MUX(1, 77, 1, N, N, N, N),
	MUX(1, 78, 1, N, N, N, N),
	MUX(1, 79, 1, N, N, N, N),
	MUX(1, 80, 1, N, N, N, N),
	MUX(1, 81, 1, N, N, N, N),
	MUX(1, 82, 1, N, N, N, N),
	MUX(1, 83, 1, N, N, N, N),
	MUX(1, 84, 1, N, N, N, N),
	MUX(1, 108, 2, N, N, N, N),
	MUX(1, 103, 2, N, N, N, N),
	MUX(1, 104, 2, N, N, N, N),
	MUX(1, 105, 2, N, N, N, N),
	MUX(1, 106, 2, N, N, N, N),
	MUX(1, 107, 2, N, N, N, N),
	MUX(1, 102, 2, N, N, N, N),
	MUX(1, 97, 2, N, N, N, N),
	MUX(1, 98, 2, N, N, N, N),
	MUX(1, 99, 2, N, N, N, N),
	MUX(1, 100, 2, N, N, N, N),
};

static struct atlas7_grp_mux vi_vip1_ext_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(vi_vip1_ext_grp_pad_mux),
	.pad_mux_list = vi_vip1_ext_grp_pad_mux,
};

static struct atlas7_pad_mux vi_vip1_low8bit_grp_pad_mux[] = {
	MUX(1, 74, 1, N, N, N, N),
	MUX(1, 75, 1, N, N, N, N),
	MUX(1, 76, 1, N, N, N, N),
	MUX(1, 77, 1, N, N, N, N),
	MUX(1, 78, 1, N, N, N, N),
	MUX(1, 79, 1, N, N, N, N),
	MUX(1, 80, 1, N, N, N, N),
	MUX(1, 81, 1, N, N, N, N),
};

static struct atlas7_grp_mux vi_vip1_low8bit_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(vi_vip1_low8bit_grp_pad_mux),
	.pad_mux_list = vi_vip1_low8bit_grp_pad_mux,
};

static struct atlas7_pad_mux vi_vip1_high8bit_grp_pad_mux[] = {
	MUX(1, 82, 1, N, N, N, N),
	MUX(1, 83, 1, N, N, N, N),
	MUX(1, 84, 1, N, N, N, N),
	MUX(1, 108, 2, N, N, N, N),
	MUX(1, 103, 2, N, N, N, N),
	MUX(1, 104, 2, N, N, N, N),
	MUX(1, 105, 2, N, N, N, N),
	MUX(1, 106, 2, N, N, N, N),
};

static struct atlas7_grp_mux vi_vip1_high8bit_grp_mux = {
	.pad_mux_count = ARRAY_SIZE(vi_vip1_high8bit_grp_pad_mux),
	.pad_mux_list = vi_vip1_high8bit_grp_pad_mux,
};

static struct atlas7_pmx_func atlas7_pmx_functions[] = {
	FUNCTION("gnss_gpio", gnss_gpio_grp, &gnss_gpio_grp_mux),
	FUNCTION("lcd_vip_gpio", lcd_vip_gpio_grp, &lcd_vip_gpio_grp_mux),
	FUNCTION("sdio_i2s_gpio", sdio_i2s_gpio_grp, &sdio_i2s_gpio_grp_mux),
	FUNCTION("sp_rgmii_gpio", sp_rgmii_gpio_grp, &sp_rgmii_gpio_grp_mux),
	FUNCTION("lvds_gpio", lvds_gpio_grp, &lvds_gpio_grp_mux),
	FUNCTION("jtag_uart_nand_gpio",
			jtag_uart_nand_gpio_grp,
			&jtag_uart_nand_gpio_grp_mux),
	FUNCTION("rtc_gpio", rtc_gpio_grp, &rtc_gpio_grp_mux),
	FUNCTION("audio_ac97", audio_ac97_grp, &audio_ac97_grp_mux),
	FUNCTION("audio_digmic_m0",
			audio_digmic_grp0,
			&audio_digmic_grp0_mux),
	FUNCTION("audio_digmic_m1",
			audio_digmic_grp1,
			&audio_digmic_grp1_mux),
	FUNCTION("audio_digmic_m2",
			audio_digmic_grp2,
			&audio_digmic_grp2_mux),
	FUNCTION("audio_func_dbg",
			audio_func_dbg_grp,
			&audio_func_dbg_grp_mux),
	FUNCTION("audio_i2s", audio_i2s_grp, &audio_i2s_grp_mux),
	FUNCTION("audio_i2s_2ch", audio_i2s_2ch_grp, &audio_i2s_2ch_grp_mux),
	FUNCTION("audio_i2s_extclk",
			audio_i2s_extclk_grp,
			&audio_i2s_extclk_grp_mux),
	FUNCTION("audio_spdif_out_m0",
			audio_spdif_out_grp0,
			&audio_spdif_out_grp0_mux),
	FUNCTION("audio_spdif_out_m1",
			audio_spdif_out_grp1,
			&audio_spdif_out_grp1_mux),
	FUNCTION("audio_spdif_out_m2",
			audio_spdif_out_grp2,
			&audio_spdif_out_grp2_mux),
	FUNCTION("audio_uart0_basic",
			audio_uart0_basic_grp,
			&audio_uart0_basic_grp_mux),
	FUNCTION("audio_uart0_urfs_m0",
			audio_uart0_urfs_grp0,
			&audio_uart0_urfs_grp0_mux),
	FUNCTION("audio_uart0_urfs_m1",
			audio_uart0_urfs_grp1,
			&audio_uart0_urfs_grp1_mux),
	FUNCTION("audio_uart0_urfs_m2",
			audio_uart0_urfs_grp2,
			&audio_uart0_urfs_grp2_mux),
	FUNCTION("audio_uart0_urfs_m3",
			audio_uart0_urfs_grp3,
			&audio_uart0_urfs_grp3_mux),
	FUNCTION("audio_uart1_basic",
			audio_uart1_basic_grp,
			&audio_uart1_basic_grp_mux),
	FUNCTION("audio_uart1_urfs_m0",
			audio_uart1_urfs_grp0,
			&audio_uart1_urfs_grp0_mux),
	FUNCTION("audio_uart1_urfs_m1",
			audio_uart1_urfs_grp1,
			&audio_uart1_urfs_grp1_mux),
	FUNCTION("audio_uart1_urfs_m2",
			audio_uart1_urfs_grp2,
			&audio_uart1_urfs_grp2_mux),
	FUNCTION("audio_uart2_urfs_m0",
			audio_uart2_urfs_grp0,
			&audio_uart2_urfs_grp0_mux),
	FUNCTION("audio_uart2_urfs_m1",
			audio_uart2_urfs_grp1,
			&audio_uart2_urfs_grp1_mux),
	FUNCTION("audio_uart2_urfs_m2",
			audio_uart2_urfs_grp2,
			&audio_uart2_urfs_grp2_mux),
	FUNCTION("audio_uart2_urxd_m0",
			audio_uart2_urxd_grp0,
			&audio_uart2_urxd_grp0_mux),
	FUNCTION("audio_uart2_urxd_m1",
			audio_uart2_urxd_grp1,
			&audio_uart2_urxd_grp1_mux),
	FUNCTION("audio_uart2_urxd_m2",
			audio_uart2_urxd_grp2,
			&audio_uart2_urxd_grp2_mux),
	FUNCTION("audio_uart2_usclk_m0",
			audio_uart2_usclk_grp0,
			&audio_uart2_usclk_grp0_mux),
	FUNCTION("audio_uart2_usclk_m1",
			audio_uart2_usclk_grp1,
			&audio_uart2_usclk_grp1_mux),
	FUNCTION("audio_uart2_usclk_m2",
			audio_uart2_usclk_grp2,
			&audio_uart2_usclk_grp2_mux),
	FUNCTION("audio_uart2_utfs_m0",
			audio_uart2_utfs_grp0,
			&audio_uart2_utfs_grp0_mux),
	FUNCTION("audio_uart2_utfs_m1",
			audio_uart2_utfs_grp1,
			&audio_uart2_utfs_grp1_mux),
	FUNCTION("audio_uart2_utfs_m2",
			audio_uart2_utfs_grp2,
			&audio_uart2_utfs_grp2_mux),
	FUNCTION("audio_uart2_utxd_m0",
			audio_uart2_utxd_grp0,
			&audio_uart2_utxd_grp0_mux),
	FUNCTION("audio_uart2_utxd_m1",
			audio_uart2_utxd_grp1,
			&audio_uart2_utxd_grp1_mux),
	FUNCTION("audio_uart2_utxd_m2",
			audio_uart2_utxd_grp2,
			&audio_uart2_utxd_grp2_mux),
	FUNCTION("c_can_trnsvr_en_m0",
			c_can_trnsvr_en_grp0,
			&c_can_trnsvr_en_grp0_mux),
	FUNCTION("c_can_trnsvr_en_m1",
			c_can_trnsvr_en_grp1,
			&c_can_trnsvr_en_grp1_mux),
	FUNCTION("c_can_trnsvr_intr",
			c_can_trnsvr_intr_grp,
			&c_can_trnsvr_intr_grp_mux),
	FUNCTION("c_can_trnsvr_stb_n",
			c_can_trnsvr_stb_n_grp,
			&c_can_trnsvr_stb_n_grp_mux),
	FUNCTION("c0_can_rxd_trnsv0",
			c0_can_rxd_trnsv0_grp,
			&c0_can_rxd_trnsv0_grp_mux),
	FUNCTION("c0_can_rxd_trnsv1",
			c0_can_rxd_trnsv1_grp,
			&c0_can_rxd_trnsv1_grp_mux),
	FUNCTION("c0_can_txd_trnsv0",
			c0_can_txd_trnsv0_grp,
			&c0_can_txd_trnsv0_grp_mux),
	FUNCTION("c0_can_txd_trnsv1",
			c0_can_txd_trnsv1_grp,
			&c0_can_txd_trnsv1_grp_mux),
	FUNCTION("c1_can_rxd_m0", c1_can_rxd_grp0, &c1_can_rxd_grp0_mux),
	FUNCTION("c1_can_rxd_m1", c1_can_rxd_grp1, &c1_can_rxd_grp1_mux),
	FUNCTION("c1_can_rxd_m2", c1_can_rxd_grp2, &c1_can_rxd_grp2_mux),
	FUNCTION("c1_can_rxd_m3", c1_can_rxd_grp3, &c1_can_rxd_grp3_mux),
	FUNCTION("c1_can_txd_m0", c1_can_txd_grp0, &c1_can_txd_grp0_mux),
	FUNCTION("c1_can_txd_m1", c1_can_txd_grp1, &c1_can_txd_grp1_mux),
	FUNCTION("c1_can_txd_m2", c1_can_txd_grp2, &c1_can_txd_grp2_mux),
	FUNCTION("c1_can_txd_m3", c1_can_txd_grp3, &c1_can_txd_grp3_mux),
	FUNCTION("ca_audio_lpc", ca_audio_lpc_grp, &ca_audio_lpc_grp_mux),
	FUNCTION("ca_bt_lpc", ca_bt_lpc_grp, &ca_bt_lpc_grp_mux),
	FUNCTION("ca_coex", ca_coex_grp, &ca_coex_grp_mux),
	FUNCTION("ca_curator_lpc",
			ca_curator_lpc_grp,
			&ca_curator_lpc_grp_mux),
	FUNCTION("ca_pcm_debug", ca_pcm_debug_grp, &ca_pcm_debug_grp_mux),
	FUNCTION("ca_pio", ca_pio_grp, &ca_pio_grp_mux),
	FUNCTION("ca_sdio_debug", ca_sdio_debug_grp, &ca_sdio_debug_grp_mux),
	FUNCTION("ca_spi", ca_spi_grp, &ca_spi_grp_mux),
	FUNCTION("ca_trb", ca_trb_grp, &ca_trb_grp_mux),
	FUNCTION("ca_uart_debug", ca_uart_debug_grp, &ca_uart_debug_grp_mux),
	FUNCTION("clkc_m0", clkc_grp0, &clkc_grp0_mux),
	FUNCTION("clkc_m1", clkc_grp1, &clkc_grp1_mux),
	FUNCTION("gn_gnss_i2c", gn_gnss_i2c_grp, &gn_gnss_i2c_grp_mux),
	FUNCTION("gn_gnss_uart_nopause",
			gn_gnss_uart_nopause_grp,
			&gn_gnss_uart_nopause_grp_mux),
	FUNCTION("gn_gnss_uart", gn_gnss_uart_grp, &gn_gnss_uart_grp_mux),
	FUNCTION("gn_trg_spi_m0", gn_trg_spi_grp0, &gn_trg_spi_grp0_mux),
	FUNCTION("gn_trg_spi_m1", gn_trg_spi_grp1, &gn_trg_spi_grp1_mux),
	FUNCTION("cvbs_dbg", cvbs_dbg_grp, &cvbs_dbg_grp_mux),
	FUNCTION("cvbs_dbg_test_m0",
			cvbs_dbg_test_grp0,
			&cvbs_dbg_test_grp0_mux),
	FUNCTION("cvbs_dbg_test_m1",
			cvbs_dbg_test_grp1,
			&cvbs_dbg_test_grp1_mux),
	FUNCTION("cvbs_dbg_test_m2",
			cvbs_dbg_test_grp2,
			&cvbs_dbg_test_grp2_mux),
	FUNCTION("cvbs_dbg_test_m3",
			cvbs_dbg_test_grp3,
			&cvbs_dbg_test_grp3_mux),
	FUNCTION("cvbs_dbg_test_m4",
			cvbs_dbg_test_grp4,
			&cvbs_dbg_test_grp4_mux),
	FUNCTION("cvbs_dbg_test_m5",
			cvbs_dbg_test_grp5,
			&cvbs_dbg_test_grp5_mux),
	FUNCTION("cvbs_dbg_test_m6",
			cvbs_dbg_test_grp6,
			&cvbs_dbg_test_grp6_mux),
	FUNCTION("cvbs_dbg_test_m7",
			cvbs_dbg_test_grp7,
			&cvbs_dbg_test_grp7_mux),
	FUNCTION("cvbs_dbg_test_m8",
			cvbs_dbg_test_grp8,
			&cvbs_dbg_test_grp8_mux),
	FUNCTION("cvbs_dbg_test_m9",
			cvbs_dbg_test_grp9,
			&cvbs_dbg_test_grp9_mux),
	FUNCTION("cvbs_dbg_test_m10",
			cvbs_dbg_test_grp10,
			&cvbs_dbg_test_grp10_mux),
	FUNCTION("cvbs_dbg_test_m11",
			cvbs_dbg_test_grp11,
			&cvbs_dbg_test_grp11_mux),
	FUNCTION("cvbs_dbg_test_m12",
			cvbs_dbg_test_grp12,
			&cvbs_dbg_test_grp12_mux),
	FUNCTION("cvbs_dbg_test_m13",
			cvbs_dbg_test_grp13,
			&cvbs_dbg_test_grp13_mux),
	FUNCTION("cvbs_dbg_test_m14",
			cvbs_dbg_test_grp14,
			&cvbs_dbg_test_grp14_mux),
	FUNCTION("cvbs_dbg_test_m15",
			cvbs_dbg_test_grp15,
			&cvbs_dbg_test_grp15_mux),
	FUNCTION("gn_gnss_power", gn_gnss_power_grp, &gn_gnss_power_grp_mux),
	FUNCTION("gn_gnss_sw_status",
			gn_gnss_sw_status_grp,
			&gn_gnss_sw_status_grp_mux),
	FUNCTION("gn_gnss_eclk", gn_gnss_eclk_grp, &gn_gnss_eclk_grp_mux),
	FUNCTION("gn_gnss_irq1_m0",
			gn_gnss_irq1_grp0,
			&gn_gnss_irq1_grp0_mux),
	FUNCTION("gn_gnss_irq2_m0",
			gn_gnss_irq2_grp0,
			&gn_gnss_irq2_grp0_mux),
	FUNCTION("gn_gnss_tm", gn_gnss_tm_grp, &gn_gnss_tm_grp_mux),
	FUNCTION("gn_gnss_tsync", gn_gnss_tsync_grp, &gn_gnss_tsync_grp_mux),
	FUNCTION("gn_io_gnsssys_sw_cfg",
			gn_io_gnsssys_sw_cfg_grp,
			&gn_io_gnsssys_sw_cfg_grp_mux),
	FUNCTION("gn_trg_m0", gn_trg_grp0, &gn_trg_grp0_mux),
	FUNCTION("gn_trg_m1", gn_trg_grp1, &gn_trg_grp1_mux),
	FUNCTION("gn_trg_shutdown_m0",
			gn_trg_shutdown_grp0,
			&gn_trg_shutdown_grp0_mux),
	FUNCTION("gn_trg_shutdown_m1",
			gn_trg_shutdown_grp1,
			&gn_trg_shutdown_grp1_mux),
	FUNCTION("gn_trg_shutdown_m2",
			gn_trg_shutdown_grp2,
			&gn_trg_shutdown_grp2_mux),
	FUNCTION("gn_trg_shutdown_m3",
			gn_trg_shutdown_grp3,
			&gn_trg_shutdown_grp3_mux),
	FUNCTION("i2c0", i2c0_grp, &i2c0_grp_mux),
	FUNCTION("i2c1", i2c1_grp, &i2c1_grp_mux),
	FUNCTION("i2s0", i2s0_grp, &i2s0_grp_mux),
	FUNCTION("i2s1_basic", i2s1_basic_grp, &i2s1_basic_grp_mux),
	FUNCTION("i2s1_rxd0_m0", i2s1_rxd0_grp0, &i2s1_rxd0_grp0_mux),
	FUNCTION("i2s1_rxd0_m1", i2s1_rxd0_grp1, &i2s1_rxd0_grp1_mux),
	FUNCTION("i2s1_rxd0_m2", i2s1_rxd0_grp2, &i2s1_rxd0_grp2_mux),
	FUNCTION("i2s1_rxd0_m3", i2s1_rxd0_grp3, &i2s1_rxd0_grp3_mux),
	FUNCTION("i2s1_rxd0_m4", i2s1_rxd0_grp4, &i2s1_rxd0_grp4_mux),
	FUNCTION("i2s1_rxd1_m0", i2s1_rxd1_grp0, &i2s1_rxd1_grp0_mux),
	FUNCTION("i2s1_rxd1_m1", i2s1_rxd1_grp1, &i2s1_rxd1_grp1_mux),
	FUNCTION("i2s1_rxd1_m2", i2s1_rxd1_grp2, &i2s1_rxd1_grp2_mux),
	FUNCTION("i2s1_rxd1_m3", i2s1_rxd1_grp3, &i2s1_rxd1_grp3_mux),
	FUNCTION("i2s1_rxd1_m4", i2s1_rxd1_grp4, &i2s1_rxd1_grp4_mux),
	FUNCTION("jtag_jt_dbg_nsrst",
			jtag_jt_dbg_nsrst_grp,
			&jtag_jt_dbg_nsrst_grp_mux),
	FUNCTION("jtag_ntrst_m0", jtag_ntrst_grp0, &jtag_ntrst_grp0_mux),
	FUNCTION("jtag_ntrst_m1", jtag_ntrst_grp1, &jtag_ntrst_grp1_mux),
	FUNCTION("jtag_swdiotms_m0",
			jtag_swdiotms_grp0,
			&jtag_swdiotms_grp0_mux),
	FUNCTION("jtag_swdiotms_m1",
			jtag_swdiotms_grp1,
			&jtag_swdiotms_grp1_mux),
	FUNCTION("jtag_tck_m0", jtag_tck_grp0, &jtag_tck_grp0_mux),
	FUNCTION("jtag_tck_m1", jtag_tck_grp1, &jtag_tck_grp1_mux),
	FUNCTION("jtag_tdi_m0", jtag_tdi_grp0, &jtag_tdi_grp0_mux),
	FUNCTION("jtag_tdi_m1", jtag_tdi_grp1, &jtag_tdi_grp1_mux),
	FUNCTION("jtag_tdo_m0", jtag_tdo_grp0, &jtag_tdo_grp0_mux),
	FUNCTION("jtag_tdo_m1", jtag_tdo_grp1, &jtag_tdo_grp1_mux),
	FUNCTION("ks_kas_spi_m0", ks_kas_spi_grp0, &ks_kas_spi_grp0_mux),
	FUNCTION("ld_ldd", ld_ldd_grp, &ld_ldd_grp_mux),
	FUNCTION("ld_ldd_16bit", ld_ldd_16bit_grp, &ld_ldd_16bit_grp_mux),
	FUNCTION("ld_ldd_fck", ld_ldd_fck_grp, &ld_ldd_fck_grp_mux),
	FUNCTION("ld_ldd_lck", ld_ldd_lck_grp, &ld_ldd_lck_grp_mux),
	FUNCTION("lr_lcdrom", lr_lcdrom_grp, &lr_lcdrom_grp_mux),
	FUNCTION("lvds_analog", lvds_analog_grp, &lvds_analog_grp_mux),
	FUNCTION("nd_df", nd_df_grp, &nd_df_grp_mux),
	FUNCTION("nd_df_nowp", nd_df_nowp_grp, &nd_df_nowp_grp_mux),
	FUNCTION("ps", ps_grp, &ps_grp_mux),
	FUNCTION("pwc_core_on", pwc_core_on_grp, &pwc_core_on_grp_mux),
	FUNCTION("pwc_ext_on", pwc_ext_on_grp, &pwc_ext_on_grp_mux),
	FUNCTION("pwc_gpio3_clk", pwc_gpio3_clk_grp, &pwc_gpio3_clk_grp_mux),
	FUNCTION("pwc_io_on", pwc_io_on_grp, &pwc_io_on_grp_mux),
	FUNCTION("pwc_lowbatt_b_m0",
			pwc_lowbatt_b_grp0,
			&pwc_lowbatt_b_grp0_mux),
	FUNCTION("pwc_mem_on", pwc_mem_on_grp, &pwc_mem_on_grp_mux),
	FUNCTION("pwc_on_key_b_m0",
			pwc_on_key_b_grp0,
			&pwc_on_key_b_grp0_mux),
	FUNCTION("pwc_wakeup_src0",
			pwc_wakeup_src0_grp,
			&pwc_wakeup_src0_grp_mux),
	FUNCTION("pwc_wakeup_src1",
			pwc_wakeup_src1_grp,
			&pwc_wakeup_src1_grp_mux),
	FUNCTION("pwc_wakeup_src2",
			pwc_wakeup_src2_grp,
			&pwc_wakeup_src2_grp_mux),
	FUNCTION("pwc_wakeup_src3",
			pwc_wakeup_src3_grp,
			&pwc_wakeup_src3_grp_mux),
	FUNCTION("pw_cko0_m0", pw_cko0_grp0, &pw_cko0_grp0_mux),
	FUNCTION("pw_cko0_m1", pw_cko0_grp1, &pw_cko0_grp1_mux),
	FUNCTION("pw_cko0_m2", pw_cko0_grp2, &pw_cko0_grp2_mux),
	FUNCTION("pw_cko0_m3", pw_cko0_grp3, &pw_cko0_grp3_mux),
	FUNCTION("pw_cko1_m0", pw_cko1_grp0, &pw_cko1_grp0_mux),
	FUNCTION("pw_cko1_m1", pw_cko1_grp1, &pw_cko1_grp1_mux),
	FUNCTION("pw_cko1_m2", pw_cko1_grp2, &pw_cko1_grp2_mux),
	FUNCTION("pw_i2s01_clk_m0",
			pw_i2s01_clk_grp0,
			&pw_i2s01_clk_grp0_mux),
	FUNCTION("pw_i2s01_clk_m1",
			pw_i2s01_clk_grp1,
			&pw_i2s01_clk_grp1_mux),
	FUNCTION("pw_i2s01_clk_m2",
			pw_i2s01_clk_grp2,
			&pw_i2s01_clk_grp2_mux),
	FUNCTION("pw_pwm0_m0", pw_pwm0_grp0, &pw_pwm0_grp0_mux),
	FUNCTION("pw_pwm0_m1", pw_pwm0_grp1, &pw_pwm0_grp1_mux),
	FUNCTION("pw_pwm1_m0", pw_pwm1_grp0, &pw_pwm1_grp0_mux),
	FUNCTION("pw_pwm1_m1", pw_pwm1_grp1, &pw_pwm1_grp1_mux),
	FUNCTION("pw_pwm1_m2", pw_pwm1_grp2, &pw_pwm1_grp2_mux),
	FUNCTION("pw_pwm2_m0", pw_pwm2_grp0, &pw_pwm2_grp0_mux),
	FUNCTION("pw_pwm2_m1", pw_pwm2_grp1, &pw_pwm2_grp1_mux),
	FUNCTION("pw_pwm2_m2", pw_pwm2_grp2, &pw_pwm2_grp2_mux),
	FUNCTION("pw_pwm3_m0", pw_pwm3_grp0, &pw_pwm3_grp0_mux),
	FUNCTION("pw_pwm3_m1", pw_pwm3_grp1, &pw_pwm3_grp1_mux),
	FUNCTION("pw_pwm_cpu_vol_m0",
			pw_pwm_cpu_vol_grp0,
			&pw_pwm_cpu_vol_grp0_mux),
	FUNCTION("pw_pwm_cpu_vol_m1",
			pw_pwm_cpu_vol_grp1,
			&pw_pwm_cpu_vol_grp1_mux),
	FUNCTION("pw_pwm_cpu_vol_m2",
			pw_pwm_cpu_vol_grp2,
			&pw_pwm_cpu_vol_grp2_mux),
	FUNCTION("pw_backlight_m0",
			pw_backlight_grp0,
			&pw_backlight_grp0_mux),
	FUNCTION("pw_backlight_m1",
			pw_backlight_grp1,
			&pw_backlight_grp1_mux),
	FUNCTION("rg_eth_mac", rg_eth_mac_grp, &rg_eth_mac_grp_mux),
	FUNCTION("rg_gmac_phy_intr_n",
			rg_gmac_phy_intr_n_grp,
			&rg_gmac_phy_intr_n_grp_mux),
	FUNCTION("rg_rgmii_mac", rg_rgmii_mac_grp, &rg_rgmii_mac_grp_mux),
	FUNCTION("rg_rgmii_phy_ref_clk_m0",
			rg_rgmii_phy_ref_clk_grp0,
			&rg_rgmii_phy_ref_clk_grp0_mux),
	FUNCTION("rg_rgmii_phy_ref_clk_m1",
			rg_rgmii_phy_ref_clk_grp1,
			&rg_rgmii_phy_ref_clk_grp1_mux),
	FUNCTION("sd0", sd0_grp, &sd0_grp_mux),
	FUNCTION("sd0_4bit", sd0_4bit_grp, &sd0_4bit_grp_mux),
	FUNCTION("sd1", sd1_grp, &sd1_grp_mux),
	FUNCTION("sd1_4bit_m0", sd1_4bit_grp0, &sd1_4bit_grp0_mux),
	FUNCTION("sd1_4bit_m1", sd1_4bit_grp1, &sd1_4bit_grp1_mux),
	FUNCTION("sd2_basic", sd2_basic_grp, &sd2_basic_grp_mux),
	FUNCTION("sd2_cdb_m0", sd2_cdb_grp0, &sd2_cdb_grp0_mux),
	FUNCTION("sd2_cdb_m1", sd2_cdb_grp1, &sd2_cdb_grp1_mux),
	FUNCTION("sd2_wpb_m0", sd2_wpb_grp0, &sd2_wpb_grp0_mux),
	FUNCTION("sd2_wpb_m1", sd2_wpb_grp1, &sd2_wpb_grp1_mux),
	FUNCTION("sd3", sd3_grp, &sd3_grp_mux),
	FUNCTION("sd5", sd5_grp, &sd5_grp_mux),
	FUNCTION("sd6_m0", sd6_grp0, &sd6_grp0_mux),
	FUNCTION("sd6_m1", sd6_grp1, &sd6_grp1_mux),
	FUNCTION("sp0_ext_ldo_on",
			sp0_ext_ldo_on_grp,
			&sp0_ext_ldo_on_grp_mux),
	FUNCTION("sp0_qspi", sp0_qspi_grp, &sp0_qspi_grp_mux),
	FUNCTION("sp1_spi", sp1_spi_grp, &sp1_spi_grp_mux),
	FUNCTION("tpiu_trace", tpiu_trace_grp, &tpiu_trace_grp_mux),
	FUNCTION("uart0", uart0_grp, &uart0_grp_mux),
	FUNCTION("uart0_nopause", uart0_nopause_grp, &uart0_nopause_grp_mux),
	FUNCTION("uart1", uart1_grp, &uart1_grp_mux),
	FUNCTION("uart2_cts_m0", uart2_cts_grp0, &uart2_cts_grp0_mux),
	FUNCTION("uart2_cts_m1", uart2_cts_grp1, &uart2_cts_grp1_mux),
	FUNCTION("uart2_rts_m0", uart2_rts_grp0, &uart2_rts_grp0_mux),
	FUNCTION("uart2_rts_m1", uart2_rts_grp1, &uart2_rts_grp1_mux),
	FUNCTION("uart2_rxd_m0", uart2_rxd_grp0, &uart2_rxd_grp0_mux),
	FUNCTION("uart2_rxd_m1", uart2_rxd_grp1, &uart2_rxd_grp1_mux),
	FUNCTION("uart2_rxd_m2", uart2_rxd_grp2, &uart2_rxd_grp2_mux),
	FUNCTION("uart2_txd_m0", uart2_txd_grp0, &uart2_txd_grp0_mux),
	FUNCTION("uart2_txd_m1", uart2_txd_grp1, &uart2_txd_grp1_mux),
	FUNCTION("uart2_txd_m2", uart2_txd_grp2, &uart2_txd_grp2_mux),
	FUNCTION("uart3_cts_m0", uart3_cts_grp0, &uart3_cts_grp0_mux),
	FUNCTION("uart3_cts_m1", uart3_cts_grp1, &uart3_cts_grp1_mux),
	FUNCTION("uart3_cts_m2", uart3_cts_grp2, &uart3_cts_grp2_mux),
	FUNCTION("uart3_rts_m0", uart3_rts_grp0, &uart3_rts_grp0_mux),
	FUNCTION("uart3_rts_m1", uart3_rts_grp1, &uart3_rts_grp1_mux),
	FUNCTION("uart3_rts_m2", uart3_rts_grp2, &uart3_rts_grp2_mux),
	FUNCTION("uart3_rxd_m0", uart3_rxd_grp0, &uart3_rxd_grp0_mux),
	FUNCTION("uart3_rxd_m1", uart3_rxd_grp1, &uart3_rxd_grp1_mux),
	FUNCTION("uart3_rxd_m2", uart3_rxd_grp2, &uart3_rxd_grp2_mux),
	FUNCTION("uart3_txd_m0", uart3_txd_grp0, &uart3_txd_grp0_mux),
	FUNCTION("uart3_txd_m1", uart3_txd_grp1, &uart3_txd_grp1_mux),
	FUNCTION("uart3_txd_m2", uart3_txd_grp2, &uart3_txd_grp2_mux),
	FUNCTION("uart4_basic", uart4_basic_grp, &uart4_basic_grp_mux),
	FUNCTION("uart4_cts_m0", uart4_cts_grp0, &uart4_cts_grp0_mux),
	FUNCTION("uart4_cts_m1", uart4_cts_grp1, &uart4_cts_grp1_mux),
	FUNCTION("uart4_cts_m2", uart4_cts_grp2, &uart4_cts_grp2_mux),
	FUNCTION("uart4_rts_m0", uart4_rts_grp0, &uart4_rts_grp0_mux),
	FUNCTION("uart4_rts_m1", uart4_rts_grp1, &uart4_rts_grp1_mux),
	FUNCTION("uart4_rts_m2", uart4_rts_grp2, &uart4_rts_grp2_mux),
	FUNCTION("usb0_drvvbus_m0",
			usb0_drvvbus_grp0,
			&usb0_drvvbus_grp0_mux),
	FUNCTION("usb0_drvvbus_m1",
			usb0_drvvbus_grp1,
			&usb0_drvvbus_grp1_mux),
	FUNCTION("usb1_drvvbus_m0",
			usb1_drvvbus_grp0,
			&usb1_drvvbus_grp0_mux),
	FUNCTION("usb1_drvvbus_m1",
			usb1_drvvbus_grp1,
			&usb1_drvvbus_grp1_mux),
	FUNCTION("visbus_dout", visbus_dout_grp, &visbus_dout_grp_mux),
	FUNCTION("vi_vip1", vi_vip1_grp, &vi_vip1_grp_mux),
	FUNCTION("vi_vip1_ext", vi_vip1_ext_grp, &vi_vip1_ext_grp_mux),
	FUNCTION("vi_vip1_low8bit",
			vi_vip1_low8bit_grp,
			&vi_vip1_low8bit_grp_mux),
	FUNCTION("vi_vip1_high8bit",
			vi_vip1_high8bit_grp,
			&vi_vip1_high8bit_grp_mux),
};

struct atlas7_pinctrl_data atlas7_ioc_data = {
	.pads = (struct pinctrl_pin_desc *)atlas7_ioc_pads,
	.pads_cnt = ARRAY_SIZE(atlas7_ioc_pads),
	.grps = (struct atlas7_pin_group *)altas7_pin_groups,
	.grps_cnt = ARRAY_SIZE(altas7_pin_groups),
	.funcs = (struct atlas7_pmx_func *)atlas7_pmx_functions,
	.funcs_cnt = ARRAY_SIZE(atlas7_pmx_functions),
	.confs = (struct atlas7_pad_config *)atlas7_ioc_pad_confs,
	.confs_cnt = ARRAY_SIZE(atlas7_ioc_pad_confs),
};

/* Simple map data structure */
struct map_data {
	u8 idx;
	u8 data;
};

/**
 * struct atlas7_pull_info - Atlas7 Pad pull info
 * @type:The type of this Pad.
 * @mask:The mas value of this pin's pull bits.
 * @v2s: The map of pull register value to pull status.
 * @s2v: The map of pull status to pull register value.
 */
struct atlas7_pull_info {
	u8 pad_type;
	u8 mask;
	const struct map_data *v2s;
	const struct map_data *s2v;
};

/* Pull Register value map to status */
static const struct map_data p4we_pull_v2s[] = {
	{ P4WE_PULL_UP, PULL_UP },
	{ P4WE_HIGH_HYSTERESIS, HIGH_HYSTERESIS },
	{ P4WE_HIGH_Z, HIGH_Z },
	{ P4WE_PULL_DOWN, PULL_DOWN },
};

static const struct map_data p16st_pull_v2s[] = {
	{ P16ST_PULL_UP, PULL_UP },
	{ PD, PULL_UNKNOWN },
	{ P16ST_HIGH_Z, HIGH_Z },
	{ P16ST_PULL_DOWN, PULL_DOWN },
};

static const struct map_data pm31_pull_v2s[] = {
	{ PM31_PULL_DISABLED, PULL_DOWN },
	{ PM31_PULL_ENABLED, PULL_UP },
};

static const struct map_data pangd_pull_v2s[] = {
	{ PANGD_PULL_UP, PULL_UP },
	{ PD, PULL_UNKNOWN },
	{ PANGD_HIGH_Z, HIGH_Z },
	{ PANGD_PULL_DOWN, PULL_DOWN },
};

/* Pull status map to register value */
static const struct map_data p4we_pull_s2v[] = {
	{ PULL_UP, P4WE_PULL_UP },
	{ HIGH_HYSTERESIS, P4WE_HIGH_HYSTERESIS },
	{ HIGH_Z, P4WE_HIGH_Z },
	{ PULL_DOWN, P4WE_PULL_DOWN },
	{ PULL_DISABLE, -1 },
	{ PULL_ENABLE, -1 },
};

static const struct map_data p16st_pull_s2v[] = {
	{ PULL_UP, P16ST_PULL_UP },
	{ HIGH_HYSTERESIS, -1 },
	{ HIGH_Z, P16ST_HIGH_Z },
	{ PULL_DOWN, P16ST_PULL_DOWN },
	{ PULL_DISABLE, -1 },
	{ PULL_ENABLE, -1 },
};

static const struct map_data pm31_pull_s2v[] = {
	{ PULL_UP, PM31_PULL_ENABLED },
	{ HIGH_HYSTERESIS, -1 },
	{ HIGH_Z, -1 },
	{ PULL_DOWN, PM31_PULL_DISABLED },
	{ PULL_DISABLE, -1 },
	{ PULL_ENABLE, -1 },
};

static const struct map_data pangd_pull_s2v[] = {
	{ PULL_UP, PANGD_PULL_UP },
	{ HIGH_HYSTERESIS, -1 },
	{ HIGH_Z, PANGD_HIGH_Z },
	{ PULL_DOWN, PANGD_PULL_DOWN },
	{ PULL_DISABLE, -1 },
	{ PULL_ENABLE, -1 },
};

static const struct atlas7_pull_info atlas7_pull_map[] = {
	{ PAD_T_4WE_PD, P4WE_PULL_MASK, p4we_pull_v2s, p4we_pull_s2v },
	{ PAD_T_4WE_PU, P4WE_PULL_MASK, p4we_pull_v2s, p4we_pull_s2v },
	{ PAD_T_16ST, P16ST_PULL_MASK, p16st_pull_v2s, p16st_pull_s2v },
	{ PAD_T_M31_0204_PD, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
	{ PAD_T_M31_0204_PU, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
	{ PAD_T_M31_0610_PD, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
	{ PAD_T_M31_0610_PU, PM31_PULL_MASK, pm31_pull_v2s, pm31_pull_s2v },
	{ PAD_T_AD, PANGD_PULL_MASK, pangd_pull_v2s, pangd_pull_s2v },
};

/**
 * struct atlas7_ds_ma_info - Atlas7 Pad DriveStrength & currents info
 * @ma:		The Drive Strength in current value .
 * @ds_16st:	The correspond raw value of 16st pad.
 * @ds_4we:	The correspond raw value of 4we pad.
 * @ds_0204m31:	The correspond raw value of 0204m31 pad.
 * @ds_0610m31:	The correspond raw value of 0610m31 pad.
 */
struct atlas7_ds_ma_info {
	u32 ma;
	u32 ds_16st;
	u32 ds_4we;
	u32 ds_0204m31;
	u32 ds_0610m31;
};

static const struct atlas7_ds_ma_info atlas7_ma2ds_map[] = {
	{ 2, DS_16ST_0, DS_4WE_0, DS_M31_0, DS_NULL },
	{ 4, DS_16ST_1, DS_NULL, DS_M31_1, DS_NULL },
	{ 6, DS_16ST_2, DS_NULL, DS_NULL, DS_M31_0 },
	{ 8, DS_16ST_3, DS_4WE_1, DS_NULL, DS_NULL },
	{ 10, DS_16ST_4, DS_NULL, DS_NULL, DS_M31_1 },
	{ 12, DS_16ST_5, DS_NULL, DS_NULL, DS_NULL },
	{ 14, DS_16ST_6, DS_NULL, DS_NULL, DS_NULL },
	{ 16, DS_16ST_7, DS_4WE_2, DS_NULL, DS_NULL },
	{ 18, DS_16ST_8, DS_NULL, DS_NULL, DS_NULL },
	{ 20, DS_16ST_9, DS_NULL, DS_NULL, DS_NULL },
	{ 22, DS_16ST_10, DS_NULL, DS_NULL, DS_NULL },
	{ 24, DS_16ST_11, DS_NULL, DS_NULL, DS_NULL },
	{ 26, DS_16ST_12, DS_NULL, DS_NULL, DS_NULL },
	{ 28, DS_16ST_13, DS_4WE_3, DS_NULL, DS_NULL },
	{ 30, DS_16ST_14, DS_NULL, DS_NULL, DS_NULL },
	{ 32, DS_16ST_15, DS_NULL, DS_NULL, DS_NULL },
};

/**
 * struct atlas7_ds_info - Atlas7 Pad DriveStrength info
 * @type:		The type of this Pad.
 * @mask:		The mask value of this pin's pull bits.
 * @imval:		The immediate value of drives trength register.
 */
struct atlas7_ds_info {
	u8 type;
	u8 mask;
	u8 imval;
	u8 reserved;
};

static const struct atlas7_ds_info atlas7_ds_map[] = {
	{ PAD_T_4WE_PD, DS_2BIT_MASK, DS_2BIT_IM_VAL },
	{ PAD_T_4WE_PU, DS_2BIT_MASK, DS_2BIT_IM_VAL },
	{ PAD_T_16ST, DS_4BIT_MASK, DS_4BIT_IM_VAL },
	{ PAD_T_M31_0204_PD, DS_1BIT_MASK, DS_1BIT_IM_VAL },
	{ PAD_T_M31_0204_PU, DS_1BIT_MASK, DS_1BIT_IM_VAL },
	{ PAD_T_M31_0610_PD, DS_1BIT_MASK, DS_1BIT_IM_VAL },
	{ PAD_T_M31_0610_PU, DS_1BIT_MASK, DS_1BIT_IM_VAL },
	{ PAD_T_AD, DS_NULL, DS_NULL },
};

static inline u32 atlas7_pin_to_bank(u32 pin)
{
	return (pin >= ATLAS7_PINCTRL_BANK_0_PINS) ? 1 : 0;
}

static int atlas7_pmx_get_funcs_count(struct pinctrl_dev *pctldev)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);

	return pmx->pctl_data->funcs_cnt;
}

static const char *atlas7_pmx_get_func_name(struct pinctrl_dev *pctldev,
					u32 selector)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);

	return pmx->pctl_data->funcs[selector].name;
}

static int atlas7_pmx_get_func_groups(struct pinctrl_dev *pctldev,
		u32 selector, const char * const **groups,
		u32 * const num_groups)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);

	*groups = pmx->pctl_data->funcs[selector].groups;
	*num_groups = pmx->pctl_data->funcs[selector].num_groups;

	return 0;
}

static void __atlas7_pmx_pin_input_disable_set(struct atlas7_pmx *pmx,
				const struct atlas7_pad_mux *mux)
{
	/* Set Input Disable to avoid input glitches
	 *
	 * All Input-Disable Control registers are located on IOCRTC.
	 * So the regs bank is always 0.
	 *
	 */
	if (mux->dinput_reg && mux->dinput_val_reg) {
		writel(DI_MASK << mux->dinput_bit,
			pmx->regs[BANK_DS] + CLR_REG(mux->dinput_reg));
		writel(DI_DISABLE << mux->dinput_bit,
			pmx->regs[BANK_DS] + mux->dinput_reg);


		writel(DIV_MASK << mux->dinput_val_bit,
			pmx->regs[BANK_DS] + CLR_REG(mux->dinput_val_reg));
		writel(DIV_DISABLE << mux->dinput_val_bit,
			pmx->regs[BANK_DS] + mux->dinput_val_reg);
	}
}

static void __atlas7_pmx_pin_input_disable_clr(struct atlas7_pmx *pmx,
				const struct atlas7_pad_mux *mux)
{
	/* Clear Input Disable to avoid input glitches */
	if (mux->dinput_reg && mux->dinput_val_reg) {
		writel(DI_MASK << mux->dinput_bit,
			pmx->regs[BANK_DS] + CLR_REG(mux->dinput_reg));
		writel(DI_ENABLE << mux->dinput_bit,
			pmx->regs[BANK_DS] + mux->dinput_reg);

		writel(DIV_MASK << mux->dinput_val_bit,
			pmx->regs[BANK_DS] + CLR_REG(mux->dinput_val_reg));
		writel(DIV_ENABLE << mux->dinput_val_bit,
			pmx->regs[BANK_DS] + mux->dinput_val_reg);
	}
}

static int __atlas7_pmx_pin_ad_sel(struct atlas7_pmx *pmx,
			struct atlas7_pad_config *conf,
			u32 bank, u32 ad_sel)
{
	unsigned long regv;

	/* Write to clear register to clear A/D selector */
	writel(ANA_CLEAR_MASK << conf->ad_ctrl_bit,
		pmx->regs[bank] + CLR_REG(conf->ad_ctrl_reg));

	/* Set target pad A/D selector */
	regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
	regv &= ~(ANA_CLEAR_MASK << conf->ad_ctrl_bit);
	writel(regv | (ad_sel << conf->ad_ctrl_bit),
			pmx->regs[bank] + conf->ad_ctrl_reg);

	regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
	pr_debug("bank:%d reg:0x%04x val:0x%08lx\n",
			bank, conf->ad_ctrl_reg, regv);
	return 0;
}

static int  __atlas7_pmx_pin_analog_enable(struct atlas7_pmx *pmx,
			struct atlas7_pad_config *conf, u32 bank)
{
	/* Only PAD_T_AD pins can change between Analogue&Digital */
	if (conf->type != PAD_T_AD)
		return -EINVAL;

	return __atlas7_pmx_pin_ad_sel(pmx, conf, bank, 0);
}

static int __atlas7_pmx_pin_digital_enable(struct atlas7_pmx *pmx,
			struct atlas7_pad_config *conf, u32 bank)
{
	/* Other type pads are always digital */
	if (conf->type != PAD_T_AD)
		return 0;

	return __atlas7_pmx_pin_ad_sel(pmx, conf, bank, 1);
}

static int __atlas7_pmx_pin_enable(struct atlas7_pmx *pmx,
				u32 pin, u32 func)
{
	struct atlas7_pad_config *conf;
	u32 bank;
	int ret;
	unsigned long regv;

	pr_debug("PMX DUMP ### pin#%d func:%d #### START >>>\n",
			pin, func);

	/* Get this Pad's descriptor from PINCTRL */
	conf = &pmx->pctl_data->confs[pin];
	bank = atlas7_pin_to_bank(pin);

	/* Just enable the analog function of this pad */
	if (FUNC_ANALOGUE == func) {
		ret = __atlas7_pmx_pin_analog_enable(pmx, conf, bank);
		if (ret)
			dev_err(pmx->dev,
				"Convert pad#%d to analog failed, ret=%d\n",
				pin, ret);
		return ret;
	}

	/* Set Pads from analog to digital */
	ret = __atlas7_pmx_pin_digital_enable(pmx, conf, bank);
	if (ret) {
		dev_err(pmx->dev,
			"Convert pad#%d to digital failed, ret=%d\n",
			pin, ret);
		return ret;
	}

	/* Write to clear register to clear current function */
	writel(FUNC_CLEAR_MASK << conf->mux_bit,
		pmx->regs[bank] + CLR_REG(conf->mux_reg));

	/* Set target pad mux function */
	regv = readl(pmx->regs[bank] + conf->mux_reg);
	regv &= ~(FUNC_CLEAR_MASK << conf->mux_bit);
	writel(regv | (func << conf->mux_bit),
			pmx->regs[bank] + conf->mux_reg);

	regv = readl(pmx->regs[bank] + conf->mux_reg);
	pr_debug("bank:%d reg:0x%04x val:0x%08lx\n",
		bank, conf->mux_reg, regv);

	return 0;
}

static int atlas7_pmx_set_mux(struct pinctrl_dev *pctldev,
			u32 func_selector, u32 group_selector)
{
	int idx, ret;
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
	struct atlas7_pmx_func *pmx_func;
	struct atlas7_pin_group *pin_grp;
	const struct atlas7_grp_mux *grp_mux;
	const struct atlas7_pad_mux *mux;

	pmx_func = &pmx->pctl_data->funcs[func_selector];
	pin_grp = &pmx->pctl_data->grps[group_selector];

	pr_debug("PMX DUMP ### Function:[%s] Group:[%s] #### START >>>\n",
			pmx_func->name, pin_grp->name);

	grp_mux = pmx_func->grpmux;

	for (idx = 0; idx < grp_mux->pad_mux_count; idx++) {
		mux = &grp_mux->pad_mux_list[idx];
		__atlas7_pmx_pin_input_disable_set(pmx, mux);
		ret = __atlas7_pmx_pin_enable(pmx, mux->pin, mux->func);
		if (ret) {
			dev_err(pmx->dev,
				"FUNC:%s GRP:%s PIN#%d.%d failed, ret=%d\n",
				pmx_func->name, pin_grp->name,
				mux->pin, mux->func, ret);
			BUG_ON(1);
		}
		__atlas7_pmx_pin_input_disable_clr(pmx, mux);
	}
	pr_debug("PMX DUMP ### Function:[%s] Group:[%s] #### END <<<\n",
			pmx_func->name, pin_grp->name);

	return 0;
}

static u32 convert_current_to_drive_strength(u32 type, u32 ma)
{
	int idx;

	for (idx = 0; idx < ARRAY_SIZE(atlas7_ma2ds_map); idx++) {
		if (atlas7_ma2ds_map[idx].ma != ma)
			continue;

		if (type == PAD_T_4WE_PD || type == PAD_T_4WE_PU)
			return atlas7_ma2ds_map[idx].ds_4we;
		else if (type == PAD_T_16ST)
			return atlas7_ma2ds_map[idx].ds_16st;
		else if (type == PAD_T_M31_0204_PD || type == PAD_T_M31_0204_PU)
			return atlas7_ma2ds_map[idx].ds_0204m31;
		else if (type == PAD_T_M31_0610_PD || type == PAD_T_M31_0610_PU)
			return atlas7_ma2ds_map[idx].ds_0610m31;
	}

	return DS_NULL;
}

static int altas7_pinctrl_set_pull_sel(struct pinctrl_dev *pctldev,
					u32 pin, u32 sel)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
	struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
	const struct atlas7_pull_info *pull_info;
	u32 bank;
	unsigned long regv;
	void __iomem *pull_sel_reg;

	bank = atlas7_pin_to_bank(pin);
	pull_info = &atlas7_pull_map[conf->type];
	pull_sel_reg = pmx->regs[bank] + conf->pupd_reg;

	/* Retrieve correspond register value from table by sel */
	regv = pull_info->s2v[sel].data & pull_info->mask;

	/* Clear & Set new value to pull register */
	writel(pull_info->mask << conf->pupd_bit, CLR_REG(pull_sel_reg));
	writel(regv << conf->pupd_bit, pull_sel_reg);

	pr_debug("PIN_CFG ### SET PIN#%d PULL SELECTOR:%d == OK ####\n",
		pin, sel);
	return 0;
}

static int __altas7_pinctrl_set_drive_strength_sel(struct pinctrl_dev *pctldev,
						u32 pin, u32 sel)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
	struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
	const struct atlas7_ds_info *ds_info;
	u32 bank;
	void __iomem *ds_sel_reg;

	ds_info = &atlas7_ds_map[conf->type];
	if (sel & (~(ds_info->mask)))
		goto unsupport;

	bank = atlas7_pin_to_bank(pin);
	ds_sel_reg = pmx->regs[bank] + conf->drvstr_reg;

	writel(ds_info->imval << conf->drvstr_bit, CLR_REG(ds_sel_reg));
	writel(sel << conf->drvstr_bit, ds_sel_reg);

	return 0;

unsupport:
	pr_err("Pad#%d type[%d] doesn't support ds code[%d]!\n",
		pin, conf->type, sel);
	return -ENOTSUPP;
}

static int altas7_pinctrl_set_drive_strength_sel(struct pinctrl_dev *pctldev,
						u32 pin, u32 ma)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
	struct atlas7_pad_config *conf = &pmx->pctl_data->confs[pin];
	u32 type = conf->type;
	u32 sel;
	int ret;

	sel = convert_current_to_drive_strength(conf->type, ma);
	if (DS_NULL == sel) {
		pr_err("Pad#%d type[%d] doesn't support ds current[%d]!\n",
		pin, type, ma);
		return -ENOTSUPP;
	}

	ret =  __altas7_pinctrl_set_drive_strength_sel(pctldev,
						pin, sel);
	pr_debug("PIN_CFG ### SET PIN#%d DS:%d MA:%d == %s ####\n",
		pin, sel, ma, ret?"FAILED":"OK");
	return ret;
}

static int atlas7_pmx_gpio_request_enable(struct pinctrl_dev *pctldev,
		struct pinctrl_gpio_range *range, u32 pin)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);
	u32 idx;

	dev_dbg(pmx->dev,
		"atlas7_pmx_gpio_request_enable: pin=%d\n", pin);
	for (idx = 0; idx < range->npins; idx++) {
		if (pin == range->pins[idx])
			break;
	}

	if (idx >= range->npins) {
		dev_err(pmx->dev,
			"The pin#%d could not be requested as GPIO!!\n",
			pin);
		return -EPERM;
	}

	__atlas7_pmx_pin_enable(pmx, pin, FUNC_GPIO);

	return 0;
}

static struct pinmux_ops atlas7_pinmux_ops = {
	.get_functions_count = atlas7_pmx_get_funcs_count,
	.get_function_name = atlas7_pmx_get_func_name,
	.get_function_groups = atlas7_pmx_get_func_groups,
	.set_mux = atlas7_pmx_set_mux,
	.gpio_request_enable = atlas7_pmx_gpio_request_enable,
};

static int atlas7_pinctrl_get_groups_count(struct pinctrl_dev *pctldev)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);

	return pmx->pctl_data->grps_cnt;
}

static const char *atlas7_pinctrl_get_group_name(struct pinctrl_dev *pctldev,
						u32 group)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);

	return pmx->pctl_data->grps[group].name;
}

static int atlas7_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
		u32 group, const u32 **pins, u32 *num_pins)
{
	struct atlas7_pmx *pmx = pinctrl_dev_get_drvdata(pctldev);

	*num_pins = pmx->pctl_data->grps[group].num_pins;
	*pins = pmx->pctl_data->grps[group].pins;

	return 0;
}

static int atlas7_pinctrl_dt_node_to_map(struct pinctrl_dev *pctldev,
					struct device_node *np_config,
					struct pinctrl_map **map,
					u32 *num_maps)
{
	return pinconf_generic_dt_node_to_map(pctldev, np_config, map,
				num_maps, PIN_MAP_TYPE_INVALID);
}

static void atlas7_pinctrl_dt_free_map(struct pinctrl_dev *pctldev,
		struct pinctrl_map *map, u32 num_maps)
{
	kfree(map);
}

static const struct pinctrl_ops atlas7_pinctrl_ops = {
	.get_groups_count = atlas7_pinctrl_get_groups_count,
	.get_group_name = atlas7_pinctrl_get_group_name,
	.get_group_pins = atlas7_pinctrl_get_group_pins,
	.dt_node_to_map = atlas7_pinctrl_dt_node_to_map,
	.dt_free_map = atlas7_pinctrl_dt_free_map,
};

static int atlas7_pin_config_set(struct pinctrl_dev *pctldev,
				unsigned pin, unsigned long *configs,
				unsigned num_configs)
{
	u16 param, arg;
	int idx, err;

	for (idx = 0; idx < num_configs; idx++) {
		param = pinconf_to_config_param(configs[idx]);
		arg = pinconf_to_config_argument(configs[idx]);

		pr_debug("PMX CFG###### ATLAS7 PIN#%d [%s] CONFIG PARAM:%d ARG:%d >>>>>\n",
			pin, atlas7_ioc_pads[pin].name, param, arg);
		switch (param) {
		case PIN_CONFIG_BIAS_PULL_UP:
			err = altas7_pinctrl_set_pull_sel(pctldev,
							pin, PULL_UP);
			if (err)
				return err;
			break;

		case PIN_CONFIG_BIAS_PULL_DOWN:
			err = altas7_pinctrl_set_pull_sel(pctldev,
							pin, PULL_DOWN);
			if (err)
				return err;
			break;

		case PIN_CONFIG_INPUT_SCHMITT_ENABLE:
			err = altas7_pinctrl_set_pull_sel(pctldev,
							pin, HIGH_HYSTERESIS);
			if (err)
				return err;
			break;
		case PIN_CONFIG_BIAS_HIGH_IMPEDANCE:
			err = altas7_pinctrl_set_pull_sel(pctldev,
							pin, HIGH_Z);
			if (err)
				return err;
			break;

		case PIN_CONFIG_DRIVE_STRENGTH:
			err = altas7_pinctrl_set_drive_strength_sel(pctldev,
							pin, arg);
			if (err)
				return err;
			break;
		default:
			return -ENOTSUPP;
		}
		pr_debug("PMX CFG###### ATLAS7 PIN#%d [%s] CONFIG PARAM:%d ARG:%d <<<<\n",
			pin, atlas7_ioc_pads[pin].name, param, arg);
	}

	return 0;
}

static int atlas7_pin_config_group_set(struct pinctrl_dev *pctldev,
				unsigned group, unsigned long *configs,
				unsigned num_configs)
{
	const unsigned *pins;
	unsigned npins;
	int i, ret;

	ret = atlas7_pinctrl_get_group_pins(pctldev, group, &pins, &npins);
	if (ret)
		return ret;
	for (i = 0; i < npins; i++) {
		if (atlas7_pin_config_set(pctldev, pins[i],
					  configs, num_configs))
			return -ENOTSUPP;
	}
	return 0;
}

static const struct pinconf_ops atlas7_pinconf_ops = {
	.pin_config_set = atlas7_pin_config_set,
	.pin_config_group_set = atlas7_pin_config_group_set,
	.is_generic = true,
};

static int atlas7_pinmux_probe(struct platform_device *pdev)
{
	int ret, idx;
	struct atlas7_pmx *pmx;
	struct device_node *np = pdev->dev.of_node;
	u32 banks = ATLAS7_PINCTRL_REG_BANKS;

	/* Create state holders etc for this driver */
	pmx = devm_kzalloc(&pdev->dev, sizeof(*pmx), GFP_KERNEL);
	if (!pmx)
		return -ENOMEM;

	pmx->dev = &pdev->dev;

	pmx->pctl_data = &atlas7_ioc_data;
	pmx->pctl_desc.name = "pinctrl-atlas7";
	pmx->pctl_desc.pins = pmx->pctl_data->pads;
	pmx->pctl_desc.npins = pmx->pctl_data->pads_cnt;
	pmx->pctl_desc.pctlops = &atlas7_pinctrl_ops;
	pmx->pctl_desc.pmxops = &atlas7_pinmux_ops;
	pmx->pctl_desc.confops = &atlas7_pinconf_ops;

	for (idx = 0; idx < banks; idx++) {
		pmx->regs[idx] = of_iomap(np, idx);
		if (!pmx->regs[idx]) {
			dev_err(&pdev->dev,
			"can't map ioc bank#%d registers\n", idx);
			ret = -ENOMEM;
			goto unmap_io;
		}
	}

	/* Now register the pin controller and all pins it handles */
	pmx->pctl = pinctrl_register(&pmx->pctl_desc, &pdev->dev, pmx);
	if (IS_ERR(pmx->pctl)) {
		dev_err(&pdev->dev, "could not register atlas7 pinmux driver\n");
		ret = PTR_ERR(pmx->pctl);
		goto unmap_io;
	}

	platform_set_drvdata(pdev, pmx);

	dev_info(&pdev->dev, "initialized atlas7 pinmux driver\n");

	return 0;

unmap_io:
	for (idx = 0; idx < banks; idx++) {
		if (!pmx->regs[idx])
			break;
		iounmap(pmx->regs[idx]);
	}

	return ret;
}

#ifdef CONFIG_PM_SLEEP
static int atlas7_pinmux_suspend_noirq(struct device *dev)
{
	struct atlas7_pmx *pmx = dev_get_drvdata(dev);
	struct atlas7_pad_status *status;
	struct atlas7_pad_config *conf;
	const struct atlas7_ds_info *ds_info;
	const struct atlas7_pull_info *pull_info;
	int idx;
	u32 bank;
	unsigned long regv;

	for (idx = 0; idx < pmx->pctl_desc.npins; idx++) {
		/* Get this Pad's descriptor from PINCTRL */
		conf = &pmx->pctl_data->confs[idx];
		bank = atlas7_pin_to_bank(idx);
		status = &pmx->sleep_data[idx];

		/* Save Function selector */
		regv = readl(pmx->regs[bank] + conf->mux_reg);
		status->func = (regv >> conf->mux_bit) & FUNC_CLEAR_MASK;

		/* Check if Pad is in Analogue selector */
		if (conf->ad_ctrl_reg == -1)
			goto save_ds_sel;

		regv = readl(pmx->regs[bank] + conf->ad_ctrl_reg);
		if (!(regv & (conf->ad_ctrl_bit << ANA_CLEAR_MASK)))
			status->func = FUNC_ANALOGUE;

save_ds_sel:
		if (conf->drvstr_reg == -1)
			goto save_pull_sel;

		/* Save Drive Strength selector */
		ds_info = &atlas7_ds_map[conf->type];
		regv = readl(pmx->regs[bank] + conf->drvstr_reg);
		status->dstr = (regv >> conf->drvstr_bit) & ds_info->mask;

save_pull_sel:
		/* Save Pull selector */
		pull_info = &atlas7_pull_map[conf->type];
		regv = readl(pmx->regs[bank] + conf->pupd_reg);
		regv = (regv >> conf->pupd_bit) & pull_info->mask;
		status->pull = pull_info->v2s[regv].data;
	}

	/*
	 * Save disable input selector, this selector is not for Pin,
	 * but for Mux function.
	 */
	for (idx = 0; idx < NUM_OF_IN_DISABLE_REG; idx++) {
		pmx->status_ds[idx] = readl(pmx->regs[BANK_DS] +
					IN_DISABLE_0_REG_SET + 0x8 * idx);
		pmx->status_dsv[idx] = readl(pmx->regs[BANK_DS] +
					IN_DISABLE_VAL_0_REG_SET + 0x8 * idx);
	}

	return 0;
}

static int atlas7_pinmux_resume_noirq(struct device *dev)
{
	struct atlas7_pmx *pmx = dev_get_drvdata(dev);
	struct atlas7_pad_status *status;
	struct atlas7_pad_config *conf;
	int idx;
	u32 bank;

	for (idx = 0; idx < pmx->pctl_desc.npins; idx++) {
		/* Get this Pad's descriptor from PINCTRL */
		conf = &pmx->pctl_data->confs[idx];
		bank = atlas7_pin_to_bank(idx);
		status = &pmx->sleep_data[idx];

		/* Restore Function selector */
		__atlas7_pmx_pin_enable(pmx, idx, (u32)status->func & 0xff);

		if (FUNC_ANALOGUE == status->func)
			goto restore_pull_sel;

		/* Restore Drive Strength selector */
		__altas7_pinctrl_set_drive_strength_sel(pmx->pctl, idx,
						(u32)status->dstr & 0xff);

restore_pull_sel:
		/* Restore Pull selector */
		altas7_pinctrl_set_pull_sel(pmx->pctl, idx,
						(u32)status->pull & 0xff);
	}

	/*
	 * Restore disable input selector, this selector is not for Pin,
	 * but for Mux function
	 */
	for (idx = 0; idx < NUM_OF_IN_DISABLE_REG; idx++) {
		writel(~0, pmx->regs[BANK_DS] +
					IN_DISABLE_0_REG_CLR + 0x8 * idx);
		writel(pmx->status_ds[idx], pmx->regs[BANK_DS] +
					IN_DISABLE_0_REG_SET + 0x8 * idx);
		writel(~0, pmx->regs[BANK_DS] +
					IN_DISABLE_VAL_0_REG_CLR + 0x8 * idx);
		writel(pmx->status_dsv[idx], pmx->regs[BANK_DS] +
					IN_DISABLE_VAL_0_REG_SET + 0x8 * idx);
	}

	return 0;
}

static const struct dev_pm_ops atlas7_pinmux_pm_ops = {
	.suspend_noirq = atlas7_pinmux_suspend_noirq,
	.resume_noirq = atlas7_pinmux_resume_noirq,
	.freeze_noirq = atlas7_pinmux_suspend_noirq,
	.restore_noirq = atlas7_pinmux_resume_noirq,
};
#endif

static const struct of_device_id atlas7_pinmux_ids[] = {
	{ .compatible = "sirf,atlas7-ioc",},
	{},
};

static struct platform_driver atlas7_pinmux_driver = {
	.driver = {
		.name = "atlas7-ioc",
		.of_match_table = atlas7_pinmux_ids,
#ifdef CONFIG_PM_SLEEP
		.pm = &atlas7_pinmux_pm_ops,
#endif
	},
	.probe = atlas7_pinmux_probe,
};

static int __init atlas7_pinmux_init(void)
{
	return platform_driver_register(&atlas7_pinmux_driver);
}
arch_initcall(atlas7_pinmux_init);


/**
 * The Following is GPIO Code
 */
static inline struct
atlas7_gpio_bank *atlas7_gpio_to_bank(struct atlas7_gpio_chip *a7gc, u32 gpio)
{
	return &a7gc->banks[GPIO_TO_BANK(gpio)];
}

static int __atlas7_gpio_to_pin(struct atlas7_gpio_chip *a7gc, u32 gpio)
{
	struct atlas7_gpio_bank *bank;
	u32 ofs;

	bank = atlas7_gpio_to_bank(a7gc, gpio);
	ofs = gpio - bank->gpio_offset;
	if (ofs >= bank->ngpio)
		return -ENODEV;

	return bank->gpio_pins[ofs];
}

static void atlas7_gpio_irq_ack(struct irq_data *d)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 val, pin_in_bank;
	unsigned long flags;

	bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
	pin_in_bank = d->hwirq - bank->gpio_offset;
	ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);

	spin_lock_irqsave(&a7gc->lock, flags);

	val = readl(ctrl_reg);
	/* clear interrupt status */
	writel(val, ctrl_reg);

	spin_unlock_irqrestore(&a7gc->lock, flags);
}

static void __atlas7_gpio_irq_mask(struct atlas7_gpio_chip *a7gc, int idx)
{
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 val, pin_in_bank;

	bank = atlas7_gpio_to_bank(a7gc, idx);
	pin_in_bank = idx - bank->gpio_offset;
	ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);

	val = readl(ctrl_reg);
	val &= ~(ATLAS7_GPIO_CTL_INTR_EN_MASK |
		ATLAS7_GPIO_CTL_INTR_STATUS_MASK);
	writel(val, ctrl_reg);
}

static void atlas7_gpio_irq_mask(struct irq_data *d)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
	unsigned long flags;

	spin_lock_irqsave(&a7gc->lock, flags);

	__atlas7_gpio_irq_mask(a7gc, d->hwirq);

	spin_unlock_irqrestore(&a7gc->lock, flags);
}

static void atlas7_gpio_irq_unmask(struct irq_data *d)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 val, pin_in_bank;
	unsigned long flags;

	bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
	pin_in_bank = d->hwirq - bank->gpio_offset;
	ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);

	spin_lock_irqsave(&a7gc->lock, flags);

	val = readl(ctrl_reg);
	val &= ~ATLAS7_GPIO_CTL_INTR_STATUS_MASK;
	val |= ATLAS7_GPIO_CTL_INTR_EN_MASK;
	writel(val, ctrl_reg);

	spin_unlock_irqrestore(&a7gc->lock, flags);
}

static int atlas7_gpio_irq_type(struct irq_data *d,
				unsigned int type)
{
	struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 val, pin_in_bank;
	unsigned long flags;

	bank = atlas7_gpio_to_bank(a7gc, d->hwirq);
	pin_in_bank = d->hwirq - bank->gpio_offset;
	ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);

	spin_lock_irqsave(&a7gc->lock, flags);

	val = readl(ctrl_reg);
	val &= ~(ATLAS7_GPIO_CTL_INTR_STATUS_MASK |
		ATLAS7_GPIO_CTL_INTR_EN_MASK);

	switch (type) {
	case IRQ_TYPE_NONE:
		break;

	case IRQ_TYPE_EDGE_RISING:
		val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
			ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
		val &= ~ATLAS7_GPIO_CTL_INTR_LOW_MASK;
		break;

	case IRQ_TYPE_EDGE_FALLING:
		val &= ~ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
		val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK |
			ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
		break;

	case IRQ_TYPE_EDGE_BOTH:
		val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
			ATLAS7_GPIO_CTL_INTR_LOW_MASK |
			ATLAS7_GPIO_CTL_INTR_TYPE_MASK;
		break;

	case IRQ_TYPE_LEVEL_LOW:
		val &= ~(ATLAS7_GPIO_CTL_INTR_HIGH_MASK |
			ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
		val |= ATLAS7_GPIO_CTL_INTR_LOW_MASK;
		break;

	case IRQ_TYPE_LEVEL_HIGH:
		val |= ATLAS7_GPIO_CTL_INTR_HIGH_MASK;
		val &= ~(ATLAS7_GPIO_CTL_INTR_LOW_MASK |
			ATLAS7_GPIO_CTL_INTR_TYPE_MASK);
		break;
	}

	writel(val, ctrl_reg);

	spin_unlock_irqrestore(&a7gc->lock, flags);

	return 0;
}

static struct irq_chip atlas7_gpio_irq_chip = {
	.name = "atlas7-gpio-irq",
	.irq_ack = atlas7_gpio_irq_ack,
	.irq_mask = atlas7_gpio_irq_mask,
	.irq_unmask = atlas7_gpio_irq_unmask,
	.irq_set_type = atlas7_gpio_irq_type,
};

static void atlas7_gpio_handle_irq(struct irq_desc *desc)
{
	struct gpio_chip *gc = irq_desc_get_handler_data(desc);
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(gc);
	struct atlas7_gpio_bank *bank = NULL;
	u32 status, ctrl;
	int pin_in_bank = 0, idx;
	struct irq_chip *chip = irq_desc_get_chip(desc);
	unsigned int irq = irq_desc_get_irq(desc);

	for (idx = 0; idx < a7gc->nbank; idx++) {
		bank = &a7gc->banks[idx];
		if (bank->irq == irq)
			break;
	}
	BUG_ON(idx == a7gc->nbank);

	chained_irq_enter(chip, desc);

	status = readl(ATLAS7_GPIO_INT_STATUS(bank));
	if (!status) {
		pr_warn("%s: gpio [%s] status %#x no interrupt is flaged\n",
			__func__, gc->label, status);
		handle_bad_irq(desc);
		return;
	}

	while (status) {
		ctrl = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));

		/*
		 * Here we must check whether the corresponding GPIO's
		 * interrupt has been enabled, otherwise just skip it
		 */
		if ((status & 0x1) && (ctrl & ATLAS7_GPIO_CTL_INTR_EN_MASK)) {
			pr_debug("%s: chip[%s] gpio:%d happens\n",
				__func__, gc->label,
				bank->gpio_offset + pin_in_bank);
			generic_handle_irq(
				irq_find_mapping(gc->irqdomain,
					bank->gpio_offset + pin_in_bank));
		}

		if (++pin_in_bank >= bank->ngpio)
			break;

		status = status >> 1;
	}

	chained_irq_exit(chip, desc);
}

static void __atlas7_gpio_set_input(struct atlas7_gpio_chip *a7gc,
				unsigned int gpio)
{
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 val, pin_in_bank;

	bank = atlas7_gpio_to_bank(a7gc, gpio);
	pin_in_bank = gpio - bank->gpio_offset;
	ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);

	val = readl(ctrl_reg);
	val &= ~ATLAS7_GPIO_CTL_OUT_EN_MASK;
	writel(val, ctrl_reg);
}

static int atlas7_gpio_request(struct gpio_chip *chip,
				unsigned int gpio)
{
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
	int ret;
	unsigned long flags;

	ret = __atlas7_gpio_to_pin(a7gc, gpio);
	if (ret < 0)
		return ret;

	if (pinctrl_request_gpio(chip->base + gpio))
		return -ENODEV;

	spin_lock_irqsave(&a7gc->lock, flags);

	/*
	 * default status:
	 * set direction as input and mask irq
	 */
	__atlas7_gpio_set_input(a7gc, gpio);
	__atlas7_gpio_irq_mask(a7gc, gpio);

	spin_unlock_irqrestore(&a7gc->lock, flags);

	return 0;
}

static void atlas7_gpio_free(struct gpio_chip *chip,
				unsigned int gpio)
{
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
	unsigned long flags;

	spin_lock_irqsave(&a7gc->lock, flags);

	__atlas7_gpio_irq_mask(a7gc, gpio);
	__atlas7_gpio_set_input(a7gc, gpio);

	spin_unlock_irqrestore(&a7gc->lock, flags);

	pinctrl_free_gpio(chip->base + gpio);
}

static int atlas7_gpio_direction_input(struct gpio_chip *chip,
					unsigned int gpio)
{
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
	unsigned long flags;

	spin_lock_irqsave(&a7gc->lock, flags);

	__atlas7_gpio_set_input(a7gc, gpio);

	spin_unlock_irqrestore(&a7gc->lock, flags);

	return 0;
}

static void __atlas7_gpio_set_output(struct atlas7_gpio_chip *a7gc,
			   unsigned int gpio, int value)
{
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 out_ctrl, pin_in_bank;

	bank = atlas7_gpio_to_bank(a7gc, gpio);
	pin_in_bank = gpio - bank->gpio_offset;
	ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);

	out_ctrl = readl(ctrl_reg);
	if (value)
		out_ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
	else
		out_ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;

	out_ctrl &= ~ATLAS7_GPIO_CTL_INTR_EN_MASK;
	out_ctrl |= ATLAS7_GPIO_CTL_OUT_EN_MASK;
	writel(out_ctrl, ctrl_reg);
}

static int atlas7_gpio_direction_output(struct gpio_chip *chip,
				unsigned int gpio, int value)
{
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
	unsigned long flags;

	spin_lock_irqsave(&a7gc->lock, flags);

	__atlas7_gpio_set_output(a7gc, gpio, value);

	spin_unlock_irqrestore(&a7gc->lock, flags);

	return 0;
}

static int atlas7_gpio_get_value(struct gpio_chip *chip,
					unsigned int gpio)
{
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
	struct atlas7_gpio_bank *bank;
	u32 val, pin_in_bank;
	unsigned long flags;

	bank = atlas7_gpio_to_bank(a7gc, gpio);
	pin_in_bank = gpio - bank->gpio_offset;

	spin_lock_irqsave(&a7gc->lock, flags);

	val = readl(ATLAS7_GPIO_CTRL(bank, pin_in_bank));

	spin_unlock_irqrestore(&a7gc->lock, flags);

	return !!(val & ATLAS7_GPIO_CTL_DATAIN_MASK);
}

static void atlas7_gpio_set_value(struct gpio_chip *chip,
				unsigned int gpio, int value)
{
	struct atlas7_gpio_chip *a7gc = to_atlas7_gpio(chip);
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 ctrl, pin_in_bank;
	unsigned long flags;

	bank = atlas7_gpio_to_bank(a7gc, gpio);
	pin_in_bank = gpio - bank->gpio_offset;
	ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin_in_bank);

	spin_lock_irqsave(&a7gc->lock, flags);

	ctrl = readl(ctrl_reg);
	if (value)
		ctrl |= ATLAS7_GPIO_CTL_DATAOUT_MASK;
	else
		ctrl &= ~ATLAS7_GPIO_CTL_DATAOUT_MASK;
	writel(ctrl, ctrl_reg);

	spin_unlock_irqrestore(&a7gc->lock, flags);
}

static const struct of_device_id atlas7_gpio_ids[] = {
	{ .compatible = "sirf,atlas7-gpio", },
	{},
};

static int atlas7_gpio_probe(struct platform_device *pdev)
{
	struct device_node *np = pdev->dev.of_node;
	struct atlas7_gpio_chip *a7gc;
	struct gpio_chip *chip;
	u32 nbank;
	int ret, idx;

	ret = of_property_read_u32(np, "gpio-banks", &nbank);
	if (ret) {
		dev_err(&pdev->dev,
			"Could not find GPIO bank info,ret=%d!\n",
			ret);
		return ret;
	}

	/* retrieve gpio descriptor data */
	a7gc = devm_kzalloc(&pdev->dev, sizeof(*a7gc) +
			sizeof(struct atlas7_gpio_bank) * nbank, GFP_KERNEL);
	if (!a7gc)
		return -ENOMEM;

	/* Get Gpio clk */
	a7gc->clk = of_clk_get(np, 0);
	if (!IS_ERR(a7gc->clk)) {
		ret = clk_prepare_enable(a7gc->clk);
		if (ret) {
			dev_err(&pdev->dev,
				"Could not enable clock!\n");
			return ret;
		}
	}

	/* Get Gpio Registers */
	a7gc->reg = of_iomap(np, 0);
	if (!a7gc->reg) {
		dev_err(&pdev->dev, "Could not map GPIO Registers!\n");
		return -ENOMEM;
	}

	a7gc->nbank = nbank;
	spin_lock_init(&a7gc->lock);

	/* Setup GPIO Chip */
	chip = &a7gc->chip;
	chip->request = atlas7_gpio_request;
	chip->free = atlas7_gpio_free;
	chip->direction_input = atlas7_gpio_direction_input;
	chip->get = atlas7_gpio_get_value;
	chip->direction_output = atlas7_gpio_direction_output;
	chip->set = atlas7_gpio_set_value;
	chip->base = -1;
	/* Each chip can support 32 pins at one bank */
	chip->ngpio = NGPIO_OF_BANK * nbank;
	chip->label = kstrdup(np->name, GFP_KERNEL);
	chip->of_node = np;
	chip->of_gpio_n_cells = 2;
	chip->dev = &pdev->dev;

	/* Add gpio chip to system */
	ret = gpiochip_add(chip);
	if (ret) {
		dev_err(&pdev->dev,
		"%s: error in probe function with status %d\n",
		np->name, ret);
		goto failed;
	}

	/* Add gpio chip to irq subsystem */
	ret =  gpiochip_irqchip_add(chip, &atlas7_gpio_irq_chip,
			0, handle_level_irq, IRQ_TYPE_NONE);
	if (ret) {
		dev_err(&pdev->dev,
			"could not connect irqchip to gpiochip\n");
		goto failed;
	}

	for (idx = 0; idx < nbank; idx++) {
		struct gpio_pin_range *pin_range;
		struct atlas7_gpio_bank *bank;

		bank = &a7gc->banks[idx];
		/* Set ctrl registers' base of this bank */
		bank->base = ATLAS7_GPIO_BASE(a7gc, idx);

		/* Get interrupt number from DTS */
		ret = of_irq_get(np, idx);
		if (ret == -EPROBE_DEFER) {
			dev_err(&pdev->dev,
				"Unable to find IRQ number. ret=%d\n", ret);
			goto failed;
		}
		bank->irq = ret;

		gpiochip_set_chained_irqchip(chip, &atlas7_gpio_irq_chip,
					bank->irq, atlas7_gpio_handle_irq);

		/* Records gpio_pin_range to a7gc */
		list_for_each_entry(pin_range, &chip->pin_ranges, node) {
			struct pinctrl_gpio_range *range;

			range = &pin_range->range;
			if (range->id == NGPIO_OF_BANK * idx) {
				bank->gpio_offset = range->id;
				bank->ngpio = range->npins;
				bank->gpio_pins = range->pins;
				bank->pctldev = pin_range->pctldev;
				break;
			}
		}

		BUG_ON(!bank->pctldev);
	}

	platform_set_drvdata(pdev, a7gc);
	dev_info(&pdev->dev, "add to system.\n");
	return 0;
failed:
	return ret;
}

#ifdef CONFIG_PM_SLEEP
static int atlas7_gpio_suspend_noirq(struct device *dev)
{
	struct atlas7_gpio_chip *a7gc = dev_get_drvdata(dev);
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 idx, pin;

	for (idx = 0; idx < a7gc->nbank; idx++) {
		bank = &a7gc->banks[idx];
		for (pin = 0; pin < bank->ngpio; pin++) {
			ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin);
			bank->sleep_data[pin] = readl(ctrl_reg);
		}
	}

	return 0;
}

static int atlas7_gpio_resume_noirq(struct device *dev)
{
	struct atlas7_gpio_chip *a7gc = dev_get_drvdata(dev);
	struct atlas7_gpio_bank *bank;
	void __iomem *ctrl_reg;
	u32 idx, pin;

	for (idx = 0; idx < a7gc->nbank; idx++) {
		bank = &a7gc->banks[idx];
		for (pin = 0; pin < bank->ngpio; pin++) {
			ctrl_reg = ATLAS7_GPIO_CTRL(bank, pin);
			writel(bank->sleep_data[pin], ctrl_reg);
		}
	}

	return 0;
}

static const struct dev_pm_ops atlas7_gpio_pm_ops = {
	.suspend_noirq = atlas7_gpio_suspend_noirq,
	.resume_noirq = atlas7_gpio_resume_noirq,
	.freeze_noirq = atlas7_gpio_suspend_noirq,
	.restore_noirq = atlas7_gpio_resume_noirq,
};
#endif

static struct platform_driver atlas7_gpio_driver = {
	.driver = {
		.name = "atlas7-gpio",
		.of_match_table = atlas7_gpio_ids,
#ifdef CONFIG_PM_SLEEP
		.pm = &atlas7_gpio_pm_ops,
#endif
	},
	.probe = atlas7_gpio_probe,
};

static int __init atlas7_gpio_init(void)
{
	return platform_driver_register(&atlas7_gpio_driver);
}
subsys_initcall(atlas7_gpio_init);

MODULE_DESCRIPTION("SIRFSOC Atlas7 pin control driver");
MODULE_LICENSE("GPL");