r820t.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * Elonics R820T silicon tuner driver
  3. *
  4. * Copyright (C) 2012 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 R820T_H
  21. #define R820T_H
  22. #include <media/dvb_frontend.h>
  23. enum r820t_chip {
  24. CHIP_R820T,
  25. CHIP_R620D,
  26. CHIP_R828D,
  27. CHIP_R828,
  28. CHIP_R828S,
  29. CHIP_R820C,
  30. };
  31. struct r820t_config {
  32. u8 i2c_addr; /* 0x34 */
  33. u32 xtal;
  34. enum r820t_chip rafael_chip;
  35. unsigned max_i2c_msg_len;
  36. bool use_diplexer;
  37. bool use_predetect;
  38. };
  39. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_R820T)
  40. struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
  41. struct i2c_adapter *i2c,
  42. const struct r820t_config *cfg);
  43. #else
  44. static inline struct dvb_frontend *r820t_attach(struct dvb_frontend *fe,
  45. struct i2c_adapter *i2c,
  46. const struct r820t_config *cfg)
  47. {
  48. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  49. return NULL;
  50. }
  51. #endif
  52. #endif