Skip to content

Commit a813032

Browse files
Wolfram Sanggeertu
authored andcommitted
pinctrl: renesas: rza1: Mark GPIOs as used
GPIOs showed up as unclaimed, so they could be muxed to something else even though they were in use. Mark GPIOs as claimed to avoid that. Signed-off-by: Wolfram Sang <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Geert Uytterhoeven <[email protected]>
1 parent 8714625 commit a813032

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/pinctrl/renesas/pinctrl-rza1.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <linux/ioport.h>
2020
#include <linux/module.h>
2121
#include <linux/of.h>
22+
#include <linux/pinctrl/consumer.h>
2223
#include <linux/pinctrl/pinconf-generic.h>
2324
#include <linux/pinctrl/pinctrl.h>
2425
#include <linux/pinctrl/pinmux.h>
@@ -750,6 +751,11 @@ static int rza1_pin_mux_single(struct rza1_pinctrl *rza1_pctl,
750751
static int rza1_gpio_request(struct gpio_chip *chip, unsigned int gpio)
751752
{
752753
struct rza1_port *port = gpiochip_get_data(chip);
754+
int ret;
755+
756+
ret = pinctrl_gpio_request(chip, gpio);
757+
if (ret)
758+
return ret;
753759

754760
rza1_pin_reset(port, gpio);
755761

@@ -771,6 +777,7 @@ static void rza1_gpio_free(struct gpio_chip *chip, unsigned int gpio)
771777
struct rza1_port *port = gpiochip_get_data(chip);
772778

773779
rza1_pin_reset(port, gpio);
780+
pinctrl_gpio_free(chip, gpio);
774781
}
775782

776783
static int rza1_gpio_get_direction(struct gpio_chip *chip, unsigned int gpio)

0 commit comments

Comments
 (0)