rtl2832.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. /*
  2. * Realtek RTL2832 DVB-T demodulator driver
  3. *
  4. * Copyright (C) 2012 Thomas Mair <thomas.mair86@gmail.com>
  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 RTL2832_H
  21. #define RTL2832_H
  22. #include <linux/kconfig.h>
  23. #include <linux/dvb/frontend.h>
  24. struct rtl2832_config {
  25. /*
  26. * Demodulator I2C address.
  27. */
  28. u8 i2c_addr;
  29. /*
  30. * Xtal frequency.
  31. * Hz
  32. * 4000000, 16000000, 25000000, 28800000
  33. */
  34. u32 xtal;
  35. /*
  36. * IFs for all used modes.
  37. * Hz
  38. * 4570000, 4571429, 36000000, 36125000, 36166667, 44000000
  39. */
  40. u32 if_dvbt;
  41. /*
  42. * tuner
  43. * XXX: This must be keep sync with dvb_usb_rtl28xxu demod driver.
  44. */
  45. #define RTL2832_TUNER_TUA9001 0x24
  46. #define RTL2832_TUNER_FC0012 0x26
  47. #define RTL2832_TUNER_E4000 0x27
  48. #define RTL2832_TUNER_FC0013 0x29
  49. #define RTL2832_TUNER_R820T 0x2a
  50. u8 tuner;
  51. };
  52. #if IS_ENABLED(CONFIG_DVB_RTL2832)
  53. extern struct dvb_frontend *rtl2832_attach(
  54. const struct rtl2832_config *cfg,
  55. struct i2c_adapter *i2c
  56. );
  57. #else
  58. static inline struct dvb_frontend *rtl2832_attach(
  59. const struct rtl2832_config *config,
  60. struct i2c_adapter *i2c
  61. )
  62. {
  63. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  64. return NULL;
  65. }
  66. #endif
  67. #endif /* RTL2832_H */