STRUCT SENSOR_HUB_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct sensor_hub_data(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's from the struct sensor_hub_data(9) page and it's literally all about the vibes of one single HID hub device's private data. think of it as the group chat that holds all the state for a hub. no cap. 🫢


✨ NAME ✨

struct sensor_hub_data β€” hold a instance data for a HID hub device

like, it's the little container where the instance data for a HID hub device lives. main character storage unit energy. πŸ‘‘


🌸 SYNOPSIS 🌸

struct sensor_hub_data {
    struct mutex mutex;
    spinlock_t lock;
    struct list_head dyn_callback_list;
    spinlock_t dyn_callback_lock;
    struct mfd_cell *hid_sensor_hub_client_devs;
    int hid_sensor_client_cnt;
    int ref_cnt;
 };

that's the whole struct, exactly as it is β€” do not come for me about the spacing, I copied it character for character. πŸ’…


πŸ¦‹ Members πŸ¦‹

get comfy, we're going through every single field, one by one, and yes I mean all of them:

  • mutex β€” a mutex whose whole job is to serialize synchronous requests. one at a time please, we're not doing chaos in here. πŸ”’
  • lock β€” a spin lock that protects the pending request structure. it's giving bodyguard for pending requests. πŸ›‘οΈ
  • dyn_callback_list β€” holds the callback function. that's it, that's the whole thing. the callbacks live here. ✨
  • dyn_callback_lock β€” a spin lock to protect the callback list. someone's gotta guard the list, and it's her. πŸ’…
  • hid_sensor_hub_client_devs β€” stores all the MFD cells for a hub instance. like a little shoebox full of MFD cells, one hub instance at a time. πŸŽ€
  • hid_sensor_client_cnt β€” the number of MFD cells, which is also (no of sensors attached). so if you ever wondered how many sensors are attached, it's this number. πŸ“
  • ref_cnt β€” the number of MFD clients that have opened this device. it's a headcount, basically. every client that opens the device increments the vibe. 🧚
ngl if you touch this struct you should know what every single one of these fields is doing. it's kernel code bestie, not a sandbox. πŸ”₯

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/hid/hid-sensor-hub.c struct
  • hid_sensor_hub_callbacks_list(9) β€” go read this one too, iykyk πŸ’œ

⭐ aaand that's the page! cute little sign-off for you: this gem lives over in ./drivers/hid, and the page is dated October 2026. slay, go read the kernel source, mwah πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from