RE: [PATCH v2 11/18] GPIO: OMAP: Clean set_gpio_triggering function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> -----Original Message-----
> From: Hilman, Kevin
> Sent: Thursday, June 16, 2011 11:11 PM
> To: DebBarma, Tarun Kanti
> Cc: linux-omap@xxxxxxxxxxxxxxx; Shilimkar, Santosh; tony@xxxxxxxxxxx
> Subject: Re: [PATCH v2 11/18] GPIO: OMAP: Clean set_gpio_triggering
> function
> 
> Tarun Kanti DebBarma <tarun.kanti@xxxxxx> writes:
> 
> > From: Charulatha V <charu@xxxxxx>
> >
> > 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@xxxxxx>
> > Signed-off-by: Tarun Kanti DebBarma <tarun.kanti@xxxxxx>
> 
> [...]
> 
> > 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.
Yes.

> 
> 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.
Ok, I will change.

> 
> [...]
> 
> >  	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.
Ok, I will change for other SoC's as well.
--
Tarun

> 
> Kevin
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux