ts2020.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. Montage Technology TS2020 - Silicon Tuner driver
  4. Copyright (C) 2009-2012 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
  5. Copyright (C) 2009-2012 TurboSight.com
  6. */
  7. #ifndef TS2020_H
  8. #define TS2020_H
  9. #include <linux/dvb/frontend.h>
  10. struct ts2020_config {
  11. u8 tuner_address;
  12. u32 frequency_div;
  13. /*
  14. * RF loop-through
  15. */
  16. bool loop_through:1;
  17. /*
  18. * clock output
  19. */
  20. #define TS2020_CLK_OUT_DISABLED 0
  21. #define TS2020_CLK_OUT_ENABLED 1
  22. #define TS2020_CLK_OUT_ENABLED_XTALOUT 2
  23. u8 clk_out:2;
  24. /*
  25. * clock output divider
  26. * 1 - 31
  27. */
  28. u8 clk_out_div:5;
  29. /* Set to true to suppress stat polling */
  30. bool dont_poll:1;
  31. /*
  32. * pointer to DVB frontend
  33. */
  34. struct dvb_frontend *fe;
  35. /*
  36. * driver private, do not set value
  37. */
  38. u8 attach_in_use:1;
  39. /* Operation to be called by the ts2020 driver to get the value of the
  40. * AGC PWM tuner input as theoretically output by the demodulator.
  41. */
  42. int (*get_agc_pwm)(struct dvb_frontend *fe, u8 *_agc_pwm);
  43. };
  44. /* Do not add new ts2020_attach() users! Use I2C bindings instead. */
  45. #if IS_REACHABLE(CONFIG_DVB_TS2020)
  46. extern struct dvb_frontend *ts2020_attach(
  47. struct dvb_frontend *fe,
  48. const struct ts2020_config *config,
  49. struct i2c_adapter *i2c);
  50. #else
  51. static inline struct dvb_frontend *ts2020_attach(
  52. struct dvb_frontend *fe,
  53. const struct ts2020_config *config,
  54. struct i2c_adapter *i2c)
  55. {
  56. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  57. return NULL;
  58. }
  59. #endif
  60. #endif /* TS2020_H */