]> git.baikalelectronics.ru Git - kernel.git/commit
backlight: pwm_bl: Fix brightness levels for non-DT case.
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Mon, 10 Dec 2018 12:14:37 +0000 (13:14 +0100)
committerLee Jones <lee.jones@linaro.org>
Mon, 10 Dec 2018 15:37:47 +0000 (15:37 +0000)
commited77ae059c78d3bfb6915c3fb2dbf77a90a822e9
treef9ba3616d7e7adab403100a6f3492aa229da6231
parenta9e80a095d95d1159b26f73bd6d9c2fadc7fb411
backlight: pwm_bl: Fix brightness levels for non-DT case.

Commit '049f161f37bc ("backlight: pwm_bl: Compute brightness of LED
linearly to human eye")' allows the possibility to compute a default
brightness table when there isn't the brightness-levels property in the
DT. Unfortunately the changes made broke the pwm backlight for the
non-DT boards.

Usually, the non-DT boards don't pass the brightness levels via platform
data, instead, it sets the max_brightness in their platform data and the
driver calculates the level without a table. The offending patch assumed
that when there is no brightness levels table we should create one, but this
is clearly wrong for the non-DT case.

After this patch the code handles the DT and the non-DT case taking in
consideration also if max_brightness is set or not.

Fixes: 049f161f37bc ("backlight: pwm_bl: Compute brightness of LED linearly to human eye")
Reported-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Tested-by: Robert Jarzmik <robert.jarzmik@free.fr>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/video/backlight/pwm_bl.c