altera-ci.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. /*
  2. * altera-ci.c
  3. *
  4. * CI driver in conjunction with NetUp Dual DVB-T/C RF CI card
  5. *
  6. * Copyright (C) 2010 NetUP Inc.
  7. * Copyright (C) 2010 Igor M. Liplianin <liplianin@netup.ru>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU General Public License as published by
  11. * the Free Software Foundation; either version 2 of the License, or
  12. * (at your option) any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. *
  18. * GNU General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU General Public License
  21. * along with this program; if not, write to the Free Software
  22. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  23. */
  24. #ifndef __ALTERA_CI_H
  25. #define __ALTERA_CI_H
  26. #define ALT_DATA 0x000000ff
  27. #define ALT_TDI 0x00008000
  28. #define ALT_TDO 0x00004000
  29. #define ALT_TCK 0x00002000
  30. #define ALT_RDY 0x00001000
  31. #define ALT_RD 0x00000800
  32. #define ALT_WR 0x00000400
  33. #define ALT_AD_RG 0x00000200
  34. #define ALT_CS 0x00000100
  35. struct altera_ci_config {
  36. void *dev;/* main dev, for example cx23885_dev */
  37. void *adapter;/* for CI to connect to */
  38. struct dvb_demux *demux;/* for hardware PID filter to connect to */
  39. int (*fpga_rw) (void *dev, int ad_rg, int val, int rw);
  40. };
  41. #if defined(CONFIG_MEDIA_ALTERA_CI) || (defined(CONFIG_MEDIA_ALTERA_CI_MODULE) \
  42. && defined(MODULE))
  43. extern int altera_ci_init(struct altera_ci_config *config, int ci_nr);
  44. extern void altera_ci_release(void *dev, int ci_nr);
  45. extern int altera_ci_irq(void *dev);
  46. extern int altera_ci_tuner_reset(void *dev, int ci_nr);
  47. #else
  48. static inline int altera_ci_init(struct altera_ci_config *config, int ci_nr)
  49. {
  50. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  51. return 0;
  52. }
  53. static inline void altera_ci_release(void *dev, int ci_nr)
  54. {
  55. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  56. }
  57. static inline int altera_ci_irq(void *dev)
  58. {
  59. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  60. return 0;
  61. }
  62. static inline int altera_ci_tuner_reset(void *dev, int ci_nr)
  63. {
  64. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  65. return 0;
  66. }
  67. #endif
  68. #if 0
  69. static inline int altera_hw_filt_init(struct altera_ci_config *config,
  70. int hw_filt_nr)
  71. {
  72. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  73. return 0;
  74. }
  75. static inline void altera_hw_filt_release(void *dev, int filt_nr)
  76. {
  77. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  78. }
  79. static inline int altera_pid_feed_control(void *dev, int filt_nr,
  80. struct dvb_demux_feed *dvbdmxfeed, int onoff)
  81. {
  82. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  83. return 0;
  84. }
  85. #endif /* CONFIG_MEDIA_ALTERA_CI */
  86. #endif /* __ALTERA_CI_H */