1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * Common code for Amlogic 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>
8  */
9 
10 #include <fdt_support.h>
11 
meson_simplefb_fdt_match(void * blob,const char * pipeline)12 int meson_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 	fdt_for_each_node_by_compatible(offset, blob, -1,
18 					"amlogic,simple-framebuffer") {
19 		ret = fdt_stringlist_search(blob, offset, "amlogic,pipeline",
20 					    pipeline);
21 		if (ret == 0)
22 			break;
23 	}
24 
25 	return offset;
26 }
27