tuner-types.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /*
  2. * descriptions for simple tuners.
  3. */
  4. #ifndef __TUNER_TYPES_H__
  5. #define __TUNER_TYPES_H__
  6. enum param_type {
  7. TUNER_PARAM_TYPE_RADIO, \
  8. TUNER_PARAM_TYPE_PAL, \
  9. TUNER_PARAM_TYPE_SECAM, \
  10. TUNER_PARAM_TYPE_NTSC
  11. };
  12. struct tuner_range {
  13. unsigned short limit;
  14. unsigned char config;
  15. unsigned char cb;
  16. };
  17. struct tuner_params {
  18. enum param_type type;
  19. /* Many Philips based tuners have a comment like this in their
  20. * datasheet:
  21. *
  22. * For channel selection involving band switching, and to ensure
  23. * smooth tuning to the desired channel without causing
  24. * unnecessary charge pump action, it is recommended to consider
  25. * the difference between wanted channel frequency and the
  26. * current channel frequency. Unnecessary charge pump action
  27. * will result in very low tuning voltage which may drive the
  28. * oscillator to extreme conditions.
  29. *
  30. * Set cb_first_if_lower_freq to 1, if this check is
  31. * required for this tuner.
  32. *
  33. * I tested this for PAL by first setting the TV frequency to
  34. * 203 MHz and then switching to 96.6 MHz FM radio. The result was
  35. * static unless the control byte was sent first.
  36. */
  37. unsigned int cb_first_if_lower_freq:1;
  38. /* Set to 1 if this tuner uses a tda9887 */
  39. unsigned int has_tda9887:1;
  40. /* Many Philips tuners use tda9887 PORT1 to select the FM radio
  41. sensitivity. If this setting is 1, then set PORT1 to 1 to
  42. get proper FM reception. */
  43. unsigned int port1_fm_high_sensitivity:1;
  44. /* Some Philips tuners use tda9887 PORT2 to select the FM radio
  45. sensitivity. If this setting is 1, then set PORT2 to 1 to
  46. get proper FM reception. */
  47. unsigned int port2_fm_high_sensitivity:1;
  48. /* Some Philips tuners use tda9887 cGainNormal to select the FM radio
  49. sensitivity. If this setting is 1, e register will use cGainNormal
  50. instead of cGainLow. */
  51. unsigned int fm_gain_normal:1;
  52. /* Most tuners with a tda9887 use QSS mode. Some (cheaper) tuners
  53. use Intercarrier mode. If this setting is 1, then the tuner
  54. needs to be set to intercarrier mode. */
  55. unsigned int intercarrier_mode:1;
  56. /* This setting sets the default value for PORT1.
  57. 0 means inactive, 1 means active. Note: the actual bit
  58. value written to the tda9887 is inverted. So a 0 here
  59. means a 1 in the B6 bit. */
  60. unsigned int port1_active:1;
  61. /* This setting sets the default value for PORT2.
  62. 0 means inactive, 1 means active. Note: the actual bit
  63. value written to the tda9887 is inverted. So a 0 here
  64. means a 1 in the B7 bit. */
  65. unsigned int port2_active:1;
  66. /* Sometimes PORT1 is inverted when the SECAM-L' standard is selected.
  67. Set this bit to 1 if this is needed. */
  68. unsigned int port1_invert_for_secam_lc:1;
  69. /* Sometimes PORT2 is inverted when the SECAM-L' standard is selected.
  70. Set this bit to 1 if this is needed. */
  71. unsigned int port2_invert_for_secam_lc:1;
  72. /* Some cards require PORT1 to be 1 for mono Radio FM and 0 for stereo. */
  73. unsigned int port1_set_for_fm_mono:1;
  74. /* Select 18% (or according to datasheet 0%) L standard PLL gating,
  75. vs the driver default of 36%. */
  76. unsigned int default_pll_gating_18:1;
  77. /* IF to use in radio mode. Tuners with a separate radio IF filter
  78. seem to use 10.7, while those without use 33.3 for PAL/SECAM tuners
  79. and 41.3 for NTSC tuners. 0 = 10.7, 1 = 33.3, 2 = 41.3 */
  80. unsigned int radio_if:2;
  81. /* Default tda9887 TOP value in dB for the low band. Default is 0.
  82. Range: -16:+15 */
  83. signed int default_top_low:5;
  84. /* Default tda9887 TOP value in dB for the mid band. Default is 0.
  85. Range: -16:+15 */
  86. signed int default_top_mid:5;
  87. /* Default tda9887 TOP value in dB for the high band. Default is 0.
  88. Range: -16:+15 */
  89. signed int default_top_high:5;
  90. /* Default tda9887 TOP value in dB for SECAM-L/L' for the low band.
  91. Default is 0. Several tuners require a different TOP value for
  92. the SECAM-L/L' standards. Range: -16:+15 */
  93. signed int default_top_secam_low:5;
  94. /* Default tda9887 TOP value in dB for SECAM-L/L' for the mid band.
  95. Default is 0. Several tuners require a different TOP value for
  96. the SECAM-L/L' standards. Range: -16:+15 */
  97. signed int default_top_secam_mid:5;
  98. /* Default tda9887 TOP value in dB for SECAM-L/L' for the high band.
  99. Default is 0. Several tuners require a different TOP value for
  100. the SECAM-L/L' standards. Range: -16:+15 */
  101. signed int default_top_secam_high:5;
  102. unsigned int count;
  103. struct tuner_range *ranges;
  104. };
  105. struct tunertype {
  106. char *name;
  107. unsigned int count;
  108. struct tuner_params *params;
  109. };
  110. extern struct tunertype tuners[];
  111. extern unsigned const int tuner_count;
  112. #endif