mt2060_priv.h 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner"
  3. *
  4. * Copyright (c) 2006 Olivier DANET <odanet@caramail.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. *
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.=
  20. */
  21. #ifndef MT2060_PRIV_H
  22. #define MT2060_PRIV_H
  23. // Uncomment the #define below to enable spurs checking. The results where quite unconvincing.
  24. // #define MT2060_SPURCHECK
  25. /* This driver is based on the information available in the datasheet of the
  26. "Comtech SDVBT-3K6M" tuner ( K1000737843.pdf ) which features the MT2060 register map :
  27. I2C Address : 0x60
  28. Reg.No | B7 | B6 | B5 | B4 | B3 | B2 | B1 | B0 | ( defaults )
  29. --------------------------------------------------------------------------------
  30. 00 | [ PART ] | [ REV ] | R = 0x63
  31. 01 | [ LNABAND ] | [ NUM1(5:2) ] | RW = 0x3F
  32. 02 | [ DIV1 ] | RW = 0x74
  33. 03 | FM1CA | FM1SS | [ NUM1(1:0) ] | [ NUM2(3:0) ] | RW = 0x00
  34. 04 | NUM2(11:4) ] | RW = 0x08
  35. 05 | [ DIV2 ] |NUM2(12)| RW = 0x93
  36. 06 | L1LK | [ TAD1 ] | L2LK | [ TAD2 ] | R
  37. 07 | [ FMF ] | R
  38. 08 | ? | FMCAL | ? | ? | ? | ? | ? | TEMP | R
  39. 09 | 0 | 0 | [ FMGC ] | 0 | GP02 | GP01 | 0 | RW = 0x20
  40. 0A | ??
  41. 0B | 0 | 0 | 1 | 1 | 0 | 0 | [ VGAG ] | RW = 0x30
  42. 0C | V1CSE | 1 | 1 | 1 | 1 | 1 | 1 | 1 | RW = 0xFF
  43. 0D | 1 | 0 | [ V1CS ] | RW = 0xB0
  44. 0E | ??
  45. 0F | ??
  46. 10 | ??
  47. 11 | [ LOTO ] | 0 | 0 | 1 | 0 | RW = 0x42
  48. PART : Part code : 6 for MT2060
  49. REV : Revision code : 3 for current revision
  50. LNABAND : Input frequency range : ( See code for details )
  51. NUM1 / DIV1 / NUM2 / DIV2 : Frequencies programming ( See code for details )
  52. FM1CA : Calibration Start Bit
  53. FM1SS : Calibration Single Step bit
  54. L1LK : LO1 Lock Detect
  55. TAD1 : Tune Line ADC ( ? )
  56. L2LK : LO2 Lock Detect
  57. TAD2 : Tune Line ADC ( ? )
  58. FMF : Estimated first IF Center frequency Offset ( ? )
  59. FM1CAL : Calibration done bit
  60. TEMP : On chip temperature sensor
  61. FMCG : Mixer 1 Cap Gain ( ? )
  62. GP01 / GP02 : Programmable digital outputs. Unconnected pins ?
  63. V1CSE : LO1 VCO Automatic Capacitor Select Enable ( ? )
  64. V1CS : LO1 Capacitor Selection Value ( ? )
  65. LOTO : LO Timeout ( ? )
  66. VGAG : Tuner Output gain
  67. */
  68. #define I2C_ADDRESS 0x60
  69. #define REG_PART_REV 0
  70. #define REG_LO1C1 1
  71. #define REG_LO1C2 2
  72. #define REG_LO2C1 3
  73. #define REG_LO2C2 4
  74. #define REG_LO2C3 5
  75. #define REG_LO_STATUS 6
  76. #define REG_FM_FREQ 7
  77. #define REG_MISC_STAT 8
  78. #define REG_MISC_CTRL 9
  79. #define REG_RESERVED_A 0x0A
  80. #define REG_VGAG 0x0B
  81. #define REG_LO1B1 0x0C
  82. #define REG_LO1B2 0x0D
  83. #define REG_LOTO 0x11
  84. #define PART_REV 0x63 // The current driver works only with PART=6 and REV=3 chips
  85. struct mt2060_priv {
  86. struct mt2060_config *cfg;
  87. struct i2c_adapter *i2c;
  88. u32 frequency;
  89. u16 if1_freq;
  90. u8 fmfreq;
  91. };
  92. #endif