acpi_get_gpiod_by_index(9)
π acpi_get_gpiod_by_index(9) π
okay bestie, this one is straight from the Kernel API Manual, and it's all about acpi_get_gpiod_by_index β your girl is gonna walk you through it, no cap π«Ά
πΈ NAME πΈ
acpi_get_gpiod_by_index β get a GPIO descriptor from device resources
β¨ SYNOPSIS β¨
int acpi_get_gpiod_by_index (struct acpi_device *adev , const char
*propname , struct acpi_gpio_lookup *lookup );
π ARGUMENTS π
adevβ pointer to a ACPI device to get GPIO frompropnameβ Property name of the GPIO (optional)lookupβ pointer tostruct acpi_gpio_lookupto fill in
π¦ DESCRIPTION π¦
Okay so this function goes through ACPI resources for adev and, based on lookup.index, looks up a GpioIo/GpioInt resource, translates it to the Linux GPIO descriptor, and returns it. lookup.index matches GpioIo/GpioInt resources only, so if there are total 3 GPIO resources, the index goes from 0 to 2. π
If propname is specified, the GPIO is looked using device property. In that case index is used to select the GPIO entry in the property value (in case of multiple).
The lookup is filled with GPIO descriptor to use with Linux generic GPIO API. If the GPIO cannot be translated an error will be returned.
β RETURN β
0 on success, negative errno on failure.
π NOTE π
if the GPIO resource has multiple entries in the pin list, this function only returns the first. π
π SEE ALSO π
- Kernel file
./drivers/gpio/gpiolib-acpi-core.c 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_from_data(9)acpi_dev_gpio_irq_wake_get_by(9)acpi_gpio_count(9)
and that's the whole page, bestie π source/version is ./drivers/gpio, date is October 2026, and it belongs to acpi_get_gpiod_by_index(9) β periodt π
π¦ 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