mt2063.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. #ifndef __MT2063_H__
  2. #define __MT2063_H__
  3. #include "dvb_frontend.h"
  4. #define DVBFE_TUNER_OPEN 99
  5. #define DVBFE_TUNER_SOFTWARE_SHUTDOWN 100
  6. #define DVBFE_TUNER_CLEAR_POWER_MASKBITS 101
  7. #define MT2063_ERROR (1 << 31)
  8. #define MT2063_USER_ERROR (1 << 30)
  9. /* Macro to be used to check for errors */
  10. #define MT2063_IS_ERROR(s) (((s) >> 30) != 0)
  11. #define MT2063_NO_ERROR(s) (((s) >> 30) == 0)
  12. #define MT2063_OK (0x00000000)
  13. /* Unknown error */
  14. #define MT2063_UNKNOWN (0x80000001)
  15. /* Error: Upconverter PLL is not locked */
  16. #define MT2063_UPC_UNLOCK (0x80000002)
  17. /* Error: Downconverter PLL is not locked */
  18. #define MT2063_DNC_UNLOCK (0x80000004)
  19. /* Error: Two-wire serial bus communications error */
  20. #define MT2063_COMM_ERR (0x80000008)
  21. /* Error: Tuner handle passed to function was invalid */
  22. #define MT2063_INV_HANDLE (0x80000010)
  23. /* Error: Function argument is invalid (out of range) */
  24. #define MT2063_ARG_RANGE (0x80000020)
  25. /* Error: Function argument (ptr to return value) was NULL */
  26. #define MT2063_ARG_NULL (0x80000040)
  27. /* Error: Attempt to open more than MT_TUNER_CNT tuners */
  28. #define MT2063_TUNER_CNT_ERR (0x80000080)
  29. /* Error: Tuner Part Code / Rev Code mismatches expected value */
  30. #define MT2063_TUNER_ID_ERR (0x80000100)
  31. /* Error: Tuner Initialization failure */
  32. #define MT2063_TUNER_INIT_ERR (0x80000200)
  33. #define MT2063_TUNER_OPEN_ERR (0x80000400)
  34. /* User-definable fields (see mt_userdef.h) */
  35. #define MT2063_USER_DEFINED1 (0x00001000)
  36. #define MT2063_USER_DEFINED2 (0x00002000)
  37. #define MT2063_USER_DEFINED3 (0x00004000)
  38. #define MT2063_USER_DEFINED4 (0x00008000)
  39. #define MT2063_USER_MASK (0x4000f000)
  40. #define MT2063_USER_SHIFT (12)
  41. /* Info: Mask of bits used for # of LO-related spurs that were avoided during tuning */
  42. #define MT2063_SPUR_CNT_MASK (0x001f0000)
  43. #define MT2063_SPUR_SHIFT (16)
  44. /* Info: Tuner timeout waiting for condition */
  45. #define MT2063_TUNER_TIMEOUT (0x00400000)
  46. /* Info: Unavoidable LO-related spur may be present in the output */
  47. #define MT2063_SPUR_PRESENT_ERR (0x00800000)
  48. /* Info: Tuner input frequency is out of range */
  49. #define MT2063_FIN_RANGE (0x01000000)
  50. /* Info: Tuner output frequency is out of range */
  51. #define MT2063_FOUT_RANGE (0x02000000)
  52. /* Info: Upconverter frequency is out of range (may be reason for MT_UPC_UNLOCK) */
  53. #define MT2063_UPC_RANGE (0x04000000)
  54. /* Info: Downconverter frequency is out of range (may be reason for MT_DPC_UNLOCK) */
  55. #define MT2063_DNC_RANGE (0x08000000)
  56. /*
  57. * Data Types
  58. */
  59. #define MAX_UDATA (4294967295) /* max value storable in u32 */
  60. /*
  61. * Define an MTxxxx_CNT macro for each type of tuner that will be built
  62. * into your application (e.g., MT2121, MT2060). MT_TUNER_CNT
  63. * must be set to the SUM of all of the MTxxxx_CNT macros.
  64. *
  65. * #define MT2050_CNT (1)
  66. * #define MT2060_CNT (1)
  67. * #define MT2111_CNT (1)
  68. * #define MT2121_CNT (3)
  69. */
  70. #define MT2063_TUNER_CNT (1) /* total num of MicroTuner tuners */
  71. #define MT2063_I2C (0xC0)
  72. /*
  73. * Constant defining the version of the following structure
  74. * and therefore the API for this code.
  75. *
  76. * When compiling the tuner driver, the preprocessor will
  77. * check against this version number to make sure that
  78. * it matches the version that the tuner driver knows about.
  79. */
  80. /* Version 010201 => 1.21 */
  81. #define MT2063_AVOID_SPURS_INFO_VERSION 010201
  82. /* DECT Frequency Avoidance */
  83. #define MT2063_DECT_AVOID_US_FREQS 0x00000001
  84. #define MT2063_DECT_AVOID_EURO_FREQS 0x00000002
  85. #define MT2063_EXCLUDE_US_DECT_FREQUENCIES(s) (((s) & MT2063_DECT_AVOID_US_FREQS) != 0)
  86. #define MT2063_EXCLUDE_EURO_DECT_FREQUENCIES(s) (((s) & MT2063_DECT_AVOID_EURO_FREQS) != 0)
  87. enum MT2063_DECT_Avoid_Type {
  88. MT2063_NO_DECT_AVOIDANCE = 0, /* Do not create DECT exclusion zones. */
  89. MT2063_AVOID_US_DECT = MT2063_DECT_AVOID_US_FREQS, /* Avoid US DECT frequencies. */
  90. MT2063_AVOID_EURO_DECT = MT2063_DECT_AVOID_EURO_FREQS, /* Avoid European DECT frequencies. */
  91. MT2063_AVOID_BOTH /* Avoid both regions. Not typically used. */
  92. };
  93. #define MT2063_MAX_ZONES 48
  94. struct MT2063_ExclZone_t;
  95. struct MT2063_ExclZone_t {
  96. u32 min_;
  97. u32 max_;
  98. struct MT2063_ExclZone_t *next_;
  99. };
  100. /*
  101. * Structure of data needed for Spur Avoidance
  102. */
  103. struct MT2063_AvoidSpursData_t {
  104. u32 nAS_Algorithm;
  105. u32 f_ref;
  106. u32 f_in;
  107. u32 f_LO1;
  108. u32 f_if1_Center;
  109. u32 f_if1_Request;
  110. u32 f_if1_bw;
  111. u32 f_LO2;
  112. u32 f_out;
  113. u32 f_out_bw;
  114. u32 f_LO1_Step;
  115. u32 f_LO2_Step;
  116. u32 f_LO1_FracN_Avoid;
  117. u32 f_LO2_FracN_Avoid;
  118. u32 f_zif_bw;
  119. u32 f_min_LO_Separation;
  120. u32 maxH1;
  121. u32 maxH2;
  122. enum MT2063_DECT_Avoid_Type avoidDECT;
  123. u32 bSpurPresent;
  124. u32 bSpurAvoided;
  125. u32 nSpursFound;
  126. u32 nZones;
  127. struct MT2063_ExclZone_t *freeZones;
  128. struct MT2063_ExclZone_t *usedZones;
  129. struct MT2063_ExclZone_t MT2063_ExclZones[MT2063_MAX_ZONES];
  130. };
  131. /*
  132. * Values returned by the MT2063's on-chip temperature sensor
  133. * to be read/written.
  134. */
  135. enum MT2063_Temperature {
  136. MT2063_T_0C = 0, /* Temperature approx 0C */
  137. MT2063_T_10C, /* Temperature approx 10C */
  138. MT2063_T_20C, /* Temperature approx 20C */
  139. MT2063_T_30C, /* Temperature approx 30C */
  140. MT2063_T_40C, /* Temperature approx 40C */
  141. MT2063_T_50C, /* Temperature approx 50C */
  142. MT2063_T_60C, /* Temperature approx 60C */
  143. MT2063_T_70C, /* Temperature approx 70C */
  144. MT2063_T_80C, /* Temperature approx 80C */
  145. MT2063_T_90C, /* Temperature approx 90C */
  146. MT2063_T_100C, /* Temperature approx 100C */
  147. MT2063_T_110C, /* Temperature approx 110C */
  148. MT2063_T_120C, /* Temperature approx 120C */
  149. MT2063_T_130C, /* Temperature approx 130C */
  150. MT2063_T_140C, /* Temperature approx 140C */
  151. MT2063_T_150C, /* Temperature approx 150C */
  152. };
  153. /*
  154. * Parameters for selecting GPIO bits
  155. */
  156. enum MT2063_GPIO_Attr {
  157. MT2063_GPIO_IN,
  158. MT2063_GPIO_DIR,
  159. MT2063_GPIO_OUT,
  160. };
  161. enum MT2063_GPIO_ID {
  162. MT2063_GPIO0,
  163. MT2063_GPIO1,
  164. MT2063_GPIO2,
  165. };
  166. /*
  167. * Parameter for function MT2063_SetExtSRO that specifies the external
  168. * SRO drive frequency.
  169. *
  170. * MT2063_EXT_SRO_OFF is the power-up default value.
  171. */
  172. enum MT2063_Ext_SRO {
  173. MT2063_EXT_SRO_OFF, /* External SRO drive off */
  174. MT2063_EXT_SRO_BY_4, /* External SRO drive divide by 4 */
  175. MT2063_EXT_SRO_BY_2, /* External SRO drive divide by 2 */
  176. MT2063_EXT_SRO_BY_1 /* External SRO drive divide by 1 */
  177. };
  178. /*
  179. * Parameter for function MT2063_SetPowerMask that specifies the power down
  180. * of various sections of the MT2063.
  181. */
  182. enum MT2063_Mask_Bits {
  183. MT2063_REG_SD = 0x0040, /* Shutdown regulator */
  184. MT2063_SRO_SD = 0x0020, /* Shutdown SRO */
  185. MT2063_AFC_SD = 0x0010, /* Shutdown AFC A/D */
  186. MT2063_PD_SD = 0x0002, /* Enable power detector shutdown */
  187. MT2063_PDADC_SD = 0x0001, /* Enable power detector A/D shutdown */
  188. MT2063_VCO_SD = 0x8000, /* Enable VCO shutdown */
  189. MT2063_LTX_SD = 0x4000, /* Enable LTX shutdown */
  190. MT2063_LT1_SD = 0x2000, /* Enable LT1 shutdown */
  191. MT2063_LNA_SD = 0x1000, /* Enable LNA shutdown */
  192. MT2063_UPC_SD = 0x0800, /* Enable upconverter shutdown */
  193. MT2063_DNC_SD = 0x0400, /* Enable downconverter shutdown */
  194. MT2063_VGA_SD = 0x0200, /* Enable VGA shutdown */
  195. MT2063_AMP_SD = 0x0100, /* Enable AMP shutdown */
  196. MT2063_ALL_SD = 0xFF73, /* All shutdown bits for this tuner */
  197. MT2063_NONE_SD = 0x0000 /* No shutdown bits */
  198. };
  199. /*
  200. * Parameter for function MT2063_GetParam & MT2063_SetParam that
  201. * specifies the tuning algorithm parameter to be read/written.
  202. */
  203. enum MT2063_Param {
  204. /* tuner address set by MT2063_Open() */
  205. MT2063_IC_ADDR,
  206. /* max number of MT2063 tuners set by MT_TUNER_CNT in mt_userdef.h */
  207. MT2063_MAX_OPEN,
  208. /* current number of open MT2063 tuners set by MT2063_Open() */
  209. MT2063_NUM_OPEN,
  210. /* crystal frequency (default: 16000000 Hz) */
  211. MT2063_SRO_FREQ,
  212. /* min tuning step size (default: 50000 Hz) */
  213. MT2063_STEPSIZE,
  214. /* input center frequency set by MT2063_Tune() */
  215. MT2063_INPUT_FREQ,
  216. /* LO1 Frequency set by MT2063_Tune() */
  217. MT2063_LO1_FREQ,
  218. /* LO1 minimum step size (default: 250000 Hz) */
  219. MT2063_LO1_STEPSIZE,
  220. /* LO1 FracN keep-out region (default: 999999 Hz) */
  221. MT2063_LO1_FRACN_AVOID_PARAM,
  222. /* Current 1st IF in use set by MT2063_Tune() */
  223. MT2063_IF1_ACTUAL,
  224. /* Requested 1st IF set by MT2063_Tune() */
  225. MT2063_IF1_REQUEST,
  226. /* Center of 1st IF SAW filter (default: 1218000000 Hz) */
  227. MT2063_IF1_CENTER,
  228. /* Bandwidth of 1st IF SAW filter (default: 20000000 Hz) */
  229. MT2063_IF1_BW,
  230. /* zero-IF bandwidth (default: 2000000 Hz) */
  231. MT2063_ZIF_BW,
  232. /* LO2 Frequency set by MT2063_Tune() */
  233. MT2063_LO2_FREQ,
  234. /* LO2 minimum step size (default: 50000 Hz) */
  235. MT2063_LO2_STEPSIZE,
  236. /* LO2 FracN keep-out region (default: 374999 Hz) */
  237. MT2063_LO2_FRACN_AVOID,
  238. /* output center frequency set by MT2063_Tune() */
  239. MT2063_OUTPUT_FREQ,
  240. /* output bandwidth set by MT2063_Tune() */
  241. MT2063_OUTPUT_BW,
  242. /* min inter-tuner LO separation (default: 1000000 Hz) */
  243. MT2063_LO_SEPARATION,
  244. /* ID of avoid-spurs algorithm in use compile-time constant */
  245. MT2063_AS_ALG,
  246. /* max # of intra-tuner harmonics (default: 15) */
  247. MT2063_MAX_HARM1,
  248. /* max # of inter-tuner harmonics (default: 7) */
  249. MT2063_MAX_HARM2,
  250. /* # of 1st IF exclusion zones used set by MT2063_Tune() */
  251. MT2063_EXCL_ZONES,
  252. /* # of spurs found/avoided set by MT2063_Tune() */
  253. MT2063_NUM_SPURS,
  254. /* >0 spurs avoided set by MT2063_Tune() */
  255. MT2063_SPUR_AVOIDED,
  256. /* >0 spurs in output (mathematically) set by MT2063_Tune() */
  257. MT2063_SPUR_PRESENT,
  258. /* Receiver Mode for some parameters. 1 is DVB-T */
  259. MT2063_RCVR_MODE,
  260. /* directly set LNA attenuation, parameter is value to set */
  261. MT2063_ACLNA,
  262. /* maximum LNA attenuation, parameter is value to set */
  263. MT2063_ACLNA_MAX,
  264. /* directly set ATN attenuation. Paremeter is value to set. */
  265. MT2063_ACRF,
  266. /* maxium ATN attenuation. Paremeter is value to set. */
  267. MT2063_ACRF_MAX,
  268. /* directly set FIF attenuation. Paremeter is value to set. */
  269. MT2063_ACFIF,
  270. /* maxium FIF attenuation. Paremeter is value to set. */
  271. MT2063_ACFIF_MAX,
  272. /* LNA Rin */
  273. MT2063_LNA_RIN,
  274. /* Power Detector LNA level target */
  275. MT2063_LNA_TGT,
  276. /* Power Detector 1 level */
  277. MT2063_PD1,
  278. /* Power Detector 1 level target */
  279. MT2063_PD1_TGT,
  280. /* Power Detector 2 level */
  281. MT2063_PD2,
  282. /* Power Detector 2 level target */
  283. MT2063_PD2_TGT,
  284. /* Selects, which DNC is activ */
  285. MT2063_DNC_OUTPUT_ENABLE,
  286. /* VGA gain code */
  287. MT2063_VGAGC,
  288. /* VGA bias current */
  289. MT2063_VGAOI,
  290. /* TAGC, determins the speed of the AGC */
  291. MT2063_TAGC,
  292. /* AMP gain code */
  293. MT2063_AMPGC,
  294. /* Control setting to avoid DECT freqs (default: MT_AVOID_BOTH) */
  295. MT2063_AVOID_DECT,
  296. /* Cleartune filter selection: 0 - by IC (default), 1 - by software */
  297. MT2063_CTFILT_SW,
  298. MT2063_EOP /* last entry in enumerated list */
  299. };
  300. /*
  301. * Parameter for selecting tuner mode
  302. */
  303. enum MT2063_RCVR_MODES {
  304. MT2063_CABLE_QAM = 0, /* Digital cable */
  305. MT2063_CABLE_ANALOG, /* Analog cable */
  306. MT2063_OFFAIR_COFDM, /* Digital offair */
  307. MT2063_OFFAIR_COFDM_SAWLESS, /* Digital offair without SAW */
  308. MT2063_OFFAIR_ANALOG, /* Analog offair */
  309. MT2063_OFFAIR_8VSB, /* Analog offair */
  310. MT2063_NUM_RCVR_MODES
  311. };
  312. /*
  313. * Possible values for MT2063_DNC_OUTPUT
  314. */
  315. enum MT2063_DNC_Output_Enable {
  316. MT2063_DNC_NONE = 0,
  317. MT2063_DNC_1,
  318. MT2063_DNC_2,
  319. MT2063_DNC_BOTH
  320. };
  321. /*
  322. ** Two-wire serial bus subaddresses of the tuner registers.
  323. ** Also known as the tuner's register addresses.
  324. */
  325. enum MT2063_Register_Offsets {
  326. MT2063_REG_PART_REV = 0, /* 0x00: Part/Rev Code */
  327. MT2063_REG_LO1CQ_1, /* 0x01: LO1C Queued Byte 1 */
  328. MT2063_REG_LO1CQ_2, /* 0x02: LO1C Queued Byte 2 */
  329. MT2063_REG_LO2CQ_1, /* 0x03: LO2C Queued Byte 1 */
  330. MT2063_REG_LO2CQ_2, /* 0x04: LO2C Queued Byte 2 */
  331. MT2063_REG_LO2CQ_3, /* 0x05: LO2C Queued Byte 3 */
  332. MT2063_REG_RSVD_06, /* 0x06: Reserved */
  333. MT2063_REG_LO_STATUS, /* 0x07: LO Status */
  334. MT2063_REG_FIFFC, /* 0x08: FIFF Center */
  335. MT2063_REG_CLEARTUNE, /* 0x09: ClearTune Filter */
  336. MT2063_REG_ADC_OUT, /* 0x0A: ADC_OUT */
  337. MT2063_REG_LO1C_1, /* 0x0B: LO1C Byte 1 */
  338. MT2063_REG_LO1C_2, /* 0x0C: LO1C Byte 2 */
  339. MT2063_REG_LO2C_1, /* 0x0D: LO2C Byte 1 */
  340. MT2063_REG_LO2C_2, /* 0x0E: LO2C Byte 2 */
  341. MT2063_REG_LO2C_3, /* 0x0F: LO2C Byte 3 */
  342. MT2063_REG_RSVD_10, /* 0x10: Reserved */
  343. MT2063_REG_PWR_1, /* 0x11: PWR Byte 1 */
  344. MT2063_REG_PWR_2, /* 0x12: PWR Byte 2 */
  345. MT2063_REG_TEMP_STATUS, /* 0x13: Temp Status */
  346. MT2063_REG_XO_STATUS, /* 0x14: Crystal Status */
  347. MT2063_REG_RF_STATUS, /* 0x15: RF Attn Status */
  348. MT2063_REG_FIF_STATUS, /* 0x16: FIF Attn Status */
  349. MT2063_REG_LNA_OV, /* 0x17: LNA Attn Override */
  350. MT2063_REG_RF_OV, /* 0x18: RF Attn Override */
  351. MT2063_REG_FIF_OV, /* 0x19: FIF Attn Override */
  352. MT2063_REG_LNA_TGT, /* 0x1A: Reserved */
  353. MT2063_REG_PD1_TGT, /* 0x1B: Pwr Det 1 Target */
  354. MT2063_REG_PD2_TGT, /* 0x1C: Pwr Det 2 Target */
  355. MT2063_REG_RSVD_1D, /* 0x1D: Reserved */
  356. MT2063_REG_RSVD_1E, /* 0x1E: Reserved */
  357. MT2063_REG_RSVD_1F, /* 0x1F: Reserved */
  358. MT2063_REG_RSVD_20, /* 0x20: Reserved */
  359. MT2063_REG_BYP_CTRL, /* 0x21: Bypass Control */
  360. MT2063_REG_RSVD_22, /* 0x22: Reserved */
  361. MT2063_REG_RSVD_23, /* 0x23: Reserved */
  362. MT2063_REG_RSVD_24, /* 0x24: Reserved */
  363. MT2063_REG_RSVD_25, /* 0x25: Reserved */
  364. MT2063_REG_RSVD_26, /* 0x26: Reserved */
  365. MT2063_REG_RSVD_27, /* 0x27: Reserved */
  366. MT2063_REG_FIFF_CTRL, /* 0x28: FIFF Control */
  367. MT2063_REG_FIFF_OFFSET, /* 0x29: FIFF Offset */
  368. MT2063_REG_CTUNE_CTRL, /* 0x2A: Reserved */
  369. MT2063_REG_CTUNE_OV, /* 0x2B: Reserved */
  370. MT2063_REG_CTRL_2C, /* 0x2C: Reserved */
  371. MT2063_REG_FIFF_CTRL2, /* 0x2D: Fiff Control */
  372. MT2063_REG_RSVD_2E, /* 0x2E: Reserved */
  373. MT2063_REG_DNC_GAIN, /* 0x2F: DNC Control */
  374. MT2063_REG_VGA_GAIN, /* 0x30: VGA Gain Ctrl */
  375. MT2063_REG_RSVD_31, /* 0x31: Reserved */
  376. MT2063_REG_TEMP_SEL, /* 0x32: Temperature Selection */
  377. MT2063_REG_RSVD_33, /* 0x33: Reserved */
  378. MT2063_REG_RSVD_34, /* 0x34: Reserved */
  379. MT2063_REG_RSVD_35, /* 0x35: Reserved */
  380. MT2063_REG_RSVD_36, /* 0x36: Reserved */
  381. MT2063_REG_RSVD_37, /* 0x37: Reserved */
  382. MT2063_REG_RSVD_38, /* 0x38: Reserved */
  383. MT2063_REG_RSVD_39, /* 0x39: Reserved */
  384. MT2063_REG_RSVD_3A, /* 0x3A: Reserved */
  385. MT2063_REG_RSVD_3B, /* 0x3B: Reserved */
  386. MT2063_REG_RSVD_3C, /* 0x3C: Reserved */
  387. MT2063_REG_END_REGS
  388. };
  389. struct MT2063_Info_t {
  390. void *handle;
  391. void *hUserData;
  392. u32 address;
  393. u32 version;
  394. u32 tuner_id;
  395. struct MT2063_AvoidSpursData_t AS_Data;
  396. u32 f_IF1_actual;
  397. u32 rcvr_mode;
  398. u32 ctfilt_sw;
  399. u32 CTFiltMax[31];
  400. u32 num_regs;
  401. u8 reg[MT2063_REG_END_REGS];
  402. };
  403. typedef struct MT2063_Info_t *pMT2063_Info_t;
  404. enum MTTune_atv_standard {
  405. MTTUNEA_UNKNOWN = 0,
  406. MTTUNEA_PAL_B,
  407. MTTUNEA_PAL_G,
  408. MTTUNEA_PAL_I,
  409. MTTUNEA_PAL_L,
  410. MTTUNEA_PAL_MN,
  411. MTTUNEA_PAL_DK,
  412. MTTUNEA_DIGITAL,
  413. MTTUNEA_FMRADIO,
  414. MTTUNEA_DVBC,
  415. MTTUNEA_DVBT
  416. };
  417. struct mt2063_config {
  418. u8 tuner_address;
  419. u32 refclock;
  420. };
  421. struct mt2063_state {
  422. struct i2c_adapter *i2c;
  423. const struct mt2063_config *config;
  424. struct dvb_tuner_ops ops;
  425. struct dvb_frontend *frontend;
  426. struct tuner_state status;
  427. const struct MT2063_Info_t *MT2063_ht;
  428. bool MT2063_init;
  429. enum MTTune_atv_standard tv_type;
  430. u32 frequency;
  431. u32 srate;
  432. u32 bandwidth;
  433. u32 reference;
  434. };
  435. #if defined(CONFIG_MEDIA_TUNER_MT2063) || (defined(CONFIG_MEDIA_TUNER_MT2063_MODULE) && defined(MODULE))
  436. struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe,
  437. struct mt2063_config *config,
  438. struct i2c_adapter *i2c);
  439. #else
  440. static inline struct dvb_frontend *mt2063_attach(struct dvb_frontend *fe,
  441. struct mt2063_config *config,
  442. struct i2c_adapter *i2c)
  443. {
  444. printk(KERN_WARNING "%s: Driver disabled by Kconfig\n", __func__);
  445. return NULL;
  446. }
  447. #endif /* CONFIG_DVB_MT2063 */
  448. #endif /* __MT2063_H__ */