summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Vasut <[email protected]>2019-04-21 22:46:25 +0200
committerMarek Vasut <[email protected]>2019-05-04 19:26:49 +0200
commit50e6901fec0bd7dbfb2e39e750119ee0c78160c5 (patch)
treef435770541592b8d5f84eeae46c11a4079a94641
parentae59d7ca59dbfc770531f51c717dc6f5d9a18f78 (diff)
pinctrl: renesas: Set pin type in sh_pfc_config_mux_for_gpio
Add missing cfg->type = PINMUX_TYPE_GPIO upon successfully setting pin as a GPIO to retain the pin configuration information. Signed-off-by: Marek Vasut <[email protected]> Cc: Alex Kiernan <[email protected]> Cc: Christoph Muellner <[email protected]> Cc: Eugeniu Rosca <[email protected]> Cc: Patrice Chotard <[email protected]> Cc: Patrick DELAUNAY <[email protected]> Cc: Philipp Tomsich <[email protected]> Cc: Simon Glass <[email protected]>
-rw-r--r--drivers/pinctrl/renesas/pfc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/pinctrl/renesas/pfc.c b/drivers/pinctrl/renesas/pfc.c
index 06359501b7d..59dc4af7027 100644
--- a/drivers/pinctrl/renesas/pfc.c
+++ b/drivers/pinctrl/renesas/pfc.c
@@ -466,7 +466,7 @@ int sh_pfc_config_mux_for_gpio(struct udevice *dev, unsigned pin_selector)
struct sh_pfc *pfc = &priv->pfc;
struct sh_pfc_pin_config *cfg;
const struct sh_pfc_pin *pin = NULL;
- int i, idx;
+ int i, ret, idx;
for (i = 1; i < pfc->info->nr_pins; i++) {
if (priv->pfc.info->pins[i].pin != pin_selector)
@@ -485,7 +485,13 @@ int sh_pfc_config_mux_for_gpio(struct udevice *dev, unsigned pin_selector)
if (cfg->type != PINMUX_TYPE_NONE)
return -EBUSY;
- return sh_pfc_config_mux(pfc, pin->enum_id, PINMUX_TYPE_GPIO);
+ ret = sh_pfc_config_mux(pfc, pin->enum_id, PINMUX_TYPE_GPIO);
+ if (ret)
+ return ret;
+
+ cfg->type = PINMUX_TYPE_GPIO;
+
+ return 0;
}
static int sh_pfc_pinctrl_pin_set(struct udevice *dev, unsigned pin_selector,