1 #ifndef __MTK_EEMCS_HELPER_H
2 #define __MTK_EEMCS_HELPER_H
4 #define MD_SYS5 (4) // MD SYS counts from 1, but internal index counts from 0
6 #define MD_EXT1 MD_SYS5 // the first external MD's ID
7 #define MAX_EXT_MD_NUM (1) // external MD uses ID 5, 6, 7, 8
9 #define CURR_EXT_MD_ID (0)
11 /* remove to avoid redeclaration
12 #define MD1_SETTING_ACTIVE (1<<0)
13 #define MD2_SETTING_ACTIVE (1<<1)
15 #define MD5_SETTING_ACTIVE (1<<4)
17 /* remove to avoid redeclaration
18 #define MD_2G_FLAG (1<<0)
19 #define MD_WG_FLAG (1<<1)
20 #define MD_TG_FLAG (1<<2)
21 #define MD_LTE_FLAG (1<<3)
23 #define MD_LWG_FLAG ((1<<3)|(1<<1)|(1<<0))
24 #define MD_LTG_FLAG ((1<<3)|(1<<2)|(1<<0))
27 //-------------other configure-------------------------//
28 #define MAX_KERN_API (20)
29 #define MAX_SLEEP_API (20)
31 //-------------error code define-----------------------//
32 #define E_NO_EXIST (-1)
36 EEMCS_ID_GET_MD_WAKEUP_SRC
= 0,
37 EEMCS_ID_CCCI_DORMANCY
= 1,
38 EEMCS_ID_LOCK_MD_SLEEP
= 2,
39 EEMCS_ID_ACK_MD_SLEEP
= 3,
40 EEMCS_ID_SSW_SWITCH_MODE
= 4,
41 EEMCS_ID_SET_MD_TX_LEVEL
= 5,
42 EEMCS_ID_GET_TXPOWER
= 6, // For thermal
43 EEMCS_ID_IPO_H_RESTORE_CB
= 7,
47 EXT_MD_DORMANT_NOTIFY
= 0x100,
48 EXT_MD_SLP_REQUEST
= 0x101,
49 EXT_MD_TX_POWER
= 0x102,
50 EXT_MD_RF_TEMPERATURE
= 0x103,
51 EXT_MD_RF_TEMPERATURE_3G
= 0x104,
52 EXT_MD_GET_BATTERY_INFO
= 0x105,
53 EXT_MD_SIM_TYPE
= 0x107,
57 EEMCS_RSM_ID_RESUME_WDT_IRQ
= 0,
58 EEMCS_RSM_ID_MD_LOCK_DORMANT
= 1,
59 EEMCS_RSM_ID_WAKE_UP_MD
= 2,
64 EEMCS_SLP_ID_MD_FAST_DROMANT
= 0,
65 EEMCS_SLP_ID_MD_UNLOCK_DORMANT
= 1,
70 EEMCS_ID_GET_FDD_THERMAL_DATA
= 0,
71 EEMCS_ID_GET_TDD_THERMAL_DATA
,
77 /* remove to avoid redeclaration
88 //-------------structure define------------------------//
89 typedef int (*eemcs_kern_cb_func_t
)(int, char *, unsigned int);
91 EEMCS_KERN_FUNC_ID id
;
92 eemcs_kern_cb_func_t func
;
93 }eemcs_kern_func_info
;
95 typedef int (*eemcs_sys_cb_func_t
)(int, int);
98 eemcs_sys_cb_func_t func
;
99 }eemcs_sys_cb_func_info_t
;
102 //-----------------export function declaration----------------------------//
103 int parse_eemcs_dfo_setting(void *dfo_data
, int num
);
104 int parse_ext_meta_md_setting(unsigned char args
[]);
105 void get_ext_md_post_fix(int md_id
, char buf
[], char buf_ex
[]);
106 unsigned int get_ext_modem_is_enabled(int md_id
);
107 unsigned int get_ext_modem_support(int md_id
);
108 unsigned int set_ext_modem_support(int md_id
, int md_type
);
109 void get_ap_platform_ver(char * ver
);
110 unsigned int get_nr_ext_modem(void);
111 unsigned int *get_ext_modem_size_list(void);
112 unsigned int get_ext_md_mem_start_addr(int md_id
);
113 unsigned int get_ext_md_mem_size(int md_id
);
114 int clear_md_region_protection(int md_id
);
115 void eemcs_memory_reserve(void);
117 int eemcs_register_ccci_kern_func(unsigned int id
, eemcs_kern_cb_func_t func
);
118 int eemcs_register_ccci_kern_func_by_md_id(int md_id
, unsigned int id
, eemcs_kern_cb_func_t func
);
119 int eemcs_exec_ccci_kern_func(unsigned int id
, char *buf
, unsigned int len
);
120 int eemcs_exec_ccci_kern_func_by_md_id(int md_id
, unsigned int id
, char *buf
, unsigned int len
);
122 void eemcs_register_suspend_notify(int md_id
, unsigned int id
, void (*func
)(int));
123 void eemcs_register_resume_notify(int md_id
, unsigned int id
, void (*func
)(int));
125 int eemcs_register_sys_msg_notify_func(int md_id
, int (*func
)(int, unsigned int, unsigned int));
126 int eemcs_notify_md_by_sys_msg(int md_id
, unsigned int msg
, unsigned int data
);
128 int eemcs_register_ccci_sys_call_back(int md_id
, unsigned int id
, eemcs_sys_cb_func_t func
);
129 void eemcs_exec_ccci_sys_call_back(int md_id
, int cb_id
, int data
);
131 int eemcs_get_bat_info(unsigned int para
);