Re: Locking in the (now generic) GPIO infrastructure?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Leon Woestenberg <leon.woestenberg@...>
Cc: LAK <linux-arm-kernel@...>, Linux Kernel list <linux-kernel@...>
Date: Friday, June 6, 2008 - 6:28 am

On Wed, Jun 04, 2008 at 01:00:19PM +0200, Leon Woestenberg wrote:

Yes, that looks rather buggy to me, and also sub-optimal to boot. The
u8 line should be changed to just 'unsigned' having the compiler truncate
to 8bit isn't useful when then used with a shift.

static inline void gpio_line_set(unsigned line, int value)
{
	unsigned long flags;
	unsigned regval;

	local_irq_save(flags);

	regval = *IXP4XX_GPIO_GPOUTR;

	if (value == IXP4XX_GPIO_HIGH)
		regval |= (1 << line);
	else if (value == IXP4XX_GPIO_LOW)
	   	regval &= ~(1 << line);

	*IXP4XX_GPIO_GPOUTR = regval;
	local_irq_restore(flags);
}
 

I think it depends on whether gpiolib is being used or not, there may
be some locking in there.

-- 
Ben

Q:      What's a light-year?
A:      One-third less calories than a regular year.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Locking in the (now generic) GPIO infrastructure?, Leon Woestenberg, (Wed Jun 4, 7:00 am)
Re: Locking in the (now generic) GPIO infrastructure?, David Brownell, (Fri Jun 6, 8:53 am)
Re: Locking in the (now generic) GPIO infrastructure?, Mikael Pettersson, (Sat Jun 7, 7:52 am)
Re: Locking in the (now generic) GPIO infrastructure?, Leon Woestenberg, (Fri Jun 6, 3:23 pm)
Re: Locking in the (now generic) GPIO infrastructure?, David Brownell, (Fri Jun 6, 4:13 pm)
Re: Locking in the (now generic) GPIO infrastructure?, Ben Dooks, (Fri Jun 6, 6:28 am)
Re: Locking in the (now generic) GPIO infrastructure?, Russell King - ARM Linux, (Fri Jun 6, 4:52 am)