mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Svyatoslav Ryhel <clamor95@gmail.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Thierry Reding <thierry.reding@kernel.org>,
	Jonathan Hunter <jonathanh@nvidia.com>,
	Jessica Zhang <jesszhan0024@gmail.com>,
	Mikko Perttunen <mperttunen@nvidia.com>
Cc: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
	linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 04/13] drm/panel: panel-lg-lh400wv3: Convert to use MIPI DBI bus
Date: Thu, 3 Dec 2026 11:25:27 +0100	[thread overview]
Message-ID: <530c271c-1854-42b2-8149-751a885a73b9@linaro.org> (raw)
In-Reply-To: <20261130114155.72920-5-clamor95@gmail.com>

On 11/30/26 12:41, Svyatoslav Ryhel wrote:
> Switch from a generic platform driver to a dedicated MIPI DBI Type B
> driver.
> 
> Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
> ---
>   drivers/gpu/drm/panel/panel-lg-lh400wv3.c | 34 ++++++++++-------------
>   1 file changed, 15 insertions(+), 19 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-lg-lh400wv3.c b/drivers/gpu/drm/panel/panel-lg-lh400wv3.c
> index 557bcb6f2ca70..6fe9654a7c3e8 100644
> --- a/drivers/gpu/drm/panel/panel-lg-lh400wv3.c
> +++ b/drivers/gpu/drm/panel/panel-lg-lh400wv3.c
> @@ -6,16 +6,14 @@
>   #include <linux/gpio/consumer.h>
>   #include <linux/media-bus-format.h>
>   #include <linux/module.h>
> -#include <linux/of_platform.h>
> -#include <linux/platform_device.h>
> -#include <linux/property.h>
> +#include <linux/of.h>
>   #include <linux/regulator/consumer.h>
>   
>   #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>
>   #include <drm/drm_probe_helper.h>
>   
> @@ -25,7 +23,7 @@ static const struct regulator_bulk_data lg_lh400wv3_supplies[] = {
>   
>   struct lg_lh400wv3 {
>   	struct drm_panel panel;
> -	struct mipi_dbi *dbi;
> +	struct mipi_dbi_device *dbidev;
>   
>   	struct regulator_bulk_data *supplies;
>   	struct gpio_desc *reset_gpio;
> @@ -40,9 +38,10 @@ static inline struct lg_lh400wv3 *to_lg_lh400wv3(struct drm_panel *panel)
>   ({ \
>   	const u8 d[] = { seq }; \
>   	struct drm_panel *panel = &(priv)->panel; \
> +	struct mipi_dbi_device *dbidev = (priv)->dbidev; \
>   	struct device *dev = panel->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 +53,6 @@ static int lg_lh400wv3_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(lg_lh400wv3_supplies), priv->supplies);
> @@ -73,7 +68,7 @@ static int lg_lh400wv3_prepare(struct drm_panel *panel)
>   	usleep_range(10000, 11000);
>   
>   	return 0;
> -};
> +}
>   
>   static int lg_lh400wv3_enable(struct drm_panel *panel)
>   {
> @@ -129,7 +124,7 @@ static int lg_lh400wv3_disable(struct drm_panel *panel)
>   	usleep_range(10000, 11000);
>   
>   	return 0;
> -};
> +}
>   
>   static int lg_lh400wv3_unprepare(struct drm_panel *panel)
>   {
> @@ -182,9 +177,9 @@ static const struct drm_panel_funcs lg_lh400wv3_panel_funcs = {
>   	.get_modes = lg_lh400wv3_get_modes,
>   };
>   
> -static int lg_lh400wv3_probe(struct platform_device *pdev)
> +static int lg_lh400wv3_probe(struct mipi_dbi_device *dbidev)
>   {
> -	struct device *dev = &pdev->dev;
> +	struct device *dev = &dbidev->dev;
>   	struct lg_lh400wv3 *priv;
>   	int ret;
>   
> @@ -203,6 +198,9 @@ static int lg_lh400wv3_probe(struct platform_device *pdev)
>   		return dev_err_probe(dev, PTR_ERR(priv->reset_gpio),
>   				     "Failed to get reset gpio\n");
>   
> +	priv->dbidev = dbidev;
> +	mipi_dbi_set_drvdata(dbidev, priv);
> +
>   	ret = drm_panel_of_backlight(&priv->panel);
>   	if (ret)
>   		return dev_err_probe(dev, ret, "Failed to get backlight\n");
> @@ -211,9 +209,7 @@ static int lg_lh400wv3_probe(struct platform_device *pdev)
>   	if (ret)
>   		return dev_err_probe(dev, ret, "Failed to add panel\n");
>   
> -	platform_set_drvdata(pdev, priv);
> -
> -	return 0;
> +	return devm_mipi_dbi_attach(dev, dbidev);
>   }
>   
>   static const struct of_device_id lg_lh400wv3_of_match[] = {
> @@ -222,14 +218,14 @@ static const struct of_device_id lg_lh400wv3_of_match[] = {
>   };
>   MODULE_DEVICE_TABLE(of, lg_lh400wv3_of_match);
>   
> -static struct platform_driver lg_lh400wv3_driver = {
> +static struct mipi_dbi_driver lg_lh400wv3_driver = {
>   	.driver = {
>   		.name = "panel-lg-lh400wv3",
>   		.of_match_table = lg_lh400wv3_of_match,
>   	},
>   	.probe = lg_lh400wv3_probe,
>   };
> -module_platform_driver(lg_lh400wv3_driver);
> +module_mipi_dbi_driver(lg_lh400wv3_driver);
>   
>   MODULE_AUTHOR("Svyatoslav Ryhel <clamor95@gmail.com>");
>   MODULE_DESCRIPTION("LG LH400WV3-SD04 MIPI DBI Type B panel driver");

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

Thanks,
Neil

  reply	other threads:[~2026-12-03 10:25 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 11:41 [PATCH v9 00/13] drm/tegra: Add support for Tegra20/Tegra30 8-bit CPU interface Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 01/13] drm: Add MIPI DBI bus support for MIPI DBI Type A and B Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 02/13] drm/panel: panel-hitachi-tx10d07vm0baa: Convert to use MIPI DBI bus Svyatoslav Ryhel
2026-12-03 10:25   ` Neil Armstrong
2026-11-30 11:41 ` [PATCH v9 03/13] drm/panel: panel-hitachi-tx10d07vm0baa: Convert to mipi_dbi_write_seq_multi() Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 04/13] drm/panel: panel-lg-lh400wv3: Convert to use MIPI DBI bus Svyatoslav Ryhel
2026-12-03 10:25   ` Neil Armstrong [this message]
2026-11-30 11:41 ` [PATCH v9 05/13] drm/panel: panel-lg-lh400wv3: Convert to mipi_dbi_write_seq_multi() Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 06/13] drm/tegra: dc: Add elements required by Tegra MIPI DBI Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 07/13] dt-bindings: display: tegra: Document Tegra20 DSI port Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 08/13] drm/tegra: output: Make panel parsing configurable Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 09/13] drm/tegra: Convert to use atomic versions of drm_encoder_helper_funcs Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 10/13] dt-bindings: display: tegra: Document nvidia,contiguous-rgb-pins property Svyatoslav Ryhel
2026-12-03 13:41   ` Rob Herring
2026-11-30 11:41 ` [PATCH v9 11/13] drm/tegra: rgb: Parameterize configuration based on bus flags and DT property Svyatoslav Ryhel
2026-11-30 11:41 ` [PATCH v9 12/13] dt-bindings: display: tegra: Document 8-bit CPU parallel interface Svyatoslav Ryhel
2026-11-30 13:59   ` Rob Herring (Arm)
2026-11-30 11:41 ` [PATCH v9 13/13] drm/tegra: Add support for 8-bit CPU interface Svyatoslav Ryhel

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=530c271c-1854-42b2-8149-751a885a73b9@linaro.org \
    --to=neil.armstrong@linaro.org \
    --cc=airlied@gmail.com \
    --cc=clamor95@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jesszhan0024@gmail.com \
    --cc=jonathanh@nvidia.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mperttunen@nvidia.com \
    --cc=mripard@kernel.org \
    --cc=robh@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=thierry.reding@kernel.org \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®