/* This function sets the direction of specified GPIO signal as input. It returns 0 if direction of GPIO signals is set as input otherwise it returns negative error value.  */
static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
/* This function sets the direction of specified GPIO signal as input. It returns 0 if direction of GPIO signals is set as input otherwise it returns negative error value.  */
static int xgpio_dir_in(struct gpio_chip *gc, unsigned int gpio)
{
	unsigned long flags;
	struct of_mm_gpio_chip *mm_gc = to_of_mm_gpio_chip(gc);
	struct xgpio_instance *chip =
	    container_of(mm_gc, struct xgpio_instance, mmchip);
	spin_lock_irqsave(&chip->gpio_lock, flags);
	chip->gpio_dir |= (1 << gpio);
	out_be32(mm_gc->regs + XGPIO_TRI_OFFSET, chip->gpio_dir);
	spin_unlock_irqrestore(&chip->gpio_lock, flags);
	return 0;
}