提交 e20bc93a 编写于 作者: O Obeida Shamoun 提交者: Zheng Zengkai

backlight: qcom-wled: Use sink_addr for sync toggle

stable inclusion
from stable-5.10.36
commit 918a45b65365749f279cf2955d73d86ef25831a0
bugzilla: 51867
CVE: NA

--------------------------------

[ Upstream commit cdfd4c68 ]

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: NObeida Shamoun <oshmoun100@googlemail.com>
Signed-off-by: NKonrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: NMarijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: NDaniel Thompson <daniel.thompson@linaro.org>
Acked-by: NKiran Gunda <kgunda@codeaurora.org>
Signed-off-by: NLee Jones <lee.jones@linaro.org>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NChen Jun <chenjun102@huawei.com>
Acked-by: NWeilong Chen <chenweilong@huawei.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 cf7d3583
...@@ -336,13 +336,13 @@ static int wled3_sync_toggle(struct wled *wled) ...@@ -336,13 +336,13 @@ static int wled3_sync_toggle(struct wled *wled)
unsigned int mask = GENMASK(wled->max_string_count - 1, 0); unsigned int mask = GENMASK(wled->max_string_count - 1, 0);
rc = regmap_update_bits(wled->regmap, rc = regmap_update_bits(wled->regmap,
wled->ctrl_addr + WLED3_SINK_REG_SYNC, wled->sink_addr + WLED3_SINK_REG_SYNC,
mask, mask); mask, mask);
if (rc < 0) if (rc < 0)
return rc; return rc;
rc = regmap_update_bits(wled->regmap, rc = regmap_update_bits(wled->regmap,
wled->ctrl_addr + WLED3_SINK_REG_SYNC, wled->sink_addr + WLED3_SINK_REG_SYNC,
mask, WLED3_SINK_REG_SYNC_CLEAR); mask, WLED3_SINK_REG_SYNC_CLEAR);
return rc; return rc;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册