]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
drivers: tpm2: update reset gpio semantics
authorJorge Ramirez-Ortiz <jorge@foundries.io>
Thu, 3 Jun 2021 10:40:26 +0000 (12:40 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 24 Sep 2021 18:36:50 +0000 (14:36 -0400)
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>
Acked-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt
drivers/tpm/tpm2_tis_spi.c

index 3a2ee4bd1759a7fecdf232239a4c597c980252d9..16f870225fdbeeda017e5e3063d37fba5258bb27 100644 (file)
@@ -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:
index 4b33ac8fd3d953df7516da905d1733c10658143f..1d24d32d867e58f13a01f91744ee5f0fc3c089e4 100644 (file)
@@ -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);