tda827x.h 1.9 KB

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