diff options
author | Philipp Zabel <p.zabel@pengutronix.de> | 2023-03-30 14:46:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2023-04-05 11:54:37 +0200 |
commit | 28e00cb53bf2d5f7bf80a84156202fa2ab8fadd7 (patch) | |
tree | fbfce3b5b341b3ba464092b7289e200466898191 /include | |
parent | 4331fe82a01336b863cd113573f97a839943f60a (diff) | |
download | barebox-28e00cb53bf2d5f7bf80a84156202fa2ab8fadd7.tar.gz |
firmware: Add request/release_firmware() calls
Add request_firmware() and release_firmware() calls that allow drivers
to load a firmware file. Also move the struct firmware definition from
remoteproc.h into firmware.h.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20230330124643.3562397-1-p.zabel@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/firmware.h | 16 | ||||
-rw-r--r-- | include/linux/remoteproc.h | 5 |
2 files changed, 16 insertions, 5 deletions
diff --git a/include/firmware.h b/include/firmware.h index 05433f2f78..93c800e11b 100644 --- a/include/firmware.h +++ b/include/firmware.h @@ -13,6 +13,11 @@ #include <debug_ll.h> #include <linux/kernel.h> +struct firmware { + size_t size; + const u8 *data; +}; + struct firmware_handler { char *id; /* unique identifier for this firmware device */ char *model; /* description for this device */ @@ -37,6 +42,8 @@ struct firmware_mgr *firmwaremgr_find_by_node(struct device_node *np); int firmwaremgr_load_file(struct firmware_mgr *, const char *path); char *firmware_get_searchpath(void); void firmware_set_searchpath(const char *path); +int request_firmware(const struct firmware **fw, const char *fw_name, struct device *dev); +void release_firmware(const struct firmware *fw); #else static inline struct firmware_mgr *firmwaremgr_find_by_node(struct device_node *np) { @@ -57,6 +64,15 @@ static inline void firmware_set_searchpath(const char *path) { } +static inline int request_firmware(const struct firmware **fw, const char *fw_name, + struct device *dev) +{ + return -EINVAL; +} + +static inline void release_firmware(const struct firmware *fw) +{ +} #endif void firmwaremgr_list_handlers(void); diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 170fff7987..33fe2f81b7 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -18,11 +18,6 @@ struct resource_table { u32 offset[0]; } __packed; -struct firmware { - size_t size; - const u8 *data; -}; - struct rproc; struct rproc_ops { |