stb0899_drv.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. STB0899 Multistandard 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 __STB0899_DRV_H
  18. #define __STB0899_DRV_H
  19. #include <linux/kernel.h>
  20. #include <linux/module.h>
  21. #include "dvb_frontend.h"
  22. #define STB0899_TSMODE_SERIAL 1
  23. #define STB0899_CLKPOL_FALLING 2
  24. #define STB0899_CLKNULL_PARITY 3
  25. #define STB0899_SYNC_FORCED 4
  26. #define STB0899_FECMODE_DSS 5
  27. struct stb0899_s1_reg {
  28. u16 address;
  29. u8 data;
  30. };
  31. struct stb0899_s2_reg {
  32. u16 offset;
  33. u32 base_address;
  34. u32 data;
  35. };
  36. struct stb0899_config {
  37. const struct stb0899_s1_reg *init_dev;
  38. const struct stb0899_s2_reg *init_s2_demod;
  39. const struct stb0899_s1_reg *init_s1_demod;
  40. const struct stb0899_s2_reg *init_s2_fec;
  41. const struct stb0899_s1_reg *init_tst;
  42. u32 xtal_freq;
  43. u8 demod_address;
  44. u8 ts_output_mode;
  45. u8 block_sync_mode;
  46. u8 ts_pfbit_toggle;
  47. u8 clock_polarity;
  48. u8 data_clk_parity;
  49. u8 fec_mode;
  50. u8 data_output_ctl;
  51. u8 data_fifo_mode;
  52. u8 out_rate_comp;
  53. u8 i2c_repeater;
  54. int inversion;
  55. u32 esno_ave;
  56. u32 esno_quant;
  57. u32 avframes_coarse;
  58. u32 avframes_fine;
  59. u32 miss_threshold;
  60. u32 uwp_threshold_acq;
  61. u32 uwp_threshold_track;
  62. u32 uwp_threshold_sof;
  63. u32 sof_search_timeout;
  64. u32 btr_nco_bits;
  65. u32 btr_gain_shift_offset;
  66. u32 crl_nco_bits;
  67. u32 ldpc_max_iter;
  68. int (*tuner_set_frequency)(struct dvb_frontend *fe, u32 frequency);
  69. int (*tuner_get_frequency)(struct dvb_frontend *fe, u32 *frequency);
  70. int (*tuner_set_bandwidth)(struct dvb_frontend *fe, u32 bandwidth);
  71. int (*tuner_get_bandwidth)(struct dvb_frontend *fe, u32 *bandwidth);
  72. int (*tuner_set_rfsiggain)(struct dvb_frontend *fe, u32 rf_gain);
  73. };
  74. extern struct dvb_frontend *stb0899_attach(struct stb0899_config *config, struct i2c_adapter *i2c);
  75. #endif