lgdt3306a.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Support for LGDT3306A - 8VSB/QAM-B
  4. *
  5. * Copyright (C) 2013,2014 Fred Richter <frichter@hauppauge.com>
  6. * based on lgdt3305.[ch] by Michael Krufky
  7. */
  8. #ifndef _LGDT3306A_H_
  9. #define _LGDT3306A_H_
  10. #include <linux/i2c.h>
  11. #include <media/dvb_frontend.h>
  12. enum lgdt3306a_mpeg_mode {
  13. LGDT3306A_MPEG_PARALLEL = 0,
  14. LGDT3306A_MPEG_SERIAL = 1,
  15. };
  16. enum lgdt3306a_tp_clock_edge {
  17. LGDT3306A_TPCLK_RISING_EDGE = 0,
  18. LGDT3306A_TPCLK_FALLING_EDGE = 1,
  19. };
  20. enum lgdt3306a_tp_valid_polarity {
  21. LGDT3306A_TP_VALID_LOW = 0,
  22. LGDT3306A_TP_VALID_HIGH = 1,
  23. };
  24. struct lgdt3306a_config {
  25. u8 i2c_addr;
  26. /* user defined IF frequency in KHz */
  27. u16 qam_if_khz;
  28. u16 vsb_if_khz;
  29. /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
  30. unsigned int deny_i2c_rptr:1;
  31. /* spectral inversion - 0:disabled 1:enabled */
  32. unsigned int spectral_inversion:1;
  33. enum lgdt3306a_mpeg_mode mpeg_mode;
  34. enum lgdt3306a_tp_clock_edge tpclk_edge;
  35. enum lgdt3306a_tp_valid_polarity tpvalid_polarity;
  36. /* demod clock freq in MHz; 24 or 25 supported */
  37. int xtalMHz;
  38. /* returned by driver if using i2c bus multiplexing */
  39. struct dvb_frontend **fe;
  40. struct i2c_adapter **i2c_adapter;
  41. };
  42. #if IS_REACHABLE(CONFIG_DVB_LGDT3306A)
  43. struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
  44. struct i2c_adapter *i2c_adap);
  45. #else
  46. static inline
  47. struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
  48. struct i2c_adapter *i2c_adap)
  49. {
  50. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  51. return NULL;
  52. }
  53. #endif /* CONFIG_DVB_LGDT3306A */
  54. #endif /* _LGDT3306A_H_ */