blob: 0cf5f0c42bd2d7ce5a47afbc29ef63b5c14cb09f [file] [log] [blame]
Icenowy Zhenge5f92462017-10-26 11:14:45 +08001/*
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
13int 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}