tda827x.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. struct tda827x_config
  22. {
  23. /* saa7134 - provided callbacks */
  24. int (*init) (struct dvb_frontend *fe);
  25. int (*sleep) (struct dvb_frontend *fe);
  26. /* interface to tda829x driver */
  27. unsigned int config;
  28. int switch_addr;
  29. void (*agcf)(struct dvb_frontend *fe);
  30. };
  31. /**
  32. * Attach a tda827x tuner to the supplied frontend structure.
  33. *
  34. * @param fe Frontend to attach to.
  35. * @param addr i2c address of the tuner.
  36. * @param i2c i2c adapter to use.
  37. * @param cfg optional callback function pointers.
  38. * @return FE pointer on success, NULL on failure.
  39. */
  40. #if defined(CONFIG_MEDIA_TUNER_TDA827X) || (defined(CONFIG_MEDIA_TUNER_TDA827X_MODULE) && defined(MODULE))
  41. extern struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe, int addr,
  42. struct i2c_adapter *i2c,
  43. struct tda827x_config *cfg);
  44. #else
  45. static inline struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe,
  46. int addr,
  47. struct i2c_adapter *i2c,
  48. struct tda827x_config *cfg)
  49. {
  50. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  51. return NULL;
  52. }
  53. #endif // CONFIG_MEDIA_TUNER_TDA827X
  54. #endif // __DVB_TDA827X_H__