diff --git a/include/fdtdec.h b/include/fdtdec.h index e70714b2f2cb4973ae4dc4dd14320edadca49aa1..f8a4e94186d654550014f30e5849cea2d7e1f9d0 100644 --- a/include/fdtdec.h +++ b/include/fdtdec.h @@ -109,6 +109,19 @@ struct fdt_gpio_state { int fdtdec_next_alias(const void *blob, const char *name, enum fdt_compat_id id, int *upto); +/** + * Find the compatible ID for a given node. + * + * Generally each node has at least one compatible string attached to it. + * This function looks through our list of known compatible strings and + * returns the corresponding ID which matches the compatible string. + * + * @param blob FDT blob to use + * @param node Node containing compatible string to find + * @return compatible ID, or COMPAT_UNKNOWN if we cannot find a match + */ +enum fdt_compat_id fdtdec_lookup(const void *blob, int node); + /** * Find the next compatible node for a peripheral. * diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 32f03cc82b63a35ede520c62e662d7940ae527fe..96f3e7bccf41dd8cdc31efcbeebaad491806b7ce 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -128,7 +128,7 @@ int fdtdec_get_is_enabled(const void *blob, int node) return 1; } -enum fdt_compat_id fd_dec_lookup(const void *blob, int node) +enum fdt_compat_id fdtdec_lookup(const void *blob, int node) { enum fdt_compat_id id;