public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Ujfalusi <peter.ujfalusi@ti.com>
To: Tomi Valkeinen <tomi.valkeinen@ti.com>,
	Tony Lindgren <tony@atomide.com>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/3] pinctrl: single: fix pcs_disable with bits_per_mux
Date: Thu, 28 Nov 2013 14:00:33 +0200	[thread overview]
Message-ID: <52973061.2070100@ti.com> (raw)
In-Reply-To: <1385638160-30125-2-git-send-email-tomi.valkeinen@ti.com>

On 11/28/2013 01:29 PM, Tomi Valkeinen wrote:
> 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.

I wonder how did I missed this?

Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com>

> 
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
>  drivers/pinctrl/pinctrl-single.c | 10 ++++++++--
>  1 file 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);
> 


-- 
Péter

  reply	other threads:[~2013-11-28 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-28 11:29 [PATCH 1/3] pinctrl: single: fix DT bindings documentation Tomi Valkeinen
2013-11-28 11:29 ` [PATCH 2/3] pinctrl: single: fix pcs_disable with bits_per_mux Tomi Valkeinen
2013-11-28 12:00   ` Peter Ujfalusi [this message]
2013-11-30 17:07     ` Tony Lindgren
2013-11-30 17:24       ` Tony Lindgren
2013-11-28 11:29 ` [PATCH 3/3] pinctrl: single: fix infinite loop caused by bad mask Tomi Valkeinen
2013-11-30 17:21   ` Tony Lindgren
2013-11-30 17:05 ` [PATCH 1/3] pinctrl: single: fix DT bindings documentation Tony Lindgren
  -- strict thread matches above, loose matches on Subject: below --
2014-01-09 12:50 Tomi Valkeinen
2014-01-09 12:50 ` [PATCH 2/3] pinctrl: single: fix pcs_disable with bits_per_mux Tomi Valkeinen
2014-01-15  7:31   ` Linus Walleij

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52973061.2070100@ti.com \
    --to=peter.ujfalusi@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tomi.valkeinen@ti.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox