ENUM GPIO_REGMAP_OPERATION(9)
π NAME π
enum gpio_regmap_operation β okay so this is the operation type for your gpio_regmap callbacks, bestie. That's the whole vibe. It's an enum, it tells things what kinda op they're doing, and honestly it ate.
This page lives in the Kernel API Manual, and yeah, the function is enum gpio_regmap_operation(9) β iconic, no notes.
β¨ SYNOPSIS β¨
enum gpio_regmap_operation {
GPIO_REGMAP_GET_OP ,
GPIO_REGMAP_SET_OP ,
GPIO_REGMAP_GET_DIR_OP ,
GPIO_REGMAP_SET_DIR_OP
};
Look at her. Four members, zero drama (mostly). π
π¦ Constants π¦
These are the four moods the enum can be in, and each one is lowkey doing exactly what it says on the label:
GPIO_REGMAP_GET_OPβ the "read" mood π β it indicates a read operation to get the current GPIO value.GPIO_REGMAP_SET_OPβ the "write" mood βοΈ β it indicates a write operation to set the GPIO output value.GPIO_REGMAP_GET_DIR_OPβ the "which way are we pointing" read mood π§ β it indicates a read operation to get the GPIO direction.GPIO_REGMAP_SET_DIR_OPβ the "okay point this way" write mood π β it indicates a write operation to set the GPIO direction.
πΈ Description πΈ
So here's the lore, and tbh it's giving "we tried it the old way and it did not slay."
Traditionally, the operation type was inferred from the base register. Simple, cute, worked sometimes. But β and this is the important part, bestie β that approach does not always work. For example, when all control bits of a single GPIO reside in the same register, the whole "just look at the base register" trick falls apart ππ.
Enter this enum. It allows the callbacks (reg_mask_xlate and value_xlate) to explicitly distinguish between operation types. No guessing, no vibe-checking the register, just β¨clarityβ¨.
And because the kernel respects your autonomy: the user is free to choose which method to use. Your code, your rules, periodt. π«Ά
Then the page hits us with these β¨literally threeβ¨ headings and honestly they're main-character energy with no supporting cast:
Read operation:
Write operation:
Direction operations:
(Yeah β that's it. That's the whole bit. The page puts them there and leaves them hanging, no cap. Not me waiting for the rest of the sentence π.)
π SEE ALSO π
- Kernel file
./include/linux/gpio/regmap.hβ go read her, she's the source of truth π¦ struct gpio_regmap_config(9)β the struct bestie that makes all this work π
β aaaand that's the page!! go touch some registers (responsibly) ππ
Sign-off time: this one comes from ./include/linux/gpio, stamped October 2026, and yeah β it's enum gpio_regmap_operation(9) all the way down. mwah ππ§
π¦ 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