[PATCH 2/2] video: ti: am335x: Support OF graph
Markus Schneider-Pargmann (TI.com)
msp at baylibre.com
Fri Nov 28 11:34:19 CET 2025
Add support for OF graph parsing. When using OF graph the default
tilcdc_panel_info is used which is the same as defined in Linux.
Signed-off-by: Markus Schneider-Pargmann (TI.com) <msp at baylibre.com>
---
drivers/video/ti/tilcdc.c | 46 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 38 insertions(+), 8 deletions(-)
diff --git a/drivers/video/ti/tilcdc.c b/drivers/video/ti/tilcdc.c
index 340c79299bacabc5a95dbeafbed3cb729afe7576..b498e81864b87464c00c1b23cb1d35394b06d9e8 100644
--- a/drivers/video/ti/tilcdc.c
+++ b/drivers/video/ti/tilcdc.c
@@ -6,6 +6,7 @@
#include <clk.h>
#include <dm.h>
#include <dm/device_compat.h>
+#include <dm/ofnode_graph.h>
#include <log.h>
#include <panel.h>
#include <video.h>
@@ -113,6 +114,18 @@ struct tilcdc_priv {
DECLARE_GLOBAL_DATA_PTR;
+static const struct tilcdc_panel_info tilcdc_panel_info_default = {
+ .ac_bias = 255,
+ .ac_bias_intrpt = 0,
+ .dma_burst_sz = 16,
+ .bpp = 16,
+ .fdd = 0x80,
+ .tft_alt_mode = 0,
+ .sync_edge = 0,
+ .sync_ctrl = 1,
+ .raster_order = 0,
+};
+
static ulong tilcdc_set_pixel_clk_rate(struct udevice *dev, ulong rate)
{
struct tilcdc_priv *priv = dev_get_priv(dev);
@@ -173,6 +186,8 @@ static int tilcdc_probe(struct udevice *dev)
struct udevice *panel, *clk_dev;
struct tilcdc_panel_info info;
struct display_timing timing;
+ bool is_legacy_panel = false;
+ ofnode remote;
ulong rate;
u32 reg;
int err;
@@ -181,10 +196,21 @@ static int tilcdc_probe(struct udevice *dev)
if (!(gd->flags & GD_FLG_RELOC))
return 0;
- err = uclass_get_device(UCLASS_PANEL, 0, &panel);
- if (err) {
- dev_err(dev, "failed to get panel\n");
- return err;
+ /* Try using remote node first, then fall back to using UCLASS_PANEL */
+ remote = ofnode_graph_get_remote_node(dev_ofnode(dev), -1, -1);
+ if (ofnode_valid(remote)) {
+ err = uclass_get_device_by_ofnode(UCLASS_PANEL, remote, &panel);
+ if (err) {
+ dev_err(dev, "failed to get panel via OF graph\n");
+ return err;
+ }
+ } else {
+ err = uclass_get_device(UCLASS_PANEL, 0, &panel);
+ if (err) {
+ dev_err(dev, "failed to get panel\n");
+ return err;
+ }
+ is_legacy_panel = true;
}
err = panel_get_display_timing(panel, &timing);
@@ -205,10 +231,14 @@ static int tilcdc_probe(struct udevice *dev)
if (timing.vactive.typ > LCDC_MAX_HEIGHT)
timing.vactive.typ = LCDC_MAX_HEIGHT;
- err = tilcdc_panel_get_display_info(panel, &info);
- if (err) {
- dev_err(dev, "failed to get panel info\n");
- return err;
+ if (is_legacy_panel) {
+ err = tilcdc_panel_get_display_info(panel, &info);
+ if (err) {
+ dev_err(dev, "failed to get panel info\n");
+ return err;
+ }
+ } else {
+ info = tilcdc_panel_info_default;
}
switch (info.bpp) {
--
2.51.0
More information about the U-Boot
mailing list