rtl2830.h 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * Realtek RTL2830 DVB-T demodulator driver
  3. *
  4. * Copyright (C) 2011 Antti Palosaari <crope@iki.fi>
  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. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. */
  20. #ifndef RTL2830_H
  21. #define RTL2830_H
  22. #include <linux/dvb/frontend.h>
  23. struct rtl2830_config {
  24. /*
  25. * Demodulator I2C address.
  26. */
  27. u8 i2c_addr;
  28. /*
  29. * Xtal frequency.
  30. * Hz
  31. * 4000000, 16000000, 25000000, 28800000
  32. */
  33. u32 xtal;
  34. /*
  35. * TS output mode.
  36. */
  37. u8 ts_mode;
  38. /*
  39. * Spectrum inversion.
  40. */
  41. bool spec_inv;
  42. /*
  43. */
  44. u8 vtop;
  45. /*
  46. */
  47. u8 krf;
  48. /*
  49. */
  50. u8 agc_targ_val;
  51. };
  52. #if defined(CONFIG_DVB_RTL2830) || \
  53. (defined(CONFIG_DVB_RTL2830_MODULE) && defined(MODULE))
  54. extern struct dvb_frontend *rtl2830_attach(
  55. const struct rtl2830_config *config,
  56. struct i2c_adapter *i2c
  57. );
  58. extern struct i2c_adapter *rtl2830_get_tuner_i2c_adapter(
  59. struct dvb_frontend *fe
  60. );
  61. #else
  62. static inline struct dvb_frontend *rtl2830_attach(
  63. const struct rtl2830_config *config,
  64. struct i2c_adapter *i2c
  65. )
  66. {
  67. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  68. return NULL;
  69. }
  70. static inline struct i2c_adapter *rtl2830_get_tuner_i2c_adapter(
  71. struct dvb_frontend *fe
  72. )
  73. {
  74. return NULL;
  75. }
  76. #endif
  77. #endif /* RTL2830_H */