STRUCT QUAD8(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct quad8(9) ✨

okay so bestie, welcome to the struct quad8(9) glow-up πŸ’… this is a page from the Kernel API Manual, and it's literally just one struct β€” but she's that girl. it's the device private data structure, aka the little backpack this driver carries around for every quad8 device it babysits. πŸŽ€


🌸 NAME 🌸

struct quad8 β€” the device private data structure. that's it. that's the whole vibe. she holds the state, she holds the regmap, she holds the counters. queen behavior honestly πŸ‘‘


πŸ¦‹ SYNOPSIS πŸ¦‹

struct quad8 {
    spinlock_t lock;
    u8 cmr[QUAD8_NUM_COUNTERS];
    u8 ior[QUAD8_NUM_COUNTERS];
    u8 idr[QUAD8_NUM_COUNTERS];
    unsigned int fck_prescaler[QUAD8_NUM_COUNTERS];
    unsigned int preset[QUAD8_NUM_COUNTERS];
    unsigned int cable_fault_enable;
    struct regmap *map;
 };

no cap, that's the whole thing. every field below gets its own lil moment ✨


πŸ’– Members πŸ’–

  • lock β€” a spinlock_t that keeps the device states from getting clobbered during R/W ops πŸ™ˆ like, bestie, we are not letting two writers fight over the same registers. not on her watch. πŸ’€
  • cmr β€” array of Counter Mode Register states. one entry per counter, all cozy in there. πŸ“
  • ior β€” array of Input / Output Control Register states. same deal, array energy, QUAD8_NUM_COUNTERS wide. 🧚
  • idr β€” array of Index Control Register states. yup, another array. she collects them. it's her thing. πŸ’œ
  • fck_prescaler β€” array of filter clock prescaler configurations. unsigned int, one per counter. the timing vibes ✨
  • preset β€” array of preset values. unsigned int again. those starting numbers live here πŸŽ€
  • cable_fault_enable β€” differential encoder cable status enable configurations. a single unsigned int, no array, she's a solo act. 🌈
  • map β€” the regmap for the device. this is the main-character field, fr fr β€” it's how we actually talk to the hardware πŸ”₯πŸ‘‘
lowkey important: the arrays are all sized with QUAD8_NUM_COUNTERS, so don't go indexing past that 😭 that's not a vibe check you want to fail.

🌟 SEE ALSO 🌟

  • Kernel file ./drivers/counter/104-quad-8.c β€” go read the source, bestie, iykyk 🫢

and that's the page!! sourced fresh from ./drivers/counter, dated October 2026, and yes it's giving vintage-future manual energy πŸ’€πŸ’– mwah, slay, go forth and read your structs πŸ˜­πŸ‘‘

πŸ“¦ where this page comes from