desc_to_gpio(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay bestie, pull up a chair β€” this is desc_to_gpio(9) from the Kernel API Manual, and we're gonna make it make sense πŸ’…βœ¨

πŸ’– NAME πŸ’–

desc_to_gpio β€” convert a GPIO descriptor to the integer namespace πŸ¦‹

✨ SYNOPSIS ✨

int desc_to_gpio (const struct gpio_desc *desc );

πŸŽ€ ARGUMENTS πŸŽ€

  • desc β€” the GPIO descriptor, aka the little handle bestie is holding 🫢

🌸 DESCRIPTION 🌸

So this one is lowkey on its way out. Like, it literally should disappear in the future, no cap. But rn we still need it because we still use GPIO numbers for error messages and sysfs nodes. So it stays for now, doing its main character legacy thing πŸ’€βœ¨

πŸ”₯ RETURN πŸ”₯

The global GPIO number for the GPIO specified by its descriptor. That's the whole vibe: hand over the descriptor, get the global number back πŸ‘‘

🌈 SEE ALSO 🌈

The kernel file is ./drivers/gpio/gpiolib.c, and here's the entire friend group you should also go say hi to:


signed with love by ./drivers/gpio πŸ“, dated October 2026 πŸ—“οΈ, and filed under desc_to_gpio(9) πŸ’–πŸ«Ά

πŸ“¦ where this page comes from