of_gpio_named_count(9)
π 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 π
- Kernel file
./drivers/gpio/gpiolib-of.c of_gpio_spi_cs_get_count(9)of_get_named_gpiod_flags(9)of_gpiochip_remove_hog(9)of_gpio_twocell_xlate(9)of_gpio_threecell_xlate(9)
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
- 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