Skip to content

Commit 5eb622e

Browse files
I-n-o-kLee Jones
authored andcommitted
backlight: qcom-wled: Correct the sync_toggle sequence
As per the current implementation, after FSC (Full Scale Current) and brightness update the sync bits are set-then-cleared. But, the FSC and brightness sync takes place when the sync bits are set (e.g. on a rising edge). So the hardware team recommends a clear-then-set approach in order to guarantee such a transition regardless of the previous register state. Signed-off-by: Kiran Gunda <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Signed-off-by: Lee Jones <[email protected]>
1 parent 4d6e9cd commit 5eb622e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/video/backlight/qcom-wled.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,13 @@ static int wled3_sync_toggle(struct wled *wled)
337337

338338
rc = regmap_update_bits(wled->regmap,
339339
wled->sink_addr + WLED3_SINK_REG_SYNC,
340-
mask, mask);
340+
mask, WLED3_SINK_REG_SYNC_CLEAR);
341341
if (rc < 0)
342342
return rc;
343343

344344
rc = regmap_update_bits(wled->regmap,
345345
wled->sink_addr + WLED3_SINK_REG_SYNC,
346-
mask, WLED3_SINK_REG_SYNC_CLEAR);
346+
mask, mask);
347347

348348
return rc;
349349
}
@@ -353,17 +353,17 @@ static int wled5_mod_sync_toggle(struct wled *wled)
353353
int rc;
354354
u8 val;
355355

356-
val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT :
357-
WLED5_SINK_REG_SYNC_MOD_B_BIT;
358356
rc = regmap_update_bits(wled->regmap,
359357
wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
360-
WLED5_SINK_REG_SYNC_MASK, val);
358+
WLED5_SINK_REG_SYNC_MASK, 0);
361359
if (rc < 0)
362360
return rc;
363361

362+
val = (wled->cfg.mod_sel == MOD_A) ? WLED5_SINK_REG_SYNC_MOD_A_BIT :
363+
WLED5_SINK_REG_SYNC_MOD_B_BIT;
364364
return regmap_update_bits(wled->regmap,
365365
wled->sink_addr + WLED5_SINK_REG_MOD_SYNC_BIT,
366-
WLED5_SINK_REG_SYNC_MASK, 0);
366+
WLED5_SINK_REG_SYNC_MASK, val);
367367
}
368368

369369
static int wled_ovp_fault_status(struct wled *wled, bool *fault_set)

0 commit comments

Comments
 (0)