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 BBA1FC4708F for ; Tue, 1 Jun 2021 06:09:39 +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 9B2FA6139A for ; Tue, 1 Jun 2021 06:09:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B2FA6139A 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 2811782E9B; Tue, 1 Jun 2021 08:09:36 +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="lAXzATin"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A012A82EA5; Tue, 1 Jun 2021 08:09:34 +0200 (CEST) Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) (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 E384882E9A for ; Tue, 1 Jun 2021 08:09:31 +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-wr1-x433.google.com with SMTP id n2so12984220wrm.0 for ; Mon, 31 May 2021 23:09:31 -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=UHzS+cqOrSqlwF24dFduJhpZDxSfh+9MPx5gpUuqQtY=; b=lAXzATinjbMDn/9m/RxXo2iEGnzbABspVY4UNbeOx0vVkoTZXBVi0uxcULSWhR/2kv 8+b2iyaitcssG2wo/o2ZCKRUkwWLqzdCzJ3t+yTWEIuvubwQybYcWG7erwACIL18iSDA fkRHIXpUZGjyBE2/sjhAXKUFqLAyB27g3DNz6UDFzB8/WqoZ2/qBKSP0uY1Wc2va5fxW n5yF5rLkCmsWe/PGhjHe4Ievaygs7RsU19LxlkEoEYyROJ3OPgRUWl8Ll6O1hN52j7KQ duIuiyuuX/x83BTmeByRkmSu03apARs7d1yOrQM2KCucpRlLk1stsY6f1aXfHRrGrkd7 7Nuw== 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=UHzS+cqOrSqlwF24dFduJhpZDxSfh+9MPx5gpUuqQtY=; b=MZ/w+ziuavxxIIWDIT71ce1kG3KFvKP3+ArIvtJNrzK0lTxJKYBVeesZb9d+ehSUz8 AWyPa5ls9h+OGGv1vtzHb1nGu3Ph0QRTPwNBq5kYVN4ulIk/yaTwWmDyWP5VHHpgGcyu jRT+x+GOoAOhGIGZC06b4oycDTOK7CVX1nUHZ1YdRCvBJx1S4dZR08c43SG0pg1F0pHD 3ZX+UKduvQAv89NNint0iX9nPK1GuJhfP2WXbCq8j+MFABUcR5a47+7P4gKtgbOR7n5L VLBI4HKnBQfKnVTNsp/vJmwZereJTq/vqM0map+zvVM2z0+tD1vT1Z1YScqd13T59vbM puNw== X-Gm-Message-State: AOAM532lO9iy2mnGTgfjuSdBA/TLN5EEbFsrqhtvAd3J0t821ms9CtLA lc2nEAMkYjG+T2sV83i4uFu3zQ== X-Google-Smtp-Source: ABdhPJzvjZzbYxA5wH2W0i5AJNUI287y2wktyOa9/5b5X2O/jpiwixlvNXYEag4roJXzQ5usoRgjDg== X-Received: by 2002:a5d:4d4f:: with SMTP id a15mr24835186wru.80.1622527771472; Mon, 31 May 2021 23:09:31 -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 c12sm2147553wrr.90.2021.05.31.23.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 May 2021 23:09:30 -0700 (PDT) From: Jorge Ramirez-Ortiz To: jorge@foundries.io, sjg@chromium.org, michal.simek@xilinx.com Cc: bruno.thomsen@gmail.com, u-boot@lists.denx.de Subject: [PATCHv2] drivers: tpm2: update reset gpio semantics Date: Tue, 1 Jun 2021 08:09:27 +0200 Message-Id: <20210601060927.30894-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 propery name. Signed-off-by: Jorge Ramirez-Ortiz --- v2: kept gpio-reset as legacy .../tpm2/tis-tpm2-spi.txt | 2 +- drivers/tpm/tpm2_tis_spi.c | 21 ++++++++++++------- 2 files changed, 14 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..bbcd12950f 100644 --- a/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt +++ b/doc/device-tree-bindings/tpm2/tis-tpm2-spi.txt @@ -6,7 +6,7 @@ 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) - 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..1f9f89f68f 100644 --- a/drivers/tpm/tpm2_tis_spi.c +++ b/drivers/tpm/tpm2_tis_spi.c @@ -589,18 +589,23 @@ 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; + } } + 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