From patchwork Tue Sep 22 18:45:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1369229 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=im+XGF08; 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 4BwrCx74Dcz9sTS for ; Wed, 23 Sep 2020 04:57:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5C67C826DF; Tue, 22 Sep 2020 20:49:32 +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="im+XGF08"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E897D825CA; Tue, 22 Sep 2020 20:47:36 +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=-3.5 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-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) (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 8A4BC823D1 for ; Tue, 22 Sep 2020 20:47:22 +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-ot1-x344.google.com with SMTP id m12so16633011otr.0 for ; Tue, 22 Sep 2020 11:47:22 -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=LyxZEZlVZ0IZ2pGoo9kaKP3/OjsR3lSnPOQC8D14Jfs=; b=im+XGF084EF/SEDfN1lcyVXsyhJm2iuwAKxicUD8r0tbMdFImeJua7egSGq8EM3R2d 2AIPZk6AFfqIjGBJD71ap4ruv4MfodoGLCgmze8k0Tu7hcTtM1XhBhgWrYmJYghFdsIQ WGgNnHbVZq0H5l+qegk/XvUjm3jm5tXR5eI1E= 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=LyxZEZlVZ0IZ2pGoo9kaKP3/OjsR3lSnPOQC8D14Jfs=; b=RAqhOnucU+608AYivpAxfbU7u9CcyFDAmsKzNSv4cDjLAY9hj1cYvbg2yioYt9SKfA CIheiCO0w8efUAmZOUjxbN4BHF8RF23kE+NMZKR7+BP4EXRw3I8TOgJ5Uur9RgNCEioD g/2DWZnvPO0PyHfiumV6DScqcvlpEtdkw5paS3z9BNq56MGIEktkHVvbF+29wG8DA+Ri pXnBm9UsHszZFPhE1XjZYaeWz2KnyMx3ypOAbpPZ6M75agZvRFjtY3sSdVYqGjA8dCjI RjLBGnnIiEBFl/dIGDFYWWJwQY5J4nuhYTxWGpN34XiDrZoO7twDcoRppdtSqEtg1KEy UlgQ== X-Gm-Message-State: AOAM530W6PAZshaZvZswcweAxyCpztp8jsNAf3ByPQTe4OMbCrInd7no 8qARDK48bVt+tcE6U09srU5QbnsgxiFzX3v4 X-Google-Smtp-Source: ABdhPJx31KLDkwRqqIFbwpxkshi3Wc5FiFgOx2tdPS+9or/5uT9AbPYpmtkAneYZCuxiVfCQtxUmYA== X-Received: by 2002:a05:6830:c3:: with SMTP id x3mr3502708oto.235.1600800441190; Tue, 22 Sep 2020 11:47:21 -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 q24sm7622663oij.19.2020.09.22.11.47.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Sep 2020 11:47:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Andy Shevchenko , Wolfgang Wallner , Bin Meng , Bernhard Messerklinger , Simon Glass Subject: [PATCH v4 58/59] acpi: Add more documentation for struct acpi_gpio Date: Tue, 22 Sep 2020 12:45:43 -0600 Message-Id: <20200922184544.2920969-27-sjg@chromium.org> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog In-Reply-To: <20200922184544.2920969-1-sjg@chromium.org> References: <20200922184544.2920969-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 Add some documentation provided by Andy Shevchenko to describe how to use struct acpi_gpio. Signed-off-by: Simon Glass --- Changes in v4: - Add Andy's documentation to struct acpi_gpio include/acpi/acpi_device.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/include/acpi/acpi_device.h b/include/acpi/acpi_device.h index 1b838fcb857..007b7e7caf1 100644 --- a/include/acpi/acpi_device.h +++ b/include/acpi/acpi_device.h @@ -170,6 +170,28 @@ enum acpi_gpio_polarity { * @io_shared; true if GPIO is shared * @io_restrict: I/O restriction setting * @polarity: GPIO polarity + * + * Note that GpioIo doesn't have any means of Active Low / High setting, so a + * _DSD must be provided to mitigate this. + * + * GpioIo doesn't properly communicate the initial state of the output pin, + * thus Linux assumes the simple rule: + * + * Pull Bias Polarity Requested... + * + * Implicit x AS IS (assumed firmware configured for us) + * Explicit x (no _DSD) as Pull Bias (Up == High, Down == Low), + * assuming non-active (Polarity = !Pull Bias) + * + * Down Low as low, assuming active + * Down High as high, assuming non-active + * Up Low as high, assuming non-active + * Up High as high, assuming active + * + * GpioIo() can be used as interrupt and in this case the IoRestriction mustn't + * be OutputOnly. It also requires active_low flag from _DSD in cases where it's + * needed (better to always provide than rely on above assumption made on OS + * level). */ struct acpi_gpio { int pin_count;