mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 12:46:14 +02:00
video: ti: am335x: Support OF graph
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@baylibre.com>
This commit is contained in:
parent
fe2547b78d
commit
de3f687e6e
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user