lg2160.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Support for LG2160 - ATSC/MH
  4. *
  5. * Copyright (C) 2010 Michael Krufky <mkrufky@linuxtv.org>
  6. */
  7. #ifndef _LG2160_H_
  8. #define _LG2160_H_
  9. #include <linux/i2c.h>
  10. #include <media/dvb_frontend.h>
  11. enum lg_chip_type {
  12. LG2160 = 0,
  13. LG2161 = 1,
  14. };
  15. #define LG2161_1019 LG2161
  16. #define LG2161_1040 LG2161
  17. enum lg2160_spi_clock {
  18. LG2160_SPI_3_125_MHZ = 0,
  19. LG2160_SPI_6_25_MHZ = 1,
  20. LG2160_SPI_12_5_MHZ = 2,
  21. };
  22. #if 0
  23. enum lg2161_oif {
  24. LG2161_OIF_EBI2_SLA = 1,
  25. LG2161_OIF_SDIO_SLA = 2,
  26. LG2161_OIF_SPI_SLA = 3,
  27. LG2161_OIF_SPI_MAS = 4,
  28. LG2161_OIF_SERIAL_TS = 7,
  29. };
  30. #endif
  31. struct lg2160_config {
  32. u8 i2c_addr;
  33. /* user defined IF frequency in KHz */
  34. u16 if_khz;
  35. /* disable i2c repeater - 0:repeater enabled 1:repeater disabled */
  36. unsigned int deny_i2c_rptr:1;
  37. /* spectral inversion - 0:disabled 1:enabled */
  38. unsigned int spectral_inversion:1;
  39. unsigned int output_if;
  40. enum lg2160_spi_clock spi_clock;
  41. enum lg_chip_type lg_chip;
  42. };
  43. #if IS_REACHABLE(CONFIG_DVB_LG2160)
  44. extern
  45. struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
  46. struct i2c_adapter *i2c_adap);
  47. #else
  48. static inline
  49. struct dvb_frontend *lg2160_attach(const struct lg2160_config *config,
  50. struct i2c_adapter *i2c_adap)
  51. {
  52. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  53. return NULL;
  54. }
  55. #endif /* CONFIG_DVB_LG2160 */
  56. #endif /* _LG2160_H_ */