From: "Pali Rohár" <pali@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: Marek Behun <marek.behun@nic.cz>, Simon Glass <sjg@chromium.org>,
u-boot@lists.denx.de
Subject: [PATCH 5/8] gpio: mvebu_gpio: Add .request and .rfree methods for Armada 38x
Date: Mon, 25 Jul 2022 13:56:12 +0200 [thread overview]
Message-ID: <20220725115615.420-6-pali@kernel.org> (raw)
In-Reply-To: <20220725115615.420-1-pali@kernel.org>
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>
---
drivers/gpio/mvebu_gpio.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/gpio/mvebu_gpio.c b/drivers/gpio/mvebu_gpio.c
index 4c1c68ee19ed..888ccfe4d13e 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,
--
2.20.1
next prev parent reply other threads:[~2022-07-25 11:56 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-25 11:56 [PATCH 0/8] arm: mvebu: Add Armada 38x pin muxing support Pali Rohár
2022-07-25 11:56 ` [PATCH 1/8] pinctrl: Add new function pinctrl_generic_set_state_prefix() Pali Rohár
2022-07-28 6:25 ` Stefan Roese
2022-07-25 11:56 ` [PATCH 2/8] mvebu: pinctrl: Add Armada 38x driver Pali Rohár
2022-07-28 6:27 ` Stefan Roese
2022-07-25 11:56 ` [PATCH 3/8] arm: mvebu: Add gpio-ranges into Armada 38x device tree file Pali Rohár
2022-07-28 6:27 ` Stefan Roese
2022-07-25 11:56 ` [PATCH 4/8] pinctrl: Add third argument label for pinctrl_gpio_request() function Pali Rohár
2022-07-28 6:27 ` Stefan Roese
2022-07-28 13:07 ` Stefan Roese
2022-07-28 13:15 ` Pali Rohár
2022-07-28 13:18 ` Stefan Roese
2022-07-28 15:33 ` Pali Rohár
2022-07-25 11:56 ` Pali Rohár [this message]
2022-07-28 6:28 ` [PATCH 5/8] gpio: mvebu_gpio: Add .request and .rfree methods for Armada 38x Stefan Roese
2022-07-25 11:56 ` [PATCH 6/8] gpio: mvebu_gpio: Read number of gpios from DT Pali Rohár
2022-07-28 6:28 ` Stefan Roese
2022-07-25 11:56 ` [PATCH 7/8] gpio: mvebu_gpio: Set bank name to mvebu%d Pali Rohár
2022-07-28 6:29 ` Stefan Roese
2022-07-25 11:56 ` [PATCH 8/8] arm: mvebu: turris_omnia: Enable a38x pinctrl and gpio support Pali Rohár
2022-07-28 6:29 ` Stefan Roese
2022-07-28 21:42 ` Tony Dinh
2022-07-29 7:38 ` Pali Rohár
2022-07-29 8:01 ` Stefan Roese
2022-07-29 1:39 ` [PATCH 0/8] arm: mvebu: Add Armada 38x pin muxing support Tony Dinh
2022-07-29 12:00 ` Stefan Roese
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220725115615.420-6-pali@kernel.org \
--to=pali@kernel.org \
--cc=marek.behun@nic.cz \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox