STRUCT GPIO_V2_LINE_ATTRIBUTE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 from enum 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 β€” if id is GPIO_V2_LINE_ATTR_ID_FLAGS, this is the flags for the GPIO line, with values from enum gpio_v2_line_flag, such as GPIO_V2_LINE_FLAG_ACTIVE_LOW, GPIO_V2_LINE_FLAG_OUTPUT etc, added together πŸ”₯. and heads up: this overrides the default flags contained in the struct gpio_v2_line_config for the associated line. it said "my line, my rules" πŸ’…
  • values β€” if id is GPIO_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 into struct gpio_v2_line_request.offsets. bit-by-bit, index-by-index, it's a whole matching system and it ate ⭐
  • debounce_period_us β€” if id is GPIO_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