lgs8gxx.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Support for Legend Silicon GB20600 (a.k.a DMB-TH) demodulator
  4. * LGS8913, LGS8GL5, LGS8G75
  5. * experimental support LGS8G42, LGS8G52
  6. *
  7. * Copyright (C) 2007-2009 David T.L. Wong <davidtlwong@gmail.com>
  8. * Copyright (C) 2008 Sirius International (Hong Kong) Limited
  9. * Timothy Lee <timothy.lee@siriushk.com> (for initial work on LGS8GL5)
  10. */
  11. #ifndef __LGS8GXX_H__
  12. #define __LGS8GXX_H__
  13. #include <linux/dvb/frontend.h>
  14. #include <linux/i2c.h>
  15. #define LGS8GXX_PROD_LGS8913 0
  16. #define LGS8GXX_PROD_LGS8GL5 1
  17. #define LGS8GXX_PROD_LGS8G42 3
  18. #define LGS8GXX_PROD_LGS8G52 4
  19. #define LGS8GXX_PROD_LGS8G54 5
  20. #define LGS8GXX_PROD_LGS8G75 6
  21. struct lgs8gxx_config {
  22. /* product type */
  23. u8 prod;
  24. /* the demodulator's i2c address */
  25. u8 demod_address;
  26. /* parallel or serial transport stream */
  27. u8 serial_ts;
  28. /* transport stream polarity*/
  29. u8 ts_clk_pol;
  30. /* transport stream clock gated by ts_valid */
  31. u8 ts_clk_gated;
  32. /* A/D Clock frequency */
  33. u32 if_clk_freq; /* in kHz */
  34. /* IF frequency */
  35. u32 if_freq; /* in kHz */
  36. /*Use External ADC*/
  37. u8 ext_adc;
  38. /*External ADC output two's complement*/
  39. u8 adc_signed;
  40. /*Sample IF data at falling edge of IF_CLK*/
  41. u8 if_neg_edge;
  42. /*IF use Negative center frequency*/
  43. u8 if_neg_center;
  44. /*8G75 internal ADC input range selection*/
  45. /*0: 0.8Vpp, 1: 1.0Vpp, 2: 1.6Vpp, 3: 2.0Vpp*/
  46. u8 adc_vpp;
  47. /* slave address and configuration of the tuner */
  48. u8 tuner_address;
  49. };
  50. #if IS_REACHABLE(CONFIG_DVB_LGS8GXX)
  51. extern struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
  52. struct i2c_adapter *i2c);
  53. #else
  54. static inline
  55. struct dvb_frontend *lgs8gxx_attach(const struct lgs8gxx_config *config,
  56. struct i2c_adapter *i2c) {
  57. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  58. return NULL;
  59. }
  60. #endif /* CONFIG_DVB_LGS8GXX */
  61. #endif /* __LGS8GXX_H__ */