• Enric Balletbo i Serra's avatar
    backlight: pwm_bl: Compute brightness of LED linearly to human eye · 88ba95be
    Enric Balletbo i Serra authored
    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: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
    Acked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
    Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
    88ba95be
pwm_bl.c 17.3 KB