STRUCT GPIOHANDLE_CONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct gpiohandle_config(9) β€” Kernel API Manual, but make it make sense

okay so bestie, welcome to the struct gpiohandle_config page πŸ’– this is one of those kernel API man pages (manual section 9, iykyk) and we're gonna get you through it. it's giving "small struct, big lore" and honestly? iconic. let's go ✨

🌸 NAME 🌸

struct gpiohandle_config β€” the configuration for a GPIO handle request, periodt πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole shape of it, no cap, copy it exactly:

struct gpiohandle_config {
    __u32 flags;
    __u8 default_values[GPIOHANDLES_MAX];
    __u32 padding[4];
 };

that's it. three fields. tiny little baby struct 🍼 but every one of them matters, so let's do a vibe check on each.


πŸ‘‘ Members πŸ‘‘

  • flags β€” the updated flags for the GPIO lines you're requesting, things like GPIOHANDLE_REQUEST_OUTPUT, GPIOHANDLE_REQUEST_ACTIVE_LOW etc, added together. yeah, you stack 'em up, it's a little combo meal πŸ“
  • default_values β€” okay so if GPIOHANDLE_REQUEST_OUTPUT is set in flags, this field specifies the default output value. it should be 0 (inactive) or 1 (active). and here's the quirky part πŸ‘€ anything other than 0 or 1 will be interpreted as active. so like... not 0? you're active. sorry bestie, that's just the rules πŸ’…
  • padding β€” reserved for future use and should be zero filled. it's literally just holding space for its future self 🫢 zero fill it, don't be weird about it.

⚠️ Note ⚠️

alright, listen up, this one's important 😭 this struct is part of ABI v1 and is deprecated. so if you're out here writing new code with it... bestie. no. use ABI v2 and struct gpio_v2_line_config instead. the old one still exists but it's giving legacy energy πŸ’€

🌈 SEE ALSO 🌈

this page has a lot of friends, and we're not leaving a single one out β€” go read up on all of these, fr fr:

  • Kernel file ./include/uapi/linux/gpio.h
  • 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_attribute(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_data(9)
  • struct gpioevent_request(9)
  • struct gpioevent_data(9)

that's the whole page, you ate it up πŸ’œ this one's sourced from ./include/uapi/linux, dated October 2026, and it's filed under struct gpiohandle_config(9). go forth and configure responsibly, main character 🧚⭐

πŸ“¦ where this page comes from