public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Tony Lindgren <tony@atomide.com>
To: David Brownell <david-b@pacbell.net>
Cc: linux-omap@vger.kernel.org
Subject: Re: [patch 2.6.28-rc3-git] omap gpio: minor bugfixes
Date: Thu, 13 Nov 2008 14:19:01 -0800	[thread overview]
Message-ID: <20081113221900.GK3106@atomide.com> (raw)
In-Reply-To: <200811071440.18526.david-b@pacbell.net>

* David Brownell <david-b@pacbell.net> [081107 14:40]:
> From: David Brownell <dbrownell@users.sourceforge.net>
> 
> Minor GPIO fixes:
> 
>  - If get_gpio_bank() fails, then BUG() out.
> 
>  - In omap_set_gpio_debounce():
>     * protect the read/modify/write with the relevant spinlock
>     * make the omap3 clock ops pass "sparse" checking
> 
> Except for the spinlock problem, these were reported through "make".

Pushing today and adding to omap-upstream queue.

Tony

> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
> ---
>  arch/arm/plat-omap/gpio.c |   20 +++++++++++++++-----
>  1 file changed, 15 insertions(+), 5 deletions(-)
> 
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -244,6 +244,8 @@ static inline struct gpio_bank *get_gpio
>  		return &gpio_bank[gpio >> 5];
>  	if (cpu_is_omap34xx())
>  		return &gpio_bank[gpio >> 5];
> +	BUG();
> +	return NULL;
>  }
>  
>  static inline int get_gpio_index(int gpio)
> @@ -447,6 +449,7 @@ void omap_set_gpio_debounce(int gpio, in
>  {
>  	struct gpio_bank *bank;
>  	void __iomem *reg;
> +	unsigned long flags;
>  	u32 val, l = 1 << get_gpio_index(gpio);
>  
>  	if (cpu_class_is_omap1())
> @@ -454,21 +457,28 @@ void omap_set_gpio_debounce(int gpio, in
>  
>  	bank = get_gpio_bank(gpio);
>  	reg = bank->base;
> -
>  	reg += OMAP24XX_GPIO_DEBOUNCE_EN;
> +
> +	spin_lock_irqsave(&bank->lock, flags);
>  	val = __raw_readl(reg);
>  
>  	if (enable && !(val & l))
>  		val |= l;
> -	else if (!enable && val & l)
> +	else if (!enable && (val & l))
>  		val &= ~l;
>  	else
> -		return;
> +		goto done;
>  
> -	if (cpu_is_omap34xx())
> -		enable ? clk_enable(bank->dbck) : clk_disable(bank->dbck);
> +	if (cpu_is_omap34xx()) {
> +		if (enable)
> +			clk_enable(bank->dbck);
> +		else
> +			clk_disable(bank->dbck);
> +	}
>  
>  	__raw_writel(val, reg);
> +done:
> +	spin_unlock_irqrestore(&bank->lock, flags);
>  }
>  EXPORT_SYMBOL(omap_set_gpio_debounce);
>  
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2008-11-13 22:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-07 22:40 [patch 2.6.28-rc3-git] omap gpio: minor bugfixes David Brownell
2008-11-13 22:19 ` Tony Lindgren [this message]

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=20081113221900.GK3106@atomide.com \
    --to=tony@atomide.com \
    --cc=david-b@pacbell.net \
    --cc=linux-omap@vger.kernel.org \
    /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