import PULS_20160108
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / drivers / misc / mediatek / connectivity / combo / common / platform / alps / wmt_plat_stub.c
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
10 /*******************************************************************************
11 * C O M P I L E R F L A G S
12 ********************************************************************************
13 */
14
15 /*******************************************************************************
16 * M A C R O S
17 ********************************************************************************
18 */
19
20
21 #if CONFIG_HAS_WAKELOCK
22 #include <linux/wakelock.h>
23 #define CFG_WMT_WAKELOCK_SUPPORT 1
24 #endif
25
26 #ifdef DFT_TAG
27 #undef DFT_TAG
28 #endif
29 #define DFT_TAG "[WMT-PLAT]"
30
31
32 /*******************************************************************************
33 * E X T E R N A L R E F E R E N C E S
34 ********************************************************************************
35 */
36
37 /* ALPS and COMBO header files */
38 #include <mach/mtk_wcn_cmb_stub.h>
39 /* MTK_WCN_COMBO header files */
40 #include "wmt_plat.h"
41 #include "wmt_plat_stub.h"
42 #include "wmt_exp.h"
43 #include <mach/mtk_wcn_cmb_stub.h>
44 #include "wmt_lib.h"
45 #include "osal_typedef.h"
46
47 /*******************************************************************************
48 * C O N S T A N T S
49 ********************************************************************************
50 */
51
52
53
54
55 /*******************************************************************************
56 * D A T A T Y P E S
57 ********************************************************************************
58 */
59
60 /*******************************************************************************
61 * F U N C T I O N D E C L A R A T I O N S
62 ********************************************************************************
63 */
64
65 static VOID wmt_plat_func_ctrl(UINT32 type, UINT32 on);
66
67
68
69 /*******************************************************************************
70 * P U B L I C D A T A
71 ********************************************************************************
72 */
73
74
75 /*******************************************************************************
76 * P R I V A T E D A T A
77 ********************************************************************************
78 */
79
80
81 /*******************************************************************************
82 * F U N C T I O N S
83 ********************************************************************************
84 */
85
86 static void wmt_plat_func_ctrl(unsigned int type, unsigned int on)
87 {
88 if (on) {
89 mtk_wcn_wmt_func_on((ENUM_WMTDRV_TYPE_T) type);
90 } else {
91 mtk_wcn_wmt_func_off((ENUM_WMTDRV_TYPE_T) type);
92 }
93 return;
94 }
95
96 static signed long wmt_plat_thremal_query(void)
97 {
98 return wmt_lib_tm_temp_query();
99 }
100
101 #if MTK_WCN_CMB_FOR_SDIO_1V_AUTOK
102 static unsigned int wmt_plat_get_drv_status(unsigned int type)
103 {
104 return wmt_lib_get_drv_status(type);
105 }
106 #endif
107
108 static INT32 wmt_plat_do_reset (UINT32 type)
109 {
110 return wmt_lib_trigger_reset();
111 }
112
113 INT32 wmt_plat_stub_init(VOID)
114 {
115 INT32 iRet = -1;
116 CMB_STUB_CB stub_cb;
117 stub_cb.aif_ctrl_cb = wmt_plat_audio_ctrl;
118 stub_cb.func_ctrl_cb = wmt_plat_func_ctrl;
119 stub_cb.thermal_query_cb = wmt_plat_thremal_query;
120 stub_cb.wmt_do_reset_cb = wmt_plat_do_reset;
121 #if MTK_WCN_CMB_FOR_SDIO_1V_AUTOK
122 stub_cb.get_drv_status_cb = wmt_plat_get_drv_status;
123 #endif
124 stub_cb.size = sizeof(stub_cb);
125
126 /* register to cmb_stub */
127 iRet = mtk_wcn_cmb_stub_reg(&stub_cb);
128 return iRet;
129 }