1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2015, Intel Corporation.
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms and conditions of the GNU General Public License,
8 * version 2, as published by the Free Software Foundation.
10 * This program is distributed in the hope it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 #ifndef __IA_CSS_FIRMWARE_H
17 #define __IA_CSS_FIRMWARE_H
20 * This file contains firmware loading/unloading support functionality
23 #include <linux/device.h>
24 #include "ia_css_err.h"
25 #include "ia_css_env.h"
27 /* CSS firmware package structure.
30 void *data; /** pointer to the firmware data */
31 unsigned int bytes; /** length in bytes of firmware data */
36 /* @brief Loads the firmware
37 * @param[in] env Environment, provides functions to access the
38 * environment in which the CSS code runs. This is
39 * used for host side memory access and message
41 * @param[in] fw Firmware package containing the firmware for all
42 * predefined ISP binaries.
43 * @return Returns -EINVAL in case of any
44 * errors and 0 otherwise.
46 * This function interprets the firmware package. All
47 * contents of this firmware package are copied into local data structures, so
48 * the fw pointer could be freed after this function completes.
50 * Rationale for this function is that it can be called before ia_css_init, and thus
51 * speeds up ia_css_init (ia_css_init is called each time a stream is created but the
52 * firmware only needs to be loaded once).
55 ia_css_load_firmware(struct device *dev, const struct ia_css_env *env,
56 const struct ia_css_fw *fw);
58 /* @brief Unloads the firmware
61 * This function unloads the firmware loaded by ia_css_load_firmware.
62 * It is pointless to call this function if no firmware is loaded,
63 * but it won't harm. Use this to deallocate all memory associated with the firmware.
66 ia_css_unload_firmware(void);
68 #endif /* __IA_CSS_FIRMWARE_H */