STRUCT MSA311_PRIV(9)
π 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, allF_MAX_FIELDSof 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
- 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