21 #include <linux/kernel.h>
26 #define CPU_32_PORT(fn, pfx, sfx) \
27 PORT_10(fn, pfx, sfx), PORT_10(fn, pfx##1, sfx), \
28 PORT_10(fn, pfx##2, sfx), PORT_1(fn, pfx##30, sfx), \
29 PORT_1(fn, pfx##31, sfx)
31 #define CPU_32_PORT6(fn, pfx, sfx) \
32 PORT_1(fn, pfx##0, sfx), PORT_1(fn, pfx##1, sfx), \
33 PORT_1(fn, pfx##2, sfx), PORT_1(fn, pfx##3, sfx), \
34 PORT_1(fn, pfx##4, sfx), PORT_1(fn, pfx##5, sfx), \
35 PORT_1(fn, pfx##6, sfx), PORT_1(fn, pfx##7, sfx), \
36 PORT_1(fn, pfx##8, sfx)
38 #define CPU_ALL_PORT(fn, pfx, sfx) \
39 CPU_32_PORT(fn, pfx##_0_, sfx), \
40 CPU_32_PORT(fn, pfx##_1_, sfx), \
41 CPU_32_PORT(fn, pfx##_2_, sfx), \
42 CPU_32_PORT(fn, pfx##_3_, sfx), \
43 CPU_32_PORT(fn, pfx##_4_, sfx), \
44 CPU_32_PORT(fn, pfx##_5_, sfx), \
45 CPU_32_PORT6(fn, pfx##_6_, sfx)
47 #define _GP_GPIO(pfx, sfx) PINMUX_GPIO(GPIO_GP##pfx, GP##pfx##_DATA)
48 #define _GP_DATA(pfx, sfx) PINMUX_DATA(GP##pfx##_DATA, GP##pfx##_FN, \
49 GP##pfx##_IN, GP##pfx##_OUT)
51 #define _GP_INOUTSEL(pfx, sfx) GP##pfx##_IN, GP##pfx##_OUT
52 #define _GP_INDT(pfx, sfx) GP##pfx##_DATA
54 #define GP_ALL(str) CPU_ALL_PORT(_PORT_ALL, GP, str)
55 #define PINMUX_GPIO_GP_ALL() CPU_ALL_PORT(_GP_GPIO, , unused)
56 #define PINMUX_DATA_GP_ALL() CPU_ALL_PORT(_GP_DATA, , unused)
59 #define PORT_10_REV(fn, pfx, sfx) \
60 PORT_1(fn, pfx##9, sfx), PORT_1(fn, pfx##8, sfx), \
61 PORT_1(fn, pfx##7, sfx), PORT_1(fn, pfx##6, sfx), \
62 PORT_1(fn, pfx##5, sfx), PORT_1(fn, pfx##4, sfx), \
63 PORT_1(fn, pfx##3, sfx), PORT_1(fn, pfx##2, sfx), \
64 PORT_1(fn, pfx##1, sfx), PORT_1(fn, pfx##0, sfx)
66 #define CPU_32_PORT_REV(fn, pfx, sfx) \
67 PORT_1(fn, pfx##31, sfx), PORT_1(fn, pfx##30, sfx), \
68 PORT_10_REV(fn, pfx##2, sfx), PORT_10_REV(fn, pfx##1, sfx), \
69 PORT_10_REV(fn, pfx, sfx)
71 #define GP_INOUTSEL(bank) CPU_32_PORT_REV(_GP_INOUTSEL, _##bank##_, unused)
72 #define GP_INDT(bank) CPU_32_PORT_REV(_GP_INDT, _##bank##_, unused)
74 #define PINMUX_IPSR_DATA(ipsr, fn) PINMUX_DATA(fn##_MARK, FN_##ipsr, FN_##fn)
75 #define PINMUX_IPSR_MODSEL_DATA(ipsr, fn, ms) PINMUX_DATA(fn##_MARK, FN_##ms, \
1932 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1933 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1934 0, 0, 0, 0, 0, 0, 0, 0,
1950 1, 3, 2, 1, 2, 4, 3, 2, 2, 2, 2, 2, 3, 3) {
1988 3, 4, 2, 2, 2, 4, 4, 4, 3, 2, 2) {
1990 0, 0, 0, 0, 0, 0, 0, 0,
2026 1, 3, 1, 1, 1, 1, 1, 1, 3, 3, 4, 4, 4, 4) {
2072 3, 1, 1, 3, 1, 2, 1, 1, 1, 1, 1,
2073 1, 3, 3, 1, 1, 1, 1, 1, 1, 3) {
2123 3, 1, 1, 1, 1, 1, 1, 3, 3,
2124 1, 1, 1, 1, 1, 1, 3, 3, 3, 2) {
2171 1, 2, 1, 4, 3, 4, 2, 2,
2172 2, 2, 1, 1, 1, 1, 1, 1, 3) {
2217 1, 2, 2, 2, 2, 3, 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_7_DATA, GP_6_6_DATA, GP_6_5_DATA, GP_6_4_DATA,
2598 GP_6_3_DATA, GP_6_2_DATA, GP_6_1_DATA, GP_6_0_DATA }
2603 static struct resource r8a7779_pfc_resources[] = {
2605 .start = 0xfffc0000,
2610 .start = 0xffc40000,
2617 .name =
"r8a7779_pfc",
2619 .resource = r8a7779_pfc_resources,
2620 .num_resources =
ARRAY_SIZE(r8a7779_pfc_resources),
2622 .unlock_reg = 0xfffc0000,
2634 .gpios = pinmux_gpios,
2635 .cfg_regs = pinmux_config_regs,
2636 .data_regs = pinmux_data_regs,
2638 .gpio_data = pinmux_data,
2644 register_pinmux(&r8a7779_pinmux_info);