2020-06-15 13:02:42

by Alexandre Torgue

[permalink] [raw]
Subject: [PATCH 0/2] pinctrl: stm32: Add possibility to configure only one pin

Hi,

Currently stm32 pinctrl driver offers only the possibility to configure pins
groups thanks "pin_config_group_set" callback. To configure pins thanks to the
GPIOlib (i.e. GPIO_PULL_UP ...) this driver needs also to support
"pin_config_set" callback.

Regards
Alex

Alexandre Torgue (2):
pinctrl: stm32: return proper error code in pin_config_set
pinctrl: stm32: add possibility to configure pins individually

drivers/pinctrl/stm32/pinctrl-stm32.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)

--
2.17.1


2020-06-15 13:04:35

by Alexandre Torgue

[permalink] [raw]
Subject: [PATCH 1/2] pinctrl: stm32: return proper error code in pin_config_set

".pin_config_set" or ".pin_config_group_set" can be called with a
configuration not supported (i.e. PIN_CONFIG_PERSIST_STATE). In this case,
it is more suitable to return -ENOTSUPP instead of -EINVAL.

Signed-off-by: Alexandre Torgue <[email protected]>

diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
index a657cd829ce6..5d9839beaa07 100644
--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
+++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
@@ -1084,7 +1084,7 @@ static int stm32_pconf_parse_conf(struct pinctrl_dev *pctldev,
ret = stm32_pmx_gpio_set_direction(pctldev, range, pin, false);
break;
default:
- ret = -EINVAL;
+ ret = -ENOTSUPP;
}

return ret;
--
2.17.1

2020-06-20 21:14:00

by Linus Walleij

[permalink] [raw]
Subject: Re: [PATCH 0/2] pinctrl: stm32: Add possibility to configure only one pin

On Mon, Jun 15, 2020 at 2:59 PM Alexandre Torgue
<[email protected]> wrote:

> Currently stm32 pinctrl driver offers only the possibility to configure pins
> groups thanks "pin_config_group_set" callback. To configure pins thanks to the
> GPIOlib (i.e. GPIO_PULL_UP ...) this driver needs also to support
> "pin_config_set" callback.

Nice feature growth!
Patches applied.

Yours,
Linus Walleij