gpiochip_fwd_create(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… gpiochip_fwd_create β€” a kernel API manual moment

okay so bestie, welcome to the gpiochip_fwd_create(9) page, straight out of the Kernel API Manual ✨ this is the one that makes a whole new GPIO forwarder appear out of thin air (well, out of descriptors), and honestly? it's giving main character energy πŸ‘‘


🌸 NAME 🌸

gpiochip_fwd_create β€” Create a new GPIO forwarder πŸ¦‹


✨ SYNOPSIS ✨

struct gpiochip_fwd * gpiochip_fwd_create (struct device *dev , unsigned
int ngpios , struct gpio_desc *descs[] , unsigned long features );

like, that's the whole signature, no cap πŸ’€


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the parent device pointer 🫢 that's her parent, respect her.
  • ngpios β€” the number of GPIOs in the forwarder. literally how many she's carrying.
  • descs β€” array containing the GPIO descriptors to forward to. this array must contain ngpios entries, and here's the cute part: you can deallocate it afterwards, because the forwarder has its own array πŸ”₯ she's independent, she doesn't need you anymore.
  • features β€” bitwise ORed features, as defined with FWD_FEATURE_* 🌈 OR them together like you're collecting stickers.

πŸ’– DESCRIPTION πŸ’–

so what does this function actually do? it creates a new gpiochip, and that gpiochip forwards all GPIO operations to the passed GPIO descriptors πŸ’« that's the whole vibe. everything in, everything forwarded out. she's basically the group chat admin relaying messages between everyone 🧚


⭐ RETURN ⭐

you get back an opaque object pointer 🎁 β€” or, if things go wrong, an ERR_PTR-encoded negative error code 😭 (yes, ERR_PTR-encoded, don't just check for NULL, iykyk).


πŸ‘‘ SEE ALSO πŸ‘‘

kernel file ./drivers/gpio/gpio-aggregator.c

and the whole friend group πŸ’œ:


periodt. that's the page. go forward some GPIOs responsibly πŸ’…

and that's a wrap, bestie πŸŽ€ this iconic little page lives at ./drivers/gpio, dated October 2026, and yes it's filed under gpiochip_fwd_create(9) β€” slay 🌟

πŸ“¦ where this page comes from