include/linux/led-class-flash.h
Source file repositories/reference/linux-study-clean/include/linux/led-class-flash.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/led-class-flash.h- Extension
.h- Size
- 6754 bytes
- Lines
- 229
- 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.h
Detected Declarations
struct device_nodestruct led_classdev_flashstruct led_flash_opsstruct led_flash_settingstruct led_classdev_flashfunction led_classdev_flash_registerfunction devm_led_classdev_flash_registerfunction led_set_flash_strobefunction led_get_flash_strobe
Annotated Snippet
struct led_flash_ops {
/* set flash brightness */
int (*flash_brightness_set)(struct led_classdev_flash *fled_cdev,
u32 brightness);
/* get flash brightness */
int (*flash_brightness_get)(struct led_classdev_flash *fled_cdev,
u32 *brightness);
/* set flash strobe state */
int (*strobe_set)(struct led_classdev_flash *fled_cdev, bool state);
/* get flash strobe state */
int (*strobe_get)(struct led_classdev_flash *fled_cdev, bool *state);
/* set flash timeout */
int (*timeout_set)(struct led_classdev_flash *fled_cdev, u32 timeout);
/* get the flash LED fault */
int (*fault_get)(struct led_classdev_flash *fled_cdev, u32 *fault);
/* set flash duration */
int (*duration_set)(struct led_classdev_flash *fled_cdev, u32 duration);
};
/*
* Current value of a flash setting along
* with its constraints.
*/
struct led_flash_setting {
/* maximum allowed value */
u32 min;
/* maximum allowed value */
u32 max;
/* step value */
u32 step;
/* current value */
u32 val;
};
struct led_classdev_flash {
/* led class device */
struct led_classdev led_cdev;
/* flash led specific ops */
const struct led_flash_ops *ops;
/* flash brightness value in microamperes along with its constraints */
struct led_flash_setting brightness;
/* flash timeout value in microseconds along with its constraints */
struct led_flash_setting timeout;
/* flash timeout value in microseconds along with its constraints */
struct led_flash_setting duration;
/* LED Flash class sysfs groups */
const struct attribute_group *sysfs_groups[LED_FLASH_SYSFS_GROUPS_SIZE];
};
static inline struct led_classdev_flash *lcdev_to_flcdev(
struct led_classdev *lcdev)
{
return container_of(lcdev, struct led_classdev_flash, led_cdev);
}
/**
* led_classdev_flash_register_ext - register a new object of LED class with
* init data and with support for flash LEDs
* @parent: LED flash controller device this flash LED is driven by
* @fled_cdev: the led_classdev_flash structure for this device
* @init_data: the LED class flash device initialization data
*
* Returns: 0 on success or negative error value on failure
*/
int led_classdev_flash_register_ext(struct device *parent,
struct led_classdev_flash *fled_cdev,
struct led_init_data *init_data);
/**
* led_classdev_flash_unregister - unregisters an object of led_classdev class
* with support for flash LEDs
* @fled_cdev: the flash LED to unregister
*
* Unregister a previously registered via led_classdev_flash_register object
*/
void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev);
int devm_led_classdev_flash_register_ext(struct device *parent,
struct led_classdev_flash *fled_cdev,
struct led_init_data *init_data);
void devm_led_classdev_flash_unregister(struct device *parent,
struct led_classdev_flash *fled_cdev);
Annotation
- Immediate include surface: `linux/leds.h`.
- Detected declarations: `struct device_node`, `struct led_classdev_flash`, `struct led_flash_ops`, `struct led_flash_setting`, `struct led_classdev_flash`, `function led_classdev_flash_register`, `function devm_led_classdev_flash_register`, `function led_set_flash_strobe`, `function led_get_flash_strobe`.
- 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.