mt352.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Driver for Zarlink DVB-T MT352 demodulator
  4. *
  5. * Written by Holger Waechtler <holger@qanu.de>
  6. * and Daniel Mack <daniel@qanu.de>
  7. *
  8. * AVerMedia AVerTV DVB-T 771 support by
  9. * Wolfram Joost <dbox2@frokaschwei.de>
  10. *
  11. * Support for Samsung TDTC9251DH01C(M) tuner
  12. * Copyright (C) 2004 Antonio Mancuso <antonio.mancuso@digitaltelevision.it>
  13. * Amauri Celani <acelani@essegi.net>
  14. *
  15. * DVICO FusionHDTV DVB-T1 and DVICO FusionHDTV DVB-T Lite support by
  16. * Christopher Pascoe <c.pascoe@itee.uq.edu.au>
  17. */
  18. #ifndef MT352_H
  19. #define MT352_H
  20. #include <linux/dvb/frontend.h>
  21. struct mt352_config
  22. {
  23. /* the demodulator's i2c address */
  24. u8 demod_address;
  25. /* frequencies in kHz */
  26. int adc_clock; // default: 20480
  27. int if2; // default: 36166
  28. /* set if no pll is connected to the secondary i2c bus */
  29. int no_tuner;
  30. /* Initialise the demodulator and PLL. Cannot be NULL */
  31. int (*demod_init)(struct dvb_frontend* fe);
  32. };
  33. #if IS_REACHABLE(CONFIG_DVB_MT352)
  34. extern struct dvb_frontend* mt352_attach(const struct mt352_config* config,
  35. struct i2c_adapter* i2c);
  36. #else
  37. static inline struct dvb_frontend* mt352_attach(const struct mt352_config* config,
  38. struct i2c_adapter* i2c)
  39. {
  40. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  41. return NULL;
  42. }
  43. #endif // CONFIG_DVB_MT352
  44. static inline int mt352_write(struct dvb_frontend *fe, const u8 buf[], int len) {
  45. int r = 0;
  46. if (fe->ops.write)
  47. r = fe->ops.write(fe, buf, len);
  48. return r;
  49. }
  50. #endif // MT352_H