Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

pinctrl: ingenic: Improve JZ4760 support

- Add otg function and otg-vbus group.

- Add lcd-8bit, lcd-16bit, lcd-18bit, lcd-generic and lcd-special
groups. Change the lcd-24bit group so that it only selects the pins
that aren't in the lcd-18bit and lcd-generic groups (which breaks
Device Tree in theory, but there is none out there for any JZ4760
based board, yet). Remove the lcd-no-pins group which is just useless.

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Link: https://lore.kernel.org/r/20210120110722.20133-1-paul@crapouillou.net
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Paul Cercueil and committed by
Linus Walleij
dd1ccfd6 4ef82b30

+29 -11
+29 -11
drivers/pinctrl/pinctrl-ingenic.c
··· 376 376 0x26, 0x27, 0x28, 0x29, 377 377 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f, 0x30, 0x31, 378 378 }; 379 - static int jz4760_lcd_24bit_pins[] = { 380 - 0x40, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 381 - 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 382 - 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57, 383 - 0x58, 0x59, 0x5a, 0x5b, 379 + static int jz4760_lcd_8bit_pins[] = { 380 + 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x4c, 381 + 0x4d, 0x52, 0x53, 384 382 }; 383 + static int jz4760_lcd_16bit_pins[] = { 384 + 0x4e, 0x4f, 0x50, 0x51, 0x56, 0x57, 0x58, 0x59, 385 + }; 386 + static int jz4760_lcd_18bit_pins[] = { 387 + 0x5a, 0x5b, 388 + }; 389 + static int jz4760_lcd_24bit_pins[] = { 390 + 0x40, 0x41, 0x4a, 0x4b, 0x54, 0x55, 391 + }; 392 + static int jz4760_lcd_special_pins[] = { 0x40, 0x41, 0x4a, 0x54 }; 393 + static int jz4760_lcd_generic_pins[] = { 0x49, }; 385 394 static int jz4760_pwm_pwm0_pins[] = { 0x80, }; 386 395 static int jz4760_pwm_pwm1_pins[] = { 0x81, }; 387 396 static int jz4760_pwm_pwm2_pins[] = { 0x82, }; ··· 399 390 static int jz4760_pwm_pwm5_pins[] = { 0x85, }; 400 391 static int jz4760_pwm_pwm6_pins[] = { 0x6a, }; 401 392 static int jz4760_pwm_pwm7_pins[] = { 0x6b, }; 393 + static int jz4760_otg_pins[] = { 0x8a, }; 402 394 403 395 static u8 jz4760_uart3_data_funcs[] = { 0, 1, }; 404 396 static u8 jz4760_mmc0_1bit_a_funcs[] = { 1, 1, 0, }; ··· 446 436 INGENIC_PIN_GROUP("i2c0-data", jz4760_i2c0, 0), 447 437 INGENIC_PIN_GROUP("i2c1-data", jz4760_i2c1, 0), 448 438 INGENIC_PIN_GROUP("cim-data", jz4760_cim, 0), 439 + INGENIC_PIN_GROUP("lcd-8bit", jz4760_lcd_8bit, 0), 440 + INGENIC_PIN_GROUP("lcd-16bit", jz4760_lcd_16bit, 0), 441 + INGENIC_PIN_GROUP("lcd-18bit", jz4760_lcd_18bit, 0), 449 442 INGENIC_PIN_GROUP("lcd-24bit", jz4760_lcd_24bit, 0), 450 - { "lcd-no-pins", }, 443 + INGENIC_PIN_GROUP("lcd-generic", jz4760_lcd_generic, 0), 444 + INGENIC_PIN_GROUP("lcd-special", jz4760_lcd_special, 1), 451 445 INGENIC_PIN_GROUP("pwm0", jz4760_pwm_pwm0, 0), 452 446 INGENIC_PIN_GROUP("pwm1", jz4760_pwm_pwm1, 0), 453 447 INGENIC_PIN_GROUP("pwm2", jz4760_pwm_pwm2, 0), ··· 460 446 INGENIC_PIN_GROUP("pwm5", jz4760_pwm_pwm5, 0), 461 447 INGENIC_PIN_GROUP("pwm6", jz4760_pwm_pwm6, 0), 462 448 INGENIC_PIN_GROUP("pwm7", jz4760_pwm_pwm7, 0), 449 + INGENIC_PIN_GROUP("otg-vbus", jz4760_otg, 0), 463 450 }; 464 451 465 452 static const char *jz4760_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; ··· 492 477 static const char *jz4760_i2c0_groups[] = { "i2c0-data", }; 493 478 static const char *jz4760_i2c1_groups[] = { "i2c1-data", }; 494 479 static const char *jz4760_cim_groups[] = { "cim-data", }; 495 - static const char *jz4760_lcd_groups[] = { "lcd-24bit", "lcd-no-pins", }; 480 + static const char *jz4760_lcd_groups[] = { 481 + "lcd-8bit", "lcd-16bit", "lcd-18bit", "lcd-24bit", 482 + "lcd-special", "lcd-generic", 483 + }; 496 484 static const char *jz4760_pwm0_groups[] = { "pwm0", }; 497 485 static const char *jz4760_pwm1_groups[] = { "pwm1", }; 498 486 static const char *jz4760_pwm2_groups[] = { "pwm2", }; ··· 504 486 static const char *jz4760_pwm5_groups[] = { "pwm5", }; 505 487 static const char *jz4760_pwm6_groups[] = { "pwm6", }; 506 488 static const char *jz4760_pwm7_groups[] = { "pwm7", }; 489 + static const char *jz4760_otg_groups[] = { "otg-vbus", }; 507 490 508 491 static const struct function_desc jz4760_functions[] = { 509 492 { "uart0", jz4760_uart0_groups, ARRAY_SIZE(jz4760_uart0_groups), }, ··· 533 514 { "pwm5", jz4760_pwm5_groups, ARRAY_SIZE(jz4760_pwm5_groups), }, 534 515 { "pwm6", jz4760_pwm6_groups, ARRAY_SIZE(jz4760_pwm6_groups), }, 535 516 { "pwm7", jz4760_pwm7_groups, ARRAY_SIZE(jz4760_pwm7_groups), }, 517 + { "otg", jz4760_otg_groups, ARRAY_SIZE(jz4760_otg_groups), }, 536 518 }; 537 519 538 520 static const struct ingenic_chip_info jz4760_chip_info = { ··· 668 648 0xa9, 0xab, 0xaa, 0xac, 0xa5, 0xa4, 0xad, 0xae, 0xa6, 0xa8, 669 649 }; 670 650 static int jz4770_mac_mii_pins[] = { 0xa7, 0xaf, }; 671 - static int jz4770_otg_pins[] = { 0x8a, }; 672 651 673 652 static const struct group_desc jz4770_groups[] = { 674 653 INGENIC_PIN_GROUP("uart0-data", jz4770_uart0_data, 0), ··· 766 747 INGENIC_PIN_GROUP("pwm7", jz4770_pwm_pwm7, 0), 767 748 INGENIC_PIN_GROUP("mac-rmii", jz4770_mac_rmii, 0), 768 749 INGENIC_PIN_GROUP("mac-mii", jz4770_mac_mii, 0), 769 - INGENIC_PIN_GROUP("otg-vbus", jz4770_otg, 0), 750 + INGENIC_PIN_GROUP("otg-vbus", jz4760_otg, 0), 770 751 }; 771 752 772 753 static const char *jz4770_uart0_groups[] = { "uart0-data", "uart0-hwflow", }; ··· 827 808 static const char *jz4770_pwm6_groups[] = { "pwm6", }; 828 809 static const char *jz4770_pwm7_groups[] = { "pwm7", }; 829 810 static const char *jz4770_mac_groups[] = { "mac-rmii", "mac-mii", }; 830 - static const char *jz4770_otg_groups[] = { "otg-vbus", }; 831 811 832 812 static const struct function_desc jz4770_functions[] = { 833 813 { "uart0", jz4770_uart0_groups, ARRAY_SIZE(jz4770_uart0_groups), }, ··· 859 841 { "pwm6", jz4770_pwm6_groups, ARRAY_SIZE(jz4770_pwm6_groups), }, 860 842 { "pwm7", jz4770_pwm7_groups, ARRAY_SIZE(jz4770_pwm7_groups), }, 861 843 { "mac", jz4770_mac_groups, ARRAY_SIZE(jz4770_mac_groups), }, 862 - { "otg", jz4770_otg_groups, ARRAY_SIZE(jz4770_otg_groups), }, 844 + { "otg", jz4760_otg_groups, ARRAY_SIZE(jz4760_otg_groups), }, 863 845 }; 864 846 865 847 static const struct ingenic_chip_info jz4770_chip_info = {