lgdt3305.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Support for LG Electronics LGDT3304 and LGDT3305 - VSB/QAM
  4. *
  5. * Copyright (C) 2008, 2009, 2010 Michael Krufky <mkrufky@linuxtv.org>
  6. */
  7. #ifndef _LGDT3305_H_
  8. #define _LGDT3305_H_
  9. #include <linux/i2c.h>
  10. #include <media/dvb_frontend.h>
  11. enum lgdt3305_mpeg_mode {
  12. LGDT3305_MPEG_PARALLEL = 0,
  13. LGDT3305_MPEG_SERIAL = 1,
  14. };
  15. enum lgdt3305_tp_clock_edge {
  16. LGDT3305_TPCLK_RISING_EDGE = 0,
  17. LGDT3305_TPCLK_FALLING_EDGE = 1,
  18. };
  19. enum lgdt3305_tp_clock_mode {
  20. LGDT3305_TPCLK_GATED = 0,
  21. LGDT3305_TPCLK_FIXED = 1,
  22. };
  23. enum lgdt3305_tp_valid_polarity {
  24. LGDT3305_TP_VALID_LOW = 0,
  25. LGDT3305_TP_VALID_HIGH = 1,
  26. };
  27. enum lgdt_demod_chip_type {
  28. LGDT3305 = 0,
  29. LGDT3304 = 1,
  30. };
  31. struct lgdt3305_config {
  32. u8 i2c_addr;
  33. /* user defined IF frequency in KHz */
  34. u16 qam_if_khz;
  35. u16 vsb_if_khz;
  36. /* AGC Power reference - defaults are used if left unset */
  37. u16 usref_8vsb; /* default: 0x32c4 */
  38. u16 usref_qam64; /* default: 0x5400 */
  39. u16 usref_qam256; /* default: 0x2a80 */
  40. /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
  41. unsigned int deny_i2c_rptr:1;
  42. /* spectral inversion - 0:disabled 1:enabled */
  43. unsigned int spectral_inversion:1;
  44. /* use RF AGC loop - 0:disabled 1:enabled */
  45. unsigned int rf_agc_loop:1;
  46. enum lgdt3305_mpeg_mode mpeg_mode;
  47. enum lgdt3305_tp_clock_edge tpclk_edge;
  48. enum lgdt3305_tp_clock_mode tpclk_mode;
  49. enum lgdt3305_tp_valid_polarity tpvalid_polarity;
  50. enum lgdt_demod_chip_type demod_chip;
  51. };
  52. #if IS_REACHABLE(CONFIG_DVB_LGDT3305)
  53. extern
  54. struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
  55. struct i2c_adapter *i2c_adap);
  56. #else
  57. static inline
  58. struct dvb_frontend *lgdt3305_attach(const struct lgdt3305_config *config,
  59. struct i2c_adapter *i2c_adap)
  60. {
  61. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  62. return NULL;
  63. }
  64. #endif /* CONFIG_DVB_LGDT3305 */
  65. #endif /* _LGDT3305_H_ */