From patchwork Thu Oct 22 03:02:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1385883 X-Patchwork-Delegate: bmeng.cn@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=fPUCxBFQ; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4CGsjD4rr5z9sSn for ; Thu, 22 Oct 2020 14:07:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 52EC9824CC; Thu, 22 Oct 2020 05:04:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fPUCxBFQ"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 54E5B82468; Thu, 22 Oct 2020 05:03:46 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (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 B475A82462 for ; Thu, 22 Oct 2020 05:03:42 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd43.google.com with SMTP id z5so43477iob.1 for ; Wed, 21 Oct 2020 20:03:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=0CvcRJjAuGtWvAoANIhIjsdmKxNMzLEmfaVM48Ew/lI=; b=fPUCxBFQcWO/td5amcYTp4DVe1GW3BN53KMoIigPejqJnsns8YEncRDVG0FqbGbOMS RZuqMjxV6MUvZPUYGqyYmors3xPOJYgUTp27kzKEfc12rhCl8Nri7pK8rIRNjzJwzhqX ooSBDMmvByrOH+///ne1WDKf2HFJdGda3tpVs= 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=0CvcRJjAuGtWvAoANIhIjsdmKxNMzLEmfaVM48Ew/lI=; b=VjtQFlYizOIy6dq0KpKPuja/1bpGzhxGej03e1PxweCUk2LTm6oCvVoS6keMkuRvWY wvdv1AKYqLfCMackeZVkth01pwH3+1K5sBKBlgcgq4+FKWRgLjMLg0aeCjHcz7Hl3qvL 5oLYynP5CKTDMpeAssOAMxSmSEBFafvvaCcjlZxz+T8ZSItUh7mPm+fBLqsTTc6iexhs S3MNlXijTmFIhScCVXiIDW9YRagHGYhs58/EFgEyZVkqdVk+s+4/N5ASx0OTva+5b9Iy +lx4yUpQFgA6SSfWJ1kPvB95fEPrDT5nwulJNexYsKGycvUxBjNr2Vv9l8FdRsbZWQY+ 9Wvg== X-Gm-Message-State: AOAM533BYM+JKjL/fp4F/M+Gv0SXcsPkH4RGxthPrf5q4EEgARKbeTzu ciKi8zpVYx+s42TD1qilMqV+YB14oOA1Zq2U X-Google-Smtp-Source: ABdhPJxpI/603EaElbGmJcirOJbP9G3CveMaQi9xqN3tUSM9E6Z8GeZ55dLdLXJ7hg/1xoSI96KICw== X-Received: by 2002:a5e:9e42:: with SMTP id j2mr381979ioq.87.1603335821530; Wed, 21 Oct 2020 20:03:41 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id p4sm206171ilg.79.2020.10.21.20.03.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Oct 2020 20:03:41 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Heinrich Schuchardt , Bernhard Messerklinger , Wolfgang Wallner , Walter Lozano , Simon Glass , Bin Meng Subject: [PATCH v2 17/30] acpi: Correct reset handling in acpi_device_add_power_res() Date: Wed, 21 Oct 2020 21:02:50 -0600 Message-Id: <20201022030303.584490-16-sjg@chromium.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog In-Reply-To: <20201022030303.584490-1-sjg@chromium.org> References: <20201022030303.584490-1-sjg@chromium.org> MIME-Version: 1.0 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.3 at phobos.denx.de X-Virus-Status: Clean If there is no reset line, this still emits ACPI code for the reset GPIO. Fix it by updating the check. Signed-off-by: Simon Glass Reviewed-by: Bin Meng --- (no changes since v1) lib/acpi/acpi_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/acpi/acpi_device.c b/lib/acpi/acpi_device.c index 95dfac583fc..c3439a59883 100644 --- a/lib/acpi/acpi_device.c +++ b/lib/acpi/acpi_device.c @@ -422,7 +422,7 @@ int acpi_device_add_power_res(struct acpi_ctx *ctx, u32 tx_state_val, /* Method (_ON, 0, Serialized) */ acpigen_write_method_serialized(ctx, "_ON", 0); - if (reset_gpio) { + if (has_reset) { ret = acpigen_set_enable_tx_gpio(ctx, tx_state_val, dw0_read, dw0_write, &reset, true); if (ret)