linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Neil Armstrong <narmstrong@baylibre.com>
To: Jerome Brunet <jbrunet@baylibre.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Kevin Hilman <khilman@baylibre.com>
Cc: devicetree@vger.kernel.org, linux-amlogic@lists.infradead.org,
	Guillaume La Roque <glaroque@baylibre.com>,
	linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 2/2] pinctrl: meson: add support of drive-strength
Date: Mon, 18 Mar 2019 14:12:28 +0100	[thread overview]
Message-ID: <544af6b6-acf4-9904-3b32-9a99567e6ac9@baylibre.com> (raw)
In-Reply-To: <20190314163725.7918-3-jbrunet@baylibre.com>

On 14/03/2019 17:37, Jerome Brunet wrote:
> From: Guillaume La Roque <glaroque@baylibre.com>
> 
> drive-strength is a new feature needed for G12A SoC.
> the default DS setting after boot is usually 0.5mA and it is not enough for
> many functions. We need to be able to set the drive strength to reliably
> enable things like MMC, I2C, etc ...
> 
> Signed-off-by: Guillaume La Roque <glaroque@baylibre.com>
> Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
> ---
>  drivers/pinctrl/meson/pinctrl-meson-g12a.c |  36 ++---
>  drivers/pinctrl/meson/pinctrl-meson.c      | 166 ++++++++++++++++-----
>  drivers/pinctrl/meson/pinctrl-meson.h      |  20 ++-
>  3 files changed, 162 insertions(+), 60 deletions(-)
> 
> diff --git a/drivers/pinctrl/meson/pinctrl-meson-g12a.c b/drivers/pinctrl/meson/pinctrl-meson-g12a.c
> index d494492e98e9..3475cd7bd2af 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson-g12a.c
> +++ b/drivers/pinctrl/meson/pinctrl-meson-g12a.c

[...]

>  static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
>  			     unsigned long *config)
>  {
>  	struct meson_pinctrl *pc = pinctrl_dev_get_drvdata(pcdev);
>  	enum pin_config_param param = pinconf_to_config_param(*config);
>  	u16 arg;
> +	int ret;
>  
>  	switch (param) {
>  	case PIN_CONFIG_BIAS_DISABLE:
> @@ -291,6 +373,10 @@ static int meson_pinconf_get(struct pinctrl_dev *pcdev, unsigned int pin,
>  		else
>  			return -EINVAL;
>  		break;
> +	case PIN_CONFIG_DRIVE_STRENGTH:
> +		ret = meson_pinconf_get_drive_strength(pc, pin, &arg);
> +		if (ret)
> +			return ret;

Missing break here !

Neil


>  	default:
>  		return -ENOTSUPP;
>  	}
> diff --git a/drivers/pinctrl/meson/pinctrl-meson.h b/drivers/pinctrl/meson/pinctrl-meson.h
> index 5eaab925f427..1a88103dcb9b 100644
> --- a/drivers/pinctrl/meson/pinctrl-meson.h
> +++ b/drivers/pinctrl/meson/pinctrl-meson.h
> @@ -71,9 +71,20 @@ enum meson_reg_type {
>  	REG_DIR,
>  	REG_OUT,
>  	REG_IN,
> +	REG_DS,
>  	NUM_REG,
>  };
>  
> +/**
> + * enum meson_pinconf_drv - value of drive-strength supported
> + */
> +enum meson_pinconf_drv {
> +	MESON_PINCONF_DRV_500UA,
> +	MESON_PINCONF_DRV_2500UA,
> +	MESON_PINCONF_DRV_3000UA,
> +	MESON_PINCONF_DRV_4000UA,
> +};
> +
>  /**
>   * struct meson bank
>   *
> @@ -132,7 +143,8 @@ struct meson_pinctrl {
>  		.num_groups = ARRAY_SIZE(fn ## _groups),		\
>  	}
>  
> -#define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib)	\
> +#define BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib,     \
> +		dsr, dsb)                                                      \
>  	{								\
>  		.name		= n,					\
>  		.first		= f,					\
> @@ -145,8 +157,12 @@ struct meson_pinctrl {
>  			[REG_DIR]	= { dr, db },			\
>  			[REG_OUT]	= { or, ob },			\
>  			[REG_IN]	= { ir, ib },			\
> +			[REG_DS]	= { dsr, dsb },			\
>  		},							\
> -	 }
> +	}
> +
> +#define BANK(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib) \
> +	BANK_DS(n, f, l, fi, li, per, peb, pr, pb, dr, db, or, ob, ir, ib, 0, 0)
>  
>  #define MESON_PIN(x) PINCTRL_PIN(x, #x)
>  
> 


_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic

  reply	other threads:[~2019-03-18 13:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14 16:37 [PATCH 0/2] pinctrl: meson: add g12a drive strength support Jerome Brunet
2019-03-14 16:37 ` [PATCH 1/2] dt-bindings: pinctrl: meson: Add drive-strength property Jerome Brunet
2019-03-31  6:40   ` Rob Herring
2019-03-31  7:04     ` Jerome Brunet
2019-04-04  3:42       ` Linus Walleij
2019-03-14 16:37 ` [PATCH 2/2] pinctrl: meson: add support of drive-strength Jerome Brunet
2019-03-18 13:12   ` Neil Armstrong [this message]
2019-03-25  9:44 ` [PATCH 0/2] pinctrl: meson: add g12a drive strength support Jerome Brunet
2019-04-04  3:41 ` 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=544af6b6-acf4-9904-3b32-9a99567e6ac9@baylibre.com \
    --to=narmstrong@baylibre.com \
    --cc=devicetree@vger.kernel.org \
    --cc=glaroque@baylibre.com \
    --cc=jbrunet@baylibre.com \
    --cc=khilman@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).