stv090x.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. /*
  2. STV0900/0903 Multistandard Broadcast Frontend driver
  3. Copyright (C) Manu Abraham <abraham.manu@gmail.com>
  4. Copyright (C) ST Microelectronics
  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 __STV090x_H
  18. #define __STV090x_H
  19. enum stv090x_demodulator {
  20. STV090x_DEMODULATOR_0 = 1,
  21. STV090x_DEMODULATOR_1
  22. };
  23. enum stv090x_device {
  24. STV0903 = 0,
  25. STV0900,
  26. };
  27. enum stv090x_mode {
  28. STV090x_DUAL = 0,
  29. STV090x_SINGLE
  30. };
  31. enum stv090x_tsmode {
  32. STV090x_TSMODE_SERIAL_PUNCTURED = 1,
  33. STV090x_TSMODE_SERIAL_CONTINUOUS,
  34. STV090x_TSMODE_PARALLEL_PUNCTURED,
  35. STV090x_TSMODE_DVBCI
  36. };
  37. enum stv090x_clkmode {
  38. STV090x_CLK_INT = 0, /* Clk i/p = CLKI */
  39. STV090x_CLK_EXT = 2 /* Clk i/p = XTALI */
  40. };
  41. enum stv090x_i2crpt {
  42. STV090x_RPTLEVEL_256 = 0,
  43. STV090x_RPTLEVEL_128 = 1,
  44. STV090x_RPTLEVEL_64 = 2,
  45. STV090x_RPTLEVEL_32 = 3,
  46. STV090x_RPTLEVEL_16 = 4,
  47. STV090x_RPTLEVEL_8 = 5,
  48. STV090x_RPTLEVEL_4 = 6,
  49. STV090x_RPTLEVEL_2 = 7,
  50. };
  51. struct stv090x_config {
  52. enum stv090x_device device;
  53. enum stv090x_mode demod_mode;
  54. enum stv090x_clkmode clk_mode;
  55. u32 xtal; /* default: 8000000 */
  56. u8 address; /* default: 0x68 */
  57. u32 ref_clk; /* default: 16000000 FIXME to tuner config */
  58. u8 ts1_mode;
  59. u8 ts2_mode;
  60. enum stv090x_i2crpt repeater_level;
  61. bool diseqc_envelope_mode;
  62. int (*tuner_init) (struct dvb_frontend *fe);
  63. int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
  64. int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency);
  65. int (*tuner_get_frequency) (struct dvb_frontend *fe, u32 *frequency);
  66. int (*tuner_set_bandwidth) (struct dvb_frontend *fe, u32 bandwidth);
  67. int (*tuner_get_bandwidth) (struct dvb_frontend *fe, u32 *bandwidth);
  68. int (*tuner_set_bbgain) (struct dvb_frontend *fe, u32 gain);
  69. int (*tuner_get_bbgain) (struct dvb_frontend *fe, u32 *gain);
  70. int (*tuner_set_refclk) (struct dvb_frontend *fe, u32 refclk);
  71. int (*tuner_get_status) (struct dvb_frontend *fe, u32 *status);
  72. };
  73. #if defined(CONFIG_DVB_STV090x) || (defined(CONFIG_DVB_STV090x_MODULE) && defined(MODULE))
  74. extern struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
  75. struct i2c_adapter *i2c,
  76. enum stv090x_demodulator demod);
  77. #else
  78. static inline struct dvb_frontend *stv090x_attach(const struct stv090x_config *config,
  79. struct i2c_adapter *i2c,
  80. enum stv090x_demodulator demod)
  81. {
  82. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  83. return NULL;
  84. }
  85. #endif /* CONFIG_DVB_STV090x */
  86. #endif /* __STV090x_H */