gpiod_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 gpiod_get(9) β€” NAME 🌸

okay so bestie, this page is straight out of the Kernel API Manual, and it's about gpiod_get β€” literally β€œobtain a GPIO for a given GPIO function” πŸ’…βœ¨.


πŸŽ€ SYNOPSIS πŸŽ€

struct gpio_desc * gpiod_get (struct device *dev , const char *con_id ,
       enum gpiod_flags flags );

πŸ’… ARGUMENTS πŸ’…

  • dev β€” the GPIO consumer, and yes it can be NULL for system-global GPIOs 🫢
  • con_id β€” the function within the GPIO consumer
  • flags β€” optional GPIO initialization flags ✨

πŸ”₯ RETURN πŸ”₯

You get back the GPIO descriptor corresponding to the function con_id of device dev πŸ’–. If no GPIO has been assigned to the requested function, it's -ENOENT. And if some other error happened while trying to acquire the GPIO, you get another IS_ERR code. That's the tea πŸ˜­πŸ’….


🌈 SEE ALSO 🌈

Kernel file ./drivers/gpio/gpiolib.c β€” plus the whole iconic friend group, fr fr:


source/version: ./drivers/gpio β€’ date: October 2026 β€” mwah, periodt πŸ’‹πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from