public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Patrice CHOTARD <patrice.chotard@st.com>
To: u-boot@lists.denx.de
Subject: [PATCH v2 10/11] pinctrl: stmfx: add information on pin configuration
Date: Thu, 2 Jul 2020 07:59:53 +0000	[thread overview]
Message-ID: <55421cef-be5b-8b99-e293-9bf9b791d1d8@st.com> (raw)
In-Reply-To: <20200604143022.v2.10.I1b4851af3f935a0e9b02f80c3f5303f9f80502df@changeid>

Hi Patrick

On 6/4/20 2:30 PM, Patrick Delaunay wrote:
> Add information on pin configuration used for pinmux command.
>
> Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
> ---
>
> Changes in v2: None
>
>  drivers/pinctrl/pinctrl-stmfx.c | 32 +++++++++++++++++++++++++++++++-
>  1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/pinctrl/pinctrl-stmfx.c b/drivers/pinctrl/pinctrl-stmfx.c
> index 1d326ecf17..c2ea82770e 100644
> --- a/drivers/pinctrl/pinctrl-stmfx.c
> +++ b/drivers/pinctrl/pinctrl-stmfx.c
> @@ -358,6 +358,34 @@ static const char *stmfx_pinctrl_get_pin_name(struct udevice *dev,
>  	return pin_name;
>  }
>  
> +static const char *stmfx_pinctrl_get_pin_conf(struct udevice *dev,
> +					      unsigned int pin, int func)
> +{
> +	int pupd, type;
> +
> +	type = stmfx_conf_get_type(dev, pin);
> +	if (type < 0)
> +		return "";
> +
> +	if (func == GPIOF_OUTPUT) {
> +		if (type)
> +			return "drive-open-drain";
> +		else
> +			return ""; /* default: push-pull*/
> +	}
> +	if (!type)
> +		return ""; /* default: bias-disable*/
> +
> +	pupd = stmfx_conf_get_pupd(dev, pin);
> +	if (pupd < 0)
> +		return "";
> +
> +	if (pupd)
> +		return "bias-pull-up";
> +	else
> +		return "bias-pull-down";
> +}
> +
>  static int stmfx_pinctrl_get_pin_muxing(struct udevice *dev,
>  					unsigned int selector,
>  					char *buf, int size)
> @@ -369,7 +397,9 @@ static int stmfx_pinctrl_get_pin_muxing(struct udevice *dev,
>  	if (func < 0)
>  		return func;
>  
> -	snprintf(buf, size, "%s", func == GPIOF_INPUT ? "input" : "output");
> +	snprintf(buf, size, "%s ", func == GPIOF_INPUT ? "input" : "output");
> +
> +	strncat(buf, stmfx_pinctrl_get_pin_conf(dev, selector, func), size);
>  
>  	return 0;
>  }

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>

Thanks

  reply	other threads:[~2020-07-02  7:59 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-04 12:30 [PATCH v2 00/11] stm32mp1: activate gpio hog support and add new pinctrl ops Patrick Delaunay
2020-06-04 12:30 ` [PATCH v2 01/11] configs: stm32mp1: activate CONFIG_GPIO_HOG Patrick Delaunay
2020-07-02  7:41   ` [Uboot-stm32] " Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 02/11] board: stm32mp1: update the gpio hog support Patrick Delaunay
2020-07-02  7:42   ` [Uboot-stm32] " Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 03/11] gpio: stm32: add ops set_dir_flags Patrick Delaunay
2020-07-02  7:48   ` Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 04/11] gpio: stm32: add ops get_dir_flags Patrick Delaunay
2020-07-02  7:51   ` Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 05/11] gpio: stmfx: move function to prepare new ops introduction Patrick Delaunay
2020-07-02  7:51   ` Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 06/11] gpio: stmfx: rename function used to change pin configuration Patrick Delaunay
2020-07-02  7:51   ` Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 07/11] gpio: stmfx: add function stmfx_read_reg and stmfx_write_reg Patrick Delaunay
2020-07-02  7:56   ` Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 08/11] gpio: stmfx: add ops set_dir_flag Patrick Delaunay
2020-07-02  7:58   ` Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 09/11] gpio: stmfx: add ops get_dir_flags Patrick Delaunay
2020-07-02  7:58   ` Patrice CHOTARD
2020-06-04 12:30 ` [PATCH v2 10/11] pinctrl: stmfx: add information on pin configuration Patrick Delaunay
2020-07-02  7:59   ` Patrice CHOTARD [this message]
2020-06-04 12:30 ` [PATCH v2 11/11] pinctrl: stm32: " Patrick Delaunay
2020-07-02  8:02   ` Patrice CHOTARD

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=55421cef-be5b-8b99-e293-9bf9b791d1d8@st.com \
    --to=patrice.chotard@st.com \
    --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