mxl5005s.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. /*
  2. * For the Realtek RTL chip RTL2831U
  3. * Realtek Release Date: 2008-03-14, ver 080314
  4. * Realtek version RTL2831 Linux driver version 080314
  5. * ver 080314
  6. *
  7. * for linux kernel version 2.6.21.4 - 2.6.22-14
  8. * support MXL5005s and MT2060 tuners (support tuner auto-detecting)
  9. * support two IR types -- RC5 and NEC
  10. *
  11. * Known boards with Realtek RTL chip RTL2821U
  12. * Freecom USB stick 14aa:0160 (version 4)
  13. * Conceptronic CTVDIGRCU
  14. *
  15. * Copyright (c) 2008 Realtek
  16. * Copyright (c) 2008 Jan Hoogenraad, Barnaby Shearer, Andy Hasper
  17. * This code is placed under the terms of the GNU General Public License
  18. *
  19. * Released by Realtek under GPLv2.
  20. * Thanks to Realtek for a lot of support we received !
  21. *
  22. * Revision: 080314 - original version
  23. */
  24. #ifndef __MXL5005S_H
  25. #define __MXL5005S_H
  26. struct mxl5005s_config
  27. {
  28. /* 7 bit i2c address */
  29. u8 i2c_address;
  30. #define IF_FREQ_4570000HZ 4570000
  31. #define IF_FREQ_4571429HZ 4571429
  32. #define IF_FREQ_5380000HZ 5380000
  33. #define IF_FREQ_36000000HZ 36000000
  34. #define IF_FREQ_36125000HZ 36125000
  35. #define IF_FREQ_36166667HZ 36166667
  36. #define IF_FREQ_44000000HZ 44000000
  37. u32 if_freq;
  38. #define CRYSTAL_FREQ_4000000HZ 4000000
  39. #define CRYSTAL_FREQ_16000000HZ 16000000
  40. #define CRYSTAL_FREQ_25000000HZ 25000000
  41. #define CRYSTAL_FREQ_28800000HZ 28800000
  42. u32 xtal_freq;
  43. #define MXL_DUAL_AGC 0
  44. #define MXL_SINGLE_AGC 1
  45. u8 agc_mode;
  46. #define MXL_TF_DEFAULT 0
  47. #define MXL_TF_OFF 1
  48. #define MXL_TF_C 2
  49. #define MXL_TF_C_H 3
  50. #define MXL_TF_D 4
  51. #define MXL_TF_D_L 5
  52. #define MXL_TF_E 6
  53. #define MXL_TF_F 7
  54. #define MXL_TF_E_2 8
  55. #define MXL_TF_E_NA 9
  56. #define MXL_TF_G 10
  57. u8 tracking_filter;
  58. #define MXL_RSSI_DISABLE 0
  59. #define MXL_RSSI_ENABLE 1
  60. u8 rssi_enable;
  61. #define MXL_CAP_SEL_DISABLE 0
  62. #define MXL_CAP_SEL_ENABLE 1
  63. u8 cap_select;
  64. #define MXL_DIV_OUT_1 0
  65. #define MXL_DIV_OUT_4 1
  66. u8 div_out;
  67. #define MXL_CLOCK_OUT_DISABLE 0
  68. #define MXL_CLOCK_OUT_ENABLE 1
  69. u8 clock_out;
  70. #define MXL5005S_IF_OUTPUT_LOAD_200_OHM 200
  71. #define MXL5005S_IF_OUTPUT_LOAD_300_OHM 300
  72. u32 output_load;
  73. #define MXL5005S_TOP_5P5 55
  74. #define MXL5005S_TOP_7P2 72
  75. #define MXL5005S_TOP_9P2 92
  76. #define MXL5005S_TOP_11P0 110
  77. #define MXL5005S_TOP_12P9 129
  78. #define MXL5005S_TOP_14P7 147
  79. #define MXL5005S_TOP_16P8 168
  80. #define MXL5005S_TOP_19P4 194
  81. #define MXL5005S_TOP_21P2 212
  82. #define MXL5005S_TOP_23P2 232
  83. #define MXL5005S_TOP_25P2 252
  84. #define MXL5005S_TOP_27P1 271
  85. #define MXL5005S_TOP_29P2 292
  86. #define MXL5005S_TOP_31P7 317
  87. #define MXL5005S_TOP_34P9 349
  88. u32 top;
  89. #define MXL_ANALOG_MODE 0
  90. #define MXL_DIGITAL_MODE 1
  91. u8 mod_mode;
  92. #define MXL_ZERO_IF 0
  93. #define MXL_LOW_IF 1
  94. u8 if_mode;
  95. /* Stuff I don't know what to do with */
  96. u8 AgcMasterByte;
  97. };
  98. #if defined(CONFIG_DVB_TUNER_MXL5005S) || (defined(CONFIG_DVB_TUNER_MXL5005S_MODULE) && defined(MODULE))
  99. extern struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
  100. struct i2c_adapter *i2c,
  101. struct mxl5005s_config *config);
  102. #else
  103. static inline struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
  104. struct i2c_adapter *i2c,
  105. struct mxl5005s_config *config);
  106. {
  107. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  108. return NULL;
  109. }
  110. #endif /* CONFIG_DVB_TUNER_MXL5005S */
  111. #endif /* __MXL5005S_H */