From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: backlight: Add SY7758 6-channel High Efficiency LED Driver support
Date: Mon, 25 May 2026 20:43:17 +1000 [thread overview]
Message-ID: <review-patch2-20260521-topic-sm8650-ayaneo-pocket-s2-sy7758-v4-2-73c732615e4a@linaro.org> (raw)
In-Reply-To: <20260521-topic-sm8650-ayaneo-pocket-s2-sy7758-v4-2-73c732615e4a@linaro.org>
Patch Review
**Makefile ordering (minor):** The new entry is placed between `SAHARA` and `SKY81452`, but alphabetically `SY7758` sorts after `SKY81452`:
```c
obj-$(CONFIG_BACKLIGHT_SAHARA) += kb3886_bl.o
+obj-$(CONFIG_BACKLIGHT_SY7758) += sy7758.o
obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o
```
Should be:
```
obj-$(CONFIG_BACKLIGHT_SKY81452) += sky81452-backlight.o
+obj-$(CONFIG_BACKLIGHT_SY7758) += sy7758.o
obj-$(CONFIG_BACKLIGHT_TPS65217) += tps65217_bl.o
```
**Kconfig ordering (minor):** The entry is placed between `KTZ8866` (K) and `LM3533` (L), but `SY7758` (S) should sort much later. That said, the existing Kconfig is not strictly alphabetical (e.g. `HP680` appears after `OMAP1`, `APPLE` after `MT6370`), so this is cosmetic at best.
**Redundant `FIELD_PREP` for bit-0 fields (style nit):** `MSK_BRT_12BIT_L` is `GENMASK(7, 0)` and `MSK_BRT_12BIT_H` is `GENMASK(3, 0)`. Since both masks start at bit 0, `FIELD_PREP` is a no-op — it doesn't shift. The explicit `& 0xff` / `& 0xf` masks are also redundant when using `FIELD_PREP`, since it already masks the value:
```c
ret = regmap_write(sydev->regmap, REG_BRT_12BIT_L,
FIELD_PREP(MSK_BRT_12BIT_L,
brightness & 0xff));
```
Either use `FIELD_PREP` alone (dropping the manual masks) or drop `FIELD_PREP` entirely (just write `brightness & 0xff`). Having both is belt-and-suspenders that adds clutter. The same pattern appears in `sy7758_init` for the default brightness writes.
**Unnecessary initialization (trivial):** In `sy7758_init`:
```c
int ret = 0;
```
`ret` is immediately assigned on the next line, so `= 0` is unnecessary.
**`update_status` return style (trivial):** The trailing `return 0` could be simplified:
```c
ret = regmap_write(sydev->regmap, REG_BRT_12BIT_H,
FIELD_PREP(MSK_BRT_12BIT_H,
(brightness >> 8) & 0xf));
if (ret)
return ret;
return 0;
```
Could simply be `return regmap_write(...)` for the last write, or `return ret;` instead of the `if`/`return 0` pair. This matches patterns in other backlight drivers.
**Hardcoded init configuration (observation, not a blocker):** `sy7758_init` writes fixed values to multiple OTP/config registers (current limits, boost voltage, PWM frequency, etc.). These are specific to the Ayaneo Pocket S2. If this chip is used on other boards, these values would need to come from DT properties. Acceptable for now given there is only one user, but worth noting for future extensibility.
**`MAX_BRIGHTNESS = 4080` (question):** The 12-bit register range would support up to 4095 (0xFFF). The chosen max of 4080 (0xFF0) presumably comes from the datasheet — if so, no issue, but it's worth confirming this isn't a typo.
**Everything else looks correct:** Probe sequence handles errors well with consistent `dev_err_probe` usage, devm resource management is clean, the device ID check at probe is good practice, and `sy7758_remove` calling `backlight_disable` before devm teardown is correct.
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-05-25 10:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-21 8:07 [PATCH v4 0/2] backlight: Add SY7758 6-channel High Efficiency LED Driver support Neil Armstrong
2026-05-21 8:08 ` [PATCH v4 1/2] dt-bindings: leds: backlight: document the SY7758 6-channel High Efficiency LED Driver Neil Armstrong
2026-05-25 10:43 ` Claude review: " Claude Code Review Bot
2026-05-21 8:08 ` [PATCH v4 2/2] backlight: Add SY7758 6-channel High Efficiency LED Driver support Neil Armstrong
2026-05-25 10:43 ` Claude Code Review Bot [this message]
2026-05-25 10:43 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-04-30 9:47 [PATCH v2 0/2] " Neil Armstrong
2026-04-30 9:47 ` [PATCH v2 2/2] " Neil Armstrong
2026-05-05 0:44 ` Claude review: " Claude Code Review Bot
2026-05-05 0:44 ` Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=review-patch2-20260521-topic-sm8650-ayaneo-pocket-s2-sy7758-v4-2-73c732615e4a@linaro.org \
--to=claude-review@example.com \
--cc=dri-devel-reviews@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox