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.

Dependency Surface

Detected Declarations

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

Implementation Notes