Skip to content

Commit 12b8f01

Browse files
SuperDavidWulinusw
authored andcommitted
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 <[email protected]> Reviewed-by: Heiko Stuebner <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 8546137 commit 12b8f01

File tree

1 file changed

+67
-1
lines changed

1 file changed

+67
-1
lines changed

drivers/pinctrl/pinctrl-rockchip.c

Lines changed: 67 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ struct rockchip_pin_bank {
301301
struct rockchip_mux_recalced_data {
302302
u8 num;
303303
u8 pin;
304-
u8 reg;
304+
u32 reg;
305305
u8 bit;
306306
u8 mask;
307307
};
@@ -558,6 +558,70 @@ static const struct pinctrl_ops rockchip_pctrl_ops = {
558558
* Hardware access
559559
*/
560560

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+
};
624+
561625
static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {
562626
{
563627
.num = 2,
@@ -3162,6 +3226,8 @@ static struct rockchip_pin_ctrl rv1108_pin_ctrl = {
31623226
.type = RV1108,
31633227
.grf_mux_offset = 0x10,
31643228
.pmu_mux_offset = 0x0,
3229+
.iomux_recalced = rv1108_mux_recalced_data,
3230+
.niomux_recalced = ARRAY_SIZE(rv1108_mux_recalced_data),
31653231
.pull_calc_reg = rv1108_calc_pull_reg_and_bit,
31663232
.drv_calc_reg = rv1108_calc_drv_reg_and_bit,
31673233
.schmitt_calc_reg = rv1108_calc_schmitt_reg_and_bit,

0 commit comments

Comments
 (0)