include/linux/backlight.h
Source file repositories/reference/linux-study-clean/include/linux/backlight.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/backlight.h- Extension
.h- Size
- 12401 bytes
- Lines
- 452
- 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.
- 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/device.hlinux/mutex.hlinux/types.h
Detected Declarations
struct backlight_devicestruct backlight_opsstruct backlight_propertiesstruct backlight_deviceenum backlight_update_reasonenum backlight_typeenum backlight_scalefunction backlight_update_statusfunction backlight_enablefunction backlight_disablefunction backlight_is_blankfunction update_statusfunction backlight_notify_blankfunction of_find_backlight_by_nodefunction devm_of_find_backlight
Annotated Snippet
struct backlight_ops {
/**
* @options: Configure how operations are called from the core.
*
* The options parameter is used to adjust the behaviour of the core.
* Set BL_CORE_SUSPENDRESUME to get the update_status() operation called
* upon suspend and resume.
*/
unsigned int options;
#define BL_CORE_SUSPENDRESUME (1 << 0)
/**
* @update_status: Operation called when properties have changed.
*
* Notify the backlight driver some property has changed.
* The update_status operation is protected by the update_lock.
*
* The backlight driver is expected to use backlight_is_blank()
* to check if the display is blanked and set brightness accordingly.
* update_status() is called when any of the properties has changed.
*
* RETURNS:
*
* 0 on success, negative error code if any failure occurred.
*/
int (*update_status)(struct backlight_device *);
/**
* @get_brightness: Return the current backlight brightness.
*
* The driver may implement this as a readback from the HW.
* This operation is optional and if not present then the current
* brightness property value is used.
*
* RETURNS:
*
* A brightness value which is 0 or a positive number.
* On failure a negative error code is returned.
*/
int (*get_brightness)(struct backlight_device *);
/**
* @controls_device: Check against the display device
*
* Check if the backlight controls the given display device. This
* operation is optional and if not implemented it is assumed that
* the display is always the one controlled by the backlight.
*
* RETURNS:
*
* If display_dev is NULL or display_dev matches the device controlled by
* the backlight, return true. Otherwise return false.
*/
bool (*controls_device)(struct backlight_device *bd, struct device *display_dev);
};
/**
* struct backlight_properties - backlight properties
*
* This structure defines all the properties of a backlight.
*/
struct backlight_properties {
/**
* @brightness: The current brightness requested by the user.
*
* The backlight core makes sure the range is (0 to max_brightness)
* when the brightness is set via the sysfs attribute:
* /sys/class/backlight/<backlight>/brightness.
*
* This value can be set in the backlight_properties passed
* to devm_backlight_device_register() to set a default brightness
* value.
*/
int brightness;
/**
* @max_brightness: The maximum brightness value.
*
* This value must be set in the backlight_properties passed to
* devm_backlight_device_register() and shall not be modified by the
* driver after registration.
*/
int max_brightness;
/**
* @power: The current power mode.
*
* User space can configure the power mode using the sysfs
* attribute: /sys/class/backlight/<backlight>/bl_power
Annotation
- Immediate include surface: `linux/device.h`, `linux/mutex.h`, `linux/types.h`.
- Detected declarations: `struct backlight_device`, `struct backlight_ops`, `struct backlight_properties`, `struct backlight_device`, `enum backlight_update_reason`, `enum backlight_type`, `enum backlight_scale`, `function backlight_update_status`, `function backlight_enable`, `function backlight_disable`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source 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.