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
Subject: Re: [PATCH v2 11/18] GPIO: OMAP: Clean set_gpio_triggering function
Date: Thu, 16 Jun 2011 10:40:39 -0700	[thread overview]
Message-ID: <87mxhhn088.fsf@ti.com> (raw)
In-Reply-To: <1308111806-29152-2-git-send-email-tarun.kanti@ti.com> (Tarun Kanti DebBarma's message of "Wed, 15 Jun 2011 09:53:19 +0530")

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

> From: Charulatha V <charu@ti.com>
>
> Getting rid of ifdefs within the function by adding register offset intctrl
> and associating OMAPXXXX_GPIO_INT_CONTROL in respective SoC specific files.
>
> Signed-off-by: Charulatha V <charu@ti.com>
> Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@ti.com>

[...]

> diff --git a/arch/arm/mach-omap2/gpio.c b/arch/arm/mach-omap2/gpio.c
> index 0a8f637..3c96855 100644
> --- a/arch/arm/mach-omap2/gpio.c
> +++ b/arch/arm/mach-omap2/gpio.c
> @@ -83,6 +83,10 @@ static int omap2_gpio_dev_init(struct omap_hwmod *oh, void *unused)
>  		return -ENOMEM;
>  	}
>  
> +	pdata->regs->irqctrl = USHRT_MAX;
> +	pdata->regs->edgectrl1 = USHRT_MAX;
> +	pdata->regs->edgectrl2 = USHRT_MAX;

As with all the other undefined values, please use zero.  

The driver check is checking for non-zero values which would be true
with USHRT_MAX.  You don't happen to see this because of the OMAP1 #ifdef.

[...]

>  	if (likely(!(bank->non_wakeup_gpios & gpio_bit))) {
>  		if (cpu_is_omap44xx()) {
> -			MOD_REG_BIT(OMAP4_GPIO_IRQWAKEN0, gpio_bit,
> +			MOD_REG_BIT(bank->regs->wkup_status, gpio_bit,
>  				trigger != 0);
>  		} else {
>  			/*
> @@ -233,10 +222,10 @@ static inline void set_24xx_gpio_triggering(struct gpio_bank *bank, int gpio,
>  			 */
>  			if (trigger & IRQ_TYPE_EDGE_BOTH)
>  				__raw_writel(1 << gpio, bank->base
> -					+ OMAP24XX_GPIO_SETWKUENA);
> +					+ bank->regs->wkup_set);
>  			else
>  				__raw_writel(1 << gpio, bank->base
> -					+ OMAP24XX_GPIO_CLEARWKUENA);
> +					+ bank->regs->wkup_clear);
>  		}

Probably should be done in an additional patch, but the cpu_is_44xx()
above could be removed too.  

The 44xx TRM recommends using the wkup_status only (not using set/clear
registers) and the same could be done for the other SoCs.

Kevin

  reply	other threads:[~2011-06-16 17:40 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15  4:23 [PATCH v2 10/18] GPIO: OMAP: Remove hardcoded offsets in ctxt save/restore Tarun Kanti DebBarma
2011-06-15  4:23 ` [PATCH v2 11/18] GPIO: OMAP: Clean set_gpio_triggering function Tarun Kanti DebBarma
2011-06-16 17:40   ` Kevin Hilman [this message]
2011-06-17  5:16     ` DebBarma, Tarun Kanti
2011-06-15  4:23 ` [PATCH v2 12/18] GPIO: OMAP: Clean omap_gpio_mod_init function Tarun Kanti DebBarma
2011-06-16 17:49   ` Kevin Hilman
2011-06-17  5:11     ` DebBarma, Tarun Kanti
2011-06-27 10:48     ` DebBarma, Tarun Kanti
2011-06-27 23:06       ` Kevin Hilman
2011-06-15  4:23 ` [PATCH v2 13/18] GPIO: OMAP15xx: Use pinctrl offset instead of macro Tarun Kanti DebBarma
2011-06-15  4:23 ` [PATCH v2 14/18] GPIO: OMAP: Fix use of readl/readw to access isr_reg Tarun Kanti DebBarma
2011-06-16 17:53   ` Kevin Hilman
2011-06-17  5:07     ` DebBarma, Tarun Kanti
2011-06-16 17:57   ` Kevin Hilman
2011-06-17  5:05     ` DebBarma, Tarun Kanti
2011-06-15  4:23 ` [PATCH v2 15/18] GPIO: OMAP: Remove bank->method & METHOD_* macros Tarun Kanti DebBarma
2011-06-15  4:23 ` [PATCH v2 16/18] GPIO: OMAP: Fix bankwidth for OMAP7xx MPUIO Tarun Kanti DebBarma
2011-06-15  4:23 ` [PATCH v2 17/18] GPIO: OMAP: Use PM runtime framework Tarun Kanti DebBarma
2011-06-16 18:03   ` Kevin Hilman
2011-06-17  5:00     ` DebBarma, Tarun Kanti
2011-06-15  4:23 ` [PATCH v2 18/18] GPIO: OMAP2+: Clean prepare_for_idle and resume_after_idle Tarun Kanti DebBarma
2011-06-16 18:10   ` Kevin Hilman
2011-06-17  4:57     ` 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=87mxhhn088.fsf@ti.com \
    --to=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 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.