Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/panel: jd9365tx_probe() calls removed
  of_drm_get_panel_orientation()
- [Low] drm/panel: jd9365tx_send_cmds() duplicates
  mipi_dsi_dcs_write_seq_multi()
--

commit ca140a7fa3afff2f94a32e601392829d717fcccf
Author: Hefei <[email protected]>

drm/panel: add VIEWE JD9365TX 7 inch DSI panel

This commit adds a DRM panel driver for the VIEWE 7KF82 720x1280 Jadard
JD9365TX 2-lane MIPI-DSI panel module.

> diff --git a/drivers/gpu/drm/panel/panel-viewe-jd9365tx.c 
> b/drivers/gpu/drm/panel/panel-viewe-jd9365tx.c
> new file mode 100644
> index 0000000000000..7455dff834c4d
> --- /dev/null
> +++ b/drivers/gpu/drm/panel/panel-viewe-jd9365tx.c
> @@ -0,0 +1,340 @@

[ ... ]

> +struct jd9365tx_cmd {
> +     u8 len;
> +     u8 data[64];
> +     u16 delay_ms;
> +};
> +
> +#define JD_CMD(...) {                                        \
> +     .len = sizeof((u8[]){ __VA_ARGS__ }),           \
> +     .data = { __VA_ARGS__ },                        \
> +     .delay_ms = 0,                                  \
> +}
> +
> +#define JD_CMD_DELAY(ms, ...) {                              \
> +     .len = sizeof((u8[]){ __VA_ARGS__ }),           \
> +     .data = { __VA_ARGS__ },                        \
> +     .delay_ms = (ms),                               \
> +}

[ ... ]

> +static int jd9365tx_send_cmds(struct mipi_dsi_device *dsi,
> +                           const struct jd9365tx_cmd *cmds,
> +                           unsigned int count)
> +{
> +     unsigned int i;
> +     int ret;
> +
> +     for (i = 0; i < count; i++) {
> +             const struct jd9365tx_cmd *cmd = &cmds[i];
> +
> +             if (cmd->len) {
> +                     ret = mipi_dsi_dcs_write_buffer(dsi, cmd->data, 
> cmd->len);
> +                     if (ret < 0) {
> +                             dev_err(&dsi->dev,
> +                                     "DCS write 0x%02x failed: %d\n",
> +                                     cmd->data[0], ret);
> +                             return ret;
> +                     }
> +             }
> +             if (cmd->delay_ms)
> +                     msleep(cmd->delay_ms);
> +     }
> +     return 0;
> +}

[Severity: Low]
Can the init sequence use mipi_dsi_dcs_write_seq_multi() and
mipi_dsi_msleep() with the dsi_ctx that jd9365tx_prepare() already sets
up?  That avoids calling the deprecated mipi_dsi_dcs_write_buffer()
helper, removes the custom jd9365tx_send_cmds() loop, and drops the fixed
64-byte data[] padding per entry in struct jd9365tx_cmd.

[ ... ]

> +static int jd9365tx_probe(struct mipi_dsi_device *dsi)
> +{
> +     struct device *dev = &dsi->dev;
> +     struct jd9365tx_panel *ctx;
> +     int ret;

[ ... ]

> +     ret = of_drm_get_panel_orientation(dev->of_node, &ctx->orientation);
> +     if (ret < 0)
> +             return dev_err_probe(dev, ret, "failed to get orientation\n");

[Severity: High]
Does this fail to build when CONFIG_DRM_PANEL_VIEWE_JD9365TX is enabled?
Commit b5a8b1f2a973 ("drm/panel: Use drm_of_get_panel_orientation()")
removed of_drm_get_panel_orientation() in favor of
drm_of_get_panel_orientation() declared in <drm/drm_of.h>, which also
needs to be included here.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=4

Reply via email to