[backlight helper] Support setting backlight through leds subclass
ClosedPublic

Authored by bshah on Aug 12 2016, 8:57 AM.

Details

Summary

Some devices uses simple leds to provide the backlight to display, one
such example is Nexus 5, which uses /sys/class/leds/lcd-backlight/.

Diff Detail

Repository
R122 Powerdevil
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
bshah updated this revision to Diff 5856.Aug 12 2016, 8:57 AM
bshah retitled this revision from to [backlight helper] Support setting backlight through leds subclass.
bshah updated this object.
bshah edited the test plan for this revision. (Show Details)
bshah added reviewers: Plasma, broulik.
Restricted Application added a project: Plasma. · View Herald TranscriptAug 12 2016, 8:57 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
bshah added inline comments.Aug 12 2016, 9:02 AM
daemon/backends/upower/backlighthelper.cpp
124–127

Still, Due to ledInterfaces being last this won't work on Nexus 5 I fear, mostly because it also have another raw interface at `/sys/class/backlight/lm3630``` which doesn't actually adjust brightness.

broulik added inline comments.Aug 12 2016, 9:03 AM
daemon/backends/upower/backlighthelper.cpp
102

You could simplify this to ledsDir.setNameFilters({QStringLiteral("*lcd*"), QStringLiteral("*wled*")});

125

Either make ledInterfaces const or use constFirst here (I know the existing code does it wrong)

bshah updated this revision to Diff 5857.Aug 12 2016, 9:11 AM
bshah marked 3 inline comments as done.
  • use constFirst instead of first
  • prefer led backlights first if available
  • simplify QStringLiteral
broulik accepted this revision.Aug 12 2016, 9:12 AM
broulik edited edge metadata.
This revision is now accepted and ready to land.Aug 12 2016, 9:12 AM
This revision was automatically updated to reflect the committed changes.