tda827x.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. DVB Driver for Philips tda827x / tda827xa Silicon tuners
  3. (c) 2005 Hartmut Hackmann
  4. (c) 2007 Michael Krufky
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef __DVB_TDA827X_H__
  18. #define __DVB_TDA827X_H__
  19. #include <linux/i2c.h>
  20. #include "dvb_frontend.h"
  21. #include "tda8290.h"
  22. struct tda827x_config
  23. {
  24. /* saa7134 - provided callbacks */
  25. int (*init) (struct dvb_frontend *fe);
  26. int (*sleep) (struct dvb_frontend *fe);
  27. /* interface to tda829x driver */
  28. enum tda8290_lna config;
  29. int switch_addr;
  30. void (*agcf)(struct dvb_frontend *fe);
  31. };
  32. /**
  33. * Attach a tda827x tuner to the supplied frontend structure.
  34. *
  35. * @param fe Frontend to attach to.
  36. * @param addr i2c address of the tuner.
  37. * @param i2c i2c adapter to use.
  38. * @param cfg optional callback function pointers.
  39. * @return FE pointer on success, NULL on failure.
  40. */
  41. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TDA827X)
  42. extern struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe, int addr,
  43. struct i2c_adapter *i2c,
  44. struct tda827x_config *cfg);
  45. #else
  46. static inline struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe,
  47. int addr,
  48. struct i2c_adapter *i2c,
  49. struct tda827x_config *cfg)
  50. {
  51. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  52. return NULL;
  53. }
  54. #endif // CONFIG_MEDIA_TUNER_TDA827X
  55. #endif // __DVB_TDA827X_H__