acpi_get_gpiod_by_index(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– 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 from
  • propname β€” Property name of the GPIO (optional)
  • lookup β€” pointer to struct acpi_gpio_lookup to 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 🌈


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