drivers/leds/rgb/leds-lp5812.h
Source file repositories/reference/linux-study-clean/drivers/leds/rgb/leds-lp5812.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/leds/rgb/leds-lp5812.h- Extension
.h- Size
- 4073 bytes
- Lines
- 173
- Domain
- Driver Families
- Bucket
- drivers/leds
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/delay.hlinux/i2c.hlinux/kernel.hlinux/led-class-multicolor.hlinux/leds.hlinux/mutex.hlinux/sysfs.hlinux/types.h
Detected Declarations
struct lp5812_regstruct lp5812_mode_mappingstruct lp5812_led_configstruct lp5812_chipstruct lp5812_ledenum control_modeenum dimming_type
Annotated Snippet
struct lp5812_reg {
u16 addr;
union {
u8 val;
u8 mask;
u8 shift;
};
};
struct lp5812_mode_mapping {
char mode_name[LP5812_MODE_NAME_MAX_LEN];
u8 mode;
u8 scan_order_0;
u8 scan_order_1;
u8 scan_order_2;
u8 scan_order_3;
u8 selection_led;
};
struct lp5812_led_config {
bool is_sc_led;
const char *name;
u8 color_id[LED_COLOR_ID_MAX];
u32 max_current[LED_COLOR_ID_MAX];
int chan_nr;
int num_colors;
int led_id[LED_COLOR_ID_MAX];
};
struct lp5812_chip {
u8 num_channels;
struct i2c_client *client;
struct mutex lock; /* Protects register access */
struct lp5812_led_config *led_config;
const char *label;
const char *scan_mode;
union lp5812_scan_order scan_order;
union lp5812_drive_mode drive_mode;
};
struct lp5812_led {
u8 brightness;
int chan_nr;
struct led_classdev cdev;
struct led_classdev_mc mc_cdev;
struct lp5812_chip *chip;
};
#endif /*_LP5812_H_*/
Annotation
- Immediate include surface: `linux/delay.h`, `linux/i2c.h`, `linux/kernel.h`, `linux/led-class-multicolor.h`, `linux/leds.h`, `linux/mutex.h`, `linux/sysfs.h`, `linux/types.h`.
- Detected declarations: `struct lp5812_reg`, `struct lp5812_mode_mapping`, `struct lp5812_led_config`, `struct lp5812_chip`, `struct lp5812_led`, `enum control_mode`, `enum dimming_type`.
- Atlas domain: Driver Families / drivers/leds.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.