Claude review: drm: lcdif: Use dedicated set/clr registers for polarity/edge

Claude Code Review Bot
2026-03-31T06:48:35Z

Patch Review

**Improvement over the original code, but the commit message undersells it.**

The old code:
```c
writel(ctrl, lcdif->base + LCDC_V8_CTRL);
```
This was a full register write with only polarity bits set, which would **clobber** any other bits previously configured in `LCDC_V8_CTRL` (e.g., `CTRL_NEG`, `CTRL_FETCH_START_OPTION_*`). Using `REG_SET`/`REG_CLR` at offsets +4/+8 is strictly safer because it modifies only the targeted bits via atomic set/clear.

The commit message says "It is unclear if there is a difference" — but there **is** a clear difference: the old code was a plain write that could zero other CTRL bits, while `REG_SET`/`REG_CLR` are read-modify-write at the hardware level. The commit message should mention this as the primary motivation rather than presenting it as cargo-culting the BSP.

No functional issues with the code itself. The `else` branches correctly clear the bits when the condition is false, which the old code did implicitly (by not OR-ing them into a zero-initialized variable and then doing a full write).