ts2020.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /*
  2. Montage Technology TS2020 - Silicon Tuner driver
  3. Copyright (C) 2009-2012 Konstantin Dimitrov <kosio.dimitrov@gmail.com>
  4. Copyright (C) 2009-2012 TurboSight.com
  5. This program is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program; if not, write to the Free Software
  15. Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  16. */
  17. #ifndef TS2020_H
  18. #define TS2020_H
  19. #include <linux/dvb/frontend.h>
  20. struct ts2020_config {
  21. u8 tuner_address;
  22. u32 frequency_div;
  23. /*
  24. * RF loop-through
  25. */
  26. bool loop_through:1;
  27. /*
  28. * clock output
  29. */
  30. #define TS2020_CLK_OUT_DISABLED 0
  31. #define TS2020_CLK_OUT_ENABLED 1
  32. #define TS2020_CLK_OUT_ENABLED_XTALOUT 2
  33. u8 clk_out:2;
  34. /*
  35. * clock output divider
  36. * 1 - 31
  37. */
  38. u8 clk_out_div:5;
  39. /* Set to true to suppress stat polling */
  40. bool dont_poll:1;
  41. /*
  42. * pointer to DVB frontend
  43. */
  44. struct dvb_frontend *fe;
  45. /*
  46. * driver private, do not set value
  47. */
  48. u8 attach_in_use:1;
  49. /* Operation to be called by the ts2020 driver to get the value of the
  50. * AGC PWM tuner input as theoretically output by the demodulator.
  51. */
  52. int (*get_agc_pwm)(struct dvb_frontend *fe, u8 *_agc_pwm);
  53. };
  54. /* Do not add new ts2020_attach() users! Use I2C bindings instead. */
  55. #if IS_REACHABLE(CONFIG_DVB_TS2020)
  56. extern struct dvb_frontend *ts2020_attach(
  57. struct dvb_frontend *fe,
  58. const struct ts2020_config *config,
  59. struct i2c_adapter *i2c);
  60. #else
  61. static inline struct dvb_frontend *ts2020_attach(
  62. struct dvb_frontend *fe,
  63. const struct ts2020_config *config,
  64. struct i2c_adapter *i2c)
  65. {
  66. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  67. return NULL;
  68. }
  69. #endif
  70. #endif /* TS2020_H */