altera-ci.h 2.6 KB

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