lgdt3306a.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /*
  2. * Support for LGDT3306A - 8VSB/QAM-B
  3. *
  4. * Copyright (C) 2013,2014 Fred Richter <frichter@hauppauge.com>
  5. * based on lgdt3305.[ch] by Michael Krufky
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. */
  17. #ifndef _LGDT3306A_H_
  18. #define _LGDT3306A_H_
  19. #include <linux/i2c.h>
  20. #include <media/dvb_frontend.h>
  21. enum lgdt3306a_mpeg_mode {
  22. LGDT3306A_MPEG_PARALLEL = 0,
  23. LGDT3306A_MPEG_SERIAL = 1,
  24. };
  25. enum lgdt3306a_tp_clock_edge {
  26. LGDT3306A_TPCLK_RISING_EDGE = 0,
  27. LGDT3306A_TPCLK_FALLING_EDGE = 1,
  28. };
  29. enum lgdt3306a_tp_valid_polarity {
  30. LGDT3306A_TP_VALID_LOW = 0,
  31. LGDT3306A_TP_VALID_HIGH = 1,
  32. };
  33. struct lgdt3306a_config {
  34. u8 i2c_addr;
  35. /* user defined IF frequency in KHz */
  36. u16 qam_if_khz;
  37. u16 vsb_if_khz;
  38. /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
  39. unsigned int deny_i2c_rptr:1;
  40. /* spectral inversion - 0:disabled 1:enabled */
  41. unsigned int spectral_inversion:1;
  42. enum lgdt3306a_mpeg_mode mpeg_mode;
  43. enum lgdt3306a_tp_clock_edge tpclk_edge;
  44. enum lgdt3306a_tp_valid_polarity tpvalid_polarity;
  45. /* demod clock freq in MHz; 24 or 25 supported */
  46. int xtalMHz;
  47. /* returned by driver if using i2c bus multiplexing */
  48. struct dvb_frontend **fe;
  49. struct i2c_adapter **i2c_adapter;
  50. };
  51. #if IS_REACHABLE(CONFIG_DVB_LGDT3306A)
  52. struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
  53. struct i2c_adapter *i2c_adap);
  54. #else
  55. static inline
  56. struct dvb_frontend *lgdt3306a_attach(const struct lgdt3306a_config *config,
  57. struct i2c_adapter *i2c_adap)
  58. {
  59. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  60. return NULL;
  61. }
  62. #endif /* CONFIG_DVB_LGDT3306A */
  63. #endif /* _LGDT3306A_H_ */