All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kevin Hilman <khilman@ti.com>
To: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Cc: linux-omap@vger.kernel.org, Charulatha V <charu@ti.com>,
	Santosh Shilimkar <santosh.shilimkar@ti.com>,
	Tony Lindgren <tony@atomide.com>
Subject: Re: [RFC PATCH 09/10] OMAP: GPIO: cleanup omap_gpio_free and triggering functions
Date: Thu, 19 May 2011 18:06:03 +0200	[thread overview]
Message-ID: <877h9m8yl0.fsf@ti.com> (raw)
In-Reply-To: <1305546104-1511-10-git-send-email-tarun.kanti@ti.com> (Tarun Kanti DebBarma's message of "Mon, 16 May 2011 17:11:43 +0530")

Tarun Kanti DebBarma <tarun.kanti@ti.com> writes:

> We can get rid of ifdef / if checks of OMAP revision in set_24xx_gpio_triggering()
> and omap_gpio_free().
>
> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>
> Cc: Charulatha V <charu@ti.com>
> Cc: Santosh Shilimkar <santosh.shilimkar@ti.com>
> Cc: Kevin Hilman <khilman@ti.com>
> Cc: Tony Lindgren <tony@atomide.com>
> ---
>  arch/arm/plat-omap/gpio.c |   38 ++++++++------------------------------
>  1 files changed, 8 insertions(+), 30 deletions(-)
>
> diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c
> index 714626a..bc07559 100644
> --- a/arch/arm/plat-omap/gpio.c
> +++ b/arch/arm/plat-omap/gpio.c
> @@ -269,15 +269,9 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
>  			bank->enabled_non_wakeup_gpios &= ~gpio_bit;
>  	}
>  
> -	if (cpu_is_omap44xx()) {
> -		bank->level_mask =
> -			__raw_readl(bank->base + OMAP4_GPIO_LEVELDETECT0) |
> -			__raw_readl(bank->base + OMAP4_GPIO_LEVELDETECT1);
> -	} else {
> -		bank->level_mask =
> -			__raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT0) |
> -			__raw_readl(bank->base + OMAP24XX_GPIO_LEVELDETECT1);
> -	}
> +	bank->level_mask =
> +		__raw_readl(bank->base + bank->regs->leveldetect0) |
> +		__raw_readl(bank->base + bank->regs->leveldetect1);

Please fold this part into patch 8/10 where the leveldetect* is
initially added.

>  }
>  #endif
>  
> @@ -609,29 +603,13 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
>  {
>  	struct gpio_bank *bank = container_of(chip, struct gpio_bank, chip);
>  	unsigned long flags;
> +	void __iomem *reg;
>  
>  	spin_lock_irqsave(&bank->lock, flags);
> -#ifdef CONFIG_ARCH_OMAP16XX
> -	if (bank->method == METHOD_GPIO_1610) {
> -		/* Disable wake-up during idle for dynamic tick */
> -		void __iomem *reg = bank->base + OMAP1610_GPIO_CLEAR_WAKEUPENA;
> -		__raw_writel(1 << offset, reg);
> -	}
> -#endif
> -#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
> -	if (bank->method == METHOD_GPIO_24XX) {
> -		/* Disable wake-up during idle for dynamic tick */
> -		void __iomem *reg = bank->base + OMAP24XX_GPIO_CLEARWKUENA;
> -		__raw_writel(1 << offset, reg);
> -	}
> -#endif
> -#ifdef CONFIG_ARCH_OMAP4
> -	if (bank->method == METHOD_GPIO_44XX) {
> -		/* Disable wake-up during idle for dynamic tick */
> -		void __iomem *reg = bank->base + OMAP4_GPIO_IRQWAKEN0;
> -		__raw_writel(1 << offset, reg);
> -	}
> -#endif
> +	/* Disable wake-up during idle for dynamic tick */
> +	reg = bank->base + bank->regs->wkupclear;
> +
> +	__raw_writel(1 << offset, reg);


In addition to Charu's comments, please fold this into the patch where
wake_clear etc. are added.

Kevin


>  	bank->mod_usage &= ~(1 << offset);
>  
>  	if ((bank->regs->ctrl != USHRT_MAX) && (!bank->mod_usage)) {

  parent reply	other threads:[~2011-05-19 16:06 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-16 11:41 [RFC PATCH 00/10] OMAP: GPIO: cleanup GPIO driver Tarun Kanti DebBarma
2011-05-16 11:41 ` [RFC PATCH 01/10] OMAP: GPIO: Avoid cpu_is checks during module ena/disable Tarun Kanti DebBarma
2011-05-16 11:41 ` [RFC PATCH 02/10] ZOOM: QUART: Request reset GPIO Tarun Kanti DebBarma
2011-05-19 16:11   ` Kevin Hilman
2011-05-20  8:23     ` Varadarajan, Charulatha
2011-05-16 11:41 ` [RFC PATCH 03/10] OMAP2PLUS: GPIO: Fix non-wakeup GPIO and rev_ids Tarun Kanti DebBarma
2011-05-16 11:41 ` [RFC PATCH 04/10] OMAP: GPIO: Remove dependency on gpio_bank_count Tarun Kanti DebBarma
2011-05-19 15:42   ` Kevin Hilman
2011-05-20  8:27     ` Varadarajan, Charulatha
2011-05-19 16:39   ` Kevin Hilman
2011-05-20  8:30     ` Varadarajan, Charulatha
2011-05-16 11:41 ` [RFC PATCH 05/10] OMAP2PLUS: GPIO: Use flag to identify wkup dmn GPIO Tarun Kanti DebBarma
2011-05-19 16:34   ` Kevin Hilman
2011-05-16 11:41 ` [RFC PATCH 06/10] OMAP: GPIO: Use USHRT_MAX for rev offset instead of -1 Tarun Kanti DebBarma
2011-05-19 15:59   ` Kevin Hilman
2011-05-20  8:31     ` Varadarajan, Charulatha
2011-05-20  9:30       ` Kevin Hilman
2011-05-16 11:41 ` [RFC PATCH 07/10] OMAP: GPIO: cleanup suspend and resume functions Tarun Kanti DebBarma
2011-05-19 16:08   ` Kevin Hilman
2011-05-20  9:20   ` Varadarajan, Charulatha
2011-05-16 11:41 ` [RFC PATCH 08/10] OMAP: GPIO: cleanup prepare-for and resume-after idle functions Tarun Kanti DebBarma
2011-05-19 16:10   ` Kevin Hilman
2011-05-16 11:41 ` [RFC PATCH 09/10] OMAP: GPIO: cleanup omap_gpio_free and triggering functions Tarun Kanti DebBarma
2011-05-18 11:03   ` Varadarajan, Charulatha
2011-05-19 16:06   ` Kevin Hilman [this message]
2011-05-16 11:41 ` [RFC PATCH 10/10] OMAP: GPIO: remove harcoded offsets in context save and restore Tarun Kanti DebBarma

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=877h9m8yl0.fsf@ti.com \
    --to=khilman@ti.com \
    --cc=charu@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=santosh.shilimkar@ti.com \
    --cc=tarun.kanti@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.