aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/drivers/staging/media/atomisp/pci/atomisp_acc.h
blob: ba14181962f85141688b5e1464c4f9afe9cfb536 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/*
 * Support for Clovertrail PNW Camera Imaging ISP subsystem.
 *
 * Copyright (c) 2012 Intel Corporation. All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License version
 * 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 *
 */

#ifndef __ATOMISP_ACC_H__
#define __ATOMISP_ACC_H__

#include "../../include/linux/atomisp.h"
#include "atomisp_internal.h"

#include "ia_css_types.h"

/*
 * Interface functions for AtomISP driver acceleration API implementation.
 */

struct atomisp_sub_device;

void atomisp_acc_cleanup(struct atomisp_device *isp);

/*
 * Free up any allocated resources.
 * Must be called each time when the device is closed.
 * Note that there isn't corresponding open() call;
 * this function may be called sequentially multiple times.
 * Must be called to free up resources before driver is unloaded.
 */
void atomisp_acc_release(struct atomisp_sub_device *asd);

/* Load acceleration binary. DEPRECATED. */
int atomisp_acc_load(struct atomisp_sub_device *asd,
		     struct atomisp_acc_fw_load *fw);

/* Load acceleration binary with specified properties */
int atomisp_acc_load_to_pipe(struct atomisp_sub_device *asd,
			     struct atomisp_acc_fw_load_to_pipe *fw);

/* Unload specified acceleration binary */
int atomisp_acc_unload(struct atomisp_sub_device *asd,
		       unsigned int *handle);

/*
 * Map a memory region into ISP memory space.
 */
int atomisp_acc_map(struct atomisp_sub_device *asd,
		    struct atomisp_acc_map *map);

/*
 * Unmap a mapped memory region.
 */
int atomisp_acc_unmap(struct atomisp_sub_device *asd,
		      struct atomisp_acc_map *map);

/*
 * Set acceleration binary argument to a previously mapped memory region.
 */
int atomisp_acc_s_mapped_arg(struct atomisp_sub_device *asd,
			     struct atomisp_acc_s_mapped_arg *arg);

/*
 * Start acceleration.
 * Return immediately, acceleration is left running in background.
 * Specify either acceleration binary or pipeline which to start.
 */
int atomisp_acc_start(struct atomisp_sub_device *asd,
		      unsigned int *handle);

/*
 * Wait until acceleration finishes.
 * This MUST be called after each acceleration has been started.
 * Specify either acceleration binary or pipeline handle.
 */
int atomisp_acc_wait(struct atomisp_sub_device *asd,
		     unsigned int *handle);

/*
 * Used by ISR to notify ACC stage finished.
 * This is internally used and does not export as IOCTL.
 */
void atomisp_acc_done(struct atomisp_sub_device *asd, unsigned int handle);

/*
 * Appends the loaded acceleration binary extensions to the
 * current ISP mode. Must be called just before atomisp_css_start().
 */
int atomisp_acc_load_extensions(struct atomisp_sub_device *asd);

/*
 * Must be called after streaming is stopped:
 * unloads any loaded acceleration extensions.
 */
void atomisp_acc_unload_extensions(struct atomisp_sub_device *asd);

/*
 * Set acceleration firmware flags.
 */
int atomisp_acc_set_state(struct atomisp_sub_device *asd,
			  struct atomisp_acc_state *arg);

/*
 * Get acceleration firmware flags.
 */
int atomisp_acc_get_state(struct atomisp_sub_device *asd,
			  struct atomisp_acc_state *arg);

#endif /* __ATOMISP_ACC_H__ */