STRUCT MSA311_PRIV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct msa311_priv(9) πŸ’…

okay so picture this: you're deep in the Kernel API Manual, section 9, and you've stumbled onto struct msa311_priv β€” the whole internal private-state situation for the MSA311. It's giving backstage pass energy. No cap, this is the little struct that holds all the device's secrets. ✨


🌸 NAME 🌸

struct msa311_priv β€” the MSA311's very own internal private state. It's private for a reason bestie, that's the whole vibe. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

struct msa311_priv {
    struct regmap *regs;
    struct regmap_field *fields[F_MAX_FIELDS];
    struct device *dev;
    struct mutex lock;
    char *chip_name;
    struct iio_trigger *new_data_trig;
 };

literally the whole thing. iconic honestly. πŸ’–


πŸ¦‹ Members πŸ¦‹

  • regs β€” the underlying I2C bus adapter, used to abstract away all those slave register accesses. it's the middleman that makes the register poking not a whole situation. πŸ”₯
  • fields β€” abstract objects for accessing the fields of each register. one per field, all F_MAX_FIELDS of them, living their best array life. ⭐
  • dev β€” the device handler that's associated with the appropriate bus client. your main character link back to the actual device. πŸ‘‘
  • lock β€” a mutex that protects the msa311 device state between the setup routines and the data access routines. like, specifically: power transitions, samp_freq/scale tuning, retrieving axes data, etc. so when two things want the device at once, nobody gets stepped on. πŸ’…
  • chip_name β€” the chip name, formatted as "msa311-02x" % partid. cute little generated name, yk? πŸŽ€
  • new_data_trig β€” the optional NEW_DATA interrupt-driven trigger, used to notify external consumers that a new sample is ready. "hey bestie, fresh data just dropped" β€” that's this field. 🌈

🧚 SEE ALSO 🧚

Kernel file ./drivers/iio/accel/msa311.c, plus these absolutely essential reads: msa311_get_odr(9), msa311_set_odr(9), msa311_wait_for_next_data(9), msa311_set_pwr_mode(9), msa311_get_axis(9). go read them, iykyk. πŸ“šπŸ’œ


lowkey a reminder: this struct is internal and private β€” treat it like the group chat, don't go leaking it everywhere. πŸ™ˆ

and that's the whole page bestie! 🌸 sign-off time: this little gem lives over in ./drivers/iio/accel and the version stamped on it is October 2026, manual entry struct msa311_priv(9). slay, go forth and read your kernel source. πŸ’€βœ¨πŸ’–

πŸ“¦ where this page comes from