include/linux/led-class-multicolor.h
Source file repositories/reference/linux-study-clean/include/linux/led-class-multicolor.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/led-class-multicolor.h- Extension
.h- Size
- 3754 bytes
- Lines
- 109
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/leds.hdt-bindings/leds/common.h
Detected Declarations
struct mc_subledstruct led_classdev_mcfunction led_classdev_multicolor_registerfunction devm_led_classdev_multicolor_register
Annotated Snippet
struct mc_subled {
unsigned int color_index;
unsigned int brightness;
unsigned int intensity;
unsigned int max_intensity;
unsigned int channel;
};
struct led_classdev_mc {
/* led class device */
struct led_classdev led_cdev;
unsigned int num_colors;
struct mc_subled *subled_info;
};
static inline struct led_classdev_mc *lcdev_to_mccdev(
struct led_classdev *led_cdev)
{
return container_of(led_cdev, struct led_classdev_mc, led_cdev);
}
/**
* led_classdev_multicolor_register_ext - register a new object of led_classdev
* class with support for multicolor LEDs
* @parent: the multicolor LED to register
* @mcled_cdev: the led_classdev_mc structure for this device
* @init_data: the LED class multicolor device initialization data
*
* Returns: 0 on success or negative error value on failure
*/
int led_classdev_multicolor_register_ext(struct device *parent,
struct led_classdev_mc *mcled_cdev,
struct led_init_data *init_data);
/**
* led_classdev_multicolor_unregister - unregisters an object of led_classdev
* class with support for multicolor LEDs
* @mcled_cdev: the multicolor LED to unregister
*
* Unregister a previously registered via led_classdev_multicolor_register
* object
*/
void led_classdev_multicolor_unregister(struct led_classdev_mc *mcled_cdev);
/**
* led_mc_calc_color_components() - Calculates component brightness values of a LED cluster.
* @mcled_cdev - Multicolor LED class device of the LED cluster.
* @brightness - Global brightness of the LED cluster.
*
* Calculates the brightness values for each color component of a monochrome LED cluster,
* see Documentation/leds/leds-class-multicolor.rst for details.
*/
int led_mc_calc_color_components(struct led_classdev_mc *mcled_cdev,
enum led_brightness brightness);
int devm_led_classdev_multicolor_register_ext(struct device *parent,
struct led_classdev_mc *mcled_cdev,
struct led_init_data *init_data);
void devm_led_classdev_multicolor_unregister(struct device *parent,
struct led_classdev_mc *mcled_cdev);
static inline int led_classdev_multicolor_register(struct device *parent,
struct led_classdev_mc *mcled_cdev)
{
return led_classdev_multicolor_register_ext(parent, mcled_cdev, NULL);
}
static inline int devm_led_classdev_multicolor_register(struct device *parent,
struct led_classdev_mc *mcled_cdev)
{
return devm_led_classdev_multicolor_register_ext(parent, mcled_cdev,
NULL);
}
#endif /* _LINUX_MULTICOLOR_LEDS_H_INCLUDED */
Annotation
- Immediate include surface: `linux/leds.h`, `dt-bindings/leds/common.h`.
- Detected declarations: `struct mc_subled`, `struct led_classdev_mc`, `function led_classdev_multicolor_register`, `function devm_led_classdev_multicolor_register`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.