Commit 3d2ddfdc authored by Laxman Dewangan's avatar Laxman Dewangan Committed by Grant Likely

Documentation: gpio: Add details of open-drain/source configuration

Adding details of open drain(open collector) and open source
(open emitter) configuration of the gpio so that client can
set the pin as open drain at the time of gpio request.
Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Reviwed-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 6e2cf651
...@@ -302,6 +302,8 @@ where 'flags' is currently defined to specify the following properties: ...@@ -302,6 +302,8 @@ where 'flags' is currently defined to specify the following properties:
* GPIOF_INIT_LOW - as output, set initial level to LOW * GPIOF_INIT_LOW - as output, set initial level to LOW
* GPIOF_INIT_HIGH - as output, set initial level to HIGH * GPIOF_INIT_HIGH - as output, set initial level to HIGH
* GPIOF_OPEN_DRAIN - gpio pin is open drain type.
* GPIOF_OPEN_SOURCE - gpio pin is open source type.
since GPIOF_INIT_* are only valid when configured as output, so group valid since GPIOF_INIT_* are only valid when configured as output, so group valid
combinations as: combinations as:
...@@ -310,8 +312,19 @@ combinations as: ...@@ -310,8 +312,19 @@ combinations as:
* GPIOF_OUT_INIT_LOW - configured as output, initial level LOW * GPIOF_OUT_INIT_LOW - configured as output, initial level LOW
* GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH * GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH
In the future, these flags can be extended to support more properties such When setting the flag as GPIOF_OPEN_DRAIN then it will assume that pins is
as open-drain status. open drain type. Such pins will not be driven to 1 in output mode. It is
require to connect pull-up on such pins. By enabling this flag, gpio lib will
make the direction to input when it is asked to set value of 1 in output mode
to make the pin HIGH. The pin is make to LOW by driving value 0 in output mode.
When setting the flag as GPIOF_OPEN_SOURCE then it will assume that pins is
open source type. Such pins will not be driven to 0 in output mode. It is
require to connect pull-down on such pin. By enabling this flag, gpio lib will
make the direction to input when it is asked to set value of 0 in output mode
to make the pin LOW. The pin is make to HIGH by driving value 1 in output mode.
In the future, these flags can be extended to support more properties.
Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is
introduced to encapsulate all three fields as: introduced to encapsulate all three fields as:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment