drivers/leds/led-class.c
Source file repositories/reference/linux-study-clean/drivers/leds/led-class.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/leds/led-class.c- Extension
.c- Size
- 18293 bytes
- Lines
- 732
- Domain
- Driver Families
- Bucket
- drivers/leds
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ctype.hlinux/device.hlinux/err.hlinux/init.hlinux/kernel.hlinux/leds.hlinux/list.hlinux/module.hlinux/property.hlinux/slab.hlinux/spinlock.hlinux/timer.huapi/linux/uleds.hlinux/of.hleds.h
Detected Declarations
function led_trigger_is_hw_controlledfunction brightness_showfunction brightness_storefunction max_brightness_showfunction brightness_hw_changed_showfunction led_add_brightness_hw_changedfunction led_remove_brightness_hw_changedfunction led_classdev_notify_brightness_hw_changedfunction led_add_brightness_hw_changedfunction led_remove_brightness_hw_changedfunction led_classdev_resumefunction led_suspendfunction led_resumefunction fwnode_led_getfunction led_putfunction devm_led_releasefunction devm_of_led_getfunction led_getfunction devm_led_getfunction led_add_lookupfunction led_remove_lookupfunction devm_of_led_get_optionalfunction led_classdev_next_namefunction led_classdev_register_extfunction led_classdev_unregisterfunction devm_led_classdev_releasefunction devm_led_classdev_register_extfunction devm_led_classdev_matchfunction devm_led_classdev_unregisterfunction leds_initfunction leds_exitmodule init leds_initexport led_classdev_notify_brightness_hw_changedexport led_classdev_suspendexport led_classdev_resumeexport led_putexport devm_of_led_getexport led_getexport devm_led_getexport led_add_lookupexport led_remove_lookupexport devm_of_led_get_optionalexport led_classdev_register_extexport led_classdev_unregisterexport devm_led_classdev_register_extexport devm_led_classdev_unregister
Annotated Snippet
subsys_initcall(leds_init);
module_exit(leds_exit);
MODULE_AUTHOR("John Lenz, Richard Purdie");
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("LED Class Interface");
Annotation
- Immediate include surface: `linux/ctype.h`, `linux/device.h`, `linux/err.h`, `linux/init.h`, `linux/kernel.h`, `linux/leds.h`, `linux/list.h`, `linux/module.h`.
- Detected declarations: `function led_trigger_is_hw_controlled`, `function brightness_show`, `function brightness_store`, `function max_brightness_show`, `function brightness_hw_changed_show`, `function led_add_brightness_hw_changed`, `function led_remove_brightness_hw_changed`, `function led_classdev_notify_brightness_hw_changed`, `function led_add_brightness_hw_changed`, `function led_remove_brightness_hw_changed`.
- Atlas domain: Driver Families / drivers/leds.
- Implementation status: integration implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.