diff options
author | Enric Balletbo i Serra <enric.balletbo@collabora.com> | 2018-04-09 10:33:30 +0200 |
---|---|---|
committer | Lee Jones <lee.jones@linaro.org> | 2018-07-04 10:30:46 +0100 |
commit | 573fe6d1c25c81b0af856ffafb516db7e8d978c5 (patch) | |
tree | 3030df9310ebb37825159ab167a03aa97edeb475 /mm/workingset.c | |
parent | ce397d215ccd07b8ae3f71db689aedb85d56ab40 (diff) | |
download | linux-573fe6d1c25c81b0af856ffafb516db7e8d978c5.tar.bz2 |
backlight: pwm_bl: Linear interpolation between brightness-levels
Setting num-interpolated-steps in the dts will allow you to have linear
interpolation between values of brightness-levels. This way a high
resolution pwm duty cycle can be used without having to list out every
possible value in the dts. This system also allows for gamma corrected
values.
The most simple example is interpolate between two brightness values a
number of steps, this can be done setting the following in the dts:
brightness-levels = <0 65535>;
num-interpolated-steps = <1024>;
default-brightness-level = <512>;
This will create a brightness-level table with the following values:
<0 63 126 189 252 315 378 441 ... 64260 64323 64386 64449 65535>
Another use case can be describe a gamma corrected curve, as we have
better sensitivity at low luminance than high luminance we probably
want have smaller steps for low brightness levels values and bigger
steps for high brightness levels values. This can be achieved with
the following in the dts:
brightness-levels = <0 4096 65535>;
num-interpolated-steps = <1024>;
default-brightness-level = <512>;
This will create a brightness-levels table with the following values:
<0 4 8 12 16 20 ... 4096 4156 4216 4276 ... 65535>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'mm/workingset.c')
0 files changed, 0 insertions, 0 deletions