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
120
121
|
/* SPDX-License-Identifier: GPL-2.0 */
/*
* Support for Intel Camera Imaging ISP subsystem.
* Copyright (c) 2015, Intel Corporation.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope 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 __IA_CSS_CONTROL_H
#define __IA_CSS_CONTROL_H
/* @file
* This file contains functionality for starting and controlling CSS
*/
#include <type_support.h>
#include <ia_css_env.h>
#include <ia_css_firmware.h>
#include <ia_css_irq.h>
/* @brief Initialize the CSS API.
* @param[in] env Environment, provides functions to access the
* environment in which the CSS code runs. This is
* used for host side memory access and message
* printing. May not be NULL.
* @param[in] l1_base Base index (isp2400)
* of the L1 page table. This is a physical
* address or index.
* @param[in] irq_type The type of interrupt to be used (edge or level)
* @return Returns -EINVAL in case of any
* errors and 0 otherwise.
*
* This function initializes the API which includes allocating and initializing
* internal data structures.
* ia_css_load_firmware() must be called to load the firmware before calling
* this function.
*/
int ia_css_init(struct device *dev,
const struct ia_css_env *env,
u32 l1_base,
enum ia_css_irq_type irq_type);
/* @brief Un-initialize the CSS API.
* @return None
*
* This function deallocates all memory that has been allocated by the CSS API.
* After this function is called, no other CSS functions should be called.
*/
void
ia_css_uninit(void);
/* @brief Enable use of a separate queue for ISYS events.
*
* @param[in] enable: enable or disable use of separate ISYS event queues.
* @return error if called when SP is running.
*
* @deprecated{This is a temporary function that allows drivers to migrate to
* the use of the separate ISYS event queue. Once all drivers supports this, it
* will be made the default and this function will be removed.
* This function should only be called when the SP is not running, calling it
* when the SP is running will result in an error value being returned. }
*/
int
ia_css_enable_isys_event_queue(bool enable);
/* @brief Test whether the ISP has started.
*
* @return Boolean flag true if the ISP has started or false otherwise.
*
* Temporary function to poll whether the ISP has been started. Once it has,
* the sensor can also be started. */
bool
ia_css_isp_has_started(void);
/* @brief Test whether the SP has initialized.
*
* @return Boolean flag true if the SP has initialized or false otherwise.
*
* Temporary function to poll whether the SP has been initialized. Once it has,
* we can enqueue buffers. */
bool
ia_css_sp_has_initialized(void);
/* @brief Test whether the SP has terminated.
*
* @return Boolean flag true if the SP has terminated or false otherwise.
*
* Temporary function to poll whether the SP has been terminated. Once it has,
* we can switch mode. */
bool
ia_css_sp_has_terminated(void);
/* @brief start SP hardware
*
* @return 0 or error code upon error.
*
* It will boot the SP hardware and start multi-threading infrastructure.
* All threads will be started and blocked by semaphore. This function should
* be called before any ia_css_stream_start().
*/
int
ia_css_start_sp(void);
/* @brief stop SP hardware
*
* @return 0 or error code upon error.
*
* This function will terminate all threads and shut down SP. It should be
* called after all ia_css_stream_stop().
*/
int
ia_css_stop_sp(void);
#endif /* __IA_CSS_CONTROL_H */
|