STRUCT LM3697(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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's device struct πŸŽ€ the classic kernel back-pointer, she's everywhere.
  • lock β€” the lock for reading/writing the device 🌈 a struct mutex, keeping your reads and writes from stepping on each other. respect her.
  • bank_cfg β€” the OUTPUT_CONFIG register 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 of struct 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