xc5000.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Driver for Xceive XC5000 "QAM/8VSB single chip tuner"
  4. *
  5. * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org>
  6. */
  7. #ifndef __XC5000_H__
  8. #define __XC5000_H__
  9. #include <linux/firmware.h>
  10. struct dvb_frontend;
  11. struct i2c_adapter;
  12. #define XC5000A 1
  13. #define XC5000C 2
  14. struct xc5000_config {
  15. u8 i2c_address;
  16. u32 if_khz;
  17. u8 radio_input;
  18. u16 xtal_khz;
  19. u16 output_amp;
  20. int chip_id;
  21. };
  22. /* xc5000 callback command */
  23. #define XC5000_TUNER_RESET 0
  24. /* Possible Radio inputs */
  25. #define XC5000_RADIO_NOT_CONFIGURED 0
  26. #define XC5000_RADIO_FM1 1
  27. #define XC5000_RADIO_FM2 2
  28. #define XC5000_RADIO_FM1_MONO 3
  29. /* For each bridge framework, when it attaches either analog or digital,
  30. * it has to store a reference back to its _core equivalent structure,
  31. * so that it can service the hardware by steering gpio's etc.
  32. * Each bridge implementation is different so cast devptr accordingly.
  33. * The xc5000 driver cares not for this value, other than ensuring
  34. * it's passed back to a bridge during tuner_callback().
  35. */
  36. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC5000)
  37. extern struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
  38. struct i2c_adapter *i2c,
  39. const struct xc5000_config *cfg);
  40. #else
  41. static inline struct dvb_frontend *xc5000_attach(struct dvb_frontend *fe,
  42. struct i2c_adapter *i2c,
  43. const struct xc5000_config *cfg)
  44. {
  45. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  46. return NULL;
  47. }
  48. #endif
  49. #endif