lgs8gxx.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator
  3. * LGS8913, LGS8GL5, LGS8G75
  4. * experimental support LGS8G42, LGS8G52
  5. *
  6. * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com>
  7. * Copyright (C) 2008 Sirius International (Hong Kong) Limited
  8. * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5)
  9. *
  10. * This program is free software; you can redistribute it and/or modify
  11. * it under the terms of the GNU General Public License as published by
  12. * the Free Software Foundation; either version 2 of the License, or
  13. * (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. *
  24. */
  25. #ifndef __LGS8GXX_H__
  26. #define __LGS8GXX_H__
  27. #include <linux/dvb/frontend.h>
  28. #include <linux/i2c.h>
  29. #define LGS8GXX_PROD_LGS8913 0
  30. #define LGS8GXX_PROD_LGS8GL5 1
  31. #define LGS8GXX_PROD_LGS8G42 3
  32. #define LGS8GXX_PROD_LGS8G52 4
  33. #define LGS8GXX_PROD_LGS8G54 5
  34. #define LGS8GXX_PROD_LGS8G75 6
  35. struct lgs8gxx_config {
  36. /* product type */
  37. u8 prod;
  38. /* the demodulator's i2c address */
  39. u8 demod_address;
  40. /* parallel or serial transport stream */
  41. u8 serial_ts;
  42. /* transport stream polarity*/
  43. u8 ts_clk_pol;
  44. /* transport stream clock gated by ts_valid */
  45. u8 ts_clk_gated;
  46. /* A/D Clock frequency */
  47. u32 if_clk_freq; /* in kHz */
  48. /* IF frequency */
  49. u32 if_freq; /* in kHz */
  50. /*Use External ADC*/
  51. u8 ext_adc;
  52. /*External ADC output two's complement*/
  53. u8 adc_signed;
  54. /*Sample IF data at falling edge of IF_CLK*/
  55. u8 if_neg_edge;
  56. /*IF use Negative center frequency*/
  57. u8 if_neg_center;
  58. /*8G75 internal ADC input range selection*/
  59. /*0: 0.8Vpp, 1: 1.0Vpp, 2: 1.6Vpp, 3: 2.0Vpp*/
  60. u8 adc_vpp;
  61. /* slave address and configuration of the tuner */
  62. u8 tuner_address;
  63. };
  64. #if defined(CONFIG_DVB_LGS8GXX) || \
  65. (defined(CONFIG_DVB_LGS8GXX_MODULE) && defined(MODULE))
  66. extern struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
  67. struct i2c_adapter *i2c);
  68. #else
  69. static inline
  70. struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
  71. struct i2c_adapter *i2c) {
  72. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  73. return NULL;
  74. }
  75. #endif /* CONFIG_DVB_LGS8GXX */
  76. #endif /* __LGS8GXX_H__ */