STRUCT YAS5XX(9)
β¨ struct yas5xx β state container for the YAS5xx driver β¨
okay so bestie, this is a page from the Kernel API Manual (section 9, the kernel-API girlies) and it's literally just the struct that holds everything the YAS5xx driver needs to keep track of. it's giving "one big tote bag full of magnetometer essentials" π
no cap.
π SYNOPSIS π
struct yas5xx {
struct device *dev;
const struct yas5xx_chip_info *chip_info;
unsigned int version;
struct yas5xx_calibration calibration;
s8 hard_offsets[3];
struct iio_mount_matrix orientation;
struct regmap *map;
struct regulator_bulk_data regs[2];
struct gpio_desc *reset;
struct mutex lock;
struct {
s32 channels[4];
aligned_s64 ts;
} scan;
};
like, yes, that's the whole vibe. now let's meet the members one by one π«Ά
π¦ Members π¦
devβ the parent device pointer, aka who's your daddy device β¨chip_infoβ device-specific data and function pointers, so your chip knows its own lore π₯versionβ the device version. iconic, numbered, gender-neutral.calibrationβ calibration settings straight out of the OTP storage πhard_offsetsβ offsets for each axis, measured withinitcoilactuated. yes, all three axes, she's thorough πorientationβ the mounting matrix, for when your axis is flipped etc πmapβ regmap to access theYAX5xxregisters over I2C (that spelling is what the page says, bestie, don't come for me π)regsβ thevddandvddiopower regulators πresetβ optional GPIO line used for handlingRESET, the "have you tried turning it off and on again" wire βlockβ locks the magnetometer for exclusive use during a measurement. and lowkey this one matters: a measurement involves several register transactions, so the regmap lock is not enough on its own π the result is that measurements get serialized in a first-come-first-serve manner. queue up, girlies πscanβ naturally aligned measurements π«
πΈ SEE ALSO πΈ
Kernel file ./drivers/iio/magnetometer/yamaha-yas530.c, struct yas5xx_chip_info(9), yas530_measure(9), yas537_measure(9), yas530_get_measure(9), yas537_get_measure(9), yas530_extract_calibration(9) π
ok that's the whole page, go read the actual driver now, mwah π
and that's a wrap, bestie!! this little beauty lives in ./drivers/iio/magnetometer and it's dated October 2026 β she's from the future, she's thriving, she's literally the main character of the IIO magnetometer directory π§β¨π
π¦ 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