From: "Varadarajan, Charulatha" <charu@ti.com>
To: Tarun Kanti DebBarma <tarun.kanti@ti.com>
Cc: linux-omap@vger.kernel.org,
Santosh Shilimkar <santosh.shilimkar@ti.com>,
Kevin Hilman <khilman@ti.com>, Tony Lindgren <tony@atomide.com>
Subject: Re: [RFC PATCH 09/10] OMAP: GPIO: cleanup omap_gpio_free and triggering functions
Date: Wed, 18 May 2011 16:33:23 +0530 [thread overview]
Message-ID: <BANLkTinMqfxzQN-6M_iCJZViBxuUOm4TBg@mail.gmail.com> (raw)
In-Reply-To: <1305546104-1511-10-git-send-email-tarun.kanti@ti.com>
Tarun,
On Mon, May 16, 2011 at 17:11, Tarun Kanti DebBarma <tarun.kanti@ti.com> wrote:
> 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);
> }
> #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;
Consider using bank->wake_clear instead of extracting reg here.
> +
> + __raw_writel(1 << offset, reg);
This is wrong on OMAP15xx & OMAP7xx as wkupclear is NULL.
-V Charulatha
> bank->mod_usage &= ~(1 << offset);
>
> if ((bank->regs->ctrl != USHRT_MAX) && (!bank->mod_usage)) {
> --
> 1.6.0.4
>
>
--
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
next prev parent reply other threads:[~2011-05-18 11:04 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 [this message]
2011-05-19 16:06 ` Kevin Hilman
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=BANLkTinMqfxzQN-6M_iCJZViBxuUOm4TBg@mail.gmail.com \
--to=charu@ti.com \
--cc=khilman@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).