acpi_get_gpiod(9)
β¨ acpi_get_gpiod β¨
okay so bestie, welcome to the acpi_get_gpiod(9) page from the Kernel API Manual π
this one's a little function with a big job: it takes an ACPI GPIO pin and hands you back a GPIO descriptor you can actually use with the GPIO API. iconic behavior, honestly π
πΈ NAME πΈ
acpi_get_gpiod β translate an ACPI GPIO pin into a GPIO descriptor that's usable with the GPIO API π¦
β¨ SYNOPSIS β¨
struct gpio_desc * acpi_get_gpiod (char *path , unsigned int pin );
π ARGUMENTS π
pathβ the full path name of the ACPI GPIO controller, like for example"\_SB.GPO1"πpinβ the ACPI GPIO pin number, and ngl it's0-based and controller-relative π«Ά
π RETURN π
you get back a GPIO descriptor, which is the thing you use with the Linux generic GPIO API β¨ and if the GPIO can't be translated, or literally anything goes wrong, you get an ERR_PTR back instead π so yeah, check that thing.
π¦ DESCRIPTION π¦
so specifically β and this is the part you gotta remember β it returns -EPROBE_DEFER if the GPIO controller it's pointing at doesn't have a GPIO chip registered at that exact moment π and that's on purpose! it's to support probe deferral, which is very main character of it honestly π
π SEE ALSO π
- the kernel file
./drivers/gpio/gpiolib-acpi-core.cπ struct acpi_gpio_event(9)struct acpi_gpio_info(9)acpi_gpio_get_io_resource(9)acpi_gpiochip_request_interrupts(9)acpi_gpiochip_free_interrupts(9)acpi_get_gpiod_by_index(9)acpi_get_gpiod_from_data(9)acpi_dev_gpio_irq_wake_get_by(9)acpi_gpio_count(9)
okay that's the whole page, no cap π quick little sign-off: this one lives under ./drivers/gpio, it's dated October 2026, and yeah β slay, go 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