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.
18 #ifndef __ATOMISP_ACC_H__
19 #define __ATOMISP_ACC_H__
21 #include "../../include/linux/atomisp.h"
22 #include "atomisp_internal.h"
24 #include "ia_css_types.h"
27 * Interface functions for AtomISP driver acceleration API implementation.
30 struct atomisp_sub_device;
32 void atomisp_acc_cleanup(struct atomisp_device *isp);
35 * Free up any allocated resources.
36 * Must be called each time when the device is closed.
37 * Note that there isn't corresponding open() call;
38 * this function may be called sequentially multiple times.
39 * Must be called to free up resources before driver is unloaded.
41 void atomisp_acc_release(struct atomisp_sub_device *asd);
43 /* Load acceleration binary. DEPRECATED. */
44 int atomisp_acc_load(struct atomisp_sub_device *asd,
45 struct atomisp_acc_fw_load *fw);
47 /* Load acceleration binary with specified properties */
48 int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
49 struct atomisp_acc_fw_load_to_pipe *fw);
51 /* Unload specified acceleration binary */
52 int atomisp_acc_unload(struct atomisp_sub_device *asd,
53 unsigned int *handle);
56 * Map a memory region into ISP memory space.
58 int atomisp_acc_map(struct atomisp_sub_device *asd,
59 struct atomisp_acc_map *map);
62 * Unmap a mapped memory region.
64 int atomisp_acc_unmap(struct atomisp_sub_device *asd,
65 struct atomisp_acc_map *map);
68 * Set acceleration binary argument to a previously mapped memory region.
70 int atomisp_acc_s_mapped_arg(struct atomisp_sub_device *asd,
71 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__ */