STRUCT GPIOD_LOOKUP(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

struct gpiod_lookup β€” it's the lookup table, bestie πŸ’… (and yes, this is the struct gpiod_lookup(9) page from the Kernel API Manual, we're getting into it)

πŸŽ€ SYNOPSIS πŸŽ€

struct gpiod_lookup {
    const char *key;
    u16 chip_hwnum;
    const char *con_id;
    unsigned int idx;
    unsigned long flags;
};

πŸ¦‹ Members πŸ¦‹

  • key β€” ngl this one's doing double duty πŸ‘‘ It's either the name of the chip the GPIO belongs to, or the GPIO line name. But listen β€” GPIO line names are not guaranteed to be globally unique, so this is gonna use the first match found! No cap, first one wins, that's just how it is 😭
  • chip_hwnum β€” the hardware number of the GPIO, i.e. relative to the chip 🧚 Or you can drop U16_MAX in here to say "hey, key is actually a GPIO line name" πŸ’€
  • con_id β€” the name of the GPIO from the device's point of view 🫢 Like, how the device sees it, not the chip.
  • idx β€” the index of the GPIO, for when several GPIOs are sharing the same name πŸ™ˆ (squad goals but make it ambiguous)
  • flags β€” a bitmask of gpio_lookup_flags GPIO_* values ⭐

🌸 Description 🌸

Okay so gpiod_lookup is literally a lookup table for associating GPIOs to specific devices and functions using platform data ✨ That's the whole vibe. It's the little matchmaker between your GPIOs and the devices that need them πŸ’–


🌈 SEE ALSO 🌈

  • Kernel file ./include/linux/gpio/machine.h πŸ‘‘

That's the whole page, bestie β€” no crumbs left πŸ’… Sending you off with the source/version line: this lil beauty lives in ./include/linux/gpio and it's stamped October 2026 πŸŽ€ Now go forth and lookup, you icon πŸ¦‹βœ¨

πŸ“¦ where this page comes from