tda827x.h 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. DVB Driver for Philips tda827x / tda827xa Silicon tuners
  4. (c) 2005 Hartmut Hackmann
  5. (c) 2007 Michael Krufky
  6. */
  7. #ifndef __DVB_TDA827X_H__
  8. #define __DVB_TDA827X_H__
  9. #include <linux/i2c.h>
  10. #include <media/dvb_frontend.h>
  11. #include "tda8290.h"
  12. struct tda827x_config
  13. {
  14. /* saa7134 - provided callbacks */
  15. int (*init) (struct dvb_frontend *fe);
  16. int (*sleep) (struct dvb_frontend *fe);
  17. /* interface to tda829x driver */
  18. enum tda8290_lna config;
  19. int switch_addr;
  20. void (*agcf)(struct dvb_frontend *fe);
  21. };
  22. /**
  23. * Attach a tda827x tuner to the supplied frontend structure.
  24. *
  25. * @param fe Frontend to attach to.
  26. * @param addr i2c address of the tuner.
  27. * @param i2c i2c adapter to use.
  28. * @param cfg optional callback function pointers.
  29. * @return FE pointer on success, NULL on failure.
  30. */
  31. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TDA827X)
  32. extern struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe, int addr,
  33. struct i2c_adapter *i2c,
  34. struct tda827x_config *cfg);
  35. #else
  36. static inline struct dvb_frontend* tda827x_attach(struct dvb_frontend *fe,
  37. int addr,
  38. struct i2c_adapter *i2c,
  39. struct tda827x_config *cfg)
  40. {
  41. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  42. return NULL;
  43. }
  44. #endif // CONFIG_MEDIA_TUNER_TDA827X
  45. #endif // __DVB_TDA827X_H__