/* mux the pin to the "GPIO" peripheral role.  */
int at91_set_pio_periph(unsigned port, unsigned pin, int use_pullup)
/* mux the pin to the "GPIO" peripheral role.  */
int at91_set_pio_periph(unsigned port, unsigned pin, int use_pullup)
{
	at91_pio_t	*pio 	= (at91_pio_t *) AT91_PIO_BASE;
	u32		mask;
	if ((port < AT91_PIO_PORTS) && (pin < 32)) {
		mask = 1 << pin;
		writel(mask, &pio->port[port].idr);
		at91_set_pio_pullup(port, pin, use_pullup);
		writel(mask, &pio->port[port].per);
	}
	return 0;
}