From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: drm/panel: Add panel driver for ChipWealth CH13726A based panels
Date: Thu, 23 Apr 2026 08:16:54 +1000 [thread overview]
Message-ID: <review-patch2-20260421-ch13726a-v5-2-f7f6f4f30e05@gmail.com> (raw)
In-Reply-To: <20260421-ch13726a-v5-2-f7f6f4f30e05@gmail.com>
Patch Review
**Issue 1 (minor): Unnecessary Kconfig selects.**
```c
+ select DRM_DISPLAY_DP_HELPER
+ select DRM_DISPLAY_HELPER
```
This is a MIPI-DSI panel driver. It has no DisplayPort functionality. The only other panel drivers that select `DRM_DISPLAY_DP_HELPER` are eDP panels (Samsung ATNA33XC20 and the eDP panel driver). These selects should be removed.
**Issue 2 (minor): `uint8_t` loop variable in `ch13726a_get_modes`.**
```c
+ for (uint8_t i = 0; i < ctx->desc->num_modes; i++) {
```
No other panel driver in the tree uses `uint8_t` for this kind of loop counter. The kernel convention is `unsigned int` or `int`. While functionally fine here (there will never be >255 modes), it should be `unsigned int i` for consistency. Also, declaring the variable in the `for` initializer is C99/C11 style — while the kernel now permits it, most existing panel drivers declare `i` at function scope. Using `unsigned int` declared in the loop is fine, but `uint8_t` is unusual.
**Issue 3 (minor): `thor_bottom_desc` should be `const`.**
```c
+static struct ch13726a_desc thor_bottom_desc = {
```
This data is never modified. It should be `static const struct ch13726a_desc thor_bottom_desc`. The `.data` pointer in the of_match_table already casts it to `const void *`. Correspondingly, the `desc` member in the panel struct should be `const struct ch13726a_desc *desc`.
**Issue 4 (very minor): Cast in `of_device_get_match_data`.**
```c
+ ctx->desc = (struct ch13726a_desc *)of_device_get_match_data(dev);
```
If the `desc` field is changed to `const struct ch13726a_desc *` per above, the cast can become `(const struct ch13726a_desc *)` or be dropped entirely since `of_device_get_match_data` returns `const void *`.
**Issue 5 (observation): Reset GPIO polarity.**
```c
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
+ usleep_range(10000, 11000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 0);
+ usleep_range(10000, 11000);
+ gpiod_set_value_cansleep(ctx->reset_gpio, 1);
```
The GPIO is obtained with `GPIOD_OUT_LOW` (deasserted at probe), and the DT example uses `GPIO_ACTIVE_HIGH`. The reset sequence asserts (1), deasserts (0), then asserts (1) again — this means the panel enters reset, exits reset, and then enters reset once more as the "end" state of the reset function, staying in reset. But `ch13726a_prepare` calls `ch13726a_reset()` and then proceeds to `ch13726a_on()` which sends DSI commands. If the panel is still held in reset when DSI commands are sent, this may not work. Since the driver appears to be tested and working (v5), perhaps the logic value interpretation is inverted from the typical convention — the author should confirm that the reset sequence is intentional and correct. Typically reset functions end with the reset line deasserted (panel out of reset).
**Issue 6 (minor): `ch13726a_disable` clears LPM but `ch13726a_on` sets it.**
```c
+static int ch13726a_disable(struct drm_panel *panel)
+{
+ ...
+ ctx->dsi->mode_flags &= ~MIPI_DSI_MODE_LPM;
```
In `ch13726a_on`:
```c
+ ctx->dsi->mode_flags |= MIPI_DSI_MODE_LPM;
```
The disable path clears LPM mode, sends display-off and sleep commands without LPM. The backlight update callback also clears LPM, sends brightness, then sets it again. The on path sets LPM and sends initialization commands in LPM. This is internally consistent, but the disable path never restores LPM — so if there's a disable/re-prepare cycle, `ch13726a_on` will set it again which is fine. No bug, just worth noting.
**Summary of requested changes:**
1. Remove the `DRM_DISPLAY_DP_HELPER` and `DRM_DISPLAY_HELPER` selects from Kconfig — they are not needed for a DSI panel driver.
2. Change `uint8_t i` to `unsigned int i` in `ch13726a_get_modes`.
3. Make `thor_bottom_desc` and the `desc` struct member `const`.
4. Please confirm the reset sequence is correct (panel left in reset state before DSI init commands are sent).
---
Generated by Claude Code Patch Reviewer
next prev parent reply other threads:[~2026-04-22 22:16 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 17:38 [PATCH v5 0/2] drm/panel: Add panel driver for ChipWealth CH13726A based panels Aaron Kling via B4 Relay
2026-04-21 17:38 ` [PATCH v5 1/2] dt-bindings: display: panel: Add ChipWealth CH13726A AMOLED driver Aaron Kling via B4 Relay
2026-04-22 7:05 ` Krzysztof Kozlowski
2026-04-22 7:36 ` Aaron Kling
2026-04-22 22:16 ` Claude review: " Claude Code Review Bot
2026-04-21 17:38 ` [PATCH v5 2/2] drm/panel: Add panel driver for ChipWealth CH13726A based panels Aaron Kling via B4 Relay
2026-04-22 22:16 ` Claude Code Review Bot [this message]
2026-04-22 22:16 ` Claude review: " Claude Code Review Bot
-- strict thread matches above, loose matches on Subject: below --
2026-04-27 4:39 [PATCH v7 0/2] " Aaron Kling via B4 Relay
2026-04-27 4:39 ` [PATCH v7 2/2] " Aaron Kling via B4 Relay
2026-04-28 5:10 ` Claude review: " Claude Code Review Bot
2026-04-28 5:10 ` Claude Code Review Bot
2026-04-22 7:43 [PATCH v6 0/2] " Aaron Kling via B4 Relay
2026-04-22 7:43 ` [PATCH v6 2/2] " Aaron Kling via B4 Relay
2026-04-22 22:00 ` Claude review: " Claude Code Review Bot
2026-04-22 22:00 ` Claude Code Review Bot
2026-04-08 5:32 [PATCH v4 0/2] " Aaron Kling via B4 Relay
2026-04-08 5:32 ` [PATCH v4 2/2] " Aaron Kling via B4 Relay
2026-04-12 3:10 ` Claude review: " Claude Code Review Bot
2026-04-12 3:10 ` Claude Code Review Bot
2026-03-23 17:08 [PATCH v3 0/2] " Aaron Kling via B4 Relay
2026-03-23 17:08 ` [PATCH v3 2/2] " Aaron Kling via B4 Relay
2026-03-24 21:40 ` Claude review: " Claude Code Review Bot
2026-03-24 21:40 ` 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-20260421-ch13726a-v5-2-f7f6f4f30e05@gmail.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