Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1941b441 authored by Venkat Reddy Talla's avatar Venkat Reddy Talla Committed by Linus Walleij
Browse files

gpio: max77620: get gpio value based on direction



Gpio direction is determined by DIRx bit of GPIO
configuration register, return max77620 gpio value
based on direction in or out.

Signed-off-by: default avatarVenkat Reddy Talla <vreddytalla@nvidia.com>
Reviewed-by: default avatarAlexandre Courbot <acourbot@nvidia.com>
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 7eebe96f
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -123,7 +123,10 @@ static int max77620_gpio_get(struct gpio_chip *gc, unsigned int offset)
		return ret;
		return ret;
	}
	}


	if  (val & MAX77620_CNFG_GPIO_DIR_MASK)
		return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK);
		return !!(val & MAX77620_CNFG_GPIO_INPUT_VAL_MASK);
	else
		return !!(val & MAX77620_CNFG_GPIO_OUTPUT_VAL_MASK);
}
}


static int max77620_gpio_dir_output(struct gpio_chip *gc, unsigned int offset,
static int max77620_gpio_dir_output(struct gpio_chip *gc, unsigned int offset,