mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Johannes Schneider <johannes.schneider@leica-geosystems.com>
To: barebox@lists.infradead.org, a.fatoum@pengutronix.de,
	mgr@kernel.org, l.stach@pengutronix.de
Cc: thomas.haemmerle@leica-geosystems.com,
	Johannes Schneider <johannes.schneider@leica-geosystems.com>
Subject: [PATCH v2 10/11] video: simple-panel: support panel-lvds DT bindings
Date: Thu,  4 Jun 2026 06:50:05 +0000	[thread overview]
Message-ID: <20260604065006.2933142-11-johannes.schneider@leica-geosystems.com> (raw)
In-Reply-To: <20260604065006.2933142-1-johannes.schneider@leica-geosystems.com>

simple-panel already parses display-timings, enable-gpios and a
backlight phandle from DT, which is exactly what a Linux panel-lvds
node provides.  Unlike Linux's drivers/gpu/drm/panel/panel-simple.c
we have no hardcoded panel tables, so there's nothing LVDS-specific
left for a dedicated driver to do.  Bring panel-lvds DTs in:

  - Match "panel-lvds" in the of_device_id table.

  - Read modes from a "panel-timing" subnode as a fallback when
    "display-timings" isn't present.  Linux's panel-lvds binding uses
    the singular form; without this, the panel reports "No modes
    found" and the display chain has nothing to allocate a fb for.

  - Switch the power-supply lookup to regulator_get_optional() and
    treat -ENODEV as "no supply".  Many panel-lvds DTs omit
    "power-supply" because the rail is hard-wired; the call sites
    already pass NULL through safely.

Signed-off-by: Johannes Schneider <johannes.schneider@leica-geosystems.com>
---
 drivers/video/simple-panel.c | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/video/simple-panel.c b/drivers/video/simple-panel.c
index 63a032a9b8..66d519425a 100644
--- a/drivers/video/simple-panel.c
+++ b/drivers/video/simple-panel.c
@@ -112,6 +112,19 @@ static int simple_panel_get_modes(struct simple_panel *panel, struct display_tim
 		return 0;
 	}
 
+	/* panel-lvds DTs put the single mode in "panel-timing", not "display-timings" */
+	if (of_get_child_by_name(panel->dev->of_node, "panel-timing")) {
+		struct fb_videomode *mode = xzalloc(sizeof(*mode));
+
+		ret = of_get_display_timing(panel->dev->of_node, "panel-timing", mode);
+		if (!ret) {
+			timings->modes = mode;
+			timings->num_modes = 1;
+			return 0;
+		}
+		free(mode);
+	}
+
 	dev_err(panel->dev, "No modes found\n");
 
 	return -ENOENT;
@@ -162,9 +175,12 @@ static int simple_panel_probe(struct device *dev)
 
 	panel->backlight_node = of_parse_phandle(node, "backlight", 0);
 
-	panel->power = regulator_get(dev, "power");
-	if (IS_ERR(panel->power))
-		return dev_errp_probe(dev, panel->power, "Cannot find regulator\n");
+	panel->power = regulator_get_optional(dev, "power");
+	if (IS_ERR(panel->power)) {
+		if (PTR_ERR(panel->power) != -ENODEV)
+			return dev_errp_probe(dev, panel->power, "power supply\n");
+		panel->power = NULL;
+	}
 
 	ret = vpl_register(&panel->vpl);
 	if (ret)
@@ -175,6 +191,7 @@ static int simple_panel_probe(struct device *dev)
 
 static struct of_device_id simple_panel_of_ids[] = {
 	{ .compatible = "simple-panel", },
+	{ .compatible = "panel-lvds", },
 	{ }
 };
 MODULE_DEVICE_TABLE(of, simple_panel_of_ids);
-- 
2.43.0




  parent reply	other threads:[~2026-06-04  6:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-04  6:49 [PATCH v2 00/11] video: enable boot splash on i.MX8MP with LVDS panel Johannes Schneider
2026-06-04  6:49 ` [PATCH v2 01/11] clk: imx8mp: add 700 MHz rate entry for VIDEO_PLL1 Johannes Schneider
2026-06-04  6:49 ` [PATCH v2 02/11] clk: imx8mp: add 1039.5 MHz and 519.75 MHz rate entries " Johannes Schneider
2026-06-04  6:49 ` [PATCH v2 03/11] pmdomain: imx8mp-blk-ctrl: add media blk-ctrl power domain support Johannes Schneider
2026-06-04  6:49 ` [PATCH v2 04/11] video: backlight-pwm: make power-supply and enable-gpio optional Johannes Schneider
2026-06-04  6:50 ` [PATCH v2 05/11] video: lcdif: make functional on i.MX8MP Johannes Schneider
2026-06-04  6:50 ` [PATCH v2 06/11] video: lcdif: use 128B AXI bursts to avoid right-edge gap Johannes Schneider
2026-06-04  6:50 ` [PATCH v2 07/11] video: lcdif: default to RGB888_1X24 on VPL_GET_BUS_FORMAT failure Johannes Schneider
2026-06-04  6:50 ` [PATCH v2 08/11] video: lcdif: register simplefb fixup and enable framebuffer at probe Johannes Schneider
2026-06-04  6:50 ` [PATCH v2 09/11] video: lcdif: drain write-combine framebuffer in fb_damage Johannes Schneider
2026-06-04  6:50 ` Johannes Schneider [this message]
2026-06-04  6:50 ` [PATCH v2 11/11] video: simple-panel: lazily resolve backlight without failing Johannes Schneider

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=20260604065006.2933142-11-johannes.schneider@leica-geosystems.com \
    --to=johannes.schneider@leica-geosystems.com \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    --cc=mgr@kernel.org \
    --cc=thomas.haemmerle@leica-geosystems.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