STRUCT LM3697(9)
β¨ struct lm3697(9) β¨
okay so bestie, welcome to the Kernel API Manual π
and today's main character is struct lm3697 β it's a little struct from the LED subsystem and it's lowkey iconic for how tidy it is. Let's get into it π
πΈ NAME πΈ
struct lm3697 β
and honestly? that's it. that's the name entry. the manpage literally just gives us the struct name with a dash and dips π no cap, no description, nothing. we move on π
π¦ SYNOPSIS π¦
here's the whole shape of her, bestie β copy it exactly, fr fr:
struct lm3697 {
struct gpio_desc *enable_gpio;
struct regulator *regulator;
struct i2c_client *client;
struct regmap *regmap;
struct device *dev;
struct mutex lock;
int bank_cfg;
int num_banks;
struct lm3697_led leds[];
};
π Members π
okay so every single field, and what she actually does β¨
enable_gpioβ the hardware enable gpio π«Ά like the physical "go girl" switch for the chip.regulatorβ the LED supply regulator pointer π₯ that's where your power's coming from.clientβ pointer to the I2C client π yes, this whole thing rides the I2C bus.regmapβ the device's register map π§ that's how we talk to the registers, iykyk.devβ pointer to the device'sdevicestruct π the classic kernel back-pointer, she's everywhere.lockβ the lock for reading/writing the device π astruct mutex, keeping your reads and writes from stepping on each other. respect her.bank_cfgβ theOUTPUT_CONFIGregister values π literally just holding those register values for you.num_banksβ number of control banks β count 'em.ledsβ array of LED strings π a flexible-ish array ofstruct lm3697_led, one per string.
not me pointing out that leds[] is a trailing array with no size in the declaration β that's exactly what the page says, so that's exactly what you get π
π SEE ALSO π
- Kernel file
./drivers/leds/leds-lm3697.c struct lm3697_led(9)
and that's the whole vibe check bestie πΈ this one comes from ./drivers/leds, dated October 2026, and the manual calls her struct lm3697(9) β slay, go read the source, periodt πβ¨π¦
π¦ 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