WIP FPC-III support
[linux/fpc-iii.git] / drivers / soc / qcom / pdr_internal.h
blobab9ae8cdfa54c104b362c9f7d91f8dc70465bb6d
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __QCOM_PDR_HELPER_INTERNAL__
3 #define __QCOM_PDR_HELPER_INTERNAL__
5 #include <linux/soc/qcom/pdr.h>
7 #define SERVREG_LOCATOR_SERVICE 0x40
8 #define SERVREG_NOTIFIER_SERVICE 0x42
10 #define SERVREG_REGISTER_LISTENER_REQ 0x20
11 #define SERVREG_GET_DOMAIN_LIST_REQ 0x21
12 #define SERVREG_STATE_UPDATED_IND_ID 0x22
13 #define SERVREG_SET_ACK_REQ 0x23
14 #define SERVREG_RESTART_PD_REQ 0x24
16 #define SERVREG_DOMAIN_LIST_LENGTH 32
17 #define SERVREG_RESTART_PD_REQ_MAX_LEN 67
18 #define SERVREG_REGISTER_LISTENER_REQ_LEN 71
19 #define SERVREG_SET_ACK_REQ_LEN 72
20 #define SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN 74
21 #define SERVREG_STATE_UPDATED_IND_MAX_LEN 79
22 #define SERVREG_GET_DOMAIN_LIST_RESP_MAX_LEN 2389
24 struct servreg_location_entry {
25 char name[SERVREG_NAME_LENGTH + 1];
26 u8 service_data_valid;
27 u32 service_data;
28 u32 instance;
31 struct qmi_elem_info servreg_location_entry_ei[] = {
33 .data_type = QMI_STRING,
34 .elem_len = SERVREG_NAME_LENGTH + 1,
35 .elem_size = sizeof(char),
36 .array_type = NO_ARRAY,
37 .tlv_type = 0,
38 .offset = offsetof(struct servreg_location_entry,
39 name),
42 .data_type = QMI_UNSIGNED_4_BYTE,
43 .elem_len = 1,
44 .elem_size = sizeof(u32),
45 .array_type = NO_ARRAY,
46 .tlv_type = 0,
47 .offset = offsetof(struct servreg_location_entry,
48 instance),
51 .data_type = QMI_UNSIGNED_1_BYTE,
52 .elem_len = 1,
53 .elem_size = sizeof(u8),
54 .array_type = NO_ARRAY,
55 .tlv_type = 0,
56 .offset = offsetof(struct servreg_location_entry,
57 service_data_valid),
60 .data_type = QMI_UNSIGNED_4_BYTE,
61 .elem_len = 1,
62 .elem_size = sizeof(u32),
63 .array_type = NO_ARRAY,
64 .tlv_type = 0,
65 .offset = offsetof(struct servreg_location_entry,
66 service_data),
71 struct servreg_get_domain_list_req {
72 char service_name[SERVREG_NAME_LENGTH + 1];
73 u8 domain_offset_valid;
74 u32 domain_offset;
77 struct qmi_elem_info servreg_get_domain_list_req_ei[] = {
79 .data_type = QMI_STRING,
80 .elem_len = SERVREG_NAME_LENGTH + 1,
81 .elem_size = sizeof(char),
82 .array_type = NO_ARRAY,
83 .tlv_type = 0x01,
84 .offset = offsetof(struct servreg_get_domain_list_req,
85 service_name),
88 .data_type = QMI_OPT_FLAG,
89 .elem_len = 1,
90 .elem_size = sizeof(u8),
91 .array_type = NO_ARRAY,
92 .tlv_type = 0x10,
93 .offset = offsetof(struct servreg_get_domain_list_req,
94 domain_offset_valid),
97 .data_type = QMI_UNSIGNED_4_BYTE,
98 .elem_len = 1,
99 .elem_size = sizeof(u32),
100 .array_type = NO_ARRAY,
101 .tlv_type = 0x10,
102 .offset = offsetof(struct servreg_get_domain_list_req,
103 domain_offset),
108 struct servreg_get_domain_list_resp {
109 struct qmi_response_type_v01 resp;
110 u8 total_domains_valid;
111 u16 total_domains;
112 u8 db_rev_count_valid;
113 u16 db_rev_count;
114 u8 domain_list_valid;
115 u32 domain_list_len;
116 struct servreg_location_entry domain_list[SERVREG_DOMAIN_LIST_LENGTH];
119 struct qmi_elem_info servreg_get_domain_list_resp_ei[] = {
121 .data_type = QMI_STRUCT,
122 .elem_len = 1,
123 .elem_size = sizeof(struct qmi_response_type_v01),
124 .array_type = NO_ARRAY,
125 .tlv_type = 0x02,
126 .offset = offsetof(struct servreg_get_domain_list_resp,
127 resp),
128 .ei_array = qmi_response_type_v01_ei,
131 .data_type = QMI_OPT_FLAG,
132 .elem_len = 1,
133 .elem_size = sizeof(u8),
134 .array_type = NO_ARRAY,
135 .tlv_type = 0x10,
136 .offset = offsetof(struct servreg_get_domain_list_resp,
137 total_domains_valid),
140 .data_type = QMI_UNSIGNED_2_BYTE,
141 .elem_len = 1,
142 .elem_size = sizeof(u16),
143 .array_type = NO_ARRAY,
144 .tlv_type = 0x10,
145 .offset = offsetof(struct servreg_get_domain_list_resp,
146 total_domains),
149 .data_type = QMI_OPT_FLAG,
150 .elem_len = 1,
151 .elem_size = sizeof(u8),
152 .array_type = NO_ARRAY,
153 .tlv_type = 0x11,
154 .offset = offsetof(struct servreg_get_domain_list_resp,
155 db_rev_count_valid),
158 .data_type = QMI_UNSIGNED_2_BYTE,
159 .elem_len = 1,
160 .elem_size = sizeof(u16),
161 .array_type = NO_ARRAY,
162 .tlv_type = 0x11,
163 .offset = offsetof(struct servreg_get_domain_list_resp,
164 db_rev_count),
167 .data_type = QMI_OPT_FLAG,
168 .elem_len = 1,
169 .elem_size = sizeof(u8),
170 .array_type = NO_ARRAY,
171 .tlv_type = 0x12,
172 .offset = offsetof(struct servreg_get_domain_list_resp,
173 domain_list_valid),
176 .data_type = QMI_DATA_LEN,
177 .elem_len = 1,
178 .elem_size = sizeof(u8),
179 .array_type = NO_ARRAY,
180 .tlv_type = 0x12,
181 .offset = offsetof(struct servreg_get_domain_list_resp,
182 domain_list_len),
185 .data_type = QMI_STRUCT,
186 .elem_len = SERVREG_DOMAIN_LIST_LENGTH,
187 .elem_size = sizeof(struct servreg_location_entry),
188 .array_type = VAR_LEN_ARRAY,
189 .tlv_type = 0x12,
190 .offset = offsetof(struct servreg_get_domain_list_resp,
191 domain_list),
192 .ei_array = servreg_location_entry_ei,
197 struct servreg_register_listener_req {
198 u8 enable;
199 char service_path[SERVREG_NAME_LENGTH + 1];
202 struct qmi_elem_info servreg_register_listener_req_ei[] = {
204 .data_type = QMI_UNSIGNED_1_BYTE,
205 .elem_len = 1,
206 .elem_size = sizeof(u8),
207 .array_type = NO_ARRAY,
208 .tlv_type = 0x01,
209 .offset = offsetof(struct servreg_register_listener_req,
210 enable),
213 .data_type = QMI_STRING,
214 .elem_len = SERVREG_NAME_LENGTH + 1,
215 .elem_size = sizeof(char),
216 .array_type = NO_ARRAY,
217 .tlv_type = 0x02,
218 .offset = offsetof(struct servreg_register_listener_req,
219 service_path),
224 struct servreg_register_listener_resp {
225 struct qmi_response_type_v01 resp;
226 u8 curr_state_valid;
227 enum servreg_service_state curr_state;
230 struct qmi_elem_info servreg_register_listener_resp_ei[] = {
232 .data_type = QMI_STRUCT,
233 .elem_len = 1,
234 .elem_size = sizeof(struct qmi_response_type_v01),
235 .array_type = NO_ARRAY,
236 .tlv_type = 0x02,
237 .offset = offsetof(struct servreg_register_listener_resp,
238 resp),
239 .ei_array = qmi_response_type_v01_ei,
242 .data_type = QMI_OPT_FLAG,
243 .elem_len = 1,
244 .elem_size = sizeof(u8),
245 .array_type = NO_ARRAY,
246 .tlv_type = 0x10,
247 .offset = offsetof(struct servreg_register_listener_resp,
248 curr_state_valid),
251 .data_type = QMI_SIGNED_4_BYTE_ENUM,
252 .elem_len = 1,
253 .elem_size = sizeof(enum servreg_service_state),
254 .array_type = NO_ARRAY,
255 .tlv_type = 0x10,
256 .offset = offsetof(struct servreg_register_listener_resp,
257 curr_state),
262 struct servreg_restart_pd_req {
263 char service_path[SERVREG_NAME_LENGTH + 1];
266 struct qmi_elem_info servreg_restart_pd_req_ei[] = {
268 .data_type = QMI_STRING,
269 .elem_len = SERVREG_NAME_LENGTH + 1,
270 .elem_size = sizeof(char),
271 .array_type = NO_ARRAY,
272 .tlv_type = 0x01,
273 .offset = offsetof(struct servreg_restart_pd_req,
274 service_path),
279 struct servreg_restart_pd_resp {
280 struct qmi_response_type_v01 resp;
283 struct qmi_elem_info servreg_restart_pd_resp_ei[] = {
285 .data_type = QMI_STRUCT,
286 .elem_len = 1,
287 .elem_size = sizeof(struct qmi_response_type_v01),
288 .array_type = NO_ARRAY,
289 .tlv_type = 0x02,
290 .offset = offsetof(struct servreg_restart_pd_resp,
291 resp),
292 .ei_array = qmi_response_type_v01_ei,
297 struct servreg_state_updated_ind {
298 enum servreg_service_state curr_state;
299 char service_path[SERVREG_NAME_LENGTH + 1];
300 u16 transaction_id;
303 struct qmi_elem_info servreg_state_updated_ind_ei[] = {
305 .data_type = QMI_SIGNED_4_BYTE_ENUM,
306 .elem_len = 1,
307 .elem_size = sizeof(u32),
308 .array_type = NO_ARRAY,
309 .tlv_type = 0x01,
310 .offset = offsetof(struct servreg_state_updated_ind,
311 curr_state),
314 .data_type = QMI_STRING,
315 .elem_len = SERVREG_NAME_LENGTH + 1,
316 .elem_size = sizeof(char),
317 .array_type = NO_ARRAY,
318 .tlv_type = 0x02,
319 .offset = offsetof(struct servreg_state_updated_ind,
320 service_path),
323 .data_type = QMI_UNSIGNED_2_BYTE,
324 .elem_len = 1,
325 .elem_size = sizeof(u16),
326 .array_type = NO_ARRAY,
327 .tlv_type = 0x03,
328 .offset = offsetof(struct servreg_state_updated_ind,
329 transaction_id),
334 struct servreg_set_ack_req {
335 char service_path[SERVREG_NAME_LENGTH + 1];
336 u16 transaction_id;
339 struct qmi_elem_info servreg_set_ack_req_ei[] = {
341 .data_type = QMI_STRING,
342 .elem_len = SERVREG_NAME_LENGTH + 1,
343 .elem_size = sizeof(char),
344 .array_type = NO_ARRAY,
345 .tlv_type = 0x01,
346 .offset = offsetof(struct servreg_set_ack_req,
347 service_path),
350 .data_type = QMI_UNSIGNED_2_BYTE,
351 .elem_len = 1,
352 .elem_size = sizeof(u16),
353 .array_type = NO_ARRAY,
354 .tlv_type = 0x02,
355 .offset = offsetof(struct servreg_set_ack_req,
356 transaction_id),
361 struct servreg_set_ack_resp {
362 struct qmi_response_type_v01 resp;
365 struct qmi_elem_info servreg_set_ack_resp_ei[] = {
367 .data_type = QMI_STRUCT,
368 .elem_len = 1,
369 .elem_size = sizeof(struct qmi_response_type_v01),
370 .array_type = NO_ARRAY,
371 .tlv_type = 0x02,
372 .offset = offsetof(struct servreg_set_ack_resp,
373 resp),
374 .ei_array = qmi_response_type_v01_ei,
379 #endif