MT6620: add the new driver JB2 V1.0
[firefly-linux-kernel-4.4.55.git] / drivers / mtk_wcn_combo / drv_fm / mt6620 / inc / mt6620_fm_link.h
1 /* mt6620_fm_link.h
2  *
3  * (C) Copyright 2011
4  * MediaTek <www.MediaTek.com>
5  * Hongcheng <hongcheng.xia@MediaTek.com>
6  *
7  * MT6620 FM Radio Driver -- setup data link
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
22  */
23
24 #ifndef __MT6620_FM_LINK_H__
25 #define __MT6620_FM_LINK_H__
26 #if 0
27 #include <linux/wait.h>
28 #include "fm_link.h"
29
30 #define RX_BUF_SIZE 128
31 #define TX_BUF_SIZE 1024
32
33 #define SW_RETRY_CNT            (2)
34 #define SW_RETRY_CNT_MAX        (5)
35 #define SW_WAIT_TIMEOUT_MAX     (100)
36
37 // FM operation timeout define for error handle
38 #define TEST_TIMEOUT            (3)
39 #define FSPI_EN_TIMEOUT         (3)
40 #define FSPI_MUXSEL_TIMEOUT     (3)
41 #define FSPI_RD_TIMEOUT         (3)
42 #define FSPI_WR_TIMEOUT         (3)
43 #define I2C_RD_TIMEOUT          (3)
44 #define I2C_WR_TIMEOUT          (3)
45 #define EN_TIMEOUT              (10)
46 #define RST_TIMEOUT             (3)
47 #define TUNE_TIMEOUT            (3)
48 #define SEEK_TIMEOUT            (15)
49 #define SCAN_TIMEOUT            (15) //usualy scan will cost 10 seconds 
50 #define RDS_RX_EN_TIMEOUT       (3)
51 #define RDS_DATA_TIMEOUT        (100)
52 #define RAMPDOWN_TIMEOUT        (3)
53 #define MCUCLK_TIMEOUT          (3)
54 #define MODEMCLK_TIMEOUT        (3)
55 #define RDS_TX_TIMEOUT          (3)
56 #define PATCH_TIMEOUT           (5)
57 #define COEFF_TIMEOUT           (5)
58 #define HWCOEFF_TIMEOUT         (5)
59 #define ROM_TIMEOUT             (5)
60
61 struct fm_link_event {
62     //data
63     volatile fm_u32 flag;
64     wait_queue_head_t wq;
65     struct fm_res_ctx result; // seek/scan/read/RDS
66     //methods
67     fm_u32(*set)(struct fm_link_event* thiz, fm_u32 mask);
68     fm_u32(*clr)(struct fm_link_event* thiz, fm_u32 mask);
69     long(*check)(struct fm_link_event* thiz, fm_u32 mask, long timeout);
70     fm_u32(*get)(struct fm_link_event* thiz);
71     fm_u32(*rst)(struct fm_link_event* thiz);
72 };
73 #endif
74 #endif