From: luowei Date: Thu, 24 Apr 2014 10:28:56 +0000 (+0800) Subject: pinctrl:clear iomux bits before setting X-Git-Tag: firefly_0821_release~5439 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=12c4ae3031eec7617e536e5a1b2f207ae0b00962;p=firefly-linux-kernel-4.4.55.git pinctrl:clear iomux bits before setting --- diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c index cdbcfcd505b2..904d046631ef 100755 --- a/drivers/pinctrl/pinctrl-rockchip.c +++ b/drivers/pinctrl/pinctrl-rockchip.c @@ -621,7 +621,7 @@ static const struct pinctrl_ops rockchip_pctrl_ops = { static int rk32_iomux_bit_op(struct rockchip_pin_bank *bank, int pin, int mux, void __iomem *reg, int bits) { - u32 data,result; + u32 data = 0,result; u8 bit; unsigned long flags; struct rockchip_pinctrl *info = bank->drvdata; @@ -636,6 +636,7 @@ static int rk32_iomux_bit_op(struct rockchip_pin_bank *bank, int pin, int mux, v if(bank->bank_num == 0) { data = readl_relaxed(reg); + data &= ~(3<bank_num == 0) { data = readl_relaxed(reg); + data &= ~(0x0f<bank_num == 0) + DBG_PINCTRL("%s:GPIO%d-%d,reg=0x%x,data=0x%x,result=0x%x\n",__func__, bank->bank_num, pin, reg - bank->reg_mux_bank0, data, result); + else DBG_PINCTRL("%s:GPIO%d-%d,reg=0x%x,data=0x%x,result=0x%x\n",__func__, bank->bank_num, pin, reg - info->reg_base, data, result); return 0;