mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
3058e283b8
Add macro fdt_for_each_node_by_compatible() to allow iterating over fdt nodes by compatible string. Convert various usages of off = fdt_node_offset_by_compatible(fdt, start, compat); while (off > 0) { code(); off = fdt_node_offset_by_compatible(fdt, off, compat); } and similar, to fdt_for_each_node_by_compatible(off, fdt, start, compat) code(); Signed-off-by: Marek Behún <marek.behun@nic.cz> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org>
26 lines
671 B
C
26 lines
671 B
C
// SPDX-License-Identifier: GPL-2.0+
|
|
/*
|
|
* Common code for Amlogic SimpleFB with pipeline.
|
|
*
|
|
* (C) Copyright 2013-2014 Luc Verhaegen <libv@skynet.be>
|
|
* (C) Copyright 2014-2015 Hans de Goede <hdegoede@redhat.com>
|
|
* (C) Copyright 2017 Icenowy Zheng <icenowy@aosc.io>
|
|
*/
|
|
|
|
#include <fdt_support.h>
|
|
|
|
int meson_simplefb_fdt_match(void *blob, const char *pipeline)
|
|
{
|
|
int offset, ret;
|
|
|
|
/* Find a prefilled simpefb node, matching out pipeline config */
|
|
fdt_for_each_node_by_compatible(offset, blob, -1,
|
|
"amlogic,simple-framebuffer") {
|
|
ret = fdt_stringlist_search(blob, offset, "amlogic,pipeline",
|
|
pipeline);
|
|
if (ret == 0)
|
|
break;
|
|
}
|
|
|
|
return offset;
|
|
}
|