2 * Copyright (C) 2018 Intel Corporation <www.intel.com>
4 * SPDX-License-Identifier: GPL-2.0
12 * struct firmware - A place for storing firmware and its attribute data.
14 * This holds information about a firmware and its content.
16 * @size: Size of a file
17 * @data: Buffer for file
18 * @priv: Firmware loader private fields
27 * struct phandle_part - A place for storing phandle of node and its partition
29 * This holds information about a phandle of the block device, and its
30 * partition where the firmware would be loaded from.
32 * @phandle: Phandle of storage device node
33 * @partition: Partition of block device
41 * struct phandle_part - A place for storing all supported storage devices
43 * This holds information about all supported storage devices for driver use.
45 * @phandlepart: Attribute data for block device.
46 * @mtdpart: MTD partition for ubi partition.
47 * @ubivol: UBI volume-name for ubifsmount.
49 struct device_platdata {
50 struct phandle_part phandlepart;
56 * release_firmware - Release the resource associated with a firmware image
57 * @firmware: Firmware resource to release
59 void release_firmware(struct firmware *firmware);
62 * request_firmware_into_buf - Load firmware into a previously allocated buffer.
63 * @plat: Platform data such as storage and partition firmware loading from.
64 * @name: Name of firmware file.
65 * @buf: Address of buffer to load firmware into.
66 * @size: Size of buffer.
67 * @offset: Offset of a file for start reading into buffer.
68 * @firmwarep: Pointer to firmware image.
70 * The firmware is loaded directly into the buffer pointed to by @buf and
71 * the @firmwarep data member is pointed at @buf.
73 * Return: Size of total read, negative value when error.
75 int request_firmware_into_buf(struct device_platdata *plat,
77 void *buf, size_t size, u32 offset,
78 struct firmware **firmwarep);