pinctrl: rockchip: Fix the cleaning of drv/pull type mask

Where need to clean the special mask for rockchip_perpin_drv_list
and rockchip_pull_list.

Change-Id: I98bac7768aa0570c12c947913ef2ea91ae303f95
Signed-off-by: David.Wu <david.wu@rock-chips.com>
This commit is contained in:
David.Wu 2018-12-12 21:00:02 +08:00
parent c9eb255473
commit 2c16899d60
1 changed files with 7 additions and 2 deletions

View File

@ -2157,7 +2157,8 @@ static int rockchip_set_drive_perpin(struct rockchip_pin_bank *bank,
int reg, ret, i;
u32 data, rmask_bits, temp;
u8 bit;
int drv_type = bank->drv[pin_num / 8].drv_type & DRV_TYPE_IO_MASK;
/* Where need to clean the special mask for rockchip_perpin_drv_list */
int drv_type = bank->drv[pin_num / 8].drv_type & (~DRV_TYPE_IO_MASK);
debug("setting drive of GPIO%d-%d to %d\n", bank->bank_num,
pin_num, strength);
@ -2292,7 +2293,11 @@ static int rockchip_set_pull(struct rockchip_pin_bank *bank,
case RK3308:
case RK3368:
case RK3399:
pull_type = bank->pull_type[pin_num / 8] & PULL_TYPE_IO_MASK;
/*
* Where need to clean the special mask for
* rockchip_pull_list.
*/
pull_type = bank->pull_type[pin_num / 8] & (~PULL_TYPE_IO_MASK);
ret = -EINVAL;
for (i = 0; i < ARRAY_SIZE(rockchip_pull_list[pull_type]);
i++) {