Skip to content

backlighthelper: fix brightness handling for embedded devices

Bhushan Shah requested to merge work/fix-backlight into master

On ARM devices mainly it seems backlight devices does not have enabled property at all, so do not treat failure to open file as a invalid criteria for selecting if we should use backlight device

See e.g. pinephone:

[bshah@manjaro-arm backlight]$ ls -l device/
total 0
drwxr-xr-x 3 root root    0 Jan  1  1970 backlight
lrwxrwxrwx 1 root root    0 Dec  1 06:10 driver -> ../../../bus/platform/drivers/pwm-backlight
-rw-r--r-- 1 root root 4096 Dec 11 10:30 driver_override
-rw-r--r-- 1 root root 4096 Dec  1 06:10 lth_brightness
-r--r--r-- 1 root root 4096 Dec 11 10:30 modalias
lrwxrwxrwx 1 root root    0 Dec 11 10:30 of_node -> ../../../firmware/devicetree/base/backlight
drwxr-xr-x 2 root root    0 Dec 11 10:30 power
lrwxrwxrwx 1 root root    0 Jan  1  1970 subsystem -> ../../../bus/platform
lrwxrwxrwx 1 root root    0 Dec 11 10:30 supplier:platform:1c20800.pinctrl -> ../../virtual/devlink/platform:1c20800.pinctrl--platform:backlight
lrwxrwxrwx 1 root root    0 Dec 11 10:30 supplier:platform:1f03800.pwm -> ../../virtual/devlink/platform:1f03800.pwm--platform:backlight
lrwxrwxrwx 1 root root    0 Dec 11 10:30 supplier:regulator:regulator.23 -> ../../virtual/devlink/regulator:regulator.23--platform:backlight
-rw-r--r-- 1 root root 4096 Jan  1  1970 uevent

Merge request reports

Loading