tda8290.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. */
  4. #ifndef __TDA8290_H__
  5. #define __TDA8290_H__
  6. #include <linux/i2c.h>
  7. #include <media/dvb_frontend.h>
  8. #include "tda18271.h"
  9. enum tda8290_lna {
  10. TDA8290_LNA_OFF = 0,
  11. TDA8290_LNA_GP0_HIGH_ON = 1,
  12. TDA8290_LNA_GP0_HIGH_OFF = 2,
  13. TDA8290_LNA_ON_BRIDGE = 3,
  14. };
  15. struct tda829x_config {
  16. enum tda8290_lna lna_cfg;
  17. unsigned int probe_tuner:1;
  18. #define TDA829X_PROBE_TUNER 0
  19. #define TDA829X_DONT_PROBE 1
  20. unsigned int no_i2c_gate:1;
  21. struct tda18271_std_map *tda18271_std_map;
  22. };
  23. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TDA8290)
  24. extern int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr);
  25. extern struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
  26. struct i2c_adapter *i2c_adap,
  27. u8 i2c_addr,
  28. struct tda829x_config *cfg);
  29. #else
  30. static inline int tda829x_probe(struct i2c_adapter *i2c_adap, u8 i2c_addr)
  31. {
  32. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  33. return -EINVAL;
  34. }
  35. static inline struct dvb_frontend *tda829x_attach(struct dvb_frontend *fe,
  36. struct i2c_adapter *i2c_adap,
  37. u8 i2c_addr,
  38. struct tda829x_config *cfg)
  39. {
  40. printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
  41. __func__);
  42. return NULL;
  43. }
  44. #endif
  45. #endif /* __TDA8290_H__ */