[PATCH 4.8 108/125] pinctrl: qcom: fix masking of pinmux functions

From: Greg Kroah-Hartman
Date: Sat Oct 29 2016 - 10:00:50 EST


4.8-stable review patch. If anyone has any objections, please let me know.

------------------

From: John Crispin <john@xxxxxxxxxxx>

commit 6bcf3f63394b9c4f133e4499349d786d7f531473 upstream.

The following commit introduced a regression by not properly masking the
calculated value.

Fixes: 47a01ee9a6c3 ("pinctrl: qcom: Clear all function selection bits")
Signed-off-by: John Crispin <john@xxxxxxxxxxx>
Reviewed-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
Reviewed-by: Stephen Boyd <stephen.boyd@xxxxxxxxxx>
Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

---
drivers/pinctrl/qcom/pinctrl-msm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/pinctrl/qcom/pinctrl-msm.c
+++ b/drivers/pinctrl/qcom/pinctrl-msm.c
@@ -156,7 +156,7 @@ static int msm_pinmux_set_mux(struct pin
spin_lock_irqsave(&pctrl->lock, flags);

val = readl(pctrl->regs + g->ctl_reg);
- val &= mask;
+ val &= ~mask;
val |= i << g->mux_bit;
writel(val, pctrl->regs + g->ctl_reg);