STRUCT INA3221_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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_FIELDS of them, no more no less ✨
  • inputs β€” Array of channel input source specific structures, declared as struct ina3221_input inputs[INA3221_NUM_CHANNELS]; β€” so INA3221_NUM_CHANNELS of those bad boys 🌈
  • reg_config β€” Register value of INA3221_CONFIG, an u32. literally just the config register's value, chillin' πŸ’…
  • summation_shunt_resistor β€” equivalent shunt resistor value for summation, an int. yes "summation" is a real word here, we stan πŸ“
  • summation_channel_control β€” Value written to SCC field in INA3221_MASK_ENABLE, an u32. SCC! MASK_ENABLE! very specific, very slay πŸ”₯
  • single_shot β€” running in single-shot operating mode, a bool. 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 are F_MAX_FIELDS and INA3221_NUM_CHANNELS, and those config bits are INA3221_CONFIG and INA3221_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