Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Icenowy Zheng | 067a697 | 2017-10-26 11:14:45 +0800 | [diff] [blame] | 2 | /* |
| 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 Zheng | 067a697 | 2017-10-26 11:14:45 +0800 | [diff] [blame] | 8 | */ |
| 9 | |
Marek BehĂșn | 5d6b448 | 2022-01-20 01:04:42 +0100 | [diff] [blame] | 10 | #include <fdt_support.h> |
Icenowy Zheng | 067a697 | 2017-10-26 11:14:45 +0800 | [diff] [blame] | 11 | |
| 12 | int 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"); |
Marek BehĂșn | 5d6b448 | 2022-01-20 01:04:42 +0100 | [diff] [blame] | 19 | fdt_for_each_node_by_compatible(offset, blob, -1, |
| 20 | "allwinner,simple-framebuffer") { |
Icenowy Zheng | 067a697 | 2017-10-26 11:14:45 +0800 | [diff] [blame] | 21 | ret = fdt_stringlist_search(blob, offset, "allwinner,pipeline", |
| 22 | pipeline); |
| 23 | if (ret == 0) |
| 24 | break; |
Icenowy Zheng | 067a697 | 2017-10-26 11:14:45 +0800 | [diff] [blame] | 25 | } |
| 26 | |
| 27 | return offset; |
| 28 | } |