of_gpio_named_count(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… of_gpio_named_count(9) β€” the Kernel API Manual, bestie edition πŸ’…

🌸 NAME 🌸

of_gpio_named_count β€” Count GPIOs for a device. That's the whole mission, icon behavior only.

✨ SYNOPSIS ✨

int of_gpio_named_count (const struct device_node *np , const char
       *propname );

πŸŽ€ ARGUMENTS πŸŽ€

  • np β€” device node to count GPIOs for. Like, whose GPIOs are we counting, bestie?
  • propname β€” property name containing gpio specifier(s). Yes, that exact spelling: gpio specifier(s).

πŸ¦‹ DESCRIPTION πŸ¦‹

Okay so the function returns the count of GPIOs specified for a node. Simple. It's giving "I just count, I don't judge."

Example, because visuals help:

gpios = <0
         gpio1 1 2
         0
         gpio2 3 4>;

The above example defines four GPIOs, two of which are not specified. This function will return '4'. And yes, the unspecified ones still get counted β€” no cap.

🫢 NOTE 🫢

The empty GPIO specifiers count too. Like, they still show up to the party and they're on the list. πŸ’…

πŸ”₯ RETURN πŸ”₯

Either number of GPIOs defined in the property, or:

  • -EINVAL β€” for an incorrectly formed "gpios" property, or
  • -ENOENT β€” for a missing "gpios" property.

🌈 SEE ALSO 🌈

Go be curious, iykyk ✨


mwah πŸ’‹ β€” this page is living in source/version ./drivers/gpio and is dated October 2026. drink water and stan kernel docs 🫢

πŸ“¦ where this page comes from