Skip to content

Commit 8b31e97

Browse files
andy-shevrafaeljw
authored andcommitted
Documentation: firmware-guide: gpio-properties: Clarify initial output state
GpioIo() doesn't provide an explicit state for an output pin. Linux tries to be smart and uses a common sense based on other parameters. Document how it looks like in the code. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 0d6c41c commit 8b31e97

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

Documentation/firmware-guide/acpi/gpio-properties.rst

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,29 @@ must be 0. GpioInt() resource has its own means of defining it.
6161
In our Bluetooth example the "reset-gpios" refers to the second GpioIo()
6262
resource, second pin in that resource with the GPIO number of 31.
6363

64+
The GpioIo() resource unfortunately doesn't explicitly provide an initial
65+
state of the output pin which driver should use during its initialization.
66+
67+
Linux tries to use common sense here and derives the state from the bias
68+
and polarity settings. The table below shows the expectations:
69+
70+
========= ============= ==============
71+
Pull Bias Polarity Requested...
72+
========= ============= ==============
73+
Implicit x AS IS (assumed firmware configured for us)
74+
Explicit x (no _DSD) as Pull Bias (Up == High, Down == Low),
75+
assuming non-active (Polarity = !Pull Bias)
76+
Down Low as low, assuming active
77+
Down High as low, assuming non-active
78+
Up Low as high, assuming non-active
79+
Up High as high, assuming active
80+
========= ============= ==============
81+
82+
That said, for our above example the both GPIOs, since the bias setting
83+
is explicit and _DSD is present, will be treated as active with a high
84+
polarity and Linux will configure the pins in this state until a driver
85+
reprograms them differently.
86+
6487
It is possible to leave holes in the array of GPIOs. This is useful in
6588
cases like with SPI host controllers where some chip selects may be
6689
implemented as GPIOs and some as native signals. For example a SPI host

0 commit comments

Comments
 (0)