Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

backlight: qcom-wled: Use sink_addr for sync toggle

WLED3_SINK_REG_SYNC is, as the name implies, a sink register offset.
Therefore, use the sink address as base instead of the ctrl address.

This fixes the sync toggle on wled4, which can be observed by the fact
that adjusting brightness now works.

It has no effect on wled3 because sink and ctrl base addresses are the
same. This allows adjusting the brightness without having to disable
then reenable the module.

Signed-off-by: Obeida Shamoun <oshmoun100@googlemail.com>
Signed-off-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Acked-by: Kiran Gunda <kgunda@codeaurora.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Obeida Shamoun and committed by
Lee Jones
cdfd4c68 225be60f

+2 -2
+2 -2
drivers/video/backlight/qcom-wled.c
··· 336 336 unsigned int mask = GENMASK(wled->max_string_count - 1, 0); 337 337 338 338 rc = regmap_update_bits(wled->regmap, 339 - wled->ctrl_addr + WLED3_SINK_REG_SYNC, 339 + wled->sink_addr + WLED3_SINK_REG_SYNC, 340 340 mask, mask); 341 341 if (rc < 0) 342 342 return rc; 343 343 344 344 rc = regmap_update_bits(wled->regmap, 345 - wled->ctrl_addr + WLED3_SINK_REG_SYNC, 345 + wled->sink_addr + WLED3_SINK_REG_SYNC, 346 346 mask, WLED3_SINK_REG_SYNC_CLEAR); 347 347 348 348 return rc;