tea5767.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /*
  2. This program is free software; you can redistribute it and/or modify
  3. it under the terms of the GNU General Public License as published by
  4. the Free Software Foundation; either version 2 of the License, or
  5. (at your option) any later version.
  6. This program is distributed in the hope that it will be useful,
  7. but WITHOUT ANY WARRANTY; without even the implied warranty of
  8. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  9. GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License
  11. along with this program; if not, write to the Free Software
  12. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  13. */
  14. #ifndef __TEA5767_H__
  15. #define __TEA5767_H__
  16. #include <linux/i2c.h>
  17. #include "dvb_frontend.h"
  18. enum tea5767_xtal {
  19. TEA5767_LOW_LO_32768 = 0,
  20. TEA5767_HIGH_LO_32768 = 1,
  21. TEA5767_LOW_LO_13MHz = 2,
  22. TEA5767_HIGH_LO_13MHz = 3,
  23. };
  24. struct tea5767_ctrl {
  25. unsigned int port1:1;
  26. unsigned int port2:1;
  27. unsigned int high_cut:1;
  28. unsigned int st_noise:1;
  29. unsigned int soft_mute:1;
  30. unsigned int japan_band:1;
  31. unsigned int deemph_75:1;
  32. unsigned int pllref:1;
  33. enum tea5767_xtal xtal_freq;
  34. };
  35. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_TEA5767)
  36. extern int tea5767_autodetection(struct i2c_adapter* i2c_adap, u8 i2c_addr);
  37. extern struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe,
  38. struct i2c_adapter* i2c_adap,
  39. u8 i2c_addr);
  40. #else
  41. static inline int tea5767_autodetection(struct i2c_adapter* i2c_adap,
  42. u8 i2c_addr)
  43. {
  44. printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
  45. __func__);
  46. return -EINVAL;
  47. }
  48. static inline struct dvb_frontend *tea5767_attach(struct dvb_frontend *fe,
  49. struct i2c_adapter* i2c_adap,
  50. u8 i2c_addr)
  51. {
  52. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  53. return NULL;
  54. }
  55. #endif
  56. #endif /* __TEA5767_H__ */