/* It will set the gpio pin config to the @mode value passed in.  */
static int msp71xx_set_gpio_mode(struct gpio_chip *chip, unsigned offset, int mode)
/* It will set the gpio pin config to the @mode value passed in.  */
static int msp71xx_set_gpio_mode(struct gpio_chip *chip, unsigned offset, int mode)
{
	struct msp71xx_gpio_chip *msp_chip = to_msp71xx_gpio_chip(chip);
	const unsigned bit_offset = MSP71XX_CFG_OFFSET(offset);
	unsigned long flags;
	u32 cfg;
	spin_lock_irqsave(&gpio_lock, flags);
	cfg = __raw_readl(msp_chip->config_reg);
	cfg &= ~(CONF_MASK << bit_offset);
	cfg |= (mode << bit_offset);
	__raw_writel(cfg, msp_chip->config_reg);
	spin_unlock_irqrestore(&gpio_lock, flags);
	return 0;
}