Merge branch 'for-4.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj...
[linux-2.6-block.git] / drivers / staging / media / atomisp / pci / atomisp2 / atomisp_acc.h
1 /*
2  * Support for Clovertrail PNW Camera Imaging ISP subsystem.
3  *
4  * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
5  *
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.
9  *
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.
14  *
15  *
16  */
17
18 #ifndef __ATOMISP_ACC_H__
19 #define __ATOMISP_ACC_H__
20
21 #include "../../include/linux/atomisp.h"
22 #include "atomisp_internal.h"
23
24 #include "ia_css_types.h"
25
26 /*
27  * Interface functions for AtomISP driver acceleration API implementation.
28  */
29
30 struct atomisp_sub_device;
31
32 void atomisp_acc_cleanup(struct atomisp_device *isp);
33
34 /*
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.
40  */
41 void atomisp_acc_release(struct atomisp_sub_device *asd);
42
43 /* Load acceleration binary. DEPRECATED. */
44 int atomisp_acc_load(struct atomisp_sub_device *asd,
45                      struct atomisp_acc_fw_load *fw);
46
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);
50
51 /* Unload specified acceleration binary */
52 int atomisp_acc_unload(struct atomisp_sub_device *asd,
53                        unsigned int *handle);
54
55 /*
56  * Map a memory region into ISP memory space.
57  */
58 int atomisp_acc_map(struct atomisp_sub_device *asd,
59                     struct atomisp_acc_map *map);
60
61 /*
62  * Unmap a mapped memory region.
63  */
64 int atomisp_acc_unmap(struct atomisp_sub_device *asd,
65                       struct atomisp_acc_map *map);
66
67 /*
68  * Set acceleration binary argument to a previously mapped memory region.
69  */
70 int atomisp_acc_s_mapped_arg(struct atomisp_sub_device *asd,
71                              struct atomisp_acc_s_mapped_arg *arg);
72
73
74 /*
75  * Start acceleration.
76  * Return immediately, acceleration is left running in background.
77  * Specify either acceleration binary or pipeline which to start.
78  */
79 int atomisp_acc_start(struct atomisp_sub_device *asd,
80                       unsigned int *handle);
81
82 /*
83  * Wait until acceleration finishes.
84  * This MUST be called after each acceleration has been started.
85  * Specify either acceleration binary or pipeline handle.
86  */
87 int atomisp_acc_wait(struct atomisp_sub_device *asd,
88                      unsigned int *handle);
89
90 /*
91  * Used by ISR to notify ACC stage finished.
92  * This is internally used and does not export as IOCTL.
93  */
94 void atomisp_acc_done(struct atomisp_sub_device *asd, unsigned int handle);
95
96 /*
97  * Appends the loaded acceleration binary extensions to the
98  * current ISP mode. Must be called just before atomisp_css_start().
99  */
100 int atomisp_acc_load_extensions(struct atomisp_sub_device *asd);
101
102 /*
103  * Must be called after streaming is stopped:
104  * unloads any loaded acceleration extensions.
105  */
106 void atomisp_acc_unload_extensions(struct atomisp_sub_device *asd);
107
108 /*
109  * Set acceleration firmware flags.
110  */
111 int atomisp_acc_set_state(struct atomisp_sub_device *asd,
112                           struct atomisp_acc_state *arg);
113
114 /*
115  * Get acceleration firmware flags.
116  */
117 int atomisp_acc_get_state(struct atomisp_sub_device *asd,
118                           struct atomisp_acc_state *arg);
119
120 #endif /* __ATOMISP_ACC_H__ */