From: Nicolas Ferre <nicolas.ferre@microchip.com>
To: <Ryan.Wanner@microchip.com>, <linus.walleij@linaro.org>,
<alexandre.belloni@bootlin.com>, <claudiu.beznea@microchip.com>
Cc: <linux-arm-kernel@lists.infradead.org>,
<linux-gpio@vger.kernel.org>, <ludovic.desroches@microchip.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] pinctrl: at91-pio4: Add configuration to userspace
Date: Mon, 10 Oct 2022 11:13:26 +0200 [thread overview]
Message-ID: <8a335e97-c880-d42f-a455-9ea8f3e65267@microchip.com> (raw)
In-Reply-To: <20221007151647.98222-2-Ryan.Wanner@microchip.com>
On 07/10/2022 at 17:16, Ryan.Wanner@microchip.com wrote:
> From: Ryan Wanner <Ryan.Wanner@microchip.com>
>
> Adding support for line bias flags that have been implented in gpio API.
Typo: implemented
> There are functions in the gpiod library that can control line bias from
> userspace this adds that functionality to this driver.
>
> Adding .pin_config_set allows the driver's pin configuration to be
> accessed from userspace. The general idea for this as been taken from
> stm32, intel, and rockchip drivers that have userspace access for bias
> flags.
>
> Signed-off-by: Ryan Wanner <Ryan.Wanner@microchip.com>
Tested-by: Nicolas Ferre <nicolas.ferre@microchip.com> # on sama5d27 som1 ek
Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com>
Thanks, best regards,
Nicolas
> ---
> drivers/pinctrl/pinctrl-at91-pio4.c | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c
> index 517f2a6330ad..13b77f1eb6e2 100644
> --- a/drivers/pinctrl/pinctrl-at91-pio4.c
> +++ b/drivers/pinctrl/pinctrl-at91-pio4.c
> @@ -902,6 +902,25 @@ static int atmel_conf_pin_config_group_set(struct pinctrl_dev *pctldev,
> return 0;
> }
>
> +static int atmel_conf_pin_config_set(struct pinctrl_dev *pctldev,
> + unsigned pin,
> + unsigned long *configs,
> + unsigned num_configs)
> +{
> + struct atmel_group *grp = atmel_pctl_find_group_by_pin(pctldev, pin);
> +
> + return atmel_conf_pin_config_group_set(pctldev, grp->pin, configs, num_configs);
> +}
> +
> +static int atmel_conf_pin_config_get(struct pinctrl_dev *pctldev,
> + unsigned pin,
> + unsigned long *configs)
> +{
> + struct atmel_group *grp = atmel_pctl_find_group_by_pin(pctldev, pin);
> +
> + return atmel_conf_pin_config_group_get(pctldev, grp->pin, configs);
> +}
> +
> static void atmel_conf_pin_config_dbg_show(struct pinctrl_dev *pctldev,
> struct seq_file *s,
> unsigned int pin_id)
> @@ -949,6 +968,8 @@ static const struct pinconf_ops atmel_confops = {
> .pin_config_group_get = atmel_conf_pin_config_group_get,
> .pin_config_group_set = atmel_conf_pin_config_group_set,
> .pin_config_dbg_show = atmel_conf_pin_config_dbg_show,
> + .pin_config_set = atmel_conf_pin_config_set,
> + .pin_config_get = atmel_conf_pin_config_get,
> };
>
> static struct pinctrl_desc atmel_pinctrl_desc = {
> @@ -1139,6 +1160,7 @@ static int atmel_pinctrl_probe(struct platform_device *pdev)
> atmel_pioctrl->gpio_chip->label = dev_name(dev);
> atmel_pioctrl->gpio_chip->parent = dev;
> atmel_pioctrl->gpio_chip->names = atmel_pioctrl->group_names;
> + atmel_pioctrl->gpio_chip->set_config = gpiochip_generic_config;
>
> atmel_pioctrl->pm_wakeup_sources = devm_kcalloc(dev,
> atmel_pioctrl->nbanks,
--
Nicolas Ferre
next prev parent reply other threads:[~2022-10-10 9:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 15:16 [PATCH 0/2] pinctrl:at91-pio4:add support for pullup/down Ryan.Wanner
2022-10-07 15:16 ` [PATCH 1/2] pinctrl: at91-pio4: Add configuration to userspace Ryan.Wanner
2022-10-10 9:13 ` Nicolas Ferre [this message]
2022-10-07 15:16 ` [PATCH 2/2] pinctrl: at91-pio4: Add persist state case in config Ryan.Wanner
2022-10-10 9:08 ` Nicolas Ferre
2022-10-10 9:11 ` [PATCH 0/2] pinctrl:at91-pio4:add support for pullup/down Nicolas Ferre
2022-10-17 9:52 ` Linus Walleij
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=8a335e97-c880-d42f-a455-9ea8f3e65267@microchip.com \
--to=nicolas.ferre@microchip.com \
--cc=Ryan.Wanner@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.beznea@microchip.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ludovic.desroches@microchip.com \
/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
Powered by JetHome