aboutsummaryrefslogtreecommitdiff
path: root/common/fdt_support.c
diff options
context:
space:
mode:
authorAnatolij Gustschin2010-08-18 11:25:20 +0200
committerWolfgang Denk2010-10-12 21:05:58 +0200
commitbeca5a5f5bf0d88125580e5e9c1730469cd50ab8 (patch)
tree95d523b76c1423415fba50d3bce1ff3dcd7ff352 /common/fdt_support.c
parentc000808b6aa08dc7f3137055866e6dcc3f7f8cdc (diff)
fdt_support: support adding EDID property to FDT display nodes
Boards can pass display timing info for drivers using EDID block. Provide common function to add board specific EDID data to the device tree. Subsequent patch makes use of this functionality. Detailed timing descriptor data from EDID is used for programming the display controller. This is currently implemented on the Linux side by the fsl-diu-fb frame buffer driver and it is documented there in Documentation/powerpc/dts-bindings/fsl/diu.txt. Signed-off-by: Anatolij Gustschin <agust@denx.de> Acked-by: Detlev Zundel <dzu@denx.de> Cc: Gerald Van Baren <vanbaren@cideas.com>
Diffstat (limited to 'common/fdt_support.c')
-rw-r--r--common/fdt_support.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/common/fdt_support.c b/common/fdt_support.c
index 0ed6e77292d..9b65a8adfde 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -1189,3 +1189,32 @@ int fdt_alloc_phandle(void *blob)
return phandle + 1;
}
+
+#if defined(CONFIG_VIDEO)
+int fdt_add_edid(void *blob, const char *compat, unsigned char *edid_buf)
+{
+ int noff;
+ int ret;
+
+ noff = fdt_node_offset_by_compatible(blob, -1, compat);
+ if (noff != -FDT_ERR_NOTFOUND) {
+ debug("%s: %s\n", fdt_get_name(blob, noff, 0), compat);
+add_edid:
+ ret = fdt_setprop(blob, noff, "edid", edid_buf, 128);
+ if (ret == -FDT_ERR_NOSPACE) {
+ ret = fdt_increase_size(blob, 512);
+ if (!ret)
+ goto add_edid;
+ else
+ goto err_size;
+ } else if (ret < 0) {
+ printf("Can't add property: %s\n", fdt_strerror(ret));
+ return ret;
+ }
+ }
+ return 0;
+err_size:
+ printf("Can't increase blob size: %s\n", fdt_strerror(ret));
+ return ret;
+}
+#endif