-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
st_graphite_api.h
186 lines (157 loc) · 5.4 KB
/
st_graphite_api.h
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* st_graphite_api.h
*
* This file defines all the APIs for interacting with Graphite service and
* modules.
*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
* BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#define GCS_DETECTION_ENGINE_CONFIG_KW_DET_ENABLE 0x1
#define GCS_DETECTION_ENGINE_CONFIG_USER_VER_ENABLE 0x2
#define GCS_DETECTION_ENGINE_CONFIG_FAILURE_DET_ENABLE 0x4
#define GCS_DETECTION_ENGINE_EVENT_DETECTED 0
#define GCS_DETECTION_ENGINE_EVENT_FAILED 1
#define GCS_READ_CMDRSP_STATUS_SUCCESS 0
/* st_hw_session_gcs.c:1608:61
* st_hw_session_gcs.c:137:68
*/
enum gcs_data_xfer {
GCS_XFER_READ,
};
/* ref: st_hw_session_gcs.c
* sound_trigger.sm8150 fields order -- 8.1.r1.
* BEWARE --- THIS IS A PACKED STRUCT, ORDER IS IMPORTANT!!!
*/
struct graphite_cal_header {
uint32_t module_id;
uint16_t instance_id;
uint16_t reserved;
uint32_t param_id;
uint32_t size;
} __packed;
struct graphite_data_cmd_hdr {
uint32_t module_id;
uint16_t instance_id;
uint16_t reserved;
uint32_t cmd_id;
uint32_t size_in_bytes;
uint32_t token;
} __packed;
struct graphite_data_cmdrsp_hdr {
uint32_t module_id;
uint16_t instance_id;
uint16_t reserved;
uint32_t cmd_id;
uint32_t size_in_bytes;
uint32_t token;
} __packed;
/*************/
/* GCS MODULES */
struct gcs_module_info {
/* st_hw_session_gcs.c line 632 */
uint32_t MID;
uint32_t IID;
};
struct gcs_module_param_info { /* st_hw_session_gcs line 522 */
struct gcs_module_info module_info;
uint32_t PID; /* st_hw_session_gcs.c line 206 */
};
struct gcs_event_rsp {
struct gcs_module_param_info module_param_info;
uint32_t payload_size;
void *payload;
};
/* MODULES END */
struct gcs_det_engine_config_param {
struct graphite_cal_header cal_hdr;
uint16_t mode;
uint16_t custom_payload_sz;
} __packed;
struct gcs_det_engine_custom_config_param {
struct graphite_cal_header cal_hdr;
};
struct gcs_det_engine_event {
uint16_t status;
uint16_t custom_payload_sz;
/* followed by uint8_t*custom_payload_sz for conf levels */
};
struct gcs_cmd_read_payload_t {
uint32_t size_in_bytes;
};
struct gcs_cmd_readrsp_payload_t {
uint32_t status;
uint32_t flags;
uint32_t timestamp_lsw;
uint32_t timestapm_msw;
};
struct gcs_data_cmd_t {
struct graphite_data_cmd_hdr hdr;
union {
struct gcs_cmd_read_payload_t read;
} payload;
} __packed;
#define MAX_BRDIGE_BUF_PORTS (8)
struct gcs_bridge_buf_payload {
uint32_t minor_version;
uint32_t addr_circbuf_info[MAX_BRDIGE_BUF_PORTS];
} __packed;
struct gcs_bridge_buf_params {
struct graphite_cal_header cal_hdr;
struct gcs_bridge_buf_payload payload;
} __packed;
/* custom params defined by STHAL to VA engine */
/*
* start and stop individual engines in single
* module
*/
struct gcs_det_engine_start_custom_config {
struct graphite_cal_header cal_hdr;
uint16_t minor_version; /* Param version. Currently fixed value 1 */
uint16_t enable; /* 1: start engine 0: stop engine */
uint32_t token; /* unique token per engine */
} __packed;
struct gcs_det_engine_start_params {
uint16_t minor_version; /* Param version. Currently fixed value 1 */
uint32_t token; /* unique token per engine sent in
@gcs_det_engine_start_custom_config*/
} __packed;
struct gcs_det_event_type_custom_config {
struct graphite_cal_header cal_hdr;
uint32_t minor_version; /* Param version. Currently fixed value 1 */
uint32_t event_type; /* Value 1 selects generic event */
uint32_t mode; /* Bit 0 enables confidence levels. Bit 1 enables
keyword start/end indices */
} __packed;
/*
* Expected format of event when used with
* @gcs_det_engine_start_custom_config
*/
struct gcs_det_engine_extended_event {
struct gcs_det_engine_event ev_params;
struct gcs_det_engine_start_params start_params;
/* followed by VA engine specific custom payload */
} __packed;