STRUCT GPIO_MOUSE(9)
π¦ struct gpio_mouse(9) π¦
okay bestie, welcome to the Kernel API Manual β we're doing struct gpio_mouse today and honestly? it's giving "small struct, big responsibility" β¨
πΈ NAME πΈ
struct gpio_mouse β (that's it, that's the name, the original page literally leaves the description blank and honestly? iconic. no notes. π
)
β¨ SYNOPSIS β¨
struct gpio_mouse {
u32 scan_ms;
struct gpio_desc *up;
struct gpio_desc *down;
struct gpio_desc *left;
struct gpio_desc *right;
struct gpio_desc *bleft;
struct gpio_desc *bmiddle;
struct gpio_desc *bright;
};
like, look at her. seven pointers and a u32. she's perfect π«Ά
π Members π
so bestie, here's the roster, one by one, no skips:
scan_msβ the scan interval in milliseconds. yes, the only member that isn't a pointer. she's the main character here ngl πupβ GPIO line for the up value. β¬οΈdownβ GPIO line for the down value. β¬οΈleftβ GPIO line for the left value. β¬ οΈrightβ GPIO line for the right value. β‘οΈbleftβ GPIO line for the left button. (thebis for button, iykyk π±οΈ)bmiddleβ GPIO line for the middle button. π±οΈbrightβ GPIO line for the right button. (and not "bright" like the light, it's b + right, don't let the name jump-scare you fr fr π)
vibe check: four of these are directions, three are buttons, and one is a millisecond number. memorize the difference and you're slaying.
π Description π
so here's the tea β β this struct must be added to the platform_device in the board code. like, not optional, not "if you feel like it", it must be there.
and what's it for? it's used by the gpio_mouse driver to do two things:
- setup GPIO lines
- calculate mouse movement
that's the whole job. she sets up the lines, she does the math on the movement, she goes home. periodt. π
π₯ SEE ALSO π₯
- Kernel file
./drivers/input/mouse/gpio_mouse.cβ go read the source, bestie, it's right there, it's free, it's educational π
and that's the whole page!! go forth and build your tiny GPIO mouse, you absolute icon π§π
mwah π β this little dispatch came to you from ./drivers/input/mouse, dated October 2026, and yes she's still serving struct gpio_mouse(9) realness. byeee πβ¨
π¦ 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