xc4000.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Driver for Xceive XC4000 "QAM/8VSB single chip tuner"
  4. *
  5. * Copyright (c) 2007 Steven Toth <stoth@linuxtv.org>
  6. */
  7. #ifndef __XC4000_H__
  8. #define __XC4000_H__
  9. #include <linux/firmware.h>
  10. struct dvb_frontend;
  11. struct i2c_adapter;
  12. struct xc4000_config {
  13. u8 i2c_address;
  14. /* if non-zero, power management is enabled by default */
  15. u8 default_pm;
  16. /* value to be written to XREG_AMPLITUDE in DVB-T mode (0: no write) */
  17. u8 dvb_amplitude;
  18. /* if non-zero, register 0x0E is set to filter analog TV video output */
  19. u8 set_smoothedcvbs;
  20. /* IF for DVB-T */
  21. u32 if_khz;
  22. };
  23. /* xc4000 callback command */
  24. #define XC4000_TUNER_RESET 0
  25. /* For each bridge framework, when it attaches either analog or digital,
  26. * it has to store a reference back to its _core equivalent structure,
  27. * so that it can service the hardware by steering gpio's etc.
  28. * Each bridge implementation is different so cast devptr accordingly.
  29. * The xc4000 driver cares not for this value, other than ensuring
  30. * it's passed back to a bridge during tuner_callback().
  31. */
  32. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC4000)
  33. extern struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
  34. struct i2c_adapter *i2c,
  35. struct xc4000_config *cfg);
  36. #else
  37. static inline struct dvb_frontend *xc4000_attach(struct dvb_frontend *fe,
  38. struct i2c_adapter *i2c,
  39. struct xc4000_config *cfg)
  40. {
  41. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  42. return NULL;
  43. }
  44. #endif
  45. #endif