mxl5005s.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. MaxLinear MXL5005S VSB/QAM/DVBT tuner driver
  4. Copyright (C) 2008 MaxLinear
  5. Copyright (C) 2008 Steven Toth <stoth@linuxtv.org>
  6. */
  7. #ifndef __MXL5005S_H
  8. #define __MXL5005S_H
  9. #include <linux/i2c.h>
  10. #include <media/dvb_frontend.h>
  11. struct mxl5005s_config {
  12. /* 7 bit i2c address */
  13. u8 i2c_address;
  14. #define IF_FREQ_4570000HZ 4570000
  15. #define IF_FREQ_4571429HZ 4571429
  16. #define IF_FREQ_5380000HZ 5380000
  17. #define IF_FREQ_36000000HZ 36000000
  18. #define IF_FREQ_36125000HZ 36125000
  19. #define IF_FREQ_36166667HZ 36166667
  20. #define IF_FREQ_44000000HZ 44000000
  21. u32 if_freq;
  22. #define CRYSTAL_FREQ_4000000HZ 4000000
  23. #define CRYSTAL_FREQ_16000000HZ 16000000
  24. #define CRYSTAL_FREQ_25000000HZ 25000000
  25. #define CRYSTAL_FREQ_28800000HZ 28800000
  26. u32 xtal_freq;
  27. #define MXL_DUAL_AGC 0
  28. #define MXL_SINGLE_AGC 1
  29. u8 agc_mode;
  30. #define MXL_TF_DEFAULT 0
  31. #define MXL_TF_OFF 1
  32. #define MXL_TF_C 2
  33. #define MXL_TF_C_H 3
  34. #define MXL_TF_D 4
  35. #define MXL_TF_D_L 5
  36. #define MXL_TF_E 6
  37. #define MXL_TF_F 7
  38. #define MXL_TF_E_2 8
  39. #define MXL_TF_E_NA 9
  40. #define MXL_TF_G 10
  41. u8 tracking_filter;
  42. #define MXL_RSSI_DISABLE 0
  43. #define MXL_RSSI_ENABLE 1
  44. u8 rssi_enable;
  45. #define MXL_CAP_SEL_DISABLE 0
  46. #define MXL_CAP_SEL_ENABLE 1
  47. u8 cap_select;
  48. #define MXL_DIV_OUT_1 0
  49. #define MXL_DIV_OUT_4 1
  50. u8 div_out;
  51. #define MXL_CLOCK_OUT_DISABLE 0
  52. #define MXL_CLOCK_OUT_ENABLE 1
  53. u8 clock_out;
  54. #define MXL5005S_IF_OUTPUT_LOAD_200_OHM 200
  55. #define MXL5005S_IF_OUTPUT_LOAD_300_OHM 300
  56. u32 output_load;
  57. #define MXL5005S_TOP_5P5 55
  58. #define MXL5005S_TOP_7P2 72
  59. #define MXL5005S_TOP_9P2 92
  60. #define MXL5005S_TOP_11P0 110
  61. #define MXL5005S_TOP_12P9 129
  62. #define MXL5005S_TOP_14P7 147
  63. #define MXL5005S_TOP_16P8 168
  64. #define MXL5005S_TOP_19P4 194
  65. #define MXL5005S_TOP_21P2 212
  66. #define MXL5005S_TOP_23P2 232
  67. #define MXL5005S_TOP_25P2 252
  68. #define MXL5005S_TOP_27P1 271
  69. #define MXL5005S_TOP_29P2 292
  70. #define MXL5005S_TOP_31P7 317
  71. #define MXL5005S_TOP_34P9 349
  72. u32 top;
  73. #define MXL_ANALOG_MODE 0
  74. #define MXL_DIGITAL_MODE 1
  75. u8 mod_mode;
  76. #define MXL_ZERO_IF 0
  77. #define MXL_LOW_IF 1
  78. u8 if_mode;
  79. /* Some boards need to override the built-in logic for determining
  80. the gain when in QAM mode (the HVR-1600 is one such case) */
  81. u8 qam_gain;
  82. /* Stuff I don't know what to do with */
  83. u8 AgcMasterByte;
  84. };
  85. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MXL5005S)
  86. extern struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
  87. struct i2c_adapter *i2c,
  88. struct mxl5005s_config *config);
  89. #else
  90. static inline struct dvb_frontend *mxl5005s_attach(struct dvb_frontend *fe,
  91. struct i2c_adapter *i2c,
  92. struct mxl5005s_config *config)
  93. {
  94. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  95. return NULL;
  96. }
  97. #endif /* CONFIG_DVB_TUNER_MXL5005S */
  98. #endif /* __MXL5005S_H */