mxl111sf-tuner.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. * mxl111sf-tuner.h - driver for the MaxLinear MXL111SF CMOS tuner
  3. *
  4. * Copyright (C) 2010 Michael Krufky <mkrufky@kernellabs.com>
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with this program; if not, write to the Free Software
  18. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. */
  20. #ifndef __MXL111SF_TUNER_H__
  21. #define __MXL111SF_TUNER_H__
  22. #include "dvb_frontend.h"
  23. #include "mxl111sf.h"
  24. enum mxl_if_freq {
  25. #if 0
  26. MXL_IF_LO = 0x00, /* other IF < 9MHz */
  27. #endif
  28. MXL_IF_4_0 = 0x01, /* 4.0 MHz */
  29. MXL_IF_4_5 = 0x02, /* 4.5 MHz */
  30. MXL_IF_4_57 = 0x03, /* 4.57 MHz */
  31. MXL_IF_5_0 = 0x04, /* 5.0 MHz */
  32. MXL_IF_5_38 = 0x05, /* 5.38 MHz */
  33. MXL_IF_6_0 = 0x06, /* 6.0 MHz */
  34. MXL_IF_6_28 = 0x07, /* 6.28 MHz */
  35. MXL_IF_7_2 = 0x08, /* 7.2 MHz */
  36. MXL_IF_35_25 = 0x09, /* 35.25 MHz */
  37. MXL_IF_36 = 0x0a, /* 36 MHz */
  38. MXL_IF_36_15 = 0x0b, /* 36.15 MHz */
  39. MXL_IF_44 = 0x0c, /* 44 MHz */
  40. #if 0
  41. MXL_IF_HI = 0x0f, /* other IF > 35 MHz and < 45 MHz */
  42. #endif
  43. };
  44. struct mxl111sf_tuner_config {
  45. enum mxl_if_freq if_freq;
  46. unsigned int invert_spectrum:1;
  47. int (*read_reg)(struct mxl111sf_state *state, u8 addr, u8 *data);
  48. int (*write_reg)(struct mxl111sf_state *state, u8 addr, u8 data);
  49. int (*program_regs)(struct mxl111sf_state *state,
  50. struct mxl111sf_reg_ctrl_info *ctrl_reg_info);
  51. int (*top_master_ctrl)(struct mxl111sf_state *state, int onoff);
  52. int (*ant_hunt)(struct dvb_frontend *fe);
  53. };
  54. /* ------------------------------------------------------------------------ */
  55. #if defined(CONFIG_DVB_USB_MXL111SF) || \
  56. (defined(CONFIG_DVB_USB_MXL111SF_MODULE) && defined(MODULE))
  57. extern
  58. struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe,
  59. struct mxl111sf_state *mxl_state,
  60. struct mxl111sf_tuner_config *cfg);
  61. #else
  62. static inline
  63. struct dvb_frontend *mxl111sf_tuner_attach(struct dvb_frontend *fe,
  64. struct mxl111sf_state *mxl_state
  65. struct mxl111sf_tuner_config *cfg)
  66. {
  67. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  68. return NULL;
  69. }
  70. #endif
  71. #endif /* __MXL111SF_TUNER_H__ */
  72. /*
  73. * Overrides for Emacs so that we follow Linus's tabbing style.
  74. * ---------------------------------------------------------------------------
  75. * Local variables:
  76. * c-basic-offset: 8
  77. * End:
  78. */