IBM OCP GPIO driver for linux 2.6

Milton Miller miltonm at bga.com
Fri Aug 4 04:25:26 EST 2006


On Thu Aug  3 2006 08:53:00 AM CDT, Dale Farnsworth wrote:
> The recommended way of accessing GPIO registers is to mmap them
> and manipulate them directly in user space.

> 		/* turn media led on */
> 		*reg_addr(p, OUTPUT_REG) &= ~MEDIA_LED_BIT;
> 		sleep(1);
> 		/* turn media led off */
> 		*reg_addr(p, OUTPUT_REG) |= MEDIA_LED_BIT;

Very racy if you need different bits in the same word controlled by different programs.

milton



More information about the Linuxppc-embedded mailing list