History

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.

Kent Gibson committed 2 years ago

Commit 8ff0d551 parent be91c191 file · +6 −5Browse files

Unified · Split

include/uapi/linux/gpio.h+6−5
@@ -399,8 +399,8 @@ struct gpioline_info_changed { · 398 unmodified lines
399 * a batch of input or output lines, but they must all have the same399 * a batch of input or output lines, but they must all have the same
400 * characteristics, i.e. all inputs or all outputs, all active low etc400 * characteristics, i.e. all inputs or all outputs, all active low etc
401 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested401 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set for a requested
402 * line, this specifies the default output value, should be 0 (low) or402 * line, this specifies the default output value, should be 0 (inactive) or
403 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)403 * 1 (active). Anything other than 0 or 1 will be interpreted as active.
404 * @consumer_label: a desired consumer label for the selected GPIO line(s)404 * @consumer_label: a desired consumer label for the selected GPIO line(s)
405 * such as "my-bitbanged-relay"405 * such as "my-bitbanged-relay"
406 * @lines: number of lines requested in this request, i.e. the number of406 * @lines: number of lines requested in this request, i.e. the number of
@@ -426,8 +426,8 @@ struct gpiohandle_request { · 19 unmodified lines
426 * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added426 * %GPIOHANDLE_REQUEST_OUTPUT, %GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added
427 * together427 * together
428 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags,428 * @default_values: if the %GPIOHANDLE_REQUEST_OUTPUT is set in flags,
429 * this specifies the default output value, should be 0 (low) or429 * this specifies the default output value, should be 0 (inactive) or
430 * 1 (high), anything else than 0 or 1 will be interpreted as 1 (high)430 * 1 (active). Anything other than 0 or 1 will be interpreted as active.
431 * @padding: reserved for future use and should be zero filled431 * @padding: reserved for future use and should be zero filled
432 *432 *
433 * Note: This struct is part of ABI v1 and is deprecated.433 * Note: This struct is part of ABI v1 and is deprecated.
@@ -443,7 +443,8 @@ struct gpiohandle_config { · 9 unmodified lines
443 * struct gpiohandle_data - Information of values on a GPIO handle443 * struct gpiohandle_data - Information of values on a GPIO handle
444 * @values: when getting the state of lines this contains the current444 * @values: when getting the state of lines this contains the current
445 * state of a line, when setting the state of lines these should contain445 * state of a line, when setting the state of lines these should contain
446 * the desired target state446 * 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.
447 *448 *
448 * Note: This struct is part of ABI v1 and is deprecated.449 * Note: This struct is part of ABI v1 and is deprecated.
449 * Use ABI v2 and &struct gpio_v2_line_values instead.450 * Use ABI v2 and &struct gpio_v2_line_values instead.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t