summaryrefslogtreecommitdiff
path: root/include/acpi
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2020-09-22 12:45:43 -0600
committerBin Meng <bmeng.cn@gmail.com>2020-09-25 11:27:26 +0800
commit1e4073b8559615509af45f2f826d157c39841fd0 (patch)
tree03288f50fbe0a23c0a7dd0e04f8fe15456054d2f /include/acpi
parent49f5141ed30fd6029d04f9ee31776eaba0ae5340 (diff)
acpi: Add more documentation for struct acpi_gpio
Add some documentation provided by Andy Shevchenko to describe how to use struct acpi_gpio. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include/acpi')
-rw-r--r--include/acpi/acpi_device.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/acpi/acpi_device.h b/include/acpi/acpi_device.h
index 1b838fcb85..007b7e7caf 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;