summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMichael Tretter <m.tretter@pengutronix.de>2019-09-13 15:14:42 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-09-16 09:06:18 +0200
commit32559cecae49998091dd5645b386ed917f5c468d (patch)
treeaf91b1a8977ac3ad1f3178760bc5b6cf9ba5f597 /include
parentca7b8f85f0d9455b631461288535a3cef7e58fdf (diff)
downloadbarebox-32559cecae49998091dd5645b386ed917f5c468d.tar.gz
barebox-32559cecae49998091dd5645b386ed917f5c468d.tar.xz
firmware: add function to find firmware by devicetree node
Allows to get the firmware manager using a phandle from the devicetree. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/firmware.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/firmware.h b/include/firmware.h
index 284e0f9705..7c01a77118 100644
--- a/include/firmware.h
+++ b/include/firmware.h
@@ -34,10 +34,25 @@ struct firmware_mgr;
int firmwaremgr_register(struct firmware_handler *);
struct firmware_mgr *firmwaremgr_find(const char *);
+#ifdef CONFIG_FIRMWARE
+struct firmware_mgr *firmwaremgr_find_by_node(const struct device_node *np);
+#else
+static inline struct firmware_mgr *firmwaremgr_find_by_node(const struct device_node *np)
+{
+ return NULL;
+}
+#endif
void firmwaremgr_list_handlers(void);
+#ifdef CONFIG_FIRMWARE
int firmwaremgr_load_file(struct firmware_mgr *, const char *path);
+#else
+static inline int firmwaremgr_load_file(struct firmware_mgr *mgr, const char *path)
+{
+ return -ENOSYS;
+}
+#endif
#define get_builtin_firmware(name, start, size) \
{ \