diff options
author | Paul Cercueil <paul@crapouillou.net> | 2020-11-01 09:01:03 +0000 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2020-11-10 14:58:14 +0100 |
commit | bb42b59310ebc33ab73dddd9a075d24003d1adac (patch) | |
tree | a42faf1e5f5e835cf37b4e330c087341b8d2e177 /drivers/pinctrl/pinctrl-ingenic.c | |
parent | 57972641810a97566ffd13e4be3f6a66d61eb3b5 (diff) |
pinctrl: ingenic: Get rid of repetitive data
Abuse the pin function pointer to store the pin function value directly,
when all the pins of a group have the same function value. Now when the
pointer value is <= 3 (unsigned), the pointer value is used as the pin
function; otherwise it is used as a regular pointer.
This drastically reduces the number of pin function tables needed, and
drops .data usage by about 2 KiB. Additionally, the few pin function
tables that are still around now contain u8 instead of int, since the
largest number that will be stored is 3.
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
Link: https://lore.kernel.org/r/20201101090104.5088-2-paul@crapouillou.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-ingenic.c')
-rw-r--r-- | drivers/pinctrl/pinctrl-ingenic.c | 1258 |
1 files changed, 447 insertions, 811 deletions
diff --git a/drivers/pinctrl/pinctrl-ingenic.c b/drivers/pinctrl/pinctrl-ingenic.c index c8e50a58a5e5..01498b6ff83a 100644 --- a/drivers/pinctrl/pinctrl-ingenic.c +++ b/drivers/pinctrl/pinctrl-ingenic.c @@ -134,61 +134,42 @@ static int jz4740_pwm_pwm5_pins[] = { 0x7c, }; static int jz4740_pwm_pwm6_pins[] = { 0x7e, }; static int jz4740_pwm_pwm7_pins[] = { 0x7f, }; -static int jz4740_mmc_1bit_funcs[] = { 0, 0, 0, }; -static int jz4740_mmc_4bit_funcs[] = { 0, 0, 0, }; -static int jz4740_uart0_data_funcs[] = { 1, 1, }; -static int jz4740_uart0_hwflow_funcs[] = { 1, 1, }; -static int jz4740_uart1_data_funcs[] = { 2, 2, }; -static int jz4740_lcd_8bit_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4740_lcd_16bit_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4740_lcd_18bit_funcs[] = { 0, 0, }; -static int jz4740_lcd_18bit_tft_funcs[] = { 0, 0, 0, 0, }; -static int jz4740_nand_cs1_funcs[] = { 0, }; -static int jz4740_nand_cs2_funcs[] = { 0, }; -static int jz4740_nand_cs3_funcs[] = { 0, }; -static int jz4740_nand_cs4_funcs[] = { 0, }; -static int jz4740_nand_fre_fwe_funcs[] = { 0, 0, }; -static int jz4740_pwm_pwm0_funcs[] = { 0, }; -static int jz4740_pwm_pwm1_funcs[] = { 0, }; -static int jz4740_pwm_pwm2_funcs[] = { 0, }; -static int jz4740_pwm_pwm3_funcs[] = { 0, }; -static int jz4740_pwm_pwm4_funcs[] = { 0, }; -static int jz4740_pwm_pwm5_funcs[] = { 0, }; -static int jz4740_pwm_pwm6_funcs[] = { 0, }; -static int jz4740_pwm_pwm7_funcs[] = { 0, }; - -#define INGENIC_PIN_GROUP(name, id) \ + +#define INGENIC_PIN_GROUP_FUNCS(name, id, funcs) \ { \ name, \ id##_pins, \ ARRAY_SIZE(id##_pins), \ - id##_funcs, \ + funcs, \ } +#define INGENIC_PIN_GROUP(name, id, func) \ + INGENIC_PIN_GROUP_FUNCS(name, id, (void *)(func)) + static const struct group_desc jz4740_groups[] = { - INGENIC_PIN_GROUP("mmc-1bit", jz4740_mmc_1bit), - INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit), - INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data), - INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow), - INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data), - INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit), - INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit), - INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit), - INGENIC_PIN_GROUP("lcd-18bit-tft", jz4740_lcd_18bit_tft), + INGENIC_PIN_GROUP("mmc-1bit", jz4740_mmc_1bit, 0), + INGENIC_PIN_GROUP("mmc-4bit", jz4740_mmc_4bit, 0), + INGENIC_PIN_GROUP("uart0-data", jz4740_uart0_data, 1), + INGENIC_PIN_GROUP("uart0-hwflow", jz4740_uart0_hwflow, 1), + INGENIC_PIN_GROUP("uart1-data", jz4740_uart1_data, 2), + INGENIC_PIN_GROUP("lcd-8bit", jz4740_lcd_8bit, 0), + INGENIC_PIN_GROUP("lcd-16bit", jz4740_lcd_16bit, 0), + INGENIC_PIN_GROUP("lcd-18bit", jz4740_lcd_18bit, 0), + INGENIC_PIN_GROUP("lcd-18bit-tft", jz4740_lcd_18bit_tft, 0), { "lcd-no-pins", }, - INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1), - INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2), - INGENIC_PIN_GROUP("nand-cs3", jz4740_nand_cs3), - INGENIC_PIN_GROUP("nand-cs4", jz4740_nand_cs4), - INGENIC_PIN_GROUP("nand-fre-fwe", jz4740_nand_fre_fwe), - INGENIC_PIN_GROUP("pwm0", jz4740_pwm_pwm0), - INGENIC_PIN_GROUP("pwm1", jz4740_pwm_pwm1), - INGENIC_PIN_GROUP("pwm2", jz4740_pwm_pwm2), - INGENIC_PIN_GROUP("pwm3", jz4740_pwm_pwm3), - INGENIC_PIN_GROUP("pwm4", jz4740_pwm_pwm4), - INGENIC_PIN_GROUP("pwm5", jz4740_pwm_pwm5), - INGENIC_PIN_GROUP("pwm6", jz4740_pwm_pwm6), - INGENIC_PIN_GROUP("pwm7", jz4740_pwm_pwm7), + INGENIC_PIN_GROUP("nand-cs1", jz4740_nand_cs1, 0), + INGENIC_PIN_GROUP("nand-cs2", jz4740_nand_cs2, 0), + INGENIC_PIN_GROUP("nand-cs3", jz4740_nand_cs3, 0), + INGENIC_PIN_GROUP("nand-cs4", jz4740_nand_cs4, 0), + INGENIC_PIN_GROUP("nand-fre-fwe", jz4740_nand_fre_fwe, 0), + INGENIC_PIN_GROUP("pwm0", jz4740_pwm_pwm0, 0), + INGENIC_PIN_GROUP("pwm1", jz4740_pwm_pwm1, 0), + INGENIC_PIN_GROUP("pwm2", jz4740_pwm_pwm2, 0), + INGENIC_PIN_GROUP("pwm3", jz4740_pwm_pwm3, 0), + INGENIC_PIN_GROUP("pwm4", jz4740_pwm_pwm4, 0), + INGENIC_PIN_GROUP("pwm5", jz4740_pwm_pwm5, 0), + INGENIC_PIN_GROUP("pwm6", jz4740_pwm_pwm6, 0), + INGENIC_PIN_GROUP("pwm7", jz4740_pwm_pwm7, 0), }; static const char *jz4740_mmc_groups[] = { "mmc-1bit", "mmc-4bit", }; @@ -268,54 +249,33 @@ static int jz4725b_lcd_24bit_pins[] = { 0x76, 0x77, 0x78, 0x79, }; static int jz4725b_lcd_special_pins[] = { 0x76, 0x77, 0x78, 0x79, }; static int jz4725b_lcd_generic_pins[] = { 0x75, }; -static int jz4725b_mmc0_1bit_funcs[] = { 1, 1, 1, }; -static int jz4725b_mmc0_4bit_funcs[] = { 1, 0, 1, }; -static int jz4725b_mmc1_1bit_funcs[] = { 0, 0, 0, }; -static int jz4725b_mmc1_4bit_funcs[] = { 0, 0, 0, }; -static int jz4725b_uart_data_funcs[] = { 1, 1, }; -static int jz4725b_nand_cs1_funcs[] = { 0, }; -static int jz4725b_nand_cs2_funcs[] = { 0, }; -static int jz4725b_nand_cs3_funcs[] = { 0, }; -static int jz4725b_nand_cs4_funcs[] = { 0, }; -static int jz4725b_nand_cle_ale_funcs[] = { 0, 0, }; -static int jz4725b_nand_fre_fwe_funcs[] = { 0, 0, }; -static int jz4725b_pwm_pwm0_funcs[] = { 0, }; -static int jz4725b_pwm_pwm1_funcs[] = { 0, }; -static int jz4725b_pwm_pwm2_funcs[] = { 0, }; -static int jz4725b_pwm_pwm3_funcs[] = { 0, }; -static int jz4725b_pwm_pwm4_funcs[] = { 0, }; -static int jz4725b_pwm_pwm5_funcs[] = { 0, }; -static int jz4725b_lcd_8bit_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4725b_lcd_16bit_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4725b_lcd_18bit_funcs[] = { 0, 0, }; -static int jz4725b_lcd_24bit_funcs[] = { 1, 1, 1, 1, }; -static int jz4725b_lcd_special_funcs[] = { 0, 0, 0, 0, }; -static int jz4725b_lcd_generic_funcs[] = { 0, }; +static u8 jz4725b_mmc0_4bit_funcs[] = { 1, 0, 1, }; static const struct group_desc jz4725b_groups[] = { - INGENIC_PIN_GROUP("mmc0-1bit", jz4725b_mmc0_1bit), - INGENIC_PIN_GROUP("mmc0-4bit", jz4725b_mmc0_4bit), - INGENIC_PIN_GROUP("mmc1-1bit", jz4725b_mmc1_1bit), - INGENIC_PIN_GROUP("mmc1-4bit", jz4725b_mmc1_4bit), - INGENIC_PIN_GROUP("uart-data", jz4725b_uart_data), - INGENIC_PIN_GROUP("nand-cs1", jz4725b_nand_cs1), - INGENIC_PIN_GROUP("nand-cs2", jz4725b_nand_cs2), - INGENIC_PIN_GROUP("nand-cs3", jz4725b_nand_cs3), - INGENIC_PIN_GROUP("nand-cs4", jz4725b_nand_cs4), - INGENIC_PIN_GROUP("nand-cle-ale", jz4725b_nand_cle_ale), - INGENIC_PIN_GROUP("nand-fre-fwe", jz4725b_nand_fre_fwe), - INGENIC_PIN_GROUP("pwm0", jz4725b_pwm_pwm0), - INGENIC_PIN_GROUP("pwm1", jz4725b_pwm_pwm1), - INGENIC_PIN_GROUP("pwm2", jz4725b_pwm_pwm2), - INGENIC_PIN_GROUP("pwm3", jz4725b_pwm_pwm3), - INGENIC_PIN_GROUP("pwm4", jz4725b_pwm_pwm4), - INGENIC_PIN_GROUP("pwm5", jz4725b_pwm_pwm5), - INGENIC_PIN_GROUP("lcd-8bit", jz4725b_lcd_8bit), - INGENIC_PIN_GROUP("lcd-16bit", jz4725b_lcd_16bit), - INGENIC_PIN_GROUP("lcd-18bit", jz4725b_lcd_18bit), - INGENIC_PIN_GROUP("lcd-24bit", jz4725b_lcd_24bit), - INGENIC_PIN_GROUP("lcd-special", jz4725b_lcd_special), - INGENIC_PIN_GROUP("lcd-generic", jz4725b_lcd_generic), + INGENIC_PIN_GROUP("mmc0-1bit", jz4725b_mmc0_1bit, 1), + INGENIC_PIN_GROUP_FUNCS("mmc0-4bit", jz4725b_mmc0_4bit, + jz4725b_mmc0_4bit_funcs), + INGENIC_PIN_GROUP("mmc1-1bit", jz4725b_mmc1_1bit, 0), + INGENIC_PIN_GROUP("mmc1-4bit", jz4725b_mmc1_4bit, 0), + INGENIC_PIN_GROUP("uart-data", jz4725b_uart_data, 1), + INGENIC_PIN_GROUP("nand-cs1", jz4725b_nand_cs1, 0), + INGENIC_PIN_GROUP("nand-cs2", jz4725b_nand_cs2, 0), + INGENIC_PIN_GROUP("nand-cs3", jz4725b_nand_cs3, 0), + INGENIC_PIN_GROUP("nand-cs4", jz4725b_nand_cs4, 0), + INGENIC_PIN_GROUP("nand-cle-ale", jz4725b_nand_cle_ale, 0), + INGENIC_PIN_GROUP("nand-fre-fwe", jz4725b_nand_fre_fwe, 0), + INGENIC_PIN_GROUP("pwm0", jz4725b_pwm_pwm0, 0), + INGENIC_PIN_GROUP("pwm1", jz4725b_pwm_pwm1, 0), + INGENIC_PIN_GROUP("pwm2", jz4725b_pwm_pwm2, 0), + INGENIC_PIN_GROUP("pwm3", jz4725b_pwm_pwm3, 0), + INGENIC_PIN_GROUP("pwm4", jz4725b_pwm_pwm4, 0), + INGENIC_PIN_GROUP("pwm5", jz4725b_pwm_pwm5, 0), + INGENIC_PIN_GROUP("lcd-8bit", jz4725b_lcd_8bit, 0), + INGENIC_PIN_GROUP("lcd-16bit", jz4725b_lcd_16bit, 0), + INGENIC_PIN_GROUP("lcd-18bit", jz4725b_lcd_18bit, 0), + INGENIC_PIN_GROUP("lcd-24bit", jz4725b_lcd_24bit, 1), + INGENIC_PIN_GROUP("lcd-special", jz4725b_lcd_special, 0), + INGENIC_PIN_GROUP("lcd-generic", jz4725b_lcd_generic, 0), }; static const char *jz4725b_mmc0_groups[] = { "mmc0-1bit", "mmc0-4bit", }; @@ -431,110 +391,61 @@ static int jz4760_pwm_pwm5_pins[] = { 0x85, }; static int jz4760_pwm_pwm6_pins[] = { 0x6a, }; static int jz4760_pwm_pwm7_pins[] = { 0x6b, }; -static int jz4760_uart0_data_funcs[] = { 0, 0, }; -static int jz4760_uart0_hwflow_funcs[] = { 0, 0, }; -static int jz4760_uart1_data_funcs[] = { 0, 0, }; -static int jz4760_uart1_hwflow_funcs[] = { 0, 0, }; -static int jz4760_uart2_data_funcs[] = { 0, 0, }; -static int jz4760_uart2_hwflow_funcs[] = { 0, 0, }; -static int jz4760_uart3_data_funcs[] = { 0, 1, }; -static int jz4760_uart3_hwflow_funcs[] = { 0, 0, }; -static int jz4760_mmc0_1bit_a_funcs[] = { 1, 1, 0, }; -static int jz4760_mmc0_4bit_a_funcs[] = { 1, 1, 1, }; -static int jz4760_mmc0_1bit_e_funcs[] = { 0, 0, 0, }; -static int jz4760_mmc0_4bit_e_funcs[] = { 0, 0, 0, }; -static int jz4760_mmc0_8bit_e_funcs[] = { 0, 0, 0, 0, }; -static int jz4760_mmc1_1bit_d_funcs[] = { 0, 0, 0, }; -static int jz4760_mmc1_4bit_d_funcs[] = { 0, 0, 0, }; -static int jz4760_mmc1_1bit_e_funcs[] = { 1, 1, 1, }; -static int jz4760_mmc1_4bit_e_funcs[] = { 1, 1, 1, }; -static int jz4760_mmc1_8bit_e_funcs[] = { 1, 1, 1, 1, }; -static int jz4760_mmc2_1bit_b_funcs[] = { 0, 0, 0, }; -static int jz4760_mmc2_4bit_b_funcs[] = { 0, 0, 0, }; -static int jz4760_mmc2_1bit_e_funcs[] = { 2, 2, 2, }; -static int jz4760_mmc2_4bit_e_funcs[] = { 2, 2, 2, }; -static int jz4760_mmc2_8bit_e_funcs[] = { 2, 2, 2, 2, }; -static int jz4760_nemc_8bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4760_nemc_16bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4760_nemc_cle_ale_funcs[] = { 0, 0, }; -static int jz4760_nemc_addr_funcs[] = { 0, 0, 0, 0, }; -static int jz4760_nemc_rd_we_funcs[] = { 0, 0, }; -static int jz4760_nemc_frd_fwe_funcs[] = { 0, 0, }; -static int jz4760_nemc_wait_funcs[] = { 0, }; -static int jz4760_nemc_cs1_funcs[] = { 0, }; -static int jz4760_nemc_cs2_funcs[] = { 0, }; -static int jz4760_nemc_cs3_funcs[] = { 0, }; -static int jz4760_nemc_cs4_funcs[] = { 0, }; -static int jz4760_nemc_cs5_funcs[] = { 0, }; -static int jz4760_nemc_cs6_funcs[] = { 0, }; -static int jz4760_i2c0_funcs[] = { 0, 0, }; -static int jz4760_i2c1_funcs[] = { 0, 0, }; -static int jz4760_cim_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4760_lcd_24bit_funcs[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -}; -static int jz4760_pwm_pwm0_funcs[] = { 0, }; -static int jz4760_pwm_pwm1_funcs[] = { 0, }; -static int jz4760_pwm_pwm2_funcs[] = { 0, }; -static int jz4760_pwm_pwm3_funcs[] = { 0, }; -static int jz4760_pwm_pwm4_funcs[] = { 0, }; -static int jz4760_pwm_pwm5_funcs[] = { 0, }; -static int jz4760_pwm_pwm6_funcs[] = { 0, }; -static int jz4760_pwm_pwm7_funcs[] = { 0, }; +static u8 jz4760_uart3_data_funcs[] = { 0, 1, }; +static u8 jz4760_mmc0_1bit_a_funcs[] = { 1, 1, 0, }; static const struct group_desc jz4760_groups[] = { - INGENIC_PIN_GROUP("uart0-data", jz4760_uart0_data), - INGENIC_PIN_GROUP("uart0-hwflow", jz4760_uart0_hwflow), - INGENIC_PIN_GROUP("uart1-data", jz4760_uart1_data), - INGENIC_PIN_GROUP("uart1-hwflow", jz4760_uart1_hwflow), - INGENIC_PIN_GROUP("uart2-data", jz4760_uart2_data), - INGENIC_PIN_GROUP("uart2-hwflow", jz4760_uart2_hwflow), - INGENIC_PIN_GROUP("uart3-data", jz4760_uart3_data), - INGENIC_PIN_GROUP("uart3-hwflow", jz4760_uart3_hwflow), - INGENIC_PIN_GROUP("mmc0-1bit-a", jz4760_mmc0_1bit_a), - INGENIC_PIN_GROUP("mmc0-4bit-a", jz4760_mmc0_4bit_a), - INGENIC_PIN_GROUP("mmc0-1bit-e", jz4760_mmc0_1bit_e), - INGENIC_PIN_GROUP("mmc0-4bit-e", jz4760_mmc0_4bit_e), - INGENIC_PIN_GROUP("mmc0-8bit-e", jz4760_mmc0_8bit_e), - INGENIC_PIN_GROUP("mmc1-1bit-d", jz4760_mmc1_1bit_d), - INGENIC_PIN_GROUP("mmc1-4bit-d", jz4760_mmc1_4bit_d), - INGENIC_PIN_GROUP("mmc1-1bit-e", jz4760_mmc1_1bit_e), - INGENIC_PIN_GROUP("mmc1-4bit-e", jz4760_mmc1_4bit_e), - INGENIC_PIN_GROUP("mmc1-8bit-e", jz4760_mmc1_8bit_e), - INGENIC_PIN_GROUP("mmc2-1bit-b", jz4760_mmc2_1bit_b), - INGENIC_PIN_GROUP("mmc2-4bit-b", jz4760_mmc2_4bit_b), - INGENIC_PIN_GROUP("mmc2-1bit-e", jz4760_mmc2_1bit_e), - INGENIC_PIN_GROUP("mmc2-4bit-e", jz4760_mmc2_4bit_e), - INGENIC_PIN_GROUP("mmc2-8bit-e", jz4760_mmc2_8bit_e), - INGENIC_PIN_GROUP("nemc-8bit-data", jz4760_nemc_8bit_data), - INGENIC_PIN_GROUP("nemc-16bit-data", jz4760_nemc_16bit_data), - INGENIC_PIN_GROUP("nemc-cle-ale", jz4760_nemc_cle_ale), - INGENIC_PIN_GROUP("nemc-addr", jz4760_nemc_addr), - INGENIC_PIN_GROUP("nemc-rd-we", jz4760_nemc_rd_we), - INGENIC_PIN_GROUP("nemc-frd-fwe", jz4760_nemc_frd_fwe), - INGENIC_PIN_GROUP("nemc-wait", jz4760_nemc_wait), - INGENIC_PIN_GROUP("nemc-cs1", jz4760_nemc_cs1), - INGENIC_PIN_GROUP("nemc-cs2", jz4760_nemc_cs2), - INGENIC_PIN_GROUP("nemc-cs3", jz4760_nemc_cs3), - INGENIC_PIN_GROUP("nemc-cs4", jz4760_nemc_cs4), - INGENIC_PIN_GROUP("nemc-cs5", jz4760_nemc_cs5), - INGENIC_PIN_GROUP("nemc-cs6", jz4760_nemc_cs6), - INGENIC_PIN_GROUP("i2c0-data", jz4760_i2c0), - INGENIC_PIN_GROUP("i2c1-data", jz4760_i2c1), - INGENIC_PIN_GROUP("cim-data", jz4760_cim), - INGENIC_PIN_GROUP("lcd-24bit", jz4760_lcd_24bit), + INGENIC_PIN_GROUP("uart0-data", jz4760_uart0_data, 0), + INGENIC_PIN_GROUP("uart0-hwflow", jz4760_uart0_hwflow, 0), + INGENIC_PIN_GROUP("uart1-data", jz4760_uart1_data, 0), + INGENIC_PIN_GROUP("uart1-hwflow", jz4760_uart1_hwflow, 0), + INGENIC_PIN_GROUP("uart2-data", jz4760_uart2_data, 0), + INGENIC_PIN_GROUP("uart2-hwflow", jz4760_uart2_hwflow, 0), + INGENIC_PIN_GROUP_FUNCS("uart3-data", jz4760_uart3_data, + jz4760_uart3_data_funcs), + INGENIC_PIN_GROUP("uart3-hwflow", jz4760_uart3_hwflow, 0), + INGENIC_PIN_GROUP_FUNCS("mmc0-1bit-a", jz4760_mmc0_1bit_a, + jz4760_mmc0_1bit_a_funcs), + INGENIC_PIN_GROUP("mmc0-4bit-a", jz4760_mmc0_4bit_a, 1), + INGENIC_PIN_GROUP("mmc0-1bit-e", jz4760_mmc0_1bit_e, 0), + INGENIC_PIN_GROUP("mmc0-4bit-e", jz4760_mmc0_4bit_e, 0), + INGENIC_PIN_GROUP("mmc0-8bit-e", jz4760_mmc0_8bit_e, 0), + INGENIC_PIN_GROUP("mmc1-1bit-d", jz4760_mmc1_1bit_d, 0), + INGENIC_PIN_GROUP("mmc1-4bit-d", jz4760_mmc1_4bit_d, 0), + INGENIC_PIN_GROUP("mmc1-1bit-e", jz4760_mmc1_1bit_e, 1), + INGENIC_PIN_GROUP("mmc1-4bit-e", jz4760_mmc1_4bit_e, 1), + INGENIC_PIN_GROUP("mmc1-8bit-e", jz4760_mmc1_8bit_e, 1), + INGENIC_PIN_GROUP("mmc2-1bit-b", jz4760_mmc2_1bit_b, 0), + INGENIC_PIN_GROUP("mmc2-4bit-b", jz4760_mmc2_4bit_b, 0), + INGENIC_PIN_GROUP("mmc2-1bit-e", jz4760_mmc2_1bit_e, 2), + INGENIC_PIN_GROUP("mmc2-4bit-e", jz4760_mmc2_4bit_e, 2), + INGENIC_PIN_GROUP("mmc2-8bit-e", jz4760_mmc2_8bit_e, 2), + INGENIC_PIN_GROUP("nemc-8bit-data", jz4760_nemc_8bit_data, 0), + INGENIC_PIN_GROUP("nemc-16bit-data", jz4760_nemc_16bit_data, 0), + INGENIC_PIN_GROUP("nemc-cle-ale", jz4760_nemc_cle_ale, 0), + INGENIC_PIN_GROUP("nemc-addr", jz4760_nemc_addr, 0), + INGENIC_PIN_GROUP("nemc-rd-we", jz4760_nemc_rd_we, 0), + INGENIC_PIN_GROUP("nemc-frd-fwe", jz4760_nemc_frd_fwe, 0), + INGENIC_PIN_GROUP("nemc-wait", jz4760_nemc_wait, 0), + INGENIC_PIN_GROUP("nemc-cs1", jz4760_nemc_cs1, 0), + INGENIC_PIN_GROUP("nemc-cs2", jz4760_nemc_cs2, 0), + INGENIC_PIN_GROUP("nemc-cs3", jz4760_nemc_cs3, 0), + INGENIC_PIN_GROUP("nemc-cs4", jz4760_nemc_cs4, 0), + INGENIC_PIN_GROUP("nemc-cs5", jz4760_nemc_cs5, 0), + INGENIC_PIN_GROUP("nemc-cs6", jz4760_nemc_cs6, 0), + INGENIC_PIN_GROUP("i2c0-data", jz4760_i2c0, 0), + INGENIC_PIN_GROUP("i2c1-data", jz4760_i2c1, 0), + INGENIC_PIN_GROUP("cim-data", jz4760_cim, 0), + INGENIC_PIN_GROUP("lcd-24bit", jz4760_lcd_24bit, 0), { "lcd-no-pins", }, - INGENIC_PIN_GROUP("pwm0", jz4760_pwm_pwm0), - INGENIC_PIN_GROUP("pwm1", jz4760_pwm_pwm1), - INGENIC_PIN_GROUP("pwm2", jz4760_pwm_pwm2), - INGENIC_PIN_GROUP("pwm3", jz4760_pwm_pwm3), - INGENIC_PIN_GROUP("pwm4", jz4760_pwm_pwm4), - INGENIC_PIN_GROUP("pwm5", jz4760_pwm_pwm5), - INGENIC_PIN_GROUP("pwm6", jz4760_pwm_pwm6), - INGENIC_PIN_GROUP("pwm7", jz4760_pwm_pwm7), + INGENIC_PIN_GROUP("pwm0", jz4760_pwm_pwm0, 0), + INGENIC_PIN_GROUP("pwm1", jz4760_pwm_pwm1, 0), + INGENIC_PIN_GROUP("pwm2", jz4760_pwm_pwm2, 0), + INGENIC_PIN_GROUP("pwm3", jz4760_pwm_pwm3, 0), + INGENIC_PIN_GROUP("pwm4", jz4760_pwm_pwm4, 0), + INGENIC_PIN_GROUP("pwm5", jz4760_pwm_pwm5, 0), + INGENIC_PIN_GROUP("pwm6", jz4760_pwm_pwm6, 0), + INGENIC_PIN_GROUP("pwm7", jz4760_pwm_pwm7, 0), }; static const char *jz4760_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; @@ -735,200 +646,103 @@ static int jz4770_mac_rmii_pins[] = { static int jz4770_mac_mii_pins[] = { 0xa7, 0xaf, }; static int jz4770_otg_pins[] = { 0x8a, }; -static int jz4770_uart0_data_funcs[] = { 0, 0, }; -static int jz4770_uart0_hwflow_funcs[] = { 0, 0, }; -static int jz4770_uart1_data_funcs[] = { 0, 0, }; -static int jz4770_uart1_hwflow_funcs[] = { 0, 0, }; -static int jz4770_uart2_data_funcs[] = { 0, 0, }; -static int jz4770_uart2_hwflow_funcs[] = { 0, 0, }; -static int jz4770_uart3_data_funcs[] = { 0, 1, }; -static int jz4770_uart3_hwflow_funcs[] = { 0, 0, }; -static int jz4770_ssi0_dt_a_funcs[] = { 2, }; -static int jz4770_ssi0_dt_b_funcs[] = { 1, }; -static int jz4770_ssi0_dt_d_funcs[] = { 1, }; -static int jz4770_ssi0_dt_e_funcs[] = { 0, }; -static int jz4770_ssi0_dr_a_funcs[] = { 1, }; -static int jz4770_ssi0_dr_b_funcs[] = { 1, }; -static int jz4770_ssi0_dr_d_funcs[] = { 1, }; -static int jz4770_ssi0_dr_e_funcs[] = { 0, }; -static int jz4770_ssi0_clk_a_funcs[] = { 2, }; -static int jz4770_ssi0_clk_b_funcs[] = { 1, }; -static int jz4770_ssi0_clk_d_funcs[] = { 1, }; -static int jz4770_ssi0_clk_e_funcs[] = { 0, }; -static int jz4770_ssi0_gpc_b_funcs[] = { 1, }; -static int jz4770_ssi0_gpc_d_funcs[] = { 1, }; -static int jz4770_ssi0_gpc_e_funcs[] = { 0, }; -static int jz4770_ssi0_ce0_a_funcs[] = { 2, }; -static int jz4770_ssi0_ce0_b_funcs[] = { 1, }; -static int jz4770_ssi0_ce0_d_funcs[] = { 1, }; -static int jz4770_ssi0_ce0_e_funcs[] = { 0, }; -static int jz4770_ssi0_ce1_b_funcs[] = { 1, }; -static int jz4770_ssi0_ce1_d_funcs[] = { 1, }; -static int jz4770_ssi0_ce1_e_funcs[] = { 0, }; -static int jz4770_ssi1_dt_b_funcs[] = { 2, }; -static int jz4770_ssi1_dt_d_funcs[] = { 2, }; -static int jz4770_ssi1_dt_e_funcs[] = { 1, }; -static int jz4770_ssi1_dr_b_funcs[] = { 2, }; -static int jz4770_ssi1_dr_d_funcs[] = { 2, }; -static int jz4770_ssi1_dr_e_funcs[] = { 1, }; -static int jz4770_ssi1_clk_b_funcs[] = { 2, }; -static int jz4770_ssi1_clk_d_funcs[] = { 2, }; -static int jz4770_ssi1_clk_e_funcs[] = { 1, }; -static int jz4770_ssi1_gpc_b_funcs[] = { 2, }; -static int jz4770_ssi1_gpc_d_funcs[] = { 2, }; -static int jz4770_ssi1_gpc_e_funcs[] = { 1, }; -static int jz4770_ssi1_ce0_b_funcs[] = { 2, }; -static int jz4770_ssi1_ce0_d_funcs[] = { 2, }; -static int jz4770_ssi1_ce0_e_funcs[] = { 1, }; -static int jz4770_ssi1_ce1_b_funcs[] = { 2, }; -static int jz4770_ssi1_ce1_d_funcs[] = { 2, }; -static int jz4770_ssi1_ce1_e_funcs[] = { 1, }; -static int jz4770_mmc0_1bit_a_funcs[] = { 1, 1, 0, }; -static int jz4770_mmc0_4bit_a_funcs[] = { 1, 1, 1, }; -static int jz4770_mmc0_1bit_e_funcs[] = { 0, 0, 0, }; -static int jz4770_mmc0_4bit_e_funcs[] = { 0, 0, 0, }; -static int jz4770_mmc0_8bit_e_funcs[] = { 0, 0, 0, 0, }; -static int jz4770_mmc1_1bit_d_funcs[] = { 0, 0, 0, }; -static int jz4770_mmc1_4bit_d_funcs[] = { 0, 0, 0, }; -static int jz4770_mmc1_1bit_e_funcs[] = { 1, 1, 1, }; -static int jz4770_mmc1_4bit_e_funcs[] = { 1, 1, 1, }; -static int jz4770_mmc1_8bit_e_funcs[] = { 1, 1, 1, 1, }; -static int jz4770_mmc2_1bit_b_funcs[] = { 0, 0, 0, }; -static int jz4770_mmc2_4bit_b_funcs[] = { 0, 0, 0, }; -static int jz4770_mmc2_1bit_e_funcs[] = { 2, 2, 2, }; -static int jz4770_mmc2_4bit_e_funcs[] = { 2, 2, 2, }; -static int jz4770_mmc2_8bit_e_funcs[] = { 2, 2, 2, 2, }; -static int jz4770_nemc_8bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4770_nemc_16bit_data_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4770_nemc_cle_ale_funcs[] = { 0, 0, }; -static int jz4770_nemc_addr_funcs[] = { 0, 0, 0, 0, }; -static int jz4770_nemc_rd_we_funcs[] = { 0, 0, }; -static int jz4770_nemc_frd_fwe_funcs[] = { 0, 0, }; -static int jz4770_nemc_wait_funcs[] = { 0, }; -static int jz4770_nemc_cs1_funcs[] = { 0, }; -static int jz4770_nemc_cs2_funcs[] = { 0, }; -static int jz4770_nemc_cs3_funcs[] = { 0, }; -static int jz4770_nemc_cs4_funcs[] = { 0, }; -static int jz4770_nemc_cs5_funcs[] = { 0, }; -static int jz4770_nemc_cs6_funcs[] = { 0, }; -static int jz4770_i2c0_funcs[] = { 0, 0, }; -static int jz4770_i2c1_funcs[] = { 0, 0, }; -static int jz4770_i2c2_funcs[] = { 2, 2, }; -static int jz4770_cim_8bit_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4770_cim_12bit_funcs[] = { 0, 0, 0, 0, }; -static int jz4770_lcd_24bit_funcs[] = { - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, -}; -static int jz4770_pwm_pwm0_funcs[] = { 0, }; -static int jz4770_pwm_pwm1_funcs[] = { 0, }; -static int jz4770_pwm_pwm2_funcs[] = { 0, }; -static int jz4770_pwm_pwm3_funcs[] = { 0, }; -static int jz4770_pwm_pwm4_funcs[] = { 0, }; -static int jz4770_pwm_pwm5_funcs[] = { 0, }; -static int jz4770_pwm_pwm6_funcs[] = { 0, }; -static int jz4770_pwm_pwm7_funcs[] = { 0, }; -static int jz4770_mac_rmii_funcs[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; -static int jz4770_mac_mii_funcs[] = { 0, 0, }; -static int jz4770_otg_funcs[] = { 0, }; - static const struct group_desc jz4770_groups[] = { - INGENIC_PIN_GROUP("uart0-data", jz4770_uart0_data), - INGENIC_PIN_GROUP("uart0-hwflow", jz4770_uart0_hwflow), - INGENIC_PIN_GROUP("uart1-data", jz4770_uart1_data), - INGENIC_PIN_GROUP("uart1-hwflow", jz4770_uart1_hwflow), - INGENIC_PIN_GROUP("uart2-data", jz4770_uart2_data), - INGENIC_PIN_GROUP("uart2-hwflow", jz4770_uart2_hwflow), - INGENIC_PIN_GROUP("uart3-data", jz4770_uart3_data), - INGENIC_PIN_GROUP("uart3-hwflow", jz4770_uart3_hwflow), - INGENIC_PIN_GROUP("ssi0-dt-a", jz4770_ssi0_dt_a), - INGENIC_PIN_GROUP("ssi0-dt-b", jz4770_ssi0_dt_b), - INGENIC_PIN_GROUP("ssi0-dt-d", jz4770_ssi0_dt_d), - INGENIC_PIN_GROUP("ssi0-dt-e", jz4770_ssi0_dt_e), - INGENIC_PIN_GROUP("ssi0-dr-a", jz4770_ssi0_dr_a), - INGENIC_PIN_GROUP("ssi0-dr-b", jz4770_ssi0_dr_b), - INGENIC_PIN_GROUP("ssi0-dr-d", jz4770_ssi0_dr_d), - INGENIC_PIN_GROUP("ssi0-dr-e", jz4770_ssi0_dr_e), - INGENIC_PIN_GROUP("ssi0-clk-a", jz4770_ssi0_clk_a), - INGENIC_PIN_GROUP("ssi0-clk-b", jz4770_ssi0_clk_b), - INGENIC_PIN_GROUP("ssi0-clk-d", jz4770_ssi0_clk_d), - INGENIC_PIN_GROUP("ssi0-clk-e", jz4770_ssi0_clk_e), - INGENIC_PIN_GROUP("ssi0-gpc-b", jz4770_ssi0_gpc_b), - INGENIC_PIN_GROUP("ssi0-gpc-d", jz4770_ssi0_gpc_d), - INGENIC_PIN_GROUP("ssi0-gpc-e", jz4770_ssi0_gpc_e), - INGENIC_PIN_GROUP("ssi0-ce0-a", jz4770_ssi0_ce0_a), - INGENIC_PIN_GROUP("ssi0-ce0-b", jz4770_ssi0_ce0_b), - INGENIC_PIN_GROUP("ssi0-ce0-d", jz4770_ssi0_ce0_d), - INGENIC_PIN_GROUP("ssi0-ce0-e", jz4770_ssi0_ce0_e), - INGENIC_PIN_GROUP("ssi0-ce1-b", jz4770_ssi0_ce1_b), - INGENIC_PIN_GROUP("ssi0-ce1-d", jz4770_ssi0_ce1_d), - INGENIC_PIN_GROUP("ssi0-ce1-e", jz4770_ssi0_ce1_e), - INGENIC_PIN_GROUP("ssi1-dt-b", jz4770_ssi1_dt_b), - INGENIC_PIN_GROUP("ssi1-dt-d", jz4770_ssi1_dt_d), - INGENIC_PIN_GROUP("ssi1-dt-e", jz4770_ssi1_dt_e), - INGENIC_PIN_GROUP("ssi1-dr-b", jz4770_ssi1_dr_b), - INGENIC_PIN_GROUP("ssi1-dr-d", jz4770_ssi1_dr_d), - INGENIC_PIN_GROUP("ssi1-dr-e", jz4770_ssi1_dr_e), - INGENIC_PIN_GROUP("ssi1-clk-b", jz4770_ssi1_clk_b), - INGENIC_PIN_GROUP("ssi1-clk-d", jz4770_ssi1_clk_d), - INGENIC_PIN_GROUP("ssi1-clk-e", jz4770_ssi1_clk_e), - INGENIC_PIN_GROUP("ssi1-gpc-b", jz4770_ssi1_gpc_b), - INGENIC_PIN_GROUP("ssi1-gpc-d", jz4770_ssi1_gpc_d), - INGENIC_PIN_GROUP("ssi1-gpc-e", jz4770_ssi1_gpc_e), - INGENIC_PIN_GROUP("ssi1-ce0-b", jz4770_ssi1_ce0_b), - INGENIC_PIN_GROUP("ssi1-ce0-d", jz4770_ssi1_ce0_d), - INGENIC_PIN_GROUP("ssi1-ce0-e", jz4770_ssi1_ce0_e), - INGENIC_PIN_GROUP("ssi1-ce1-b", jz4770_ssi1_ce1_b), - INGENIC_PIN_GROUP("ssi1-ce1-d", jz4770_ssi1_ce1_d), - INGENIC_PIN_GROUP("ssi1-ce1-e", jz4770_ssi1_ce1_e), - INGENIC_PIN_GROUP("mmc0-1bit-a", jz4770_mmc0_1bit_a), - INGENIC_PIN_GROUP("mmc0-4bit-a", jz4770_mmc0_4bit_a), - INGENIC_PIN_GROUP("mmc0-1bit-e", jz4770_mmc0_1bit_e), - INGENIC_PIN_GROUP("mmc0-4bit-e", jz4770_mmc0_4bit_e), - INGENIC_PIN_GROUP("mmc0-8bit-e", jz4770_mmc0_8bit_e), - INGENIC_PIN_GROUP("mmc1-1bit-d", jz4770_mmc1_1bit_d), - INGENIC_PIN_GROUP("mmc1-4bit-d", jz4770_mmc1_4bit_d), - INGENIC_PIN_GROUP("mmc1-1bit-e", jz4770_mmc1_1bit_e), - INGENIC_PIN_GROUP("mmc1-4bit-e", jz4770_mmc1_4bit_e), - INGENIC_PIN_GROUP("mmc1-8bit-e", jz4770_mmc1_8bit_e), - INGENIC_PIN_GROUP("mmc2-1bit-b", jz4770_mmc2_1bit_b), - INGENIC_PIN_GROUP("mmc2-4bit-b", jz4770_mmc2_4bit_b), - INGENIC_PIN_GROUP("mmc2-1bit-e", jz4770_mmc2_1bit_e), - INGENIC_PIN_GROUP("mmc2-4bit-e", jz4770_mmc2_4bit_e), - INGENIC_PIN_GROUP("mmc2-8bit-e", jz4770_mmc2_8bit_e), - INGENIC_PIN_GROUP("nemc-8bit-data", jz4770_nemc_8bit_data), - INGENIC_PIN_GROUP("nemc-16bit-data", jz4770_nemc_16bit_data), - INGENIC_PIN_GROUP("nemc-cle-ale", jz4770_nemc_cle_ale), - INGENIC_PIN_GROUP("nemc-addr", jz4770_nemc_addr), - INGENIC_PIN_GROUP("nemc-rd-we", jz4770_nemc_rd_we), - INGENIC_PIN_GROUP("nemc-frd-fwe", jz4770_nemc_frd_fwe), - INGENIC_PIN_GROUP("nemc-wait", jz4770_nemc_wait), - INGENIC_PIN_GROUP("nemc-cs1", jz4770_nemc_cs1), - INGENIC_PIN_GROUP("nemc-cs2", jz4770_nemc_cs2), - INGENIC_PIN_GROUP("nemc-cs3", jz4770_nemc_cs3), - INGENIC_PIN_GROUP("nemc-cs4", jz4770_nemc_cs4), - INGENIC_PIN_GROUP("nemc-cs5", jz4770_nemc_cs5), - INGENIC_PIN_GROUP("nemc-cs6", jz4770_nemc_cs6), - INGENIC_PIN_GROUP("i2c0-data", jz4770_i2c0), - INGENIC_PIN_GROUP("i2c1-data", jz4770_i2c1), - INGENIC_PIN_GROUP("i2c2-data", jz4770_i2c2), - INGENIC_PIN_GROUP("cim-data-8bit", jz4770_cim_8bit), - INGENIC_PIN_GROUP("cim-data-12bit", jz4770_cim_12bit), - INGENIC_PIN_GROUP("lcd-24bit", jz4770_lcd_24bit), + INGENIC_PIN_GROUP("uart0-data", jz4770_uart0_data, 0), + INGENIC_PIN_GROUP("uart0-hwflow", jz4770_uart0_hwflow, 0), + INGENIC_PIN_GROUP("uart1-data", jz4770_uart1_data, 0), + INGENIC_PIN_GROUP("uart1-hwflow", jz4770_uart1_hwflow, 0), + INGENIC_PIN_GROUP("uart2-data", jz4770_uart2_data, 0), + INGENIC_PIN_GROUP("uart2-hwflow", jz4770_uart2_hwflow, 0), + INGENIC_PIN_GROUP_FUNCS("uart3-data", jz4770_uart3_data, + jz4760_uart3_data_funcs), + INGENIC_PIN_GROUP("uart3-hwflow", jz4770_uart3_hwflow, 0), + INGENIC_PIN_GROUP("ssi0-dt-a", jz4770_ssi0_dt_a, 2), + INGENIC_PIN_GROUP("ssi0-dt-b", jz4770_ssi0_dt_b, 1), + INGENIC_PIN_GROUP("ssi0-dt-d", jz4770_ssi0_dt_d, 1), + INGENIC_PIN_GROUP("ssi0-dt-e", jz4770_ssi0_dt_e, 0), + INGENIC_PIN_GROUP("ssi0-dr-a", jz4770_ssi0_dr_a, 1), + INGENIC_PIN_GROUP("ssi0-dr-b", jz4770_ssi0_dr_b, 1), + INGENIC_PIN_GROUP("ssi0-dr-d", jz4770_ssi0_dr_d, 1), + INGENIC_PIN_GROUP("ssi0-dr-e", jz4770_ssi0_dr_e, 0), + INGENIC_PIN_GROUP("ssi0-clk-a", jz4770_ssi0_clk_a, 2), + INGENIC_PIN_GROUP("ssi0-clk-b", jz4770_ssi0_clk_b, 1), + INGENIC_PIN_GROUP("ssi0-clk-d", jz4770_ssi0_clk_d, 1), + INGENIC_PIN_GROUP("ssi0-clk-e", jz4770_ssi0_clk_e, 0), + INGENIC_PIN_GROUP("ssi0-gpc-b", jz4770_ssi0_gpc_b, 1), + INGENIC_PIN_GROUP("ssi0-gpc-d", jz4770_ssi0_gpc_d, 1), + INGENIC_PIN_GROUP("ssi0-gpc-e", jz4770_ssi0_gpc_e, 0), + INGENIC_PIN_GROUP("ssi0-ce0-a", jz4770_ssi0_ce0_a, 2), + INGENIC_PIN_GROUP("ssi0-ce0-b", jz4770_ssi0_ce0_b, 1), + INGENIC_PIN_GROUP("ssi0-ce0-d", jz4770_ssi0_ce0_d, 1), + INGENIC_PIN_GROUP("ssi0-ce0-e", jz4770_ssi0_ce0_e, 0), + INGENIC_PIN_GROUP("ssi0-ce1-b", jz4770_ssi0_ce1_b, 1), + INGENIC_PIN_GROUP("ssi0-ce1-d", jz4770_ssi0_ce1_d, 1), + INGENIC_PIN_GROUP("ssi0-ce1-e", jz4770_ssi0_ce1_e, 0), + INGENIC_PIN_GROUP("ssi1-dt-b", jz4770_ssi1_dt_b, 2), + INGENIC_PIN_GROUP("ssi1-dt-d", jz4770_ssi1_dt_d, 2), + INGENIC_PIN_GROUP("ssi1-dt-e", jz4770_ssi1_dt_e, 1), + INGENIC_PIN_GROUP("ssi1-dr-b", jz4770_ssi1_dr_b, 2), + INGENIC_PIN_GROUP("ssi1-dr-d", jz4770_ssi1_dr_d, 2), + INGENIC_PIN_GROUP("ssi1-dr-e", jz4770_ssi1_dr_e, 1), + INGENIC_PIN_GROUP("ssi1-clk-b", jz4770_ssi1_clk_b, 2), + INGENIC_PIN_GROUP("ssi1-clk-d", jz4770_ssi1_clk_d, 2), + INGENIC_PIN_GROUP("ssi1-clk-e", jz4770_ssi1_clk_e, 1), + INGENIC_PIN_GROUP("ssi1-gpc-b", jz4770_ssi1_gpc_b, 2), + INGENIC_PIN_GROUP("ssi1-gpc-d", jz4770_ssi1_gpc_d, 2), + INGENIC_PIN_GROUP("ssi1-gpc-e", jz4770_ssi1_gpc_e, 1), + INGENIC_PIN_GROUP("ssi1-ce0-b", jz4770_ssi1_ce0_b, 2), + INGENIC_PIN_GROUP("ssi1-ce0-d", jz4770_ssi1_ce0_d, 2), + INGENIC_PIN_GROUP("ssi1-ce0-e", jz4770_ssi1_ce0_e, 1), + INGENIC_PIN_GROUP("ssi1-ce1-b", jz4770_ssi1_ce1_b, 2), + INGENIC_PIN_GROUP("ssi1-ce1-d", jz4770_ssi1_ce1_d, 2), + INGENIC_PIN_GROUP("ssi1-ce1-e", jz4770_ssi1_ce1_e, 1), + INGENIC_PIN_GROUP_FUNCS("mmc0-1bit-a", jz4770_mmc0_1bit_a, + jz4760_mmc0_1bit_a_funcs), + INGENIC_PIN_GROUP("mmc0-4bit-a", jz4770_mmc0_4bit_a, 1), + INGENIC_PIN_GROUP("mmc0-1bit-e", jz4770_mmc0_1bit_e, 0), + INGENIC_PIN_GROUP("mmc0-4bit-e", jz4770_mmc0_4bit_e, 0), + INGENIC_PIN_GROUP("mmc0-8bit-e", jz4770_mmc0_8bit_e, 0), + INGENIC_PIN_GROUP("mmc1-1bit-d", jz4770_mmc1_1bit_d, 0), + INGENIC_PIN_GROUP("mmc1-4bit-d", jz4770_mmc1_4bit_d, 0), + INGENIC_PIN_GROUP("mmc1-1bit-e", jz4770_mmc1_1bit_e, 1), + INGENIC_PIN_GROUP("mmc1-4bit-e", jz4770_mmc1_4bit_e, 1), + INGENIC_PIN_GROUP("mmc1-8bit-e", jz4770_mmc1_8bit_e, 1), + INGENIC_PIN_GROUP("mmc2-1bit-b", jz4770_mmc2_1bit_b, 0), + INGENIC_PIN_GROUP("mmc2-4bit-b", jz4770_mmc2_4bit_b, 0), + INGENIC_PIN_GROUP("mmc2-1bit-e", jz4770_mmc2_1bit_e, 2), + INGENIC_PIN_GROUP("mmc2-4bit-e", jz4770_mmc2_4bit_e, 2), + INGENIC_PIN_GROUP("mmc2-8bit-e", jz4770_mmc2_8bit_e, 2), + INGENIC_PIN_GROUP("nemc-8bit-data", jz4770_nemc_8bit_data, 0), + INGENIC_PIN_GROUP("nemc-16bit-data", jz4770_nemc_16bit_data, 0), + INGENIC_PIN_GROUP("nemc-cle-ale", jz4770_nemc_cle_ale, 0), + INGENIC_PIN_GROUP("nemc-addr", jz4770_nemc_addr, 0), + INGENIC_PIN_GROUP("nemc-rd-we", jz4770_nemc_rd_we, 0), + INGENIC_PIN_GROUP("nemc-frd-fwe", jz4770_nemc_frd_fwe, 0), + INGENIC_PIN_GROUP("nemc-wait", jz4770_nemc_wait, 0), + INGENIC_PIN_GROUP("nemc-cs1", jz4770_nemc_cs1, 0), + INGENIC_PIN_GROUP("nemc-cs2", jz4770_nemc_cs2, 0), + INGENIC_PIN_GROUP("nemc-cs3", jz4770_nemc_cs3, 0), + INGENIC_PIN_GROUP("nemc-cs4", jz4770_nemc_cs4, 0), + INGENIC_PIN_GROUP("nemc-cs5", jz4770_nemc_cs5, 0), + INGENIC_PIN_GROUP("nemc-cs6", jz4770_nemc_cs6, 0), + INGENIC_PIN_GROUP("i2c0-data", jz4770_i2c0, 0), + INGENIC_PIN_GROUP("i2c1-data", jz4770_i2c1, 0), + INGENIC_PIN_GROUP("i2c2-data", jz4770_i2c2, 2), + INGENIC_PIN_GROUP("cim-data-8bit", jz4770_cim_8bit, 0), + INGENIC_PIN_GROUP("cim-data-12bit", jz4770_cim_12bit, 0), + INGENIC_PIN_GROUP("lcd-24bit", jz4770_lcd_24bit, 0), { "lcd-no-pins", }, - INGENIC_PIN_GROUP("pwm0", jz4770_pwm_pwm0), - INGENIC_PIN_GROUP("pwm1", jz4770_pwm_pwm1), - INGENIC_PIN_GROUP("pwm2", jz4770_pwm_pwm2), - INGENIC_PIN_GROUP("pwm3", jz4770_pwm_pwm3), - INGENIC_PIN_GROUP("pwm4", jz4770_pwm_pwm4), - INGENIC_PIN_GROUP("pwm5", jz4770_pwm_pwm5), - INGENIC_PIN_GROUP("pwm6", jz4770_pwm_pwm6), - INGENIC_PIN_GROUP("pwm7", jz4770_pwm_pwm7), - INGENIC_PIN_GROUP("mac-rmii", jz4770_mac_rmii), - INGENIC_PIN_GROUP("mac-mii", jz4770_mac_mii), - INGENIC_PIN_GROUP("otg-vbus", jz4770_otg), + INGENIC_PIN_GROUP("pwm0", jz4770_pwm_pwm0, 0), + INGENIC_PIN_GROUP("pwm1", jz4770_pwm_pwm1, 0), + INGENIC_PIN_GROUP("pwm2", jz4770_pwm_pwm2, 0), + INGENIC_PIN_GROUP("pwm3", jz4770_pwm_pwm3, 0), + INGENIC_PIN_GROUP("pwm4", jz4770_pwm_pwm4, 0), + INGENIC_PIN_GROUP("pwm5", jz4770_pwm_pwm5, 0), + INGENIC_PIN_GROUP("pwm6", jz4770_pwm_pwm6, 0), + INGENIC_PIN_GROUP("pwm7", jz4770_pwm_pwm7, 0), + INGENIC_PIN_GROUP("mac-rmii", jz4770_mac_rmii, 0), + INGENIC_PIN_GROUP("mac-mii", jz4770_mac_mii, 0), + INGENIC_PIN_GROUP("otg-vbus", jz4770_otg, 0), }; static const char *jz4770_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; @@ -1090,156 +904,115 @@ static int jz4780_i2s_clk_rx_pins[] = { 0x88, 0x89, }; static int jz4780_i2s_sysclk_pins[] = { 0x85, }; static int jz4780_hdmi_ddc_pins[] = { 0xb9, 0xb8, }; -static int jz4780_uart2_data_funcs[] = { 1, 1, }; -static int jz4780_uart2_hwflow_funcs[] = { 1, 1, }; -static int jz4780_uart4_data_funcs[] = { 2, 2, }; -static int jz4780_ssi0_dt_a_19_funcs[] = { 2, }; -static int jz4780_ssi0_dt_a_21_funcs[] = { 2, }; -static int jz4780_ssi0_dt_a_28_funcs[] = { 2, }; -static int jz4780_ssi0_dt_b_funcs[] = { 1, }; -static int jz4780_ssi0_dt_d_funcs[] = { 1, }; -static int jz4780_ssi0_dr_a_20_funcs[] = { 2, }; -static int jz4780_ssi0_dr_a_27_funcs[] = { 2, }; -static int jz4780_ssi0_dr_b_funcs[] = { 1, }; -static int jz4780_ssi0_dr_d_funcs[] = { 1, }; -static int jz4780_ssi0_clk_a_funcs[] = { 2, }; -static int jz4780_ssi0_clk_b_5_funcs[] = { 1, }; -static int jz4780_ssi0_clk_b_28_funcs[] = { 1, }; -static int jz4780_ssi0_clk_d_funcs[] = { 1, }; -static int jz4780_ssi0_gpc_b_funcs[] = { 1, }; -static int jz4780_ssi0_gpc_d_funcs[] = { 1, }; -static int jz4780_ssi0_ce0_a_23_funcs[] = { 2, }; -static int jz4780_ssi0_ce0_a_25_funcs[] = { 2, }; -static int jz4780_ssi0_ce0_b_funcs[] = { 1, }; -static int jz4780_ssi0_ce0_d_funcs[] = { 1, }; -static int jz4780_ssi0_ce1_b_funcs[] = { 1, }; -static int jz4780_ssi0_ce1_d_funcs[] = { 1, }; -static int jz4780_ssi1_dt_b_funcs[] = { 2, }; -static int jz4780_ssi1_dt_d_funcs[] = { 2, }; -static int jz4780_ssi1_dr_b_funcs[] = { 2, }; -static int jz4780_ssi1_dr_d_funcs[] = { 2, }; -static int jz4780_ssi1_clk_b_funcs[] = { 2, }; -static int jz4780_ssi1_clk_d_funcs[] = { 2, }; -static int jz4780_ssi1_gpc_b_funcs[] = { 2, }; -static int jz4780_ssi1_gpc_d_funcs[] = { 2, }; -static int jz4780_ssi1_ce0_b_funcs[] = { 2, }; -static int jz4780_ssi1_ce0_d_funcs[] = { 2, }; -static int jz4780_ssi1_ce1_b_funcs[] = { 2, }; -static int jz4780_ssi1_ce1_d_funcs[] = { 2, }; -static int jz4780_mmc0_8bit_a_funcs[] = { 1, 1, 1, 1, 1, }; -static int jz4780_i2c3_funcs[] = { 1, 1, }; -static int jz4780_i2c4_e_funcs[] = { 1, 1, }; -static int jz4780_i2c4_f_funcs[] = { 1, 1, }; -static int jz4780_i2s_data_tx_funcs[] = { 0, }; -static int jz4780_i2s_data_rx_funcs[] = { 0, }; -static int jz4780_i2s_clk_txrx_funcs[] = { 1, 0, }; -static int jz4780_i2s_clk_rx_funcs[] = { 1, 1, }; -static int jz4780_i2s_sysclk_funcs[] = { 2, }; -static int jz4780_hdmi_ddc_funcs[] = { 0, 0, }; +static u8 jz4780_i2s_clk_txrx_funcs[] = { 1, 0, }; static const struct group_desc jz4780_groups[] = { - INGENIC_PIN_GROUP("uart0-data", jz4770_uart0_data), - INGENIC_PIN_GROUP("uart0-hwflow", jz4770_uart0_hwflow), - INGENIC_PIN_GROUP("uart1-data", jz4770_uart1_data), - INGENIC_PIN_GROUP("uart1-hwflow", jz4770_uart1_hwflow), - INGENIC_PIN_GROUP("uart2-data", jz4780_uart2_data), - INGENIC_PIN_GROUP("uart2-hwflow", jz4780_uart2_hwflow), - INGENIC_PIN_GROUP("uart3-data", jz4770_uart3_data), - INGENIC_PIN_GROUP("uart3-hwflow", jz4770_uart3_hwflow), - INGENIC_PIN_GROUP("uart4-data", jz4780_uart4_data), - INGENIC_PIN_GROUP("ssi0-dt-a-19", jz4780_ssi0_dt_a_19), - INGENIC_PIN_GROUP("ssi0-dt-a-21", jz4780_ssi0_dt_a_21), - INGENIC_PIN_GROUP("ssi0-dt-a-28", jz4780_ssi0_dt_a_28), - INGENIC_PIN_GROUP("ssi0-dt-b", jz4780_ssi0_dt_b), - INGENIC_PIN_GROUP("ssi0-dt-d", jz4780_ssi0_dt_d), - INGENIC_PIN_GROUP("ssi0-dt-e", jz4770_ssi0_dt_e), - INGENIC_PIN_GROUP("ssi0-dr-a-20", jz4780_ssi0_dr_a_20), - INGENIC_PIN_GROUP("ssi0-dr-a-27", jz4780_ssi0_dr_a_27), - INGENIC_PIN_GROUP("ssi0-dr-b", jz4780_ssi0_dr_b), - INGENIC_PIN_GROUP("ssi0-dr-d", jz4780_ssi0_dr_d), - INGENIC_PIN_GROUP("ssi0-dr-e", jz4770_ssi0_dr_e), - INGENIC_PIN_GROUP("ssi0-clk-a", jz4780_ssi0_clk_a), - INGENIC_PIN_GROUP("ssi0-clk-b-5", jz4780_ssi0_clk_b_5), - INGENIC_PIN_GROUP("ssi0-clk-b-28", jz4780_ssi0_clk_b_28), - INGENIC_PIN_GROUP("ssi0-clk-d", jz4780_ssi0_clk_d), - INGENIC_PIN_GROUP("ssi0-clk-e", jz4770_ssi0_clk_e), - INGENIC_PIN_GROUP("ssi0-gpc-b", jz4780_ssi0_gpc_b), - INGENIC_PIN_GROUP("ssi0-gpc-d", jz4780_ssi0_gpc_d), - INGENIC_PIN_GROUP("ssi0-gpc-e", jz4770_ssi0_gpc_e), - INGENIC_PIN_GROUP("ssi0-ce0-a-23", jz4780_ssi0_ce0_a_23), - INGENIC_PIN_GROUP("ssi0-ce0-a-25", jz4780_ssi0_ce0_a_25), - INGENIC_PIN_GROUP("ssi0-ce0-b", jz4780_ssi0_ce0_b), - INGENIC_PIN_GROUP("ssi0-ce0-d", jz4780_ssi0_ce0_d), - INGENIC_PIN_GROUP("ssi0-ce0-e", jz4770_ssi0_ce0_e), - INGENIC_PIN_GROUP("ssi0-ce1-b", jz4780_ssi0_ce1_b), - INGENIC_PIN_GROUP("ssi0-ce1-d", jz4780_ssi0_ce1_d), - INGENIC_PIN_GROUP("ssi0-ce1-e", jz4770_ssi0_ce1_e), - INGENIC_PIN_GROUP("ssi1-dt-b", jz4780_ssi1_dt_b), - INGENIC_PIN_GROUP("ssi1-dt-d", jz4780_ssi1_dt_d), - INGENIC_PIN_GROUP("ssi1-dt-e", jz4770_ssi1_dt_e), - INGENIC_PIN_GROUP("ssi1-dr-b", jz4780_ssi1_dr_b), - INGENIC_PIN_GROUP("ssi1-dr-d", jz4780_ssi1_dr_d), - INGENIC_PIN_GROUP("ssi1-dr-e", jz4770_ssi1_dr_e), - INGENIC_PIN_GROUP("ssi1-clk-b", jz4780_ssi1_clk_b), - INGENIC_PIN_GROUP("ssi1-clk-d", jz4780_ssi1_clk_d), - INGENIC_PIN_GROUP("ssi1-clk-e", jz4770_ssi1_clk_e), - INGENIC_PIN_GROUP("ssi1-gpc-b", jz4780_ssi1_gpc_b), - INGENIC_PIN_GROUP("ssi1-gpc-d", jz4780_ssi1_gpc_d), - INGENIC_PIN_GROUP("ssi1-gpc-e", jz4770_ssi1_gpc_e), - INGENIC_PIN_GROUP("ssi1-ce0-b", jz4780_ssi1_ce0_b), - INGENIC_PIN_GROUP("ssi1-ce0-d", jz4780_ssi1_ce0_d), - INGENIC_PIN_GROUP("ssi1-ce0-e", jz4770_ssi1_ce0_e), - INGENIC_PIN_GROUP("ssi1-ce1-b", jz4780_ssi1_ce1_b), - INGENIC_PIN_GROUP("ssi1-ce1-d", jz4780_ssi1_ce1_d), - INGENIC_PIN_GROUP("ssi1-ce1-e", jz4770_ssi1_ce1_e), - INGENIC_PIN_GROUP("mmc0-1bit-a", jz4770_mmc0_1bit_a), - INGENIC_PIN_GROUP("mmc0-4bit-a", jz4770_mmc0_4bit_a), - INGENIC_PIN_GROUP("mmc0-8bit-a", jz4780_mmc0_8bit_a), - INGENIC_PIN_GROUP("mmc0-1bit-e", jz4770_mmc0_1bit_e), - INGENIC_PIN_GROUP("mmc0-4bit-e", jz4770_mmc0_4bit_e), - INGENIC_PIN_GROUP("mmc1-1bit-d", jz4770_mmc1_1bit_d), - INGENIC_PIN_GROUP("mmc1-4bit-d", jz4770_mmc1_4bit_d), - INGENIC_PIN_GROUP("mmc1-1bit-e", jz4770_mmc1_1bit_e), - INGENIC_PIN_GROUP("mmc1-4bit-e", jz4770_mmc1_4bit_e), - INGENIC_PIN_GROUP("mmc2-1bit-b", jz4770_mmc2_1bit_b), - INGENIC_PIN_GROUP("mmc2-4bit-b", jz4770_mmc2_4bit_b), - INGENIC_PIN_GROUP("mmc2-1bit-e", jz4770_mmc2_1bit_e), - INGENIC_PIN_GROUP("mmc2-4bit-e", jz4770_mmc2_4bit_e), - INGENIC_PIN_GROUP("nemc-data", jz4770_nemc_8bit_data), - INGENIC_PIN_GROUP("nemc-cle-ale", jz4770_nemc_cle_ale), - INGENIC_PIN_GROUP("nemc-addr", jz4770_nemc_addr), - INGENIC_PIN_GROUP("nemc-rd-we", jz4770_nemc_rd_we), - INGENIC_PIN_GROUP("nemc-frd-fwe", jz4770_nemc_frd_fwe), - INGENIC_PIN_GROUP("nemc-wait", jz4770_nemc_wait), - INGENIC_PIN_GROUP("nemc-cs1", jz4770_nemc_cs1), - INGENIC_PIN_GROUP("nemc-cs2", jz4770_nemc_cs2), - INGENIC_PIN_GROUP("nemc-cs3", jz4770_nemc_cs3), - INGENIC_PIN_GROUP("nemc-cs4", jz4770_nemc_cs4), - INGENIC_PIN_GROUP("nemc-cs5", jz4770_nemc_cs5), - INGENIC_PIN_GROUP("nemc-cs6", jz4770_nemc_cs6), - INGENIC_PIN_GROUP("i2c0-data", jz4770_i2c0), - INGENIC_PIN_GROUP("i2c1-data", jz4770_i2c1), - INGENIC_PIN_GROUP("i2c2-data", jz4770_i2c2), - INGENIC_PIN_GROUP("i2c3-data", jz4780_i2c3), - INGENIC_PIN_GROUP("i2c4-data-e", jz4780_i2c4_e), - INGENIC_PIN_GROUP("i2c4-data-f", jz4780_i2c4_f), - INGENIC_PIN_GROUP("i2s-data-tx", jz4780_i2s_data_tx), - INGENIC_PIN_GROUP("i2s-data-rx", jz4780_i2s_data_rx), - INGENIC_PIN_GROUP("i2s-clk-txrx", jz4780_i2s_clk_txrx), - INGENIC_PIN_GROUP("i2s-clk-rx", jz4780_i2s_clk_rx), - INGENIC_PIN_GROUP("i2s-sysclk", jz4780_i2s_sysclk), - INGENIC_PIN_GROUP("hdmi-ddc", jz4780_hdmi_ddc), - INGENIC_PIN_GROUP("cim-data", jz4770_cim_8bit), - INGENIC_PIN_GROUP("lcd-24bit", jz4770_lcd_24bit), + INGENIC_PIN_GROUP("uart0-data", jz4770_uart0_data, 0), + INGENIC_PIN_GROUP("uart0-hwflow", jz4770_uart0_hwflow, 0), + INGENIC_PIN_GROUP("uart1-data", jz4770_uart1_data, 0), + INGENIC_PIN_GROUP("uart1-hwflow", jz4770_uart1_hwflow, 0), + INGENIC_PIN_GROUP("uart2-data", jz4780_uart2_data, 1), + INGENIC_PIN_GROUP("uart2-hwflow", jz4780_uart2_hwflow, 1), + INGENIC_PIN_GROUP_FUNCS("uart3-data", jz4770_uart3_data, + jz4760_uart3_data_funcs), + INGENIC_PIN_GROUP("uart3-hwflow", jz4770_uart3_hwflow, 0), + INGENIC_PIN_GROUP("uart4-data", jz4780_uart4_data, 2), + INGENIC_PIN_GROUP("ssi0-dt-a-19", jz4780_ssi0_dt_a_19, 2), + INGENIC_PIN_GROUP("ssi0-dt-a-21", jz4780_ssi0_dt_a_21, 2), + INGENIC_PIN_GROUP("ssi0-dt-a-28", jz4780_ssi0_dt_a_28, 2), + INGENIC_PIN_GROUP("ssi0-dt-b", jz4780_ssi |