STRUCT LM3601X_LED(9)
π NAME π
struct lm3601x_led β the private lm3601x LED data, bestie π
Okay so this is a page straight out of the Kernel API Manual, section 9, and it's literally just the little struct where the lm3601x LED driver keeps all its own business. Private data, nobody else's vibe. π
β¨ SYNOPSIS β¨
struct lm3601x_led {
struct led_classdev_flash fled_cdev;
struct i2c_client *client;
struct regmap *regmap;
struct mutex lock;
unsigned int flash_timeout;
unsigned int last_flag;
u32 torch_current_max;
u32 flash_current_max;
u32 max_flash_timeout;
u32 led_mode;
};
That's the whole struct, no cap. Every field, exactly as it lives in the header. π«Ά
πΈ Members πΈ
Buckle up, we're doing a field-by-field vibe check, and every single one is getting its moment:
fled_cdevβ the flash LED class device pointer. This is the main character energy of the struct, the actual LED-class-device-flash thing it's attached to. βclientβ Pointer to the I2C client. iykyk, it's how we talk to the chip. π¦regmapβ Devices register map. The map of all the registers, aka the group chat where the hardware actually lives. πlockβ Lock for reading/writing the device. Protect the registers, protect the peace, don't let two threads body-check each other. πflash_timeoutβ the timeout for the flash. Literally the flash's timeout. That's it, that's the whole field. πlast_flagβ last known flags register value. A little snapshot of what the flags register said last time we looked, like a screenshot of the conversation. πtorch_current_maxβ maximum current for the torch. Torch mode goes brrr, but only up to this. π₯flash_current_maxβ maximum current for the flash. Same energy, flash mode, top current allowed. β‘max_flash_timeoutβ maximum timeout for the flash. The flash can't stay on longer than this, periodt. β°led_modeβ The mode to enable either IR or Torch. Pick your fighter: infrared or torch. π§
None of these are optional to mention β they're all real fields and I'm not skipping a single one, bestie. Not one. π
π SEE ALSO π
- Kernel file
./drivers/leds/flash/leds-lm3601x.cβ go read the source, that's where all the lore is π
Alright, that's the whole page, and honestly? Iconic. π The source of all this wisdom lives at ./drivers/leds/flash, dated October 2026, and it's the struct lm3601x_led(9) page from the Kernel API Manual β so if you ever need to remember what's in that struct, you know exactly where to come back. Slay, stay registered, and don't touch the registers without the lock. π
β¨π¦
π¦ 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