altera-ci.h 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. #ifndef __ALTERA_CI_H
  21. #define __ALTERA_CI_H
  22. #include <linux/kconfig.h>
  23. #define ALT_DATA 0x000000ff
  24. #define ALT_TDI 0x00008000
  25. #define ALT_TDO 0x00004000
  26. #define ALT_TCK 0x00002000
  27. #define ALT_RDY 0x00001000
  28. #define ALT_RD 0x00000800
  29. #define ALT_WR 0x00000400
  30. #define ALT_AD_RG 0x00000200
  31. #define ALT_CS 0x00000100
  32. struct altera_ci_config {
  33. void *dev;/* main dev, for example cx23885_dev */
  34. void *adapter;/* for CI to connect to */
  35. struct dvb_demux *demux;/* for hardware PID filter to connect to */
  36. int (*fpga_rw) (void *dev, int ad_rg, int val, int rw);
  37. };
  38. #if IS_REACHABLE(CONFIG_MEDIA_ALTERA_CI)
  39. extern int altera_ci_init(struct altera_ci_config *config, int ci_nr);
  40. extern void altera_ci_release(void *dev, int ci_nr);
  41. extern int altera_ci_irq(void *dev);
  42. extern int altera_ci_tuner_reset(void *dev, int ci_nr);
  43. #else
  44. static inline int altera_ci_init(struct altera_ci_config *config, int ci_nr)
  45. {
  46. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  47. return 0;
  48. }
  49. static inline void altera_ci_release(void *dev, int ci_nr)
  50. {
  51. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  52. }
  53. static inline int altera_ci_irq(void *dev)
  54. {
  55. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  56. return 0;
  57. }
  58. static inline int altera_ci_tuner_reset(void *dev, int ci_nr)
  59. {
  60. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  61. return 0;
  62. }
  63. #endif
  64. #if 0
  65. static inline int altera_hw_filt_init(struct altera_ci_config *config,
  66. int hw_filt_nr)
  67. {
  68. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  69. return 0;
  70. }
  71. static inline void altera_hw_filt_release(void *dev, int filt_nr)
  72. {
  73. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  74. }
  75. static inline int altera_pid_feed_control(void *dev, int filt_nr,
  76. struct dvb_demux_feed *dvbdmxfeed, int onoff)
  77. {
  78. printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
  79. return 0;
  80. }
  81. #endif /* CONFIG_MEDIA_ALTERA_CI */
  82. #endif /* __ALTERA_CI_H */