aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpio/mvebu_gpio.c
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-07-25 13:56:12 +0200
committerStefan Roese <sr@denx.de>2022-07-28 15:17:45 +0200
commit7d8bb89d569b18899011c44f8129a6b95a1424a6 (patch)
tree9e5f78c66bff521cb80f74ef2aa27602a9fed40b /drivers/gpio/mvebu_gpio.c
parenta1de1035b228f634241c80c60fcb39daae6116f9 (diff)
downloadu-boot-7d8bb89d569b18899011c44f8129a6b95a1424a6.zip
u-boot-7d8bb89d569b18899011c44f8129a6b95a1424a6.tar.gz
u-boot-7d8bb89d569b18899011c44f8129a6b95a1424a6.tar.bz2
gpio: mvebu_gpio: Add .request and .rfree methods for Armada 38x
To use particular pin GPIO, it needs to be first switched to GPIO by pinctrl. Use pinctrl_gpio_request() and pinctrl_gpio_free() for this purpose. Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers/gpio/mvebu_gpio.c')
-rw-r--r--drivers/gpio/mvebu_gpio.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpio/mvebu_gpio.c b/drivers/gpio/mvebu_gpio.c
index 4c1c68e..888ccfe 100644
--- a/drivers/gpio/mvebu_gpio.c
+++ b/drivers/gpio/mvebu_gpio.c
@@ -5,6 +5,7 @@
#include <common.h>
#include <dm.h>
+#include <dm/pinctrl.h>
#include <asm/gpio.h>
#include <asm/io.h>
#include <errno.h>
@@ -99,6 +100,10 @@ static int mvebu_gpio_probe(struct udevice *dev)
}
static const struct dm_gpio_ops mvebu_gpio_ops = {
+#if CONFIG_IS_ENABLED(PINCTRL_ARMADA_38X)
+ .request = pinctrl_gpio_request,
+ .rfree = pinctrl_gpio_free,
+#endif
.direction_input = mvebu_gpio_direction_input,
.direction_output = mvebu_gpio_direction_output,
.get_function = mvebu_gpio_get_function,