/* Set up direction of a GPIO: 1-> out; 0-> in  */
void lpc18xx_gpio_dir(int group, int pin, int dir)
/* Set up direction of a GPIO: 1-> out; 0-> in  */
void lpc18xx_gpio_dir(int group, int pin, int dir)
{
	unsigned int v = LPC18XX_GPIO->dir[group];
	if (dir) {
		writel(v | (1 << pin), &LPC18XX_GPIO->dir[group]);
		LPC18XX_GPIO->dir[group] = v | (1 << pin);
	} else {
		writel(v & ~(1 << pin), &LPC18XX_GPIO->dir[group]);
	}
}