Skip to content
Snippets Groups Projects
Commit beca5a5f authored by Anatolij Gustschin's avatar Anatolij Gustschin Committed by Wolfgang Denk
Browse files

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: default avatarAnatolij Gustschin <agust@denx.de>
Acked-by: default avatarDetlev Zundel <dzu@denx.de>
Cc: Gerald Van Baren <vanbaren@cideas.com>
parent c000808b
No related branches found
No related tags found
No related merge requests found
...@@ -1189,3 +1189,32 @@ int fdt_alloc_phandle(void *blob) ...@@ -1189,3 +1189,32 @@ int fdt_alloc_phandle(void *blob)
return phandle + 1; 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
...@@ -87,6 +87,7 @@ u64 fdt_translate_address(void *blob, int node_offset, const u32 *in_addr); ...@@ -87,6 +87,7 @@ u64 fdt_translate_address(void *blob, int node_offset, const u32 *in_addr);
int fdt_node_offset_by_compat_reg(void *blob, const char *compat, int fdt_node_offset_by_compat_reg(void *blob, const char *compat,
phys_addr_t compat_off); phys_addr_t compat_off);
int fdt_alloc_phandle(void *blob); int fdt_alloc_phandle(void *blob);
int fdt_add_edid(void *blob, const char *compat, unsigned char *buf);
#endif /* ifdef CONFIG_OF_LIBFDT */ #endif /* ifdef CONFIG_OF_LIBFDT */
#endif /* ifndef __FDT_SUPPORT_H */ #endif /* ifndef __FDT_SUPPORT_H */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment