On Thu, Nov 05, 2026 at 04:05:02PM +0200, Svyatoslav Ryhel wrote:
> Switch from a generic platform driver to a dedicated MIPI DBI driver.
> 
> Signed-off-by: Svyatoslav Ryhel <[email protected]>
> ---
>  .../drm/panel/panel-hitachi-tx10d07vm0baa.c   | 167 ++++++++----------
>  1 file changed, 78 insertions(+), 89 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c 
> b/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c
> index 83c2af1be9755..d5d7ba2096608 100644
> --- a/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c
> +++ b/drivers/gpu/drm/panel/panel-hitachi-tx10d07vm0baa.c
> @@ -14,6 +14,7 @@
>  #include <video/mipi_display.h>
>  
>  #include <drm/drm_mipi_dbi.h>
> +#include <drm/drm_mipi_dbi_bus.h>
>  #include <drm/drm_modes.h>
>  #include <drm/drm_of.h>
>  #include <drm/drm_panel.h>
> @@ -25,7 +26,7 @@ static const struct regulator_bulk_data 
> hitachi_tx10d07vm0baa_supplies[] = {
>  
>  struct hitachi_tx10d07vm0baa {
>       struct drm_panel panel;
> -     struct mipi_dbi *dbi;
> +     struct mipi_dbi_device *dbi;

It's somewhat difficult to exactly see the difference between mipi_dbi
and mipi_dbi_device. Maybe that should be explained better in the cover
letter of patch 1? Or the documentation added in patch1.

>  
>       struct regulator_bulk_data *supplies;
>       struct gpio_desc *reset_gpio;
> @@ -36,13 +37,12 @@ static inline struct hitachi_tx10d07vm0baa 
> *to_hitachi_tx10d07vm0baa(struct drm_
>       return container_of(panel, struct hitachi_tx10d07vm0baa, panel);
>  }
>  
> -#define panel_dbi_command(priv, cmd, seq...) \
> +#define panel_dbi_command(dbidev, cmd, seq...) \
>  ({ \
>       const u8 d[] = { seq }; \
> -     struct drm_panel *panel = &(priv)->panel; \
> -     struct device *dev = panel->dev; \
> +     struct device *dev = &(dbidev)->dev; \
>       int ret; \
> -     ret = mipi_dbi_command_stackbuf((priv)->dbi, cmd, d, ARRAY_SIZE(d)); \
> +     ret = mipi_dbi_command_stackbuf((dbidev)->dbi, cmd, d, ARRAY_SIZE(d)); \
>       if (ret) \
>               dev_err_ratelimited(dev, "error %d when sending command 
> %#02x\n", ret, cmd); \
>       ret; \
> @@ -54,10 +54,6 @@ static int hitachi_tx10d07vm0baa_prepare(struct drm_panel 
> *panel)
>       struct device *dev = panel->dev;
>       int ret;
>  
> -     priv->dbi = dev_get_drvdata(dev->parent);
> -     if (!priv->dbi)
> -             return -ENODEV;
> -
>       gpiod_set_value_cansleep(priv->reset_gpio, 1);
>  
>       ret = regulator_bulk_enable(ARRAY_SIZE(hitachi_tx10d07vm0baa_supplies), 
> priv->supplies);
> @@ -79,123 +75,116 @@ static int hitachi_tx10d07vm0baa_enable(struct 
> drm_panel *panel)
>  {
>       struct hitachi_tx10d07vm0baa *priv = to_hitachi_tx10d07vm0baa(panel);
>  
> -     panel_dbi_command(priv, MIPI_DCS_SET_PARTIAL_ROWS, 0x00, 0x00, 0x03, 
> 0x1f);
> -     panel_dbi_command(priv, MIPI_DCS_SET_SCROLL_AREA, 0x00, 0x00, 0x03, 
> 0x20,
> +     panel_dbi_command(priv->dbi, MIPI_DCS_SET_PARTIAL_ROWS, 0x00, 0x00, 
> 0x03, 0x1f);
> +     panel_dbi_command(priv->dbi, MIPI_DCS_SET_SCROLL_AREA, 0x00, 0x00, 
> 0x03, 0x20,
>                         0x00, 0x00);

The majority of the changes in this file are s/priv/priv->dbi/, so maybe
just make it so that priv = priv->db and keep the changes to a minimum?

Thierry

Attachment: signature.asc
Description: PGP signature

Reply via email to