2 * Support for Clovertrail PNW Camera Imaging ISP subsystem.
4 * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 #ifndef __ATOMISP_ACC_H__
23 #define __ATOMISP_ACC_H__
25 #include "../../include/linux/atomisp.h"
26 #include "atomisp_internal.h"
28 #include "ia_css_types.h"
31 * Interface functions for AtomISP driver acceleration API implementation.
34 struct atomisp_sub_device;
36 void atomisp_acc_cleanup(struct atomisp_device *isp);
39 * Free up any allocated resources.
40 * Must be called each time when the device is closed.
41 * Note that there isn't corresponding open() call;
42 * this function may be called sequentially multiple times.
43 * Must be called to free up resources before driver is unloaded.
45 void atomisp_acc_release(struct atomisp_sub_device *asd);
47 /* Load acceleration binary. DEPRECATED. */
48 int atomisp_acc_load(struct atomisp_sub_device *asd,
49 struct atomisp_acc_fw_load *fw);
51 /* Load acceleration binary with specified properties */
52 int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
53 struct atomisp_acc_fw_load_to_pipe *fw);
55 /* Unload specified acceleration binary */
56 int atomisp_acc_unload(struct atomisp_sub_device *asd,
57 unsigned int *handle);
60 * Map a memory region into ISP memory space.
62 int atomisp_acc_map(struct atomisp_sub_device *asd,
63 struct atomisp_acc_map *map);
66 * Unmap a mapped memory region.
68 int atomisp_acc_unmap(struct atomisp_sub_device *asd,
69 struct atomisp_acc_map *map);
72 * Set acceleration binary argument to a previously mapped memory region.
74 int atomisp_acc_s_mapped_arg(struct atomisp_sub_device *asd,
75 struct atomisp_acc_s_mapped_arg *arg);
80 * Return immediately, acceleration is left running in background.
81 * Specify either acceleration binary or pipeline which to start.
83 int atomisp_acc_start(struct atomisp_sub_device *asd,
84 unsigned int *handle);
87 * Wait until acceleration finishes.
88 * This MUST be called after each acceleration has been started.
89 * Specify either acceleration binary or pipeline handle.
91 int atomisp_acc_wait(struct atomisp_sub_device *asd,
92 unsigned int *handle);
95 * Used by ISR to notify ACC stage finished.
96 * This is internally used and does not export as IOCTL.
98 void atomisp_acc_done(struct atomisp_sub_device *asd, unsigned int handle);
101 * Appends the loaded acceleration binary extensions to the
102 * current ISP mode. Must be called just before atomisp_css_start().
104 int atomisp_acc_load_extensions(struct atomisp_sub_device *asd);
107 * Must be called after streaming is stopped:
108 * unloads any loaded acceleration extensions.
110 void atomisp_acc_unload_extensions(struct atomisp_sub_device *asd);
113 * Set acceleration firmware flags.
115 int atomisp_acc_set_state(struct atomisp_sub_device *asd,
116 struct atomisp_acc_state *arg);
119 * Get acceleration firmware flags.
121 int atomisp_acc_get_state(struct atomisp_sub_device *asd,
122 struct atomisp_acc_state *arg);
124 #endif /* __ATOMISP_ACC_H__ */