STRUCT BACKLIGHT_DEVICE(9)
π struct backlight_device(9) β the backlight device data page, bestie β¨
okay so real quick: this is a page from the Kernel API Manual, and it's all about struct backlight_device β the data blob that is a backlight device in the kernel. let's get into it π«Ά
β¨ NAME β¨
struct backlight_device β backlight device data, literally the whole point of this page π
πΈ SYNOPSIS πΈ
struct backlight_device {
struct backlight_properties props;
struct mutex update_lock;
struct mutex ops_lock;
const struct backlight_ops *ops;
struct list_head entry;
struct device dev;
int use_count;
};
like, that's the shape of it. now let's meet the members one by one π
π Members π
propsβ Backlight properties. that's it, that's the vibe β¨update_lockβ The lock used when calling theupdate_statusoperation.
update_lock is an internal backlight lock that serialise access to the update_status operation. The backlight core holds the update_lock when calling the update_status operation. and here's the important bit, no cap: the update_lock shall not be used by backlight drivers π
ββοΈ
update_lockβ (yep, listed a second time in the source page π the note below is still all aboutupdate_lock.)
update_lock is an internal backlight lock that serialise access to the update_status operation. The backlight core holds the update_lock when calling the update_status operation. The update_lock shall not be used by backlight drivers π«Ά
ops_lockβ The lock used around everything related tobacklight_ops.
ops_lock is an internal backlight lock that protects the ops pointer and is used around all accesses to ops and when the operations are invoked. and same energy as above: the ops_lock shall not be used by backlight drivers β οΈ
opsβ Pointer to the backlight operations.
If ops is NULL, the driver that registered this device has been unloaded, and if class_get_devdata points to something in the body of that driver, it is also invalid. so yeah, NULL here is giving "everything's gone, don't touch it" π
entryβ List entry of all registered backlight devices π¦devβ Parent device. the main character's parent, iykyk πuse_countβ The number of unblanked displays. lowkey a little counter of how many screens are awake rn π
π Description π
This structure holds all data required by a backlight device. that's the whole summary β it's the everything-bagel of backlight data π
π₯ SEE ALSO π₯
go look at these next, bestie, they're all in the kernel file ./include/linux/backlight.h:
enum backlight_update_reason(9)enum backlight_type(9)struct backlight_ops(9)struct backlight_properties(9)backlight_update_status(9)backlight_enable(9)backlight_disable(9)backlight_is_blank(9)backlight_get_brightness(9)bl_get_data(9)
reminder:update_lockandops_lockare internal, so drivers stay out of them, periodt π
and that's the page!! it lives in ./include/linux, dated October 2026, and it's filed under struct backlight_device(9) β slay, go read the header file now, ily bye π§π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms