altera-ci.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * altera-ci.c
  4. *
  5. * CI driver in conjunction with NetUp Dual DVB-T/C RF CI card
  6. *
  7. * Copyright (C) 2010 NetUP Inc.
  8. * Copyright (C) 2010 Igor M. Liplianin <[email protected]>
  9. */
  10. #ifndef __ALTERA_CI_H
  11. #define __ALTERA_CI_H
  12. #define ALT_DATA 0x000000ff
  13. #define ALT_TDI 0x00008000
  14. #define ALT_TDO 0x00004000
  15. #define ALT_TCK 0x00002000
  16. #define ALT_RDY 0x00001000
  17. #define ALT_RD 0x00000800
  18. #define ALT_WR 0x00000400
  19. #define ALT_AD_RG 0x00000200
  20. #define ALT_CS 0x00000100
  21. struct altera_ci_config {
  22. void *dev;/* main dev, for example cx23885_dev */
  23. void *adapter;/* for CI to connect to */
  24. struct dvb_demux *demux;/* for hardware PID filter to connect to */
  25. int (*fpga_rw) (void *dev, int ad_rg, int val, int rw);
  26. };
  27. #if IS_REACHABLE(CONFIG_MEDIA_ALTERA_CI)
  28. extern int altera_ci_init(struct altera_ci_config *config, int ci_nr);
  29. extern void altera_ci_release(void *dev, int ci_nr);
  30. extern int altera_ci_irq(void *dev);
  31. extern int altera_ci_tuner_reset(void *dev, int ci_nr);
  32. #else
  33. static inline int altera_ci_init(struct altera_ci_config *config, int ci_nr)
  34. {
  35. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  36. return 0;
  37. }
  38. static inline void altera_ci_release(void *dev, int ci_nr)
  39. {
  40. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  41. }
  42. static inline int altera_ci_irq(void *dev)
  43. {
  44. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  45. return 0;
  46. }
  47. static inline int altera_ci_tuner_reset(void *dev, int ci_nr)
  48. {
  49. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  50. return 0;
  51. }
  52. #endif
  53. #if 0
  54. static inline int altera_hw_filt_init(struct altera_ci_config *config,
  55. int hw_filt_nr)
  56. {
  57. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  58. return 0;
  59. }
  60. static inline void altera_hw_filt_release(void *dev, int filt_nr)
  61. {
  62. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  63. }
  64. static inline int altera_pid_feed_control(void *dev, int filt_nr,
  65. struct dvb_demux_feed *dvbdmxfeed, int onoff)
  66. {
  67. pr_warn("%s: driver disabled by Kconfig\n", __func__);
  68. return 0;
  69. }
  70. #endif /* CONFIG_MEDIA_ALTERA_CI */
  71. #endif /* __ALTERA_CI_H */