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

pinctrl: rockchip: Add rv1108 recalculated iomux support

The pins from GPIO1A0 to GPIO1B1 are special, need to recalculate
iomux. And the register offset is larger than the u8 range, so changed
to u32.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

David Wu and committed by
Linus Walleij
12b8f018 85461377

+67 -1
+67 -1
drivers/pinctrl/pinctrl-rockchip.c
··· 301 301 struct rockchip_mux_recalced_data { 302 302 u8 num; 303 303 u8 pin; 304 - u8 reg; 304 + u32 reg; 305 305 u8 bit; 306 306 u8 mask; 307 307 }; ··· 557 557 /* 558 558 * Hardware access 559 559 */ 560 + 561 + static struct rockchip_mux_recalced_data rv1108_mux_recalced_data[] = { 562 + { 563 + .num = 1, 564 + .pin = 0, 565 + .reg = 0x418, 566 + .bit = 0, 567 + .mask = 0x3 568 + }, { 569 + .num = 1, 570 + .pin = 1, 571 + .reg = 0x418, 572 + .bit = 2, 573 + .mask = 0x3 574 + }, { 575 + .num = 1, 576 + .pin = 2, 577 + .reg = 0x418, 578 + .bit = 4, 579 + .mask = 0x3 580 + }, { 581 + .num = 1, 582 + .pin = 3, 583 + .reg = 0x418, 584 + .bit = 6, 585 + .mask = 0x3 586 + }, { 587 + .num = 1, 588 + .pin = 4, 589 + .reg = 0x418, 590 + .bit = 8, 591 + .mask = 0x3 592 + }, { 593 + .num = 1, 594 + .pin = 5, 595 + .reg = 0x418, 596 + .bit = 10, 597 + .mask = 0x3 598 + }, { 599 + .num = 1, 600 + .pin = 6, 601 + .reg = 0x418, 602 + .bit = 12, 603 + .mask = 0x3 604 + }, { 605 + .num = 1, 606 + .pin = 7, 607 + .reg = 0x418, 608 + .bit = 14, 609 + .mask = 0x3 610 + }, { 611 + .num = 1, 612 + .pin = 8, 613 + .reg = 0x41c, 614 + .bit = 0, 615 + .mask = 0x3 616 + }, { 617 + .num = 1, 618 + .pin = 9, 619 + .reg = 0x41c, 620 + .bit = 2, 621 + .mask = 0x3 622 + }, 623 + }; 560 624 561 625 static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = { 562 626 { ··· 3226 3162 .type = RV1108, 3227 3163 .grf_mux_offset = 0x10, 3228 3164 .pmu_mux_offset = 0x0, 3165 + .iomux_recalced = rv1108_mux_recalced_data, 3166 + .niomux_recalced = ARRAY_SIZE(rv1108_mux_recalced_data), 3229 3167 .pull_calc_reg = rv1108_calc_pull_reg_and_bit, 3230 3168 .drv_calc_reg = rv1108_calc_drv_reg_and_bit, 3231 3169 .schmitt_calc_reg = rv1108_calc_schmitt_reg_and_bit,