STRUCT ALPS_DATA(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– NAME ๐Ÿ’–

struct alps_data โ€” the private data structure for the ALPS driver, aka the driver's own little diary that nobody else gets to read ๐Ÿ“”โœจ

(hi bestie, welcome to struct alps_data(9), straight out of the Kernel API Manual โ€” yes we're in the kernel docs and yes we're gonna have a good time ๐Ÿซถ)


โœจ SYNOPSIS โœจ

okay so the whole thing looks like this, and I need you to look at it with your whole chest because it's lowkey a lot:

struct alps_data {
    struct psmouse *psmouse;
    struct input_dev *dev2;
    struct input_dev *dev3;
    char phys2[32];
    char phys3[32];
    struct work_struct dev3_register_work;
    const struct alps_nibble_commands *nibble_commands;
    int addr_command;
    u16 proto_version;
    u8 byte0, mask0;
    u8 dev_id[3];
    u8 fw_ver[3];
    int flags;
    int x_max;
    int y_max;
    int x_bits;
    int y_bits;
    unsigned int x_res;
    unsigned int y_res;
    int (*hw_init)(struct psmouse *psmouse);
    void (*process_packet)(struct psmouse *psmouse);
    int (*decode_fields)(struct alps_fields *f, unsigned char *p, struct psmouse *psmouse);
    void (*set_abs_params)(struct alps_data *priv, struct input_dev *dev1);
    int prev_fin;
    int multi_packet;
    int second_touch;
    unsigned char multi_data[6];
    struct alps_fields f;
    u8 quirks;
    struct timer_list timer;
 };

no cap, that's the whole vibe. now let's go field by field ๐Ÿ’…


๐ŸŽ€ MEMBERS ๐ŸŽ€

okay so EVERY member, in order, no skipping, because we do not leave lore on the table:

  • psmouse โ€” pointer to the parent psmouse device. it's giving "my mom is the psmouse device" energy ๐Ÿ‘‘
  • dev2 โ€” the trackstick device. and guess what, it can be NULL ๐Ÿ™ˆ
  • dev3 โ€” a generic PS/2 mouse. also can be NULL, and its registering is delayed โ€” it's running late, like me to literally everything โฐ
  • phys2 โ€” the physical path for the trackstick device ๐Ÿ›ค๏ธ
  • phys3 โ€” the physical path for the generic PS/2 mouse ๐Ÿ›ค๏ธ
  • dev3_register_work โ€” a work instance used for registering the PS/2 mouse. it's the little task that gets the generic mouse through the door ๐Ÿšช
  • nibble_commands โ€” the command mapping used for touchpad register accesses. nibble. nibble. ๐Ÿ“ iykyk
  • addr_command โ€” the command used to tell the touchpad that a register address is coming next. it's literally "hey babe, an address follows" ๐Ÿ“ฌ
  • proto_version โ€” tells you if this is V1/V2/V3/... ๐Ÿ”ข (yes the "..." is doing a lot of heavy lifting, don't come for it)
  • byte0 โ€” helps figure out whether a position report packet matches the known format for this model. the first byte of the report, ANDed with mask0, should match byte0. ok so byte0 & mask0 == byte0-core, if you will โœจ
  • mask0 โ€” the mask used to check the first byte of the report ๐ŸŽญ
  • fw_ver โ€” a cached copy of the firmware version (EC report). it's not live, it's a screenshot ๐Ÿ“ธ
  • flags โ€” additional device capabilities (passthrough port, trackstick, etc.) ๐Ÿšฉ
  • x_max โ€” largest possible X position value ๐Ÿ“
  • y_max โ€” largest possible Y position value ๐Ÿ“
  • x_bits โ€” number of X bits in the MT bitmap ๐Ÿงฎ
  • y_bits โ€” number of Y bits in the MT bitmap ๐Ÿงฎ
  • hw_init โ€” protocol-specific hardware init function. main character energy for the setup arc ๐ŸŒฑ
  • process_packet โ€” protocol-specific function to process a report packet ๐Ÿ“ฆ
  • decode_fields โ€” protocol-specific function to read packet bitfields ๐Ÿ”
  • set_abs_params โ€” protocol-specific function to configure the input_dev โš™๏ธ
  • prev_fin โ€” the finger bit from the previous packet ๐Ÿ‘† (fin = finger, not fish, bestie)
  • multi_packet โ€” multi-packet data currently in progress ๐Ÿšง
  • multi_data โ€” saved multi-packet data ๐Ÿ’พ
  • f โ€” decoded packet data fields, living in a struct alps_fields ๐Ÿ—‚๏ธ
  • quirks โ€” bitmap of ALPS_QUIRK_* ๐Ÿ’… (quirks are the personality traits of hardware)
  • timer โ€” timer for flushing out the final report packet in the stream ๐Ÿšฝโœจ (flush. get it. it's a timer.)
bestie real talk: the struct also has dev_id, x_res, y_res, and second_touch up in the synopsis, but this page doesn't describe them. I am NOT inventing lore. we simply do not know them like that ๐Ÿคทโ€โ™€๏ธ

๐Ÿฆ‹ SEE ALSO ๐Ÿฆ‹

go read these next, they're literally in the kernel file ./drivers/input/mouse/alps.h:

  • struct alps_protocol_info(9)
  • struct alps_model_info(9)
  • struct alps_nibble_commands(9)
  • struct alps_fields(9)

๐ŸŒธ and that's the page!! this whole thing lives in ./drivers/input/mouse, it's dated October 2026, and it's filed under struct alps_data(9) โ€” go off, kernel docs, you ate ๐Ÿ’…๐Ÿ’–โœจ๐ŸŽ€

๐Ÿ“ฆ where this page comes from