summaryrefslogtreecommitdiff
path: root/drivers/core/ofnode.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2023-02-04 14:53:00 -0500
committerTom Rini <trini@konsulko.com>2023-02-04 14:53:00 -0500
commitf8f47e6ff214a3ba7a61025bcc4dc058f507c279 (patch)
tree081b7f28b6d20344bcfc064dd8b39f0dce742061 /drivers/core/ofnode.c
parenta209c3e6b48cf042d0220245a2d1636f74389c17 (diff)
parent03610ebf3520ae768ff90c4831f39088088ee666 (diff)
Merge tag 'video-20230204' of https://source.denx.de/u-boot/custodians/u-boot-video
- restore TI AM335x LCDC driver with DM support - make simple panel independent of backlight - add ofnode panel timing decode functions with test - add TIDSS video driver and AM62x splash screen - add TI logo
Diffstat (limited to 'drivers/core/ofnode.c')
-rw-r--r--drivers/core/ofnode.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/drivers/core/ofnode.c b/drivers/core/ofnode.c
index 4d56b1a7675..d08578e9c4f 100644
--- a/drivers/core/ofnode.c
+++ b/drivers/core/ofnode.c
@@ -991,6 +991,53 @@ int ofnode_decode_display_timing(ofnode parent, int index,
return ret;
}
+int ofnode_decode_panel_timing(ofnode parent,
+ struct display_timing *dt)
+{
+ ofnode timings;
+ u32 val = 0;
+ int ret = 0;
+
+ timings = ofnode_find_subnode(parent, "panel-timings");
+ if (!ofnode_valid(timings))
+ return -EINVAL;
+ memset(dt, 0, sizeof(*dt));
+ ret |= decode_timing_property(timings, "hback-porch", &dt->hback_porch);
+ ret |= decode_timing_property(timings, "hfront-porch", &dt->hfront_porch);
+ ret |= decode_timing_property(timings, "hactive", &dt->hactive);
+ ret |= decode_timing_property(timings, "hsync-len", &dt->hsync_len);
+ ret |= decode_timing_property(timings, "vback-porch", &dt->vback_porch);
+ ret |= decode_timing_property(timings, "vfront-porch", &dt->vfront_porch);
+ ret |= decode_timing_property(timings, "vactive", &dt->vactive);
+ ret |= decode_timing_property(timings, "vsync-len", &dt->vsync_len);
+ ret |= decode_timing_property(timings, "clock-frequency", &dt->pixelclock);
+ dt->flags = 0;
+ if (!ofnode_read_u32(timings, "vsync-active", &val)) {
+ dt->flags |= val ? DISPLAY_FLAGS_VSYNC_HIGH :
+ DISPLAY_FLAGS_VSYNC_LOW;
+ }
+ if (!ofnode_read_u32(timings, "hsync-active", &val)) {
+ dt->flags |= val ? DISPLAY_FLAGS_HSYNC_HIGH :
+ DISPLAY_FLAGS_HSYNC_LOW;
+ }
+ if (!ofnode_read_u32(timings, "de-active", &val)) {
+ dt->flags |= val ? DISPLAY_FLAGS_DE_HIGH :
+ DISPLAY_FLAGS_DE_LOW;
+ }
+ if (!ofnode_read_u32(timings, "pixelclk-active", &val)) {
+ dt->flags |= val ? DISPLAY_FLAGS_PIXDATA_POSEDGE :
+ DISPLAY_FLAGS_PIXDATA_NEGEDGE;
+ }
+ if (ofnode_read_bool(timings, "interlaced"))
+ dt->flags |= DISPLAY_FLAGS_INTERLACED;
+ if (ofnode_read_bool(timings, "doublescan"))
+ dt->flags |= DISPLAY_FLAGS_DOUBLESCAN;
+ if (ofnode_read_bool(timings, "doubleclk"))
+ dt->flags |= DISPLAY_FLAGS_DOUBLECLK;
+
+ return ret;
+}
+
const void *ofnode_get_property(ofnode node, const char *propname, int *lenp)
{
if (ofnode_is_np(node))