STRUCT YAS5XX_CHIP_INFO(9)
β¨ NAME β¨
struct yas5xx_chip_info β device-specific data and function pointers, bestie π
So this is from the Kernel API Manual (yes, the whole manual, not just a vibe), and it's literally the little info card that tells the driver everything it needs to know about each YAS chip. Obsessed.
πΈ SYNOPSIS πΈ
struct yas5xx_chip_info {
unsigned int devid;
const char *product_label;
const char *product_name;
const char *version_names[2];
const int *volatile_reg;
int volatile_reg_qty;
u32 scaling_val2;
u16 t_ref;
s16 min_temp_x10;
int (*get_measure)(struct yas5xx *yas5xx, s32 *to, s32 *xo, s32 *yo,
s32 *zo);
int (*get_calibration_data)(struct yas5xx *yas5xx);
void (*dump_calibration)(struct yas5xx *yas5xx);
int (*measure_offsets)(struct yas5xx *yas5xx);
int (*power_on)(struct yas5xx *yas5xx);
};
π Members π
Okay so here's the whole cast β every single one of them, no skips, periodt:
devidβ the device ID number. Like the chip's little student ID πͺͺproduct_labelβ the product label used in Linux. It's giving official paperwork β¨product_nameβ the product name of the YAS variant. Which flavour of YAS are we dealing with, iykyk πversion_namesβ the version letters or namings. Cute little name tags for each version πvolatile_regβ device-specific volatile registers. Handle with care, they're spicy π₯volatile_reg_qtyβ quantity of device-specific volatile registers. Just counting the spicy ones πscaling_val2β scaling value forIIO_CHAN_INFO_SCALE. Math but make it fashion πt_refβ number of counts at reference temperature 20 Β°C. Twenty degrees, iconic π‘οΈmin_temp_x10β starting point of temperature counting in 1/10:s degrees Celsius. Yes, tenths, don't @ me π§get_measureβ function pointer to get a measurement. Go get that data, bestie π«Άget_calibration_dataβ function pointer to get calibration data. The calibration lore is real πdump_calibrationβ function pointer to dump calibration for debugging. Debug girlies rise πmeasure_offsetsβ function pointer to measure the offsets. Offsets getting measured fr fr πpower_onβ function pointer to power-on procedure. Wake up, chip, we're going to the club β‘
π Description π
Okay so real talk β the t_ref value for YAS532/533 is known from the Android driver. For YAS530 and YAS537 it was approximately measured. Approximately! So if you're wondering where those numbers came from, now you know π
And the temperatures min_temp_x10 are derived from the temperature resolutions given in the data sheets. That's it, that's the tea β
Ngl these numbers aren't just vibes β they have sources, but some sources are "the Android driver" and some are "we measured it approximately", and that's just how it is.
π¦ SEE ALSO π¦
- Kernel file
./drivers/iio/magnetometer/yamaha-yas530.cstruct yas5xx(9) yas530_measure(9)yas537_measure(9)yas530_get_measure(9)yas537_get_measure(9)yas530_extract_calibration(9)
Go read those, bestie, they're all part of the same little magnetometer friend group π§²π
Kiss kiss, this page lives at ./drivers/iio/magnetometer, dated October 2026 β slay, you found the whole thing, periodt β¨π
π¦ 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