All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Jorge Ramirez-Ortiz <jorge@foundries.io>
Cc: michal.simek@xilinx.com, sjg@chromium.org, u-boot@lists.denx.de
Subject: Re: [PATCHv5] drivers: tpm2: update reset gpio semantics
Date: Mon, 20 Sep 2021 19:51:01 +0300	[thread overview]
Message-ID: <YUi79QEVIWTHeq1w@apalos.home> (raw)
In-Reply-To: <20210603104026.24346-1-jorge@foundries.io>

On Thu, Jun 03, 2021 at 12:40:26PM +0200, Jorge Ramirez-Ortiz wrote:
> Use the more generic reset-gpios property name.
> 
> Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
> Acked-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
>  v5: added Acked-by: Michal Simek
>  
>  .../tpm2/tis-tpm2-spi.txt                     |  3 ++-
>  drivers/tpm/tpm2_tis_spi.c                    | 23 ++++++++++++-------
>  2 files changed, 17 insertions(+), 9 deletions(-)
> 
> diff --git a/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt b/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt
> index 3a2ee4bd17..16f870225f 100644
> --- a/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt
> +++ b/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt
> @@ -6,7 +6,8 @@ Required properties:
>  - reg			: SPI Chip select
>  
>  Optional properties:
> -- gpio-reset		: Reset GPIO (if not connected to the SoC reset line)
> +- reset-gpios		: Reset GPIO (if not connected to the SoC reset line)
> +- gpio-reset		: Reset GPIO (deprecated, use reset-gpios instead)
>  - spi-max-frequency	: See spi-bus.txt
>  
>  Example:
> diff --git a/drivers/tpm/tpm2_tis_spi.c b/drivers/tpm/tpm2_tis_spi.c
> index 4b33ac8fd3..1d24d32d86 100644
> --- a/drivers/tpm/tpm2_tis_spi.c
> +++ b/drivers/tpm/tpm2_tis_spi.c
> @@ -589,18 +589,25 @@ static int tpm_tis_spi_probe(struct udevice *dev)
>  	if (CONFIG_IS_ENABLED(DM_GPIO)) {
>  		struct gpio_desc reset_gpio;
>  
> -		ret = gpio_request_by_name(dev, "gpio-reset", 0,
> +		ret = gpio_request_by_name(dev, "reset-gpios", 0,
>  					   &reset_gpio, GPIOD_IS_OUT);
>  		if (ret) {
> -			log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",
> -			    __func__);
> -		} else {
> -			dm_gpio_set_value(&reset_gpio, 1);
> -			mdelay(1);
> -			dm_gpio_set_value(&reset_gpio, 0);
> +			/* legacy reset */
> +			ret = gpio_request_by_name(dev, "gpio-reset", 0,
> +						   &reset_gpio, GPIOD_IS_OUT);
> +			if (ret) {
> +				log(LOGC_NONE, LOGL_NOTICE,
> +				    "%s: missing reset GPIO\n", __func__);
> +				goto init;
> +			}
> +			log(LOGC_NONE, LOGL_NOTICE,
> +			    "%s: gpio-reset is deprecated\n", __func__);
>  		}
> +		dm_gpio_set_value(&reset_gpio, 1);
> +		mdelay(1);
> +		dm_gpio_set_value(&reset_gpio, 0);
>  	}
> -
> +init:
>  	/* Ensure a minimum amount of time elapsed since reset of the TPM */
>  	mdelay(drv_data->time_before_first_cmd_ms);
>  

Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

  reply	other threads:[~2021-09-20 16:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-03 10:40 [PATCHv5] drivers: tpm2: update reset gpio semantics Jorge Ramirez-Ortiz
2021-09-20 16:51 ` Ilias Apalodimas [this message]
2021-09-25  0:36 ` Tom Rini

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=YUi79QEVIWTHeq1w@apalos.home \
    --to=ilias.apalodimas@linaro.org \
    --cc=jorge@foundries.io \
    --cc=michal.simek@xilinx.com \
    --cc=sjg@chromium.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.