acpi_get_gpiod_from_data(9)
π 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 pleasepropnameβ the property name of the GPIO, yep that's it, that's the whole thinglookupβ pointer to astruct acpi_gpio_lookupthat 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 π₯
0on success β slay π- negative
errnoon failure β the sad path π
π SEE ALSO π
kernel file ./drivers/gpio/gpiolib-acpi-core.c, plus all these absolute legends:
struct acpi_gpio_event(9)struct acpi_gpio_info(9)acpi_get_gpiod(9)acpi_gpio_get_io_resource(9)acpi_gpiochip_request_interrupts(9)acpi_gpiochip_free_interrupts(9)acpi_get_gpiod_by_index(9)acpi_dev_gpio_irq_wake_get_by(9)acpi_gpio_count(9)
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
- 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