STRUCT GPIO_V2_LINE_ATTRIBUTE(9)
π struct gpio_v2_line_attribute(9) β Kernel API Manual
okay so bestie, welcome to the Kernel API Manual β¨ and today's main character is struct gpio_v2_line_attribute β literally a configurable attribute of a line π. that's it, that's the name. no cap.
β¨ SYNOPSIS β¨
here's the whole vibe, exactly as it lives, don't touch a single character π«Ά:
struct gpio_v2_line_attribute {
__u32 id;
__u32 padding;
union {
__aligned_u64 flags;
__aligned_u64 values;
__u32 debounce_period_us;
};
};
that anonymous union is lowkey the moment, iykyk π
πΈ Members πΈ
idβ the attribute identifier, and it takes its value fromenum gpio_v2_line_attr_id. this is the "which one are we doing" field, it's giving director's chair π¬paddingβ reserved for future use, and it must be zero filled. like, not "probably", not "if you feel like it" β must. zero. filled. periodt π{unnamed_union}β anonymous. it has no name, it just is. main character energy with zero introduction π¦flagsβ ifidisGPIO_V2_LINE_ATTR_ID_FLAGS, this is the flags for the GPIO line, with values fromenum gpio_v2_line_flag, such asGPIO_V2_LINE_FLAG_ACTIVE_LOW,GPIO_V2_LINE_FLAG_OUTPUTetc, added together π₯. and heads up: this overrides the default flags contained in thestruct gpio_v2_line_configfor the associated line. it said "my line, my rules" πvaluesβ ifidisGPIO_V2_LINE_ATTR_ID_OUTPUT_VALUES, this is a bitmap containing the values to which the lines will be set, with each bit number corresponding to the index intostruct gpio_v2_line_request.offsets. bit-by-bit, index-by-index, it's a whole matching system and it ate βdebounce_period_usβ ifidisGPIO_V2_LINE_ATTR_ID_DEBOUNCE, this is the desired debounce period, in microseconds. tiny number, big job, obsessed π
π§ SEE ALSO π§
go read the kernel file ./include/uapi/linux/gpio.h and then go off bestie, because there is a whole friend group here:
struct gpiochip_info(9), enum gpio_v2_line_flag(9), struct gpio_v2_line_values(9), enum gpio_v2_line_attr_id(9), struct gpio_v2_line_config_attribute(9), struct gpio_v2_line_config(9), struct gpio_v2_line_request(9), struct gpio_v2_line_info(9), enum gpio_v2_line_changed_type(9), struct gpio_v2_line_info_changed(9), enum gpio_v2_line_event_id(9), struct gpio_v2_line_event(9), struct gpioline_info(9), struct gpioline_info_changed(9), struct gpiohandle_request(9), struct gpiohandle_config(9), struct gpiohandle_data(9), struct gpioevent_request(9), struct gpioevent_data(9) π
ngl the padding field is not a suggestion. zero fill it or the vibe check fails π
okay that's the whole page, ily, go write some gpio code π
β cute lil sign-off: this one came from ./include/uapi/linux, dated October 2026, and yes the title really is abbreviated to struct gpio...ne_attribute(9) in the corners, slay πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms