summaryrefslogtreecommitdiff
path: root/include/linux/firmware.h
diff options
context:
space:
mode:
authorVikram Mulukutla <markivx@codeaurora.org>2013-08-05 11:39:20 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-22 11:07:35 -0700
commit53adc478c89511d5614940fd7580e8225160d007 (patch)
tree68c5d6ff89c370b26939f344d671b7f5ff841910 /include/linux/firmware.h
parente7c870ae4ce5e077b5b481a9478002c17fafb488 (diff)
firmware_class: Introduce the request_firmware_direct API
On devices with low memory, using request_firmware on rather large firmware images results in a memory usage penalty that might be unaffordable. Introduce a new API that allows the firmware image to be directly loaded to a destination address without using any intermediate buffer. Change-Id: I51b55dd9044ea669e2126a3f908028850bf76325 Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org> [joshc: renamed request_firmware_direct to request_firmware_into_buf, avoiding namespace conflict] Signed-off-by: Josh Cartwright <joshc@codeaurora.org> [vmulukut: upstream merge conflict fixups] Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org> [dkeitel: upstream merge conflict fixups] Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Diffstat (limited to 'include/linux/firmware.h')
-rw-r--r--include/linux/firmware.h33
1 files changed, 32 insertions, 1 deletions
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 5c41c5e75b5c..bb31b5ad09f7 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -48,6 +48,18 @@ int request_firmware_nowait(
int request_firmware_direct(const struct firmware **fw, const char *name,
struct device *device);
+int request_firmware_into_buf(const char *name, struct device *device,
+ phys_addr_t dest_addr, size_t dest_size,
+ void * (*map_fw_mem)(phys_addr_t phys,
+ size_t size),
+ void (*unmap_fw_mem)(void *virt));
+int request_firmware_nowait_into_buf(
+ struct module *module, bool uevent,
+ const char *name, struct device *device, gfp_t gfp, void *context,
+ void (*cont)(const struct firmware *fw, void *context),
+ phys_addr_t dest_addr, size_t dest_size,
+ void * (*map_fw_mem)(phys_addr_t phys, size_t size),
+ void (*unmap_fw_mem)(void *virt));
void release_firmware(const struct firmware *fw);
#else
static inline int request_firmware(const struct firmware **fw,
@@ -56,6 +68,16 @@ static inline int request_firmware(const struct firmware **fw,
{
return -EINVAL;
}
+static inline int request_firmware_into_buf(const char *name,
+ struct device *device,
+ phys_addr_t dest_addr,
+ size_t dest_size,
+ void * (*map_fw_mem)(phys_addr_t phys,
+ size_t size),
+ void (*unmap_fw_mem)(void *virt))
+{
+ return -EINVAL;
+}
static inline int request_firmware_nowait(
struct module *module, bool uevent,
const char *name, struct device *device, gfp_t gfp, void *context,
@@ -63,7 +85,16 @@ static inline int request_firmware_nowait(
{
return -EINVAL;
}
-
+static inline int request_firmware_nowait_into_buf(
+ struct module *module, bool uevent,
+ const char *name, struct device *device, gfp_t gfp, void *context,
+ void (*cont)(const struct firmware *fw, void *context),
+ phys_addr_t dest_addr, size_t dest_size,
+ void * (*map_fw_mem)(phys_addr_t phys, size_t size),
+ void (*unmap_fw_mem)(void *virt))
+{
+ return -EINVAL;
+}
static inline void release_firmware(const struct firmware *fw)
{
}