/* mux the pin to the gpio controller (instead of "A" or "B" peripheral), and configure it for an output.  */
int __init_or_module at91_set_gpio_output(unsigned pin, int value)
/* mux the pin to the gpio controller (instead of "A" or "B" peripheral), and configure it for an output.  */
int __init_or_module at91_set_gpio_output(unsigned pin, int value)
{
	void __iomem	*pio = pin_to_controller(pin);
	unsigned	mask = pin_to_mask(pin);
	if (!pio)
		return -EINVAL;
	__raw_writel(mask, pio + PIO_IDR);
	__raw_writel(mask, pio + PIO_PUDR);
	__raw_writel(mask, pio + (value ? PIO_SODR : PIO_CODR));
	__raw_writel(mask, pio + PIO_OER);
	__raw_writel(mask, pio + PIO_PER);
	return 0;
}