STRUCT INA3221_DATA(9)
π struct ina3221_data(9) π
okay bestie, welcome to the Kernel API Manual β¨ β this is the page for struct ina3221_data, which is literally all the device-specific info the INA3221 driver needs to keep track of. it's giving "glorified backpack full of pointers and config bits" and honestly? iconic π
πΈ NAME πΈ
struct ina3221_data β device specific information π«Ά
no cap, that's the whole pitch. per-device info. that's the vibe.
β¨ SYNOPSIS β¨
here's the whole struct, copied exactly because we do not mess with code in this house π
struct ina3221_data {
struct device *pm_dev;
struct regmap *regmap;
struct regmap_field *fields[F_MAX_FIELDS];
struct ina3221_input inputs[INA3221_NUM_CHANNELS];
u32 reg_config;
int summation_shunt_resistor;
u32 summation_channel_control;
bool single_shot;
};
look at her. so many fields. main character struct energy π
π¦ Members π¦
let's do a lil member-by-member vibe check, shall we? every single one gets her moment, because nobody gets left out π€
pm_devβ Device pointer for pm runtime. power management's fave little handle πregmapβ Register map of the device. this is the map, the regmap, the whole layout bestie πΊοΈfieldsβ Register fields of the device. and yes, she's an array:struct regmap_field *fields[F_MAX_FIELDS];βF_MAX_FIELDSof them, no more no less β¨inputsβ Array of channel input source specific structures, declared asstruct ina3221_input inputs[INA3221_NUM_CHANNELS];β soINA3221_NUM_CHANNELSof those bad boys πreg_configβ Register value of INA3221_CONFIG, anu32. literally just the config register's value, chillin' πsummation_shunt_resistorβ equivalent shunt resistor value for summation, anint. yes "summation" is a real word here, we stan πsummation_channel_controlβ Value written to SCC field in INA3221_MASK_ENABLE, anu32. SCC! MASK_ENABLE! very specific, very slay π₯single_shotβ running in single-shot operating mode, abool. so it's either true or false, no in-between, periodt π
π SEE ALSO π
go peek at these, iykyk:
- Kernel file
./drivers/hwmon/ina3221.c struct ina3221_input(9)
fr fr, read both. they're besties with this struct π«Ά
lowkey important: the array sizes areF_MAX_FIELDSandINA3221_NUM_CHANNELS, and those config bits areINA3221_CONFIGandINA3221_MASK_ENABLE. don't come for me if you mix 'em up, i literally wrote them exactly π
and that's the page! π this lil number lives in ./drivers/hwmon and it's dated October 2026 β so like, future vibes but make it kernel π°οΈβ¨ bye bestie, go read some source code π¦π
π¦ 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