xref: /linux/drivers/soc/qcom/pdr_internal.h (revision c532de5a67a70f8533d495f8f2aaa9a0491c3ad0)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __QCOM_PDR_HELPER_INTERNAL__
3 #define __QCOM_PDR_HELPER_INTERNAL__
4 
5 #include <linux/soc/qcom/pdr.h>
6 
7 #define SERVREG_LOCATOR_SERVICE				0x40
8 #define SERVREG_NOTIFIER_SERVICE			0x42
9 
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
15 
16 #define SERVREG_LOC_PFR_REQ				0x24
17 
18 #define SERVREG_DOMAIN_LIST_LENGTH			32
19 #define SERVREG_RESTART_PD_REQ_MAX_LEN			67
20 #define SERVREG_REGISTER_LISTENER_REQ_LEN		71
21 #define SERVREG_SET_ACK_REQ_LEN				72
22 #define SERVREG_GET_DOMAIN_LIST_REQ_MAX_LEN		74
23 #define SERVREG_STATE_UPDATED_IND_MAX_LEN		79
24 #define SERVREG_GET_DOMAIN_LIST_RESP_MAX_LEN		2389
25 #define SERVREG_LOC_PFR_RESP_MAX_LEN			10
26 
27 struct servreg_location_entry {
28 	char name[SERVREG_NAME_LENGTH + 1];
29 	u8 service_data_valid;
30 	u32 service_data;
31 	u32 instance;
32 };
33 
34 struct servreg_get_domain_list_req {
35 	char service_name[SERVREG_NAME_LENGTH + 1];
36 	u8 domain_offset_valid;
37 	u32 domain_offset;
38 };
39 
40 struct servreg_get_domain_list_resp {
41 	struct qmi_response_type_v01 resp;
42 	u8 total_domains_valid;
43 	u16 total_domains;
44 	u8 db_rev_count_valid;
45 	u16 db_rev_count;
46 	u8 domain_list_valid;
47 	u32 domain_list_len;
48 	struct servreg_location_entry domain_list[SERVREG_DOMAIN_LIST_LENGTH];
49 };
50 
51 struct servreg_register_listener_req {
52 	u8 enable;
53 	char service_path[SERVREG_NAME_LENGTH + 1];
54 };
55 
56 struct servreg_register_listener_resp {
57 	struct qmi_response_type_v01 resp;
58 	u8 curr_state_valid;
59 	enum servreg_service_state curr_state;
60 };
61 
62 struct servreg_restart_pd_req {
63 	char service_path[SERVREG_NAME_LENGTH + 1];
64 };
65 
66 struct servreg_restart_pd_resp {
67 	struct qmi_response_type_v01 resp;
68 };
69 
70 struct servreg_state_updated_ind {
71 	enum servreg_service_state curr_state;
72 	char service_path[SERVREG_NAME_LENGTH + 1];
73 	u16 transaction_id;
74 };
75 
76 struct servreg_set_ack_req {
77 	char service_path[SERVREG_NAME_LENGTH + 1];
78 	u16 transaction_id;
79 };
80 
81 struct servreg_set_ack_resp {
82 	struct qmi_response_type_v01 resp;
83 };
84 
85 struct servreg_loc_pfr_req {
86 	char service[SERVREG_NAME_LENGTH + 1];
87 	char reason[257];
88 };
89 
90 struct servreg_loc_pfr_resp {
91 	struct qmi_response_type_v01 rsp;
92 };
93 
94 extern const struct qmi_elem_info servreg_location_entry_ei[];
95 extern const struct qmi_elem_info servreg_get_domain_list_req_ei[];
96 extern const struct qmi_elem_info servreg_get_domain_list_resp_ei[];
97 extern const struct qmi_elem_info servreg_register_listener_req_ei[];
98 extern const struct qmi_elem_info servreg_register_listener_resp_ei[];
99 extern const struct qmi_elem_info servreg_restart_pd_req_ei[];
100 extern const struct qmi_elem_info servreg_restart_pd_resp_ei[];
101 extern const struct qmi_elem_info servreg_state_updated_ind_ei[];
102 extern const struct qmi_elem_info servreg_set_ack_req_ei[];
103 extern const struct qmi_elem_info servreg_set_ack_resp_ei[];
104 extern const struct qmi_elem_info servreg_loc_pfr_req_ei[];
105 extern const struct qmi_elem_info servreg_loc_pfr_resp_ei[];
106 
107 #endif
108