tea5767.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. */
  4. #ifndef __TEA5767_H__
  5. #define __TEA5767_H__
  6. #include <linux/i2c.h>
  7. #include <media/dvb_frontend.h>
  8. enum tea5767_xtal {
  9. TEA5767_LOW_LO_32768 = 0,
  10. TEA5767_HIGH_LO_32768 = 1,
  11. TEA5767_LOW_LO_13MHz = 2,
  12. TEA5767_HIGH_LO_13MHz = 3,
  13. };
  14. struct tea5767_ctrl {
  15. unsigned int port1:1;
  16. unsigned int port2:1;
  17. unsigned int high_cut:1;
  18. unsigned int st_noise:1;
  19. unsigned int soft_mute:1;
  20. unsigned int japan_band:1;
  21. unsigned int deemph_75:1;
  22. unsigned int pllref:1;
  23. enum tea5767_xtal xtal_freq;
  24. };
  25. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TEA5767)
  26. extern int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr);
  27. extern struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe,
  28. struct i2c_adapter* i2c_adap,
  29. u8 i2c_addr);
  30. #else
  31. static inline int tea5767_autodetection(struct i2c_adapter* i2c_adap,
  32. u8 i2c_addr)
  33. {
  34. printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
  35. __func__);
  36. return -EINVAL;
  37. }
  38. static inline struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe,
  39. struct i2c_adapter* i2c_adap,
  40. u8 i2c_addr)
  41. {
  42. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  43. return NULL;
  44. }
  45. #endif
  46. #endif /* __TEA5767_H__ */