Skip to content

Commit 5ca84d4

Browse files
warthog618Bartosz Golaszewski
authored andcommitted
Documentation: gpio: Clarify effect of active low flag on line values
The documentation does not make sufficiently clear that the uAPI deals with logical line values, nor does it describe the influence of the active low flag on the mapping between physical and logical line values. Clarify the relationship between physical and logical line values and the effect of the active low flag for ioctls passing line values. Suggested-by: David C. Rankin <[email protected]> Signed-off-by: Kent Gibson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent 3ff1180 commit 5ca84d4

File tree

4 files changed

+28
-0
lines changed

4 files changed

+28
-0
lines changed

Documentation/userspace-api/gpio/gpio-handle-get-line-values-ioctl.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ Description
3636

3737
Get the values of all requested lines.
3838

39+
The values returned are logical, indicating if the line is active or inactive.
40+
The ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` flag controls the mapping between physical
41+
values (high/low) and logical values (active/inactive).
42+
If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is not set then high is active and
43+
low is inactive. If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is set then low is active
44+
and high is inactive.
45+
3946
The values of both input and output lines may be read.
4047

4148
For output lines, the value returned is driver and configuration dependent and

Documentation/userspace-api/gpio/gpio-handle-set-line-values-ioctl.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ Description
3636

3737
Set the values of all requested output lines.
3838

39+
The values set are logical, indicating if the line is to be active or inactive.
40+
The ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` flag controls the mapping between logical
41+
values (active/inactive) and physical values (high/low).
42+
If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is not set then active is high and
43+
inactive is low. If ``GPIOHANDLE_REQUEST_ACTIVE_LOW`` is set then active is low
44+
and inactive is high.
45+
3946
Only the values of output lines may be set.
4047
Attempting to set the value of input lines is an error (**EPERM**).
4148

Documentation/userspace-api/gpio/gpio-v2-line-get-values-ioctl.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ Description
3434

3535
Get the values of requested lines.
3636

37+
The values returned are logical, indicating if the line is active or inactive.
38+
The ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` flag controls the mapping between physical
39+
values (high/low) and logical values (active/inactive).
40+
If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is not set then high is active and low is
41+
inactive. If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is set then low is active and
42+
high is inactive.
43+
3744
The values of both input and output lines may be read.
3845

3946
For output lines, the value returned is driver and configuration dependent and

Documentation/userspace-api/gpio/gpio-v2-line-set-values-ioctl.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ Description
3535

3636
Set the values of requested output lines.
3737

38+
The values set are logical, indicating if the line is to be active or inactive.
39+
The ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` flag controls the mapping between logical
40+
values (active/inactive) and physical values (high/low).
41+
If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is not set then active is high and inactive
42+
is low. If ``GPIO_V2_LINE_FLAG_ACTIVE_LOW`` is set then active is low and
43+
inactive is high.
44+
3845
Only the values of output lines may be set.
3946
Attempting to set the value of an input line is an error (**EPERM**).
4047

0 commit comments

Comments
 (0)