import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / arch / arm / mach-mt8127 / include / mach / mtk_wcn_cmb_stub.h
1 /*! \file
2 \brief Declaration of library functions
3
4 Any definitions in this file will be shared among GLUE Layer and internal Driver Stack.
5 */
6
7
8
9 #ifndef _MTK_WCN_CMB_STUB_H_
10 #define _MTK_WCN_CMB_STUB_H_
11
12
13 /*******************************************************************************
14 * C O M P I L E R F L A G S
15 ********************************************************************************
16 */
17
18 /*******************************************************************************
19 * M A C R O S
20 ********************************************************************************
21 */
22 //#define MTK_WCN_CMB_AUD_IO_NAMING_STYLE_0 1 // Audio GPIO naming style for 73/75/77
23 #define MTK_WCN_CMB_AUD_IO_NAMING_STYLE_1 1 // Audio GPIO naming style for 89/8135
24
25 /*******************************************************************************
26 * E X T E R N A L R E F E R E N C E S
27 ********************************************************************************
28 */
29
30
31
32 /*******************************************************************************
33 * C O N S T A N T S
34 ********************************************************************************
35 */
36
37
38
39 /*******************************************************************************
40 * D A T A T Y P E S
41 ********************************************************************************
42 */
43 typedef enum {
44 CMB_STUB_AIF_0 = 0, /* 0000: BT_PCM_OFF & FM analog (line in/out) */
45 CMB_STUB_AIF_1 = 1, /* 0001: BT_PCM_ON & FM analog (in/out) */
46 CMB_STUB_AIF_2 = 2, /* 0010: BT_PCM_OFF & FM digital (I2S) */
47 CMB_STUB_AIF_3 = 3, /* 0011: BT_PCM_ON & FM digital (I2S) (invalid in 73evb & 1.2 phone configuration) */
48 CMB_STUB_AIF_MAX = 4,
49 } CMB_STUB_AIF_X;
50
51 /*COMBO_CHIP_AUDIO_PIN_CTRL*/
52 typedef enum {
53 CMB_STUB_AIF_CTRL_DIS = 0,
54 CMB_STUB_AIF_CTRL_EN = 1,
55 CMB_STUB_AIF_CTRL_MAX = 2,
56 } CMB_STUB_AIF_CTRL;
57
58 typedef enum {
59 COMBO_FUNC_TYPE_BT = 0,
60 COMBO_FUNC_TYPE_FM = 1,
61 COMBO_FUNC_TYPE_GPS = 2,
62 COMBO_FUNC_TYPE_WIFI = 3,
63 COMBO_FUNC_TYPE_WMT = 4,
64 COMBO_FUNC_TYPE_STP = 5,
65 COMBO_FUNC_TYPE_NUM = 6
66 } COMBO_FUNC_TYPE;
67
68 typedef enum {
69 COMBO_IF_UART = 0,
70 COMBO_IF_MSDC = 1,
71 COMBO_IF_BTIF = 2,
72 COMBO_IF_MAX,
73 } COMBO_IF;
74
75 typedef void (*wmt_bgf_eirq_cb)(void);
76 typedef int (*wmt_aif_ctrl_cb)(CMB_STUB_AIF_X, CMB_STUB_AIF_CTRL);
77 typedef void (*wmt_func_ctrl_cb)(unsigned int, unsigned int);
78 typedef signed long (*wmt_thermal_query_cb)(void);
79 typedef int (*wmt_deep_idle_ctrl_cb)(unsigned int);
80 typedef int (*wmt_func_do_reset)(unsigned int);
81
82 typedef struct _CMB_STUB_CB_ {
83 unsigned int size; //structure size
84 /*wmt_bgf_eirq_cb bgf_eirq_cb;*//* remove bgf_eirq_cb from stub. handle it in platform */
85 wmt_aif_ctrl_cb aif_ctrl_cb;
86 wmt_func_ctrl_cb func_ctrl_cb;
87 wmt_thermal_query_cb thermal_query_cb;
88 wmt_deep_idle_ctrl_cb deep_idle_ctrl_cb;
89 wmt_func_do_reset wmt_do_reset_cb;
90 } CMB_STUB_CB, *P_CMB_STUB_CB;
91
92 /*******************************************************************************
93 * P U B L I C D A T A
94 ********************************************************************************
95 */
96
97
98
99 /*******************************************************************************
100 * P R I V A T E D A T A
101 ********************************************************************************
102 */
103
104
105
106
107
108 /*******************************************************************************
109 * F U N C T I O N D E C L A R A T I O N S
110 ********************************************************************************
111 */
112
113 extern int mtk_wcn_cmb_stub_reg (P_CMB_STUB_CB p_stub_cb);
114 extern int mtk_wcn_cmb_stub_unreg (void);
115
116 extern int mtk_wcn_cmb_stub_aif_ctrl (CMB_STUB_AIF_X state, CMB_STUB_AIF_CTRL ctrl);
117
118 static inline int mtk_wcn_cmb_stub_audio_ctrl(CMB_STUB_AIF_X state) {
119 return mtk_wcn_cmb_stub_aif_ctrl(state, 1);
120 }
121
122 extern int mt_combo_plt_enter_deep_idle(COMBO_IF src);
123 extern int mt_combo_plt_exit_deep_idle(COMBO_IF src);
124
125 /* Use new mtk_wcn_stub APIs instead of old mt_combo ones for kernel to control
126 * function on/off.
127 */
128 extern void mtk_wcn_cmb_stub_func_ctrl (unsigned int type, unsigned int on);
129 extern signed long mtk_wcn_cmb_stub_query_ctrl(void);
130 extern int board_sdio_ctrl (unsigned int sdio_port_num, unsigned int on);
131
132 extern int mtk_wcn_wmt_chipid_query(void);
133 extern void mtk_wcn_wmt_set_chipid(int chipid);
134 /*******************************************************************************
135 * F U N C T I O N S
136 ********************************************************************************
137 */
138
139 #endif /* _MTK_WCN_CMB_STUB_H_ */
140
141
142
143
144
145