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)
commit88ba95bedb7958a89ba107a11d9863ca58b64f22
tree6a33425d612b9aa4541321e7cb8770a1a23a31ca
parent1e5e7cc794b5a332c23216dade0a2e937d694b7f
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