Re: [PATCH 5/6] video: add generic panel-lvds driver

Ahmad Fatoum <[email protected]>
Newsgroups org.infradead.lists.barebox
Message-ID <[email protected]>
Hello,

On 6/2/26 6:09 AM, Johannes Schneider wrote:
> From: Thomas Haemmerle <[email protected]>
> 
> Barebox has no driver for "panel-lvds" compatible DT nodes, which are used by
> all i.MX8M board display pipelines to describe LVDS panels with a panel-timing
> subnode. Without this driver the VPL chain in fsl-ldb terminates before it can
> query video modes, and the LCDIF2 framebuffer driver cannot determine the active
> display resolution, so no framebuffer is allocated and no splash is shown.
> 
> The driver reads one video mode from the panel-timing subnode, enables
> an optional power-supply regulator and enable GPIO on VPL_ENABLE, and
> controls an optional backlight device.  Closely follows the Linux
> drivers/gpu/drm/panel/panel-lvds.c behavior.

We have a driver though for simple-panel. I lean towards extending the
simple-panel driver with the panel-lvds compatible and adding any
feature it might miss there.

AFAICS, there is nothing really lvds specific here. I know Linux has
separate simple-panel drivers, but the barebox simple panel driver is
different: It has no hardcoded panel types, but only parses the DT,
exactly like what you do here.

> +static int panel_lvds_enable(struct panel_lvds *panel)
> +{
> +	int ret;
> +
> +	if (panel->power) {
> +		ret = regulator_enable(panel->power);

regulator_enable(NULL) returns 0, so no need to check here.

> +	panel->enable_gpio = of_get_named_gpio_flags(dev->of_node, "enable-gpios",
> +						     0, &panel->enable_gpio_flags);

Please use the gpiod_ family of functions for new code.


Cheers,
Ahmad

-- 
Pengutronix e.K.                  |                             |
Steuerwalder Str. 21              | http://www.pengutronix.de/  |
31137 Hildesheim, Germany         | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686  | Fax:   +49-5121-206917-5555 |
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.