STRUCT MAX3191X_CHIP(9)
π struct max3191x_chip(9) β the max3191x daisy-chain, explained by your favorite kernel bestie
okay so this is from the Kernel API Manual, and it's literally the struct that makes a whole daisy-chain of max3191x chips behave like one big happy GPIO family. let's get into it π
β¨ NAME β¨
struct max3191x_chip β max3191x daisy-chain
πΈ SYNOPSIS πΈ
struct max3191x_chip {
struct gpio_chip gpio;
struct mutex lock;
u32 nchips;
enum max3191x_mode mode;
struct gpio_descs *modesel_pins;
struct gpio_descs *fault_pins;
struct gpio_descs *db0_pins;
struct gpio_descs *db1_pins;
struct spi_message mesg;
struct spi_transfer xfer;
unsigned long *crc_error;
unsigned long *overtemp;
unsigned long *undervolt1;
unsigned long *undervolt2;
unsigned long *fault;
bool ignore_uv;
};
π Members π
the whole squad, one member at a time π«Ά
gpioβ the GPIO controller struct. main character energy, honestly β¨lockβ this one protects read sequences. it's giving bouncer at the club πͺπnchipsβ how many chips are in the daisy-chain. count 'em, bestie π’modeβ the current mode:0for 16-bit,1for 8-bit. and for simplicity, all chips in the daisy-chain are assumed to use the same mode (no mixing, we don't do that here π ββοΈ)modesel_pinsβ GPIO pins to configuremodeselof each chip ποΈfault_pinsβ GPIO pins to detect fault of each chip π¨db0_pinsβ GPIO pins to configure debounce of each chip ποΈdb1_pinsβ GPIO pins to configure debounce of each chip ποΈ (yep,db1_pinshas the exact same description asdb0_pinsβ that's what it says, not me making stuff up, i'm just the messenger π)mesgβ the SPI message used to perform a readout π¨xferβ the SPI transfer used bymesgπcrc_errorβ bitmap signaling CRC error for each chip πovertempβ bitmap signaling overtemperature alarm for each chip π₯undervolt1β bitmap signaling undervoltage alarm for each chip β‘undervolt2β bitmap signaling undervoltage warning for each chip β οΈfaultβ bitmap signaling assertion offault_pinsfor each chip π©ignore_uvβ whether to ignore undervoltage alarms. it gets set by a device property if the chips are powered through5VOUTinstead ofVCC24V, and in that case they will constantly signal undervoltage (iconic behavior, honestly π). and again, for simplicity, all chips in the daisy-chain are assumed to be powered the same way π
lowkey important: those "for simplicity" bits are real constraints, not vibes. the struct assumes uniform mode and uniform powering across the whole chain. periodt. π
π¦ SEE ALSO π¦
- Kernel file
./drivers/gpio/gpio-max3191x.cβ go read the source, bestie, it's right there πβ¨
and that's the whole page, no cap π huge shoutout to the ./drivers/gpio crew β this one's dated October 2026, manual name Kernel API Manual, so go off and read those registers responsibly, mwah ππΈπ
π¦ 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