linux-stable/drivers/video/backlight
Marijn Suijten ec961cf324 backlight: qcom-wled: Respect enabled-strings in set_brightness
The hardware is capable of controlling any non-contiguous sequence of
LEDs specified in the DT using qcom,enabled-strings as u32
array, and this also follows from the DT-bindings documentation.  The
numbers specified in this array represent indices of the LED strings
that are to be enabled and disabled.

Its value is appropriately used to setup and enable string modules, but
completely disregarded in the set_brightness paths which only iterate
over the number of strings linearly.
Take an example where only string 2 is enabled with
qcom,enabled_strings=<2>: this string is appropriately enabled but
subsequent brightness changes would have only touched the zero'th
brightness register because num_strings is 1 here.  This is simply
addressed by looking up the string for this index in the enabled_strings
array just like the other codepaths that iterate over num_strings.

Likewise enabled_strings is now also used in the autodetection path for
consistent behaviour: when a list of strings is specified in DT only
those strings will be probed for autodetection, analogous to how the
number of strings that need to be probed is already bound by
qcom,num-strings.  After all autodetection uses the set_brightness
helpers to set an initial value, which could otherwise end up changing
brightness on a different set of strings.

Fixes: 775d2ffb4a ("backlight: qcom-wled: Restructure the driver for WLED3")
Fixes: 03b2b5e869 ("backlight: qcom-wled: Add support for WLED4 peripheral")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Link: https://lore.kernel.org/r/20211115203459.1634079-10-marijn.suijten@somainline.org
2021-12-22 11:18:46 +00:00
..
88pm860x_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
aat2870_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 336 2019-06-05 17:37:07 +02:00
adp5520_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
adp8860_bl.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
adp8870_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
ams369fg06.c backlight: ams369fg06: Drop GPIO include 2019-12-16 10:30:41 +00:00
apple_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
arcxcnn_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
as3711_bl.c backlight: as3711_bl: Simplify update_status 2020-07-20 10:27:03 +01:00
backlight.c backlight: Propagate errors from get_brightness() 2021-09-23 10:48:00 +01:00
bd6107.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
corgi_lcd.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
cr_bllcd.c video: backlight: cr_bllcd: Remove unused variable 'intensity' 2020-07-21 15:45:45 +01:00
da903x_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
da9052_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ep93xx_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
gpio_backlight.c backlight: gpio_backlight: Simplify update_status() 2020-07-20 10:27:05 +01:00
hp680_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
hx8357.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 71 2019-05-24 17:36:47 +02:00
ili922x.c backlight: ili922x: Add missing kerneldoc description for ili922x_reg_dump()'s arg 2020-07-06 08:11:42 +01:00
ili9320.c video: backlight: ili9320: Make ili9320_remove() return void 2021-10-20 15:13:59 +01:00
ili9320.h video: backlight: ili9320: Make ili9320_remove() return void 2021-10-20 15:13:59 +01:00
ipaq_micro_bl.c backlight: ipaq_micro: Make structure micro_bl_props constant 2019-10-02 14:19:00 +01:00
jornada720_bl.c backlight: journada720: Fix Wmisleading-indentation warning 2021-03-23 09:42:55 +00:00
jornada720_lcd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 73 2019-05-24 17:36:47 +02:00
kb3886_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
Kconfig backlight: Kconfig whitespace and indentation cleanups 2021-06-01 13:36:24 +01:00
ktd253-backlight.c backlight: ktd253: Stabilize backlight 2021-07-21 17:27:27 +01:00
l4f00242t03.c backlight: l4f00242t03: Convert to GPIO descriptors 2020-04-29 08:52:15 +01:00
lcd.c backlight: lcd: Add missing kerneldoc entry for 'struct device parent' 2020-07-06 08:11:41 +01:00
led_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
lm3533_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
lm3630a_bl.c backlight: lm3630a: Convert to atomic PWM API and check for errors 2021-06-22 14:11:37 +01:00
lm3639_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
lms283gf05.c backlight: lms283gf05: Convert to GPIO descriptors 2021-01-20 12:47:11 +00:00
lms501kf03.c backlight: lms501kf03: Remove unused const variables 2020-07-06 08:11:41 +01:00
locomolcd.c ARM: 9049/1: locomo: make locomo bus's remove callback return void 2021-02-01 19:44:30 +00:00
lp855x_bl.c backlight: lp855x: Add support ACPI enumeration 2021-12-22 11:14:14 +00:00
lp8788_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ltv350qv.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
ltv350qv.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
lv5207lp.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
Makefile backlight: rt4831: Adds support for Richtek RT4831 backlight 2021-05-19 15:52:25 +01:00
max8925_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
omap1_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 154 2019-05-30 11:26:33 -07:00
otm3225a.c
pandora_bl.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pcf50633-backlight.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 151 2019-05-30 11:26:28 -07:00
platform_lcd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
pwm_bl.c backlight: pwm_bl: Improve bootloader/kernel device handover 2021-08-19 10:59:03 +01:00
qcom-wled.c backlight: qcom-wled: Respect enabled-strings in set_brightness 2021-12-22 11:18:46 +00:00
rave-sp-backlight.c backlight: rave-sp: Leave initial state and register with correct device 2019-08-12 09:11:10 +01:00
rt4831-backlight.c backlight: rt4831: Adds support for Richtek RT4831 backlight 2021-05-19 15:52:25 +01:00
sky81452-backlight.c backlight: sky81452-backlight: Convert comma to semicolon 2021-01-20 12:54:14 +00:00
tdo24m.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 332 2019-06-05 17:37:06 +02:00
tosa_bl.c backlight: tosa_bl: Include the right header 2020-09-08 12:31:19 +01:00
tosa_bl.h video: backlight: tosa: Use GPIO lookup table 2019-11-11 09:29:56 +00:00
tosa_lcd.c backlight: tosa_lcd: Include the right header 2020-09-08 12:30:02 +01:00
tps65217_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00
vgg2432a4.c video: backlight: ili9320: Make ili9320_remove() return void 2021-10-20 15:13:59 +01:00
wm831x_bl.c backlight: Use backlight_get_brightness() throughout 2020-07-20 10:27:06 +01:00