STRUCT BACKLIGHT_PROPERTIES(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct backlight_properties(9) β€” Kernel API Manual, but make it make sense

Okay bestie, listen up ✨ β€” this is a page straight out of the Kernel API Manual, and it's all about struct backlight_properties. Yep, that's the whole vibe: it's the glow-up blueprint for your backlight. Let's get into it 🫢


🌸 NAME 🌸

struct backlight_properties β€” literally just the backlight properties, no cap πŸ’–


✨ SYNOPSIS ✨

struct backlight_properties {
    int brightness;
    int max_brightness;
    int power;
  #define BACKLIGHT_POWER_ON              (0);
  #define BACKLIGHT_POWER_OFF             (4);
  #define BACKLIGHT_POWER_REDUCED         (1);
    enum backlight_type type;
    unsigned int state;
  #define BL_CORE_SUSPENDED       (1 << 0)        ;
  #define BL_CORE_FBBLANK         (1 << 1)        ;
    enum backlight_scale scale;
 };

πŸŽ€ Members πŸŽ€

  • brightness β€” the brightness the user is currently asking for πŸ”†

The backlight core is literally the responsible friend here: when brightness gets set through the sysfs attribute /sys/class/backlight/<backlight>/brightness, the core makes sure the value stays in the range (0 to max_brightness). Iconic.

You can also set this one inside the backlight_properties you hand to devm_backlight_device_register if you wanna ship a default brightness value.

  • max_brightness β€” the maximum brightness value, the ceiling, the limit, the "you shall not pass" πŸ’€

You must set this in the backlight_properties you pass to devm_backlight_device_register, and then the driver is not allowed to touch it after registration. Periodt.

  • power β€” the current power mode ⚑

Userspace can configure the power mode via the sysfs attribute /sys/class/backlight/<backlight>/bl_power. When the power property gets updated, update_status gets called. That's the whole flow, iykyk.

Possible values are (0: full on, 4: full off) β€” peep the BACKLIGHT_POWER constants above πŸ‘‘

When the backlight device is enabled, power is set to BACKLIGHT_POWER_ON. When the backlight device is disabled, power is set to BACKLIGHT_POWER_OFF.

  • type β€” the type of backlight being supported πŸ¦‹

This lets userspace make the appropriate policy decisions based on the backlight type. Very much giving "main character makes informed choices".

You must set this in the backlight_properties passed to devm_backlight_device_register.

  • state β€” the state of the backlight core, bestie 🧚

It's a bitmask, so think of it like little flags doing their thing. BL_CORE_FBBLANK is set when the display is expected to be blank. BL_CORE_SUSPENDED is set when the driver is suspended.

Backlight drivers are expected to use backlight_is_blank inside their update_status operation rather than reading the state property directly β€” don't go poking around, use the intended accessor πŸ™ˆ

The core maintains state, and drivers may not modify it. Hands off, queen πŸ’…

  • scale β€” the type of the brightness scale πŸ“

πŸ’œ Description πŸ’œ

This structure defines all the properties of a backlight. That's it, that's the whole point β€” every property, one struct, so clean, so organized 🌈


πŸ”₯ SEE ALSO πŸ”₯

Kernel file ./include/linux/backlight.h

enum backlight_update_reason(9), enum backlight_type(9), struct backlight_ops(9), struct backlight_device(9), backlight_update_status(9), backlight_enable(9), backlight_disable(9), backlight_is_blank(9), backlight_get_brightness(9), bl_get_data(9)


And that's the page, babes πŸ“ this beauty lives in ./include/linux, shipped in the October 2026 drop of struct backlight_properties(9) β€” go read the source, it ate πŸ’–βœ¨

πŸ“¦ where this page comes from