STRUCT MAX197_DATA(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 a struct max197_platform_data *.
  • hwmon_dev β€” the hwmon device ✨ that's the hwmon device right there, a struct device *.
  • lock β€” the read/write mutex πŸ”’ like, this is the struct mutex that 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's 10V for MAX197, 4V for MAX199. two totally different vibes, one field.
  • scale β€” need to scale 🧚 a bool that just says whether we need to scale or not. simple. elegant. serving.
  • ctrl_bytes β€” channels control byte πŸ’œ it's a u8 array of size MAX197_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