tpm2: Don't assume active low reset value
authorKayla Theil <kayla.theil@mixed-mode.de>
Fri, 6 Sep 2019 10:40:45 +0000 (12:40 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 15 Oct 2019 14:40:02 +0000 (08:40 -0600)
The reset function sets the pin to 0 then 1 but if the pin is marked
ACTIVE_LOW in the DT it gets inverted and leaves the TPM in reset.
Let the gpio driver take care of the reset polarity.

Signed-off-by: Kayla Theil <kayla.theil@mixed-mode.de>
drivers/tpm/tpm2_tis_spi.c

index 7186c179d1162f5bc797a8f6fbe4fe1b0e920dec..3d105fddba1c8a420c769d501eace3ea085b919a 100644 (file)
@@ -596,9 +596,9 @@ static int tpm_tis_spi_probe(struct udevice *dev)
                        log(LOGC_NONE, LOGL_NOTICE, "%s: missing reset GPIO\n",
                            __func__);
                } else {
-                       dm_gpio_set_value(&reset_gpio, 0);
-                       mdelay(1);
                        dm_gpio_set_value(&reset_gpio, 1);
+                       mdelay(1);
+                       dm_gpio_set_value(&reset_gpio, 0);
                }
        }