mxl5005s.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. /*
  2. MaxLinear MXL5005S VSB/QAM/DVBT tuner driver
  3. Copyright (C) 2008 MaxLinear
  4. Copyright (C) 2008 Steven Toth <stoth@hauppauge.com>
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef __MXL5005S_H
  18. #define __MXL5005S_H
  19. struct mxl5005s_config
  20. {
  21. /* 7 bit i2c address */
  22. u8 i2c_address;
  23. #define IF_FREQ_4570000HZ 4570000
  24. #define IF_FREQ_4571429HZ 4571429
  25. #define IF_FREQ_5380000HZ 5380000
  26. #define IF_FREQ_36000000HZ 36000000
  27. #define IF_FREQ_36125000HZ 36125000
  28. #define IF_FREQ_36166667HZ 36166667
  29. #define IF_FREQ_44000000HZ 44000000
  30. u32 if_freq;
  31. #define CRYSTAL_FREQ_4000000HZ 4000000
  32. #define CRYSTAL_FREQ_16000000HZ 16000000
  33. #define CRYSTAL_FREQ_25000000HZ 25000000
  34. #define CRYSTAL_FREQ_28800000HZ 28800000
  35. u32 xtal_freq;
  36. #define MXL_DUAL_AGC 0
  37. #define MXL_SINGLE_AGC 1
  38. u8 agc_mode;
  39. #define MXL_TF_DEFAULT 0
  40. #define MXL_TF_OFF 1
  41. #define MXL_TF_C 2
  42. #define MXL_TF_C_H 3
  43. #define MXL_TF_D 4
  44. #define MXL_TF_D_L 5
  45. #define MXL_TF_E 6
  46. #define MXL_TF_F 7
  47. #define MXL_TF_E_2 8
  48. #define MXL_TF_E_NA 9
  49. #define MXL_TF_G 10
  50. u8 tracking_filter;
  51. #define MXL_RSSI_DISABLE 0
  52. #define MXL_RSSI_ENABLE 1
  53. u8 rssi_enable;
  54. #define MXL_CAP_SEL_DISABLE 0
  55. #define MXL_CAP_SEL_ENABLE 1
  56. u8 cap_select;
  57. #define MXL_DIV_OUT_1 0
  58. #define MXL_DIV_OUT_4 1
  59. u8 div_out;
  60. #define MXL_CLOCK_OUT_DISABLE 0
  61. #define MXL_CLOCK_OUT_ENABLE 1
  62. u8 clock_out;
  63. #define MXL5005S_IF_OUTPUT_LOAD_200_OHM 200
  64. #define MXL5005S_IF_OUTPUT_LOAD_300_OHM 300
  65. u32 output_load;
  66. #define MXL5005S_TOP_5P5 55
  67. #define MXL5005S_TOP_7P2 72
  68. #define MXL5005S_TOP_9P2 92
  69. #define MXL5005S_TOP_11P0 110
  70. #define MXL5005S_TOP_12P9 129
  71. #define MXL5005S_TOP_14P7 147
  72. #define MXL5005S_TOP_16P8 168
  73. #define MXL5005S_TOP_19P4 194
  74. #define MXL5005S_TOP_21P2 212
  75. #define MXL5005S_TOP_23P2 232
  76. #define MXL5005S_TOP_25P2 252
  77. #define MXL5005S_TOP_27P1 271
  78. #define MXL5005S_TOP_29P2 292
  79. #define MXL5005S_TOP_31P7 317
  80. #define MXL5005S_TOP_34P9 349
  81. u32 top;
  82. #define MXL_ANALOG_MODE 0
  83. #define MXL_DIGITAL_MODE 1
  84. u8 mod_mode;
  85. #define MXL_ZERO_IF 0
  86. #define MXL_LOW_IF 1
  87. u8 if_mode;
  88. /* Stuff I don't know what to do with */
  89. u8 AgcMasterByte;
  90. };
  91. #if defined(CONFIG_DVB_TUNER_MXL5005S) || \
  92. (defined(CONFIG_DVB_TUNER_MXL5005S_MODULE) && defined(MODULE))
  93. extern struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
  94. struct i2c_adapter *i2c,
  95. struct mxl5005s_config *config)
  96. #else
  97. static inline struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
  98. struct i2c_adapter *i2c,
  99. struct mxl5005s_config *config)
  100. {
  101. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  102. return NULL;
  103. }
  104. #endif /* CONFIG_DVB_TUNER_MXL5005S */
  105. #endif /* __MXL5005S_H */