mt2060.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Driver for Microtune MT2060 "Single chip dual conversion broadband tuner"
  4. *
  5. * Copyright (c) 2006 Olivier DANET <odanet@caramail.com>
  6. */
  7. #ifndef MT2060_H
  8. #define MT2060_H
  9. struct dvb_frontend;
  10. struct i2c_adapter;
  11. /*
  12. * I2C address
  13. * 0x60, ...
  14. */
  15. /**
  16. * struct mt2060_platform_data - Platform data for the mt2060 driver
  17. * @clock_out: Clock output setting. 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1.
  18. * @if1: First IF used [MHz]. 0 defaults to 1220.
  19. * @i2c_write_max: Maximum number of bytes I2C adapter can write at once.
  20. * 0 defaults to maximum.
  21. * @dvb_frontend: DVB frontend.
  22. */
  23. struct mt2060_platform_data {
  24. u8 clock_out;
  25. u16 if1;
  26. unsigned int i2c_write_max:5;
  27. struct dvb_frontend *dvb_frontend;
  28. };
  29. /* configuration struct for mt2060_attach() */
  30. struct mt2060_config {
  31. u8 i2c_address;
  32. u8 clock_out; /* 0 = off, 1 = CLK/4, 2 = CLK/2, 3 = CLK/1 */
  33. };
  34. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_MT2060)
  35. extern struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1);
  36. #else
  37. static inline struct dvb_frontend * mt2060_attach(struct dvb_frontend *fe, struct i2c_adapter *i2c, struct mt2060_config *cfg, u16 if1)
  38. {
  39. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  40. return NULL;
  41. }
  42. #endif // CONFIG_MEDIA_TUNER_MT2060
  43. #endif