]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
backlight: qcom-wled: Use sink_addr for sync toggle
authorObeida Shamoun <oshmoun100@googlemail.com>
Sun, 14 Mar 2021 10:11:10 +0000 (11:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 May 2021 06:39:44 +0000 (08:39 +0200)
[ Upstream commit cdfd4c689e2a52c313b35ddfc1852ff274f91acb ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/backlight/qcom-wled.c

index 091f07e7c1451a893842a38ad956612ecd5ce054..fc8b443d10fd144178994106e53035500c887c17 100644 (file)
@@ -336,13 +336,13 @@ static int wled3_sync_toggle(struct wled *wled)
        unsigned int mask = GENMASK(wled->max_string_count - 1, 0);
 
        rc = regmap_update_bits(wled->regmap,
-                               wled->ctrl_addr + WLED3_SINK_REG_SYNC,
+                               wled->sink_addr + WLED3_SINK_REG_SYNC,
                                mask, mask);
        if (rc < 0)
                return rc;
 
        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);
 
        return rc;