Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/backlight

FieldValue
Subsystembacklight class, drivers/video/backlight/backlight.c (core DEVICE_ATTR block)
Config gateCONFIG_BACKLIGHT_CLASS_DEVICE (obj-$(CONFIG_BACKLIGHT_CLASS_DEVICE) += backlight.o in drivers/video/backlight/Makefile, torvalds/linux master)
ABI documentationDocumentation/ABI/stable/sysfs-class-backlight (5 core entries) plus Documentation/ABI/testing/sysfs-class-backlight (scale, ADP-driver attributes)
Since2.6.12 (bl_power, brightness, max_brightness); 2.6.17 (actual_brightness); 2.6.37 (type); 5.4 (scale)
Live (5.10.134 host)class directory present, 0 devices (headless container)
Ledger IDSYSC-backlight

What it represents

One directory per panel backlight, exposing brightness control to userspace tools such as brightnessctl and systemd-backlight. Each entry carries a type describing the control interface so userspace can prefer firmware interfaces over raw register control when several exist (stable ABI type entry). The stable ABI file lists Users: HAL, a hint at its desktop-stack age.

Relationship to the device model

/sys/class/backlight/<backlight> is a class view over /sys/devices/... (firmware, platform, or DRM-registered device). There is no backlight bus and no char/block node; the control path is purely sysfs. The class name inside backlight.c is the registration point; individual drivers register backlight_device objects that appear here.

Attributes

The stable ABI file documents 5 core attributes and the testing file adds scale plus driver-specific ADP entries; 16 What: paths spelling /sys/class/backlight/... exist across the ABI tree (the ledger records 15 as the class-level count). The table below is representative.

AttributeR/WUnit/formatConditional?Source
brightnessRW0..max_brightness; reads back the stored level, which may differ from hardwarealwaysstable ABI What brightness (2.6.12)
max_brightnessROintegeralwaysstable ABI What max_brightness (2.6.12)
actual_brightnessROqueried hardware level; may differ from brightnessalwaysstable ABI What actual_brightness (2.6.17)
bl_powerRWFB_BLANK_* values: 0 unblank, 4 powerdownalwaysstable ABI What bl_power (2.6.12)
typeROfirmware, platform, or rawalwaysstable ABI What type (2.6.37)
scaleROunknown, linear, non-linear; guides how UIs should map a slidercore attr, 5.4testing ABI What scale
ambient_light_level, ambient_light_zone, <zone>_max, <zone>_dimRO/RWADP8860/ADP8870/ADP5520 ambient-light zones, 0..127driver-specific (Analog Devices ADP*)testing ABI What entries (2.6.32/2.6.35)

Only brightness, max_brightness, actual_brightness, bl_power, type, and scale come from the class core; anything else visible in a directory is driver-specific.

Safety and writes

Reading is safe. Writing brightness (0..max) and bl_power needs root or appropriate udev permissions; these writes change panel illumination and, on some firmware interfaces, talk to the embedded controller. bl_power 4 blanks the panel entirely. Because brightness stores a value that may not match hardware, userspace is told to use actual_brightness only for display, not for decisions (stable ABI text).

References

  • Documentation/ABI/stable/sysfs-class-backlight, Documentation/ABI/testing/sysfs-class-backlight (cached copies)
  • drivers/video/backlight/backlight.c, drivers/video/backlight/Makefile (torvalds/linux master; core attr block per worklog 2-b)
  • Ledger row SYSC-backlight; worklog Task 2-b