tuner-xc2028.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* tuner-xc2028
  2. *
  3. * Copyright (c) 2007-2008 Mauro Carvalho Chehab (mchehab@infradead.org)
  4. * This code is placed under the terms of the GNU General Public License v2
  5. */
  6. #ifndef __TUNER_XC2028_H__
  7. #define __TUNER_XC2028_H__
  8. #include "dvb_frontend.h"
  9. #define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw"
  10. #define XC3028L_DEFAULT_FIRMWARE "xc3028L-v36.fw"
  11. /* Dmoduler IF (kHz) */
  12. #define XC3028_FE_DEFAULT 0 /* Don't load SCODE */
  13. #define XC3028_FE_LG60 6000
  14. #define XC3028_FE_ATI638 6380
  15. #define XC3028_FE_OREN538 5380
  16. #define XC3028_FE_OREN36 3600
  17. #define XC3028_FE_TOYOTA388 3880
  18. #define XC3028_FE_TOYOTA794 7940
  19. #define XC3028_FE_DIBCOM52 5200
  20. #define XC3028_FE_ZARLINK456 4560
  21. #define XC3028_FE_CHINA 5200
  22. enum firmware_type {
  23. XC2028_AUTO = 0, /* By default, auto-detects */
  24. XC2028_D2633,
  25. XC2028_D2620,
  26. };
  27. struct xc2028_ctrl {
  28. char *fname;
  29. int max_len;
  30. int msleep;
  31. unsigned int scode_table;
  32. unsigned int mts :1;
  33. unsigned int input1:1;
  34. unsigned int vhfbw7:1;
  35. unsigned int uhfbw8:1;
  36. unsigned int disable_power_mgmt:1;
  37. unsigned int read_not_reliable:1;
  38. unsigned int demod;
  39. enum firmware_type type:2;
  40. };
  41. struct xc2028_config {
  42. struct i2c_adapter *i2c_adap;
  43. u8 i2c_addr;
  44. struct xc2028_ctrl *ctrl;
  45. };
  46. /* xc2028 commands for callback */
  47. #define XC2028_TUNER_RESET 0
  48. #define XC2028_RESET_CLK 1
  49. #define XC2028_I2C_FLUSH 2
  50. #if IS_REACHABLE(CONFIG_MEDIA_TUNER_XC2028)
  51. extern struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
  52. struct xc2028_config *cfg);
  53. #else
  54. static inline struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
  55. struct xc2028_config *cfg)
  56. {
  57. printk(KERN_INFO "%s: not probed - driver disabled by Kconfig\n",
  58. __func__);
  59. return NULL;
  60. }
  61. #endif
  62. #endif /* __TUNER_XC2028_H__ */