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

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/gpio.h+6−5
@@ -399,8 +399,8 @@ struct gpioline_info_changed { · 398 unmodified lines
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 { · 19 unmodified lines
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 { · 9 unmodified lines
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.

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