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, santosh.shilimkar@ti.com,
	tony@atomide.com, Charulatha V <charu@ti.com>
Subject: Re: [PATCH v3 08/20] GPIO: OMAP: Use wkup regs off/suspend support flag
Date: Wed, 06 Jul 2011 12:51:17 -0700	[thread overview]
Message-ID: <871uy3i3wq.fsf@ti.com> (raw)
In-Reply-To: <1309513634-20971-9-git-send-email-tarun.kanti@ti.com> (Tarun Kanti DebBarma's message of "Fri, 1 Jul 2011 15:17:02 +0530")

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

> From: Charulatha V <charu@ti.com>
>
> Wakeup register offsets are initialized according to OMAP versions
> during device registration. These explicit checks are no longer needed.
>
> mpuio_init() function is defined under #ifdefs. It is required only in case
> of MPUIO bank type and only when PM operations are supported by it.
> This is applicable only in case of OMAP16xx SoC's MPUIO GPIO bank type.
> For all the other cases it is a dummy function. Hence clean up the same
> and remove all the OMAP SoC specific #ifdefs.
>
> bank_is_mpuio() is defined as a check to identify if the bank type is MPUIO.
> It is not required to define it separately as zero for OMAP2plus. Remove this.

The MPUIO stuff should really be separated from the wkup register stuff.

[...]

> @@ -596,27 +594,11 @@ static void omap_gpio_free(struct gpio_chip *chip, unsigned offset)
>  	unsigned long flags;
>  
>  	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) {
> +
> +	if (bank->regs->wkup_clear)
>  		/* Disable wake-up during idle for dynamic tick */
> -		void __iomem *reg = bank->base + OMAP4_GPIO_IRQWAKEN0;
> -		__raw_writel(1 << offset, reg);
> -	}
> -#endif
> +		__raw_writel(1 << offset, bank->base + bank->regs->wkup_clear);
> +

Note that this is not an equivalent change.  The current code is using
IRQWAKEN0 register and you're changing it to use the CLEARWKUPENA
register.

While the current code is clearly broken since it's not doing a
read/modify/write, this change is not very clear either, and not
documented in the changelog.

I think a better approach is to just drop the parts of this patch where
the wkup_set and wkup_clear registers are added.  Since they are removed
in patch 12/20 anyways, maybe moving 12/20 earlier in the series
would make this clearer and avoid unnessary additions followed by
removals.

Kevin

  reply	other threads:[~2011-07-06 19:51 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-01  9:46 [PATCH v3 00/20] GPIO: OMAP: driver cleanup and fixes Tarun Kanti DebBarma
2011-07-01  9:46 ` [PATCH v3 01/20] GPIO: OMAP: Remove dependency on gpio_bank_count Tarun Kanti DebBarma
2011-07-01  9:46 ` [PATCH v3 02/20] GPIO: OMAP2+: Use flag to identify wakeup domain Tarun Kanti DebBarma
2011-07-01  9:46 ` [PATCH v3 03/20] GPIO: OMAP: Make gpio_context part of gpio_bank structure Tarun Kanti DebBarma
2011-07-01  9:46 ` [PATCH v3 04/20] GPIO: OMAP: Fix pwrdm_post_transition call sequence Tarun Kanti DebBarma
2011-07-01  9:46 ` [PATCH v3 05/20] GPIO: OMAP: Handle save/restore ctx in GPIO driver Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 06/20] GPIO: OMAP2+: Make non-wakeup GPIO part of pdata Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 07/20] GPIO: OMAP: Avoid cpu checks during module ena/disable Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 08/20] GPIO: OMAP: Use wkup regs off/suspend support flag Tarun Kanti DebBarma
2011-07-06 19:51   ` Kevin Hilman [this message]
2011-07-07  5:06     ` DebBarma, Tarun Kanti
2011-07-01  9:47 ` [PATCH v3 09/20] GPIO: OMAP: Use level/edge detect reg offsets Tarun Kanti DebBarma
2011-07-05 23:51   ` Kevin Hilman
2011-07-06  4:15     ` DebBarma, Tarun Kanti
2011-07-06 19:57   ` Kevin Hilman
2011-07-07  4:47     ` DebBarma, Tarun Kanti
2011-07-01  9:47 ` [PATCH v3 10/20] GPIO: OMAP: Remove hardcoded offsets in ctxt save/restore Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 11/20] GPIO: OMAP: Clean set_gpio_triggering function Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 12/20] GPIO: OMAP: Use wkup_status for all SoCs Tarun Kanti DebBarma
2011-07-06  0:50   ` Kevin Hilman
2011-07-06  4:30     ` DebBarma, Tarun Kanti
2011-07-06  4:33     ` DebBarma, Tarun Kanti
2011-07-12  0:04     ` DebBarma, Tarun Kanti
2011-07-12 15:30       ` Kevin Hilman
2011-07-13  3:55         ` DebBarma, Tarun Kanti
2011-07-01  9:47 ` [PATCH v3 13/20] GPIO: OMAP: Clean omap_gpio_mod_init function Tarun Kanti DebBarma
2011-07-06 20:38   ` Kevin Hilman
2011-07-07  4:40     ` DebBarma, Tarun Kanti
2011-07-01  9:47 ` [PATCH v3 14/20] GPIO: OMAP15xx: Use pinctrl offset instead of macro Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 15/20] GPIO: OMAP: Use readl in irq_handler for all access Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 16/20] GPIO: OMAP: Remove bank->method & METHOD_* macros Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 17/20] GPIO: OMAP: Fix bankwidth for OMAP7xx MPUIO Tarun Kanti DebBarma
2011-07-01  9:47 ` [PATCH v3 18/20] GPIO: OMAP: Use PM runtime framework Tarun Kanti DebBarma
2011-07-20  6:28   ` Roger Quadros
2011-07-20  9:28     ` DebBarma, Tarun Kanti
2011-07-20  9:33       ` Roger Quadros
2011-07-20  9:46         ` DebBarma, Tarun Kanti
2011-07-01  9:47 ` [PATCH v3 19/20] GPIO: OMAP: optimize suspend and resume functions Tarun Kanti DebBarma
2011-07-06 20:54   ` Kevin Hilman
2011-07-07  4:42     ` DebBarma, Tarun Kanti
2011-07-01  9:47 ` [PATCH v3 20/20] GPIO: OMAP2+: Clean prepare_for_idle and resume_after_idle Tarun Kanti DebBarma
2011-07-05 23:46 ` [PATCH v3 00/20] GPIO: OMAP: driver cleanup and fixes Kevin Hilman
2011-07-06  4:37   ` DebBarma, Tarun Kanti
2011-07-06 21:07 ` Kevin Hilman
2011-07-07  4:16   ` DebBarma, Tarun Kanti
2011-07-12 15:22     ` Hilman, Kevin
2011-07-13  3:48       ` DebBarma, Tarun Kanti

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=871uy3i3wq.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.