pwm-backlight: Allow for non-increasing brightness levels
authorMike Dunn <mikedunn@newsguy.com>
Sun, 22 Sep 2013 16:59:56 +0000 (09:59 -0700)
committer黄涛 <huangtao@rock-chips.com>
Tue, 25 Feb 2014 08:57:54 +0000 (16:57 +0800)
commitc7efdbbd1045d0ddbab588b35ee453ef2a7a9869
treecd81b46447f9843046277a945a1c4f7444182640
parentf419470e45ea4f32dbd2ac27ab0443fe6f251b2e
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