blob: df6501e4c3f85c3d8f24498fb885a80c2dbad893 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Icenowy Zhenge5f92462017-10-26 11:14:45 +08002/*
3 * Common code for Allwinner SimpleFB with pipeline.
4 *
5 * (C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
6 * (C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
7 * (C) Copyright 2017 Icenowy Zheng <icenowy@aosc.io>
Icenowy Zhenge5f92462017-10-26 11:14:45 +08008 */
9
10#include <fdtdec.h>
11
12int sunxi_simplefb_fdt_match(void *blob, const char *pipeline)
13{
14 int offset, ret;
15
16 /* Find a prefilled simpefb node, matching out pipeline config */
17 offset = fdt_node_offset_by_compatible(blob, -1,
18 "allwinner,simple-framebuffer");
19 while (offset >= 0) {
20 ret = fdt_stringlist_search(blob, offset, "allwinner,pipeline",
21 pipeline);
22 if (ret == 0)
23 break;
24 offset = fdt_node_offset_by_compatible(blob, offset,
25 "allwinner,simple-framebuffer");
26 }
27
28 return offset;
29}