STRUCT MAX197_DATA(9)
πΈ struct max197_data(9) β Kernel API Manual πΈ
okay so bestie, welcome to the kernel API manual, and today's main character is struct max197_data β the little vibe-holder that keeps track of device instance specific data π like, it's literally the per-instance brain cell for the MAX197 driver, and we're gonna get to know every single field, no skips, no cap π
β¨ NAME β¨
struct max197_data β device instance specific data π¦
β¨ SYNOPSIS β¨
struct max197_data {
struct max197_platform_data *pdata;
struct device *hwmon_dev;
struct mutex lock;
int limit;
bool scale;
u8 ctrl_bytes[MAX197_NUM_CH];
};
look at her. iconic struct. she's got a pointer, a pointer, a mutex, an int, a bool, and a whole array of u8 β and every single one of them is doing something, so let's go member by member π«Ά
β¨ Members β¨
pdataβ the platform data π literally the platform data, handed in from outside, living its best life as astruct max197_platform_data *.hwmon_devβ the hwmon device β¨ that's the hwmon device right there, astruct device *.lockβ the read/write mutex π like, this is thestruct mutexthat guards the read/writes β one thread at a time besties, no cutting in line.limitβ the max range value π₯ and listen, this is a hot detail: it's10Vfor MAX197,4Vfor MAX199. two totally different vibes, one field.scaleβ need to scale π§ aboolthat just says whether we need to scale or not. simple. elegant. serving.ctrl_bytesβ channels control byte π it's au8array of sizeMAX197_NUM_CH, and it holds the channels control byte. periodt.
π SEE ALSO π
<cyan>Kernel file ./drivers/hwmon/max197.c</cyan>β go read the source bestie, that's where all the lore lives π
ngl if you're digging into ./drivers/hwmon/max197.c you're already doing amazing, go off π
and that's the page!! this little beauty comes to you from ./drivers/hwmon, dated October 2026 β mwah, love u, bye π
ππΈ
π¦ 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