Skip to content

Commit 3d2ddfd

Browse files
ldewanganglikely
authored andcommitted
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: Laxman Dewangan <[email protected]> Reviwed-by: Mark Brown <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Grant Likely <[email protected]>
1 parent 6e2cf65 commit 3d2ddfd

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

Documentation/gpio.txt

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ where 'flags' is currently defined to specify the following properties:
302302

303303
* GPIOF_INIT_LOW - as output, set initial level to LOW
304304
* GPIOF_INIT_HIGH - as output, set initial level to HIGH
305+
* GPIOF_OPEN_DRAIN - gpio pin is open drain type.
306+
* GPIOF_OPEN_SOURCE - gpio pin is open source type.
305307

306308
since GPIOF_INIT_* are only valid when configured as output, so group valid
307309
combinations as:
@@ -310,8 +312,19 @@ combinations as:
310312
* GPIOF_OUT_INIT_LOW - configured as output, initial level LOW
311313
* GPIOF_OUT_INIT_HIGH - configured as output, initial level HIGH
312314

313-
In the future, these flags can be extended to support more properties such
314-
as open-drain status.
315+
When setting the flag as GPIOF_OPEN_DRAIN then it will assume that pins is
316+
open drain type. Such pins will not be driven to 1 in output mode. It is
317+
require to connect pull-up on such pins. By enabling this flag, gpio lib will
318+
make the direction to input when it is asked to set value of 1 in output mode
319+
to make the pin HIGH. The pin is make to LOW by driving value 0 in output mode.
320+
321+
When setting the flag as GPIOF_OPEN_SOURCE then it will assume that pins is
322+
open source type. Such pins will not be driven to 0 in output mode. It is
323+
require to connect pull-down on such pin. By enabling this flag, gpio lib will
324+
make the direction to input when it is asked to set value of 0 in output mode
325+
to make the pin LOW. The pin is make to HIGH by driving value 1 in output mode.
326+
327+
In the future, these flags can be extended to support more properties.
315328

316329
Further more, to ease the claim/release of multiple GPIOs, 'struct gpio' is
317330
introduced to encapsulate all three fields as:

0 commit comments

Comments
 (0)