]> git.sur5r.net Git - u-boot/blob - drivers/video/sunxi/simplefb_common.c
Merge git://git.denx.de/u-boot-sunxi
[u-boot] / drivers / video / sunxi / simplefb_common.c
1 /*
2  * Common code for Allwinner SimpleFB with pipeline.
3  *
4  * (C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
5  * (C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
6  * (C) Copyright 2017 Icenowy Zheng <icenowy@aosc.io>
7  *
8  * SPDX-License-Identifier:     GPL-2.0+
9  */
10
11 #include <fdtdec.h>
12
13 int sunxi_simplefb_fdt_match(void *blob, const char *pipeline)
14 {
15         int offset, ret;
16
17         /* Find a prefilled simpefb node, matching out pipeline config */
18         offset = fdt_node_offset_by_compatible(blob, -1,
19                                                "allwinner,simple-framebuffer");
20         while (offset >= 0) {
21                 ret = fdt_stringlist_search(blob, offset, "allwinner,pipeline",
22                                             pipeline);
23                 if (ret == 0)
24                         break;
25                 offset = fdt_node_offset_by_compatible(blob, offset,
26                                                 "allwinner,simple-framebuffer");
27         }
28
29         return offset;
30 }