summaryrefslogtreecommitdiff
path: root/drivers/pinctrl/pinctrl-single.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-01-09 16:50:28 +0400
committerLinus Walleij <linus.walleij@linaro.org>2014-01-15 11:30:08 +0400
commitdd4c2b3cb39da587fc1e5a9315d4d894a83ec481 (patch)
treeb9871c2d0118b249f3b47236edc6ab3f91d30142 /drivers/pinctrl/pinctrl-single.c
parent2bce695435bb81efa61c8c86715d26d1e2e7c211 (diff)
downloadlinux-dd4c2b3cb39da587fc1e5a9315d4d894a83ec481.tar.xz
pinctrl: single: fix pcs_disable with bits_per_mux
pcs_enable() uses vals->mask instead of pcs->fmask when bits_per_mux is enabled. However, pcs_disable() always uses pcs->fmask. Fix pcs_disable() to use vals->mask with bits_per_mux. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/pinctrl/pinctrl-single.c')
-rw-r--r--drivers/pinctrl/pinctrl-single.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
index 829b98c5c66f..174f4c50cd77 100644
--- a/drivers/pinctrl/pinctrl-single.c
+++ b/drivers/pinctrl/pinctrl-single.c
@@ -525,12 +525,18 @@ static void pcs_disable(struct pinctrl_dev *pctldev, unsigned fselector,
for (i = 0; i < func->nvals; i++) {
struct pcs_func_vals *vals;
unsigned long flags;
- unsigned val;
+ unsigned val, mask;
vals = &func->vals[i];
raw_spin_lock_irqsave(&pcs->lock, flags);
val = pcs->read(vals->reg);
- val &= ~pcs->fmask;
+
+ if (pcs->bits_per_mux)
+ mask = vals->mask;
+ else
+ mask = pcs->fmask;
+
+ val &= ~mask;
val |= pcs->foff << pcs->fshift;
pcs->write(val, vals->reg);
raw_spin_unlock_irqrestore(&pcs->lock, flags);