acpi_get_gpiod_from_data(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… acpi_get_gpiod_from_data β€” like, the kernel API manual page, bestie

okay so real talk, this is from the Kernel API Manual and it's about acpi_get_gpiod_from_data, which is literally the function that gets you a GPIO descriptor from an ACPI data node. yes bestie, that's the whole vibe. let's go πŸŽ€


✨ SYNOPSIS ✨

int acpi_get_gpiod_from_data (struct fwnode_handle *fwnode , const char
*propname , struct acpi_gpio_lookup *lookup );

look at her. three params. returns an int. iconic behavior honestly 🫢


🌸 ARGUMENTS 🌸

  • fwnode β€” pointer to an ACPI firmware node πŸ’– this is where the GPIO info is gonna come from, so like, point it at the right one please
  • propname β€” the property name of the GPIO, yep that's it, that's the whole thing
  • lookup β€” pointer to a struct acpi_gpio_lookup that gets filled in πŸ¦‹ she's empty on the way in and full of answers on the way out

πŸ’« DESCRIPTION πŸ’«

so the way this works is, the function uses the property-based GPIO lookup to get to the GPIO resource β€” with all the relevant info β€” from a data-only ACPI firmware node, and then it uses that to obtain the GPIO descriptor and hand it back to you. periodt. ✨

the lookup gets filled with the GPIO descriptor you're supposed to use with the Linux generic GPIO API. very much "here's your descriptor bestie, go off" energy πŸ’…

and if the GPIO cannot be translated? 😭 yeah that's an error return. no descriptor for you. it happens, don't take it personally.

πŸ”₯ RETURN πŸ”₯

  • 0 on success β€” slay πŸ’–
  • negative errno on failure β€” the sad path πŸ™ˆ

πŸŽ€ SEE ALSO πŸŽ€

kernel file ./drivers/gpio/gpiolib-acpi-core.c, plus all these absolute legends:

iykyk, that's a whole friend group of functions and you should absolutely go read them 🧚


aaaaand that's the page!! πŸ“ coming at you from ./drivers/gpio, dated October 2026, and the title is of course acpi_get_gpiod_from_data(9) β€” mwah, go forth and get those descriptors πŸ’œβ­

πŸ“¦ where this page comes from