
Add support for pull direction to the exynos GPIO driver.
Signed-off-by: Simon Glass sjg@chromium.org ---
drivers/gpio/s5p_gpio.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index 49b1054..b516968 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -261,6 +261,20 @@ void gpio_set_rate(int gpio, int mode) s5p_gpio_get_pin(gpio), mode); }
+int exynos_set_pull(struct udevice *dev, unsigned offset, enum gpio_pull pull) +{ + struct exynos_bank_info *state = dev_get_priv(dev); + int val = S5P_GPIO_PULL_NONE; + + if (pull == GPIO_PULL_DOWN) + val = S5P_GPIO_PULL_DOWN; + else if (pull == GPIO_PULL_UP) + val = S5P_GPIO_PULL_UP; + s5p_gpio_set_pull(state->bank, offset, val); + + return 0; +} + #ifndef CONFIG_SPL_BUILD static int exynos_gpio_get_function(struct udevice *dev, unsigned offset) { @@ -290,6 +304,7 @@ static const struct dm_gpio_ops gpio_exynos_ops = { .direction_output = exynos_gpio_direction_output, .get_value = exynos_gpio_get_value, .set_value = exynos_gpio_set_value, + .set_pull = exynos_set_pull, .get_function = exynos_gpio_get_function, .xlate = exynos_gpio_xlate, };