STRUCT BACKLIGHT_DEVICE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 the update_status operation.

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 about update_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 to backlight_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:


reminder: update_lock and ops_lock are 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