acpi_get_gpiod(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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's 0-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 πŸŽ€


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