Skip to content

Commit 8ff0d55

Browse files
warthog618Bartosz Golaszewski
authored andcommitted
gpio: uapi: clarify default_values being logical
The documentation for default_values mentions high/low which can be confusing, particularly when the ACTIVE_LOW flag is set. Replace high/low with active/inactive to clarify that the values are logical not physical. Similarly, clarify the interpretation of values in struct gpiohandle_data. Signed-off-by: Kent Gibson <[email protected]> Reviewed-by: Andy Shevchenko <[email protected]> Acked-by: Linus Walleij <[email protected]> Signed-off-by: Bartosz Golaszewski <[email protected]>
1 parent be91c19 commit 8ff0d55

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

include/uapi/linux/gpio.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -399,8 +399,8 @@ struct gpioline_info_changed {
399399
* a batch of input or output lines, but they must all have the same
400400
* characteristics, i.e. all inputs or all outputs, all active low etc
401401
* @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested
402-
* line, this specifies the default output value, should be 0 (low) or
403-
* 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
402+
* line, this specifies the default output value, should be 0 (inactive) or
403+
* 1 (active). Anything other than 0 or 1 will be interpreted as active.
404404
* @consumer_label: a desired consumer label for the selected GPIO line(s)
405405
* such as "my-bitbanged-relay"
406406
* @lines: number of lines requested in this request, i.e. the number of
@@ -426,8 +426,8 @@ struct gpiohandle_request {
426426
* %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added
427427
* together
428428
* @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags,
429-
* this specifies the default output value, should be 0 (low) or
430-
* 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)
429+
* this specifies the default output value, should be 0 (inactive) or
430+
* 1 (active). Anything other than 0 or 1 will be interpreted as active.
431431
* @padding: reserved for future use and should be zero filled
432432
*
433433
* Note: This struct is part of ABI v1 and is deprecated.
@@ -443,7 +443,8 @@ struct gpiohandle_config {
443443
* struct gpiohandle_data - Information of values on a GPIO handle
444444
* @values: when getting the state of lines this contains the current
445445
* state of a line, when setting the state of lines these should contain
446-
* the desired target state
446+
* the desired target state. States are 0 (inactive) or 1 (active).
447+
* When setting, anything other than 0 or 1 will be interpreted as active.
447448
*
448449
* Note: This struct is part of ABI v1 and is deprecated.
449450
* Use ABI v2 and &struct gpio_v2_line_values instead.

0 commit comments

Comments
 (0)