for_each_req...pio_in_range(9)
π for_each_requested_gpio_in_range β Kernel API Manual (yes that's the manual name, we're fancy)
okay so bestie, picture this: you've got a range of GPIOs and you only care about the ones that somebody actually requested. This thing iterates over requested GPIOs in a given range π That's it. That's the whole vibe. No cap.
It's literally the iterator your for-loop dreams are made of β¨
β¨ SYNOPSIS β¨
for_each_requested_gpio_in_range (_chip , _i , _base , _size , _label );
(the spaces are exactly like that, don't @ me, copy it verbatim or it won't compile π₯)
πΈ ARGUMENTS πΈ
_chipβ the chip to query π«Ά like, which chip are we even talking to here_iβ the loop variable π« your classici, doing main character energy work_baseβ first GPIO in the range β where the party starts_sizeβ amount of GPIOs to check starting from_baseπ so it's_baseonward,_sizeof them, got it_labelβ label of current GPIO π¦ the little name tag so you know which one you're looking at
every single one of those args gets passed in exactly as written, underscore and all β they're the macro's own names, not placeholders for you to rename π
π SEE ALSO π
like, go read these next, they're iconic:
Kernel file ./include/linux/gpio/driver.hstruct gpio_irq_chip(9)struct gpio_chip(9)for_each_hwgpio_in_range(9)for_each_hwgpio(9)gpiochip_add_data(9)struct gpio_pin_range(9)
and that's the whole page, bestie π mwah π
This absolute gem comes to you from ./include/linux/gpio, dated October 2026 β periodt, that's the sign-off, go touch some hardware π§ββοΈπ
π¦ 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