STRUCT GPIOHANDLE_CONFIG(9)
π 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 likeGPIOHANDLE_REQUEST_OUTPUT,GPIOHANDLE_REQUEST_ACTIVE_LOWetc, added together. yeah, you stack 'em up, it's a little combo meal πdefault_valuesβ okay so ifGPIOHANDLE_REQUEST_OUTPUTis set inflags, this field specifies the default output value. it should be0(inactive) or1(active). and here's the quirky part π anything other than0or1will be interpreted as active. so like... not0? 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
- 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