rtl2832.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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/dvb/frontend.h>
  23. struct rtl2832_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. * IFs for all used modes.
  36. * Hz
  37. * 4570000, 4571429, 36000000, 36125000, 36166667, 44000000
  38. */
  39. u32 if_dvbt;
  40. /*
  41. */
  42. u8 tuner;
  43. };
  44. #if defined(CONFIG_DVB_RTL2832) || \
  45. (defined(CONFIG_DVB_RTL2832_MODULE) && defined(MODULE))
  46. extern struct dvb_frontend *rtl2832_attach(
  47. const struct rtl2832_config *cfg,
  48. struct i2c_adapter *i2c
  49. );
  50. extern struct i2c_adapter *rtl2832_get_tuner_i2c_adapter(
  51. struct dvb_frontend *fe
  52. );
  53. #else
  54. static inline struct dvb_frontend *rtl2832_attach(
  55. const struct rtl2832_config *config,
  56. struct i2c_adapter *i2c
  57. )
  58. {
  59. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  60. return NULL;
  61. }
  62. #endif
  63. #endif /* RTL2832_H */