]> git.baikalelectronics.ru Git - kernel.git/commit
backlight: pwm_bl: Compute brightness of LED linearly to human eye
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 9 Apr 2018 08:33:32 +0000 (10:33 +0200)
committerLee Jones <lee.jones@linaro.org>
Wed, 4 Jul 2018 09:31:18 +0000 (10:31 +0100)
commit049f161f37bc790a7d1405666eceb4508458254e
tree6a33425d612b9aa4541321e7cb8770a1a23a31ca
parentfbd69254bfb696e0fbf3b518128eee7a88b962c8
backlight: pwm_bl: Compute brightness of LED linearly to human eye

When you want to change the brightness using a PWM signal, one thing you
need to consider is how human perceive the brightness. Human perceive
the brightness change non-linearly, we have better sensitivity at low
luminance than high luminance, so to achieve perceived linear dimming,
the brightness must be matches to the way our eyes behave. The CIE 1931
lightness formula is what actually describes how we perceive light.

This patch computes a default table with the brightness levels filled
with the numbers provided by the CIE 1931 algorithm, the number of the
brightness levels is calculated based on the PWM resolution.

The calculation of the table using the CIE 1931 algorithm is enabled by
default when you do not define the 'brightness-levels' propriety in your
device tree.

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>
drivers/video/backlight/pwm_bl.c