rtl2832.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. * tuner
  37. * XXX: This must be keep sync with dvb_usb_rtl28xxu demod driver.
  38. */
  39. #define RTL2832_TUNER_TUA9001 0x24
  40. #define RTL2832_TUNER_FC0012 0x26
  41. #define RTL2832_TUNER_E4000 0x27
  42. #define RTL2832_TUNER_FC0013 0x29
  43. #define RTL2832_TUNER_R820T 0x2a
  44. #define RTL2832_TUNER_R828D 0x2b
  45. u8 tuner;
  46. };
  47. #if IS_ENABLED(CONFIG_DVB_RTL2832)
  48. struct dvb_frontend *rtl2832_attach(
  49. const struct rtl2832_config *cfg,
  50. struct i2c_adapter *i2c
  51. );
  52. extern struct i2c_adapter *rtl2832_get_i2c_adapter(
  53. struct dvb_frontend *fe
  54. );
  55. extern struct i2c_adapter *rtl2832_get_private_i2c_adapter(
  56. struct dvb_frontend *fe
  57. );
  58. #else
  59. static inline struct dvb_frontend *rtl2832_attach(
  60. const struct rtl2832_config *config,
  61. struct i2c_adapter *i2c
  62. )
  63. {
  64. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  65. return NULL;
  66. }
  67. static inline struct i2c_adapter *rtl2832_get_i2c_adapter(
  68. struct dvb_frontend *fe
  69. )
  70. {
  71. return NULL;
  72. }
  73. static inline struct i2c_adapter *rtl2832_get_private_i2c_adapter(
  74. struct dvb_frontend *fe
  75. )
  76. {
  77. return NULL;
  78. }
  79. #endif
  80. #endif /* RTL2832_H */