lgdt330x.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Support for LGDT3302 and LGDT3303 - VSB/QAM
  4. *
  5. * Copyright (C) 2005 Wilson Michaels <wilsonmichaels@earthlink.net>
  6. */
  7. #ifndef LGDT330X_H
  8. #define LGDT330X_H
  9. #include <linux/dvb/frontend.h>
  10. typedef enum lg_chip_t {
  11. UNDEFINED,
  12. LGDT3302,
  13. LGDT3303
  14. }lg_chip_type;
  15. /**
  16. * struct lgdt330x_config - contains lgdt330x configuration
  17. *
  18. * @demod_chip: LG demodulator chip LGDT3302 or LGDT3303
  19. * @serial_mpeg: MPEG hardware interface - 0:parallel 1:serial
  20. * @pll_rf_set: Callback function to set PLL interface
  21. * @set_ts_params: Callback function to set device param for start_dma
  22. * @clock_polarity_flip:
  23. * Flip the polarity of the mpeg data transfer clock using alternate
  24. * init data.
  25. * This option applies ONLY to LGDT3303 - 0:disabled (default) 1:enabled
  26. * @get_dvb_frontend:
  27. * returns the frontend associated with this I2C client.
  28. * Filled by the driver.
  29. */
  30. struct lgdt330x_config
  31. {
  32. lg_chip_type demod_chip;
  33. int serial_mpeg;
  34. int (*pll_rf_set) (struct dvb_frontend* fe, int index);
  35. int (*set_ts_params)(struct dvb_frontend* fe, int is_punctured);
  36. int clock_polarity_flip;
  37. struct dvb_frontend* (*get_dvb_frontend)(struct i2c_client *);
  38. };
  39. #if IS_REACHABLE(CONFIG_DVB_LGDT330X)
  40. struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config,
  41. u8 demod_address,
  42. struct i2c_adapter *i2c);
  43. #else
  44. static inline
  45. struct dvb_frontend *lgdt330x_attach(const struct lgdt330x_config *config,
  46. u8 demod_address,
  47. struct i2c_adapter *i2c)
  48. {
  49. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  50. return NULL;
  51. }
  52. #endif // CONFIG_DVB_LGDT330X
  53. #endif /* LGDT330X_H */