@@ -129,6 +129,7 @@ static void s5p_gpio_set_pull(struct s5p_gpio_bank *bank, int gpio, int mode)
value &= ~PULL_MASK(gpio);
switch (mode) {
+ case S5P_GPIO_PULL_NONE:
case S5P_GPIO_PULL_DOWN:
case S5P_GPIO_PULL_UP:
value |= PULL_MODE(gpio, mode);
@@ -231,6 +232,32 @@ static int exynos_gpio_set_value(struct udevice *dev, unsigned offset,
return 0;
}
+
+static int exynos_gpio_set_pull(struct udevice *dev, unsigned offset,
+ int pull)
+{
+ struct exynos_bank_info *state = dev_get_priv(dev);
+ int gpio_pull;
+
+ switch (pull) {
+ case GPIOP_NONE:
+ gpio_pull = S5P_GPIO_PULL_NONE;
+ break;
+ case GPIOP_DOWN:
+ gpio_pull = S5P_GPIO_PULL_DOWN;
+ break;
+ case GPIOP_UP:
+ gpio_pull = S5P_GPIO_PULL_UP;
+ break;
+ default:
+ return -EINVAL;
+ break;
+ }
+
+ s5p_gpio_set_pull(state->bank, offset, gpio_pull);
+
+ return 0;
+}
#endif /* nCONFIG_SPL_BUILD */
/*
@@ -290,6 +317,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_gpio_set_pull,
.get_function = exynos_gpio_get_function,
.xlate = exynos_gpio_xlate,
};