4 * MediaTek <www.MediaTek.com>
5 * Hongcheng <hongcheng.xia@MediaTek.com>
7 * MT6620 FM Radio Driver -- setup data link
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.
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.
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
24 #ifndef __MT6620_FM_LINK_H__
25 #define __MT6620_FM_LINK_H__
27 #include <linux/wait.h>
30 #define RX_BUF_SIZE 128
31 #define TX_BUF_SIZE 1024
33 #define SW_RETRY_CNT (2)
34 #define SW_RETRY_CNT_MAX (5)
35 #define SW_WAIT_TIMEOUT_MAX (100)
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)
61 struct fm_link_event {
65 struct fm_res_ctx result; // seek/scan/read/RDS
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);