public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: Re: [PATCH v2 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property
Date: Sat, 16 May 2026 11:56:03 +1000	[thread overview]
Message-ID: <review-patch2-8bf05bf2-66a3-49e0-972e-4ab7ad9f0ff0@nabladev.com> (raw)
In-Reply-To: <8bf05bf2-66a3-49e0-972e-4ab7ad9f0ff0@nabladev.com>

Patch Review

The driver patch adds:
- A `static const u8` lookup table mapping register index to microamp value
- A `u8 lvds_hsdrv_isel` field in the `lt9211` struct
- DT parsing in `lt9211_parse_dt()`
- The register write change in `lt9211_configure_tx()`

**Register change is correct:**
```c
-		{ 0x823f, 0x48 },
+		/* bits 3:0: RG_MLTX_HSDRV_ISEL, LVDS TX driver current */
+		{ 0x823f, 0x40 | ctx->lvds_hsdrv_isel },
```
Original `0x48` = `0100_1000` — bit 6 set, bits 3:0 = 8. New code: `0x40` (bit 6) OR'd with the 4-bit index (0–15), giving range `0x40`–`0x4F`. Default index 8 → `0x48`. Matches.

**DT parsing logic is sound:**
```c
+	ctx->lvds_hsdrv_isel = 8; /* default: 25 uA */
+	ret = of_property_read_u32(dev->of_node, "drive-strength-microamp",
+				   &microamp);
+	if (!ret) {
+		for (i = 0; i < ARRAY_SIZE(lt9211_hsdrv_microamp); i++) {
+			if (lt9211_hsdrv_microamp[i] == microamp) {
+				ctx->lvds_hsdrv_isel = i;
+				break;
+			}
+		}
+		if (i == ARRAY_SIZE(lt9211_hsdrv_microamp)) {
+			dev_err(dev, "Invalid drive-strength-microamp value %u\n",
+				microamp);
+			return -EINVAL;
+		}
+	} else if (ret != -EINVAL) {
+		dev_warn(dev, "Failed to read drive-strength-microamp: %d, using default\n",
+			 ret);
+	}
```

The three-way handling is correct: success → lookup, `-EINVAL` → property absent (silent default), other error → warn and continue with default. The linear scan of 16 entries is fine for a one-time probe path.

**Minor observations (non-blocking):**

1. The existing driver uses `of_property_read_u32()` via `dev->of_node`, which is consistent with the driver's existing OF usage (`of_graph_get_port_by_id`, etc.). Some reviewers may suggest `device_property_read_u32(dev, ...)` as the more generic API, but given this driver is inherently OF-only, either is acceptable.

2. The `dev_err` path for an invalid microamp value would only trigger if the DT binding schema validation is bypassed (since the binding constrains values via enum). Returning `-EINVAL` here is still the right defensive choice.

No functional issues.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-05-16  1:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 13:31 [PATCH v2 0/2] drm/bridge: lt9211: Add drive-strength-microamp DT property Boerge Struempfel
2026-05-13 13:31 ` [PATCH v2 1/2] dt-bindings: display/bridge: lt9211: Add drive-strength-microamp property Boerge Struempfel
2026-05-13 13:41   ` Marek Vasut
2026-05-14 10:56     ` Börge Strümpfel
2026-05-16  1:56     ` Claude review: " Claude Code Review Bot
2026-05-13 13:31 ` [PATCH v2 2/2] drm/bridge: lt9211: Add drive-strength-microamp DT property Boerge Struempfel
2026-05-13 13:45   ` Marek Vasut
2026-05-14 11:20     ` Börge Strümpfel
2026-05-14 12:42       ` Marek Vasut
2026-05-16  1:56     ` Claude Code Review Bot [this message]
2026-05-16  1:56 ` Claude review: " 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-8bf05bf2-66a3-49e0-972e-4ab7ad9f0ff0@nabladev.com \
    --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