/* Configure the GPIO line as an output, with default state.  */
static int ks8695_gpio_direction_output(struct gpio_chip *gc, unsigned int pin, int state)
/* Configure the GPIO line as an output, with default state.  */
static int ks8695_gpio_direction_output(struct gpio_chip *gc, unsigned int pin, int state)
{
	unsigned long x, flags;
	if (pin > KS8695_GPIO_15)
		return -EINVAL;
	ks8695_gpio_mode(pin, 1);
	local_irq_save(flags);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPD);
	if (state)
		x |= IOPD(pin);
	else
		x &= ~IOPD(pin);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPD);
	x = __raw_readl(KS8695_GPIO_VA + KS8695_IOPM);
	x |= IOPM(pin);
	__raw_writel(x, KS8695_GPIO_VA + KS8695_IOPM);
	local_irq_restore(flags);
	return 0;
}