1 /* SPDX-License-Identifier: GPL-2.0 */
3 * Support for Clovertrail PNW Camera Imaging ISP subsystem.
5 * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
19 #ifndef __ATOMISP_ACC_H__
20 #define __ATOMISP_ACC_H__
22 #include "../../include/linux/atomisp.h"
23 #include "atomisp_internal.h"
25 #include "ia_css_types.h"
28 * Interface functions for AtomISP driver acceleration API implementation.
31 struct atomisp_sub_device;
33 void atomisp_acc_cleanup(struct atomisp_device *isp);
36 * Free up any allocated resources.
37 * Must be called each time when the device is closed.
38 * Note that there isn't corresponding open() call;
39 * this function may be called sequentially multiple times.
40 * Must be called to free up resources before driver is unloaded.
42 void atomisp_acc_release(struct atomisp_sub_device *asd);
44 /* Load acceleration binary. DEPRECATED. */
45 int atomisp_acc_load(struct atomisp_sub_device *asd,
46 struct atomisp_acc_fw_load *fw);
48 /* Load acceleration binary with specified properties */
49 int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
50 struct atomisp_acc_fw_load_to_pipe *fw);
52 /* Unload specified acceleration binary */
53 int atomisp_acc_unload(struct atomisp_sub_device *asd,
54 unsigned int *handle);
57 * Map a memory region into ISP memory space.
59 int atomisp_acc_map(struct atomisp_sub_device *asd,
60 struct atomisp_acc_map *map);
63 * Unmap a mapped memory region.
65 int atomisp_acc_unmap(struct atomisp_sub_device *asd,
66 struct atomisp_acc_map *map);
69 * Set acceleration binary argument to a previously mapped memory region.
71 int atomisp_acc_s_mapped_arg(struct atomisp_sub_device *asd,
72 struct atomisp_acc_s_mapped_arg *arg);
76 * Return immediately, acceleration is left running in background.
77 * Specify either acceleration binary or pipeline which to start.
79 int atomisp_acc_start(struct atomisp_sub_device *asd,
80 unsigned int *handle);
83 * Wait until acceleration finishes.
84 * This MUST be called after each acceleration has been started.
85 * Specify either acceleration binary or pipeline handle.
87 int atomisp_acc_wait(struct atomisp_sub_device *asd,
88 unsigned int *handle);
91 * Used by ISR to notify ACC stage finished.
92 * This is internally used and does not export as IOCTL.
94 void atomisp_acc_done(struct atomisp_sub_device *asd, unsigned int handle);
97 * Appends the loaded acceleration binary extensions to the
98 * current ISP mode. Must be called just before atomisp_css_start().
100 int atomisp_acc_load_extensions(struct atomisp_sub_device *asd);
103 * Must be called after streaming is stopped:
104 * unloads any loaded acceleration extensions.
106 void atomisp_acc_unload_extensions(struct atomisp_sub_device *asd);
109 * Set acceleration firmware flags.
111 int atomisp_acc_set_state(struct atomisp_sub_device *asd,
112 struct atomisp_acc_state *arg);
115 * Get acceleration firmware flags.
117 int atomisp_acc_get_state(struct atomisp_sub_device *asd,
118 struct atomisp_acc_state *arg);
120 #endif /* __ATOMISP_ACC_H__ */