]> git.karo-electronics.de Git - karo-tx-linux.git/commit
pwm-backlight: Allow for non-increasing brightness levels
authorMike Dunn <mikedunn@newsguy.com>
Sun, 22 Sep 2013 16:59:56 +0000 (09:59 -0700)
committerThierry Reding <thierry.reding@gmail.com>
Wed, 16 Oct 2013 07:20:09 +0000 (09:20 +0200)
commit8f43e18e2769b3b28383903d501b4da29e388aad
treedcddafc52c90afc98fa8037a0ad682e5e8b6d194
parent22ceeee16eb8f0d04de3ef43a5174fb30ec18af9
pwm-backlight: Allow for non-increasing brightness levels

Currently the driver assumes that the values specified in the
brightness-levels device tree property increase as they are parsed from
left to right.  But boards that invert the signal between the PWM output
and the backlight will need to specify decreasing brightness-levels.
This patch removes the assumption that the last element of the array is
the maximum value, and instead searches the array for the maximum value
and uses that in the duty cycle calculation.

Signed-off-by: Mike Dunn <mikedunn@newsguy.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/video/backlight/pwm_bl.c