From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73347C47096 for ; Thu, 3 Jun 2021 10:38:32 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3F4D4613B8 for ; Thu, 3 Jun 2021 10:38:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3F4D4613B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6882982F9E; Thu, 3 Jun 2021 12:38:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=foundries.io header.i=@foundries.io header.b="Q9bzgqk7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0069182F9F; Thu, 3 Jun 2021 12:38:26 +0200 (CEST) Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id ED88F82F98 for ; Thu, 3 Jun 2021 12:38:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=foundries.io Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=jorge@foundries.io Received: by mail-wm1-x32e.google.com with SMTP id b145-20020a1c80970000b029019c8c824054so5565372wmd.5 for ; Thu, 03 Jun 2021 03:38:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=foundries.io; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rNFYvgrtUricAxo8/UC88bQNnm/3CpAlWEwCS2NAB80=; b=Q9bzgqk7I+770NapYs6qi5DD6o9qIT24xUg9ZrWpYEE79XHBojE9O3CtfP2+e/QZrw KZEWD8M/3v4iCItepUJTo2zkPbhUDJhUZuy7KiPl4KsMlSDBaifAPOiMBx8NDU4RcJL+ 8FvQrkh99Evrox4gGwYMmxd13/qCxyaCu6DbeUy0cdgFQBOx4xxr8GTi/KmbjSnCQkyK 6LvouvFXh5IlFIQkThBxu+50m3yY1+qn+2KqTg4xbKJNQOAteWQuKiui9Fj6Og2w0BgE ssxgbynLMCO6giaFDtBw2voH6jv/VSFMPowg+fE6hXw7/HRqJh1WTTqKcXcbNNCZEeaA afEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rNFYvgrtUricAxo8/UC88bQNnm/3CpAlWEwCS2NAB80=; b=uAkiKth6eeHwLPm6FXSZXSNDwIYTpaNPa7bz3gX7o52zP2pJsXGxe0b6ybjCBM4r1h LmwOrt9ZAtRNWdwEGnPXS9WoWF4dr6Gexr1E5EFd5/Gq+EQ6AONhLGjsY0HFfbs6ZzrN kvfbk/LmD5b8cT0uToKofR3FwJUEWPNp+IxUo/iNnadsCy0pT0lcdZm1fWdENCWkm4PN ecCGO6QED8lbxMgE91InTD4HcUgED0ABNPOUZCkg84WRneNoK7z3AiXr2AxeehRCgb8d ZDR70PB8pEg9664MFY3rIBUGhuSUPr0wMgv6LyWfw0WM7g0tV6MAwKHx0EEsHKkUr8jQ xHAw== X-Gm-Message-State: AOAM532iuQS46b8CKsg4kimQoXHHDBfHTJ1oJciVkHLpl+daV+RvraP7 0b9adSN8EVHjdFWeUctKlRcGvA== X-Google-Smtp-Source: ABdhPJxJ0y0aM/5rloucJW7uH0W99/eKq1NYUvfQlr30EWnhy4TZecm29sKeMw3h1zmXD3U60d/B1Q== X-Received: by 2002:a1c:2743:: with SMTP id n64mr9363689wmn.76.1622716703531; Thu, 03 Jun 2021 03:38:23 -0700 (PDT) Received: from localhost.localdomain (113.red-79-154-202.dynamicip.rima-tde.net. [79.154.202.113]) by smtp.gmail.com with ESMTPSA id q1sm5538272wmq.48.2021.06.03.03.38.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jun 2021 03:38:22 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge@foundries.io, michal.simek@xilinx.com Cc: sjg@chromium.org, bruno.thomsen@gmail.com, u-boot@lists.denx.de Subject: [PATCHv4] drivers: tpm2: update reset gpio semantics Date: Thu, 3 Jun 2021 12:38:18 +0200 Message-Id: <20210603103818.23475-1-jorge@foundries.io> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.4 at phobos.denx.de X-Virus-Status: Clean Use the more generic reset-gpios property name. Signed-off-by: Jorge Ramirez-Ortiz --- v4: s/will be deprecated/is deprecated .../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); -- 2.31.1