simplefb_common.c 786 B

1234567891011121314151617181920212223242526272829
  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. #include <fdtdec.h>
  10. int meson_simplefb_fdt_match(void *blob, const char *pipeline)
  11. {
  12. int offset, ret;
  13. /* Find a prefilled simpefb node, matching out pipeline config */
  14. offset = fdt_node_offset_by_compatible(blob, -1,
  15. "amlogic,simple-framebuffer");
  16. while (offset >= 0) {
  17. ret = fdt_stringlist_search(blob, offset, "amlogic,pipeline",
  18. pipeline);
  19. if (ret == 0)
  20. break;
  21. offset = fdt_node_offset_by_compatible(blob, offset,
  22. "amlogic,simple-framebuffer");
  23. }
  24. return offset;
  25. }