MT6620: add the new driver JB2 V1.0
[firefly-linux-kernel-4.4.55.git] / drivers / mtk_wcn_combo / drv_fm / mt6626 / inc / mt6626_fm.h
1 /* mt6628_fm.h
2  *
3  * (C) Copyright 2009 
4  * MediaTek <www.MediaTek.com>
5  * Hongcheng <hongcheng.xia@MediaTek.com>
6  *
7  * MT6626 FM Radio Driver --  head file
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 #ifndef __MT6626_FM_H__
24 #define __MT6626_FM_H__
25
26 #include "fm_typedef.h"
27
28 //#define FM_PowerOn_with_ShortAntenna
29 #define MT6626_RSSI_TH_LONG    0xFF01      //FM radio long antenna RSSI threshold(11.375dBuV)
30 #define MT6626_RSSI_TH_SHORT   0xFEE0      //FM radio short antenna RSSI threshold(-1dBuV)
31 #define MT6626_CQI_TH          0x00E9      //FM radio Channel quality indicator threshold(0x0000~0x00FF)
32 #define MT6626_SEEK_SPACE      1           //FM radio seek space,1:100KHZ; 2:200KHZ
33 #define MT6626_SCAN_CH_SIZE    40          //FM radio scan max channel size
34 #define MT6626_BAND            1           //FM radio band, 1:87.5MHz~108.0MHz; 2:76.0MHz~90.0MHz; 3:76.0MHz~108.0MHz; 4:special
35 #define MT6626_BAND_FREQ_L     875         //FM radio special band low freq(Default 87.5MHz)
36 #define MT6626_BAND_FREQ_H     1080        //FM radio special band high freq(Default 108.0MHz)
37 #define MT6626_DEEMPHASIS_50us TRUE
38
39 //customer need customize the I2C port
40 #ifdef MT6516
41 #define MT6626_I2C_PORT   2
42 #else 
43 #define MT6626_I2C_PORT   0
44 #endif
45
46 #define MT6626_SLAVE_ADDR    0xE0       //0x70 7-bit address
47 #define MT6626_MAX_COUNT     100
48 #define MT6626_SCANTBL_SIZE  16         //16*uinit16_t
49
50 #define AFC_ON  0x01
51 #if AFC_ON
52 #define FM_MAIN_CTRL_INIT  0x480
53 #else
54 #define FM_MAIN_CTRL_INIT  0x080
55 #endif
56
57 //FM_MAIN_EXTINTRMASK
58 #define FM_EXT_STC_DONE_MASK 0x01
59 #define FM_EXT_RDS_MASK      0x20
60
61 #define MT6626_FM_STC_DONE_TIMEOUT 12  //second
62
63 //FM_MAIN_CHANDETSTAT
64 #define FM_MAIN_CHANDET_MASK   0x3FF0  // D4~D13 in address 6FH
65 #define FM_MAIN_CHANDET_SHIFT  0x04
66 #define FM_HOST_CHAN    0x3FF0
67
68 //FM_MAIN_CFG1(0x36) && FM_MAIN_CFG2(0x37)
69 #define MT6626_FM_SEEK_UP       0x0
70 #define MT6626_FM_SEEK_DOWN     0x01
71 #define MT6626_FM_SCAN_UP       0x0
72 #define MT6626_FM_SCAN_DOWN     0x01
73 #define MT6626_FM_SPACE_INVALID 0x0
74 #define MT6626_FM_SPACE_50K     0x01
75 #define MT6626_FM_SPACE_100K    0x02
76 #define MT6626_FM_SPACE_200K    0x04 
77
78 #define ext_clk                         //if define ext_clk use external reference clock or mask will use internal
79 #define MT6626_DEV                      "MT6626"   
80
81 #endif //end of #ifndef __MT6626_FM_H__
82