STRUCT MPR_DATA(9)
π¦ NAME π¦
struct mpr_data β okay so bestie, the official description here is literally just a dash. Nothing. A whole void. π The kernel devs said "she's self-explanatory" and dipped. So the vibe is: this is the data struct for the MPR pressure sensor driver, and everything you actually need to know is in the members down below. Keep reading, iykyk.
This page is from section 9 of the Kernel API Manual, the kernel internals girlie section, so like... kernel devs only, no cap.
β¨ SYNOPSIS β¨
Here's the whole shape of her, fr fr β copy it exactly, no edits:
struct mpr_data {
struct device *dev;
const struct mpr_ops *ops;
struct mutex lock;
u32 pmin;
u32 pmax;
enum mpr_func_id function;
u32 outmin;
u32 outmax;
int scale;
int scale2;
int offset;
struct gpio_desc *gpiod_reset;
int irq;
struct completion completion;
struct {
s32 pres;
aligned_s64 ts;
} chan;
u8 rx_buf[MPR_MEASUREMENT_RD_SIZE];
u8 tx_buf[MPR_MEASUREMENT_RD_SIZE];
};
π Members π
Let's go member by member, because every single field is eating and we're not skipping a single one π«Ά
devβ the current device structure. Her whole identity, essentially πopsβ the functions that implement the sensor reads/writes, and bus init. All the actual doing happens here.lockβ access to the device during read. She's astruct mutex, she keeps things orderly, we stan a boundaries queen.pminβ minimal pressure in pascal.pmaxβ maximal pressure in pascal.functionβ the transfer function.outminβ minimum raw pressure in counts (based on transfer function).outmaxβ maximum raw pressure in counts (based on transfer function).scaleβ pressure scale.scale2β pressure scale, decimal number.offsetβ pressure offset.gpiod_resetβ reset. That's the whole description. Iconic brevity honestly πirqβ end of conversion irq. Used to distinguish between irq mode and reading in a loop until data is ready. So she's literally the girl who tells you which mode you're in πcompletionβ handshake from irq to read. Passing the message along, love that for her.chanβ channel values for buffered mode.chan.presβ pressure value.chan.tsβ timestamp.
rx_bufβ raw conversion data.tx_bufβ output buffer.
Quick reminder bestie:rx_bufandtx_bufare bothu8arrays sizedMPR_MEASUREMENT_RD_SIZE, exactly like the synopsis says. Don't go changing that number, I'm begging π
π SEE ALSO π
- Kernel file
./drivers/iio/pressure/mprls0025pa.hβ go read the header, she has the lore β¨
That's the whole page, babe! No notes, no drama, every field accounted for π
And for the official sign-off: this little gem lives in ./drivers/iio/pressure, and the date on it is October 2026. So like, future-dated and flawless. Slay πΈπ
π¦ 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