budget.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef __BUDGET_DVB__
  2. #define __BUDGET_DVB__
  3. #include "dvb_frontend.h"
  4. #include "dvbdev.h"
  5. #include "demux.h"
  6. #include "dvb_demux.h"
  7. #include "dmxdev.h"
  8. #include "dvb_filter.h"
  9. #include "dvb_net.h"
  10. #include <linux/module.h>
  11. #include <linux/mutex.h>
  12. #include <media/drv-intf/saa7146.h>
  13. extern int budget_debug;
  14. #ifdef dprintk
  15. #undef dprintk
  16. #endif
  17. #define dprintk(level,args...) \
  18. do { if ((budget_debug & level)) { printk("%s: %s(): ", KBUILD_MODNAME, __func__); printk(args); } } while (0)
  19. struct budget_info {
  20. char *name;
  21. int type;
  22. };
  23. /* place to store all the necessary device information */
  24. struct budget {
  25. /* devices */
  26. struct dvb_device dvb_dev;
  27. struct dvb_net dvb_net;
  28. struct saa7146_dev *dev;
  29. struct i2c_adapter i2c_adap;
  30. struct budget_info *card;
  31. unsigned char *grabbing;
  32. struct saa7146_pgtable pt;
  33. struct tasklet_struct fidb_tasklet;
  34. struct tasklet_struct vpe_tasklet;
  35. struct dmxdev dmxdev;
  36. struct dvb_demux demux;
  37. struct dmx_frontend hw_frontend;
  38. struct dmx_frontend mem_frontend;
  39. int ci_present;
  40. int video_port;
  41. u32 buffer_width;
  42. u32 buffer_height;
  43. u32 buffer_size;
  44. u32 buffer_warning_threshold;
  45. u32 buffer_warnings;
  46. unsigned long buffer_warning_time;
  47. u32 ttbp;
  48. int feeding;
  49. spinlock_t feedlock;
  50. spinlock_t debilock;
  51. struct dvb_adapter dvb_adapter;
  52. struct dvb_frontend *dvb_frontend;
  53. int (*read_fe_status)(struct dvb_frontend *fe, enum fe_status *status);
  54. int fe_synced;
  55. void *priv;
  56. };
  57. #define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
  58. static struct budget_info x_var ## _info = { \
  59. .name=x_name, \
  60. .type=x_type }; \
  61. static struct saa7146_pci_extension_data x_var = { \
  62. .ext_priv = &x_var ## _info, \
  63. .ext = &budget_extension };
  64. #define BUDGET_TT 0
  65. #define BUDGET_TT_HW_DISEQC 1
  66. #define BUDGET_PATCH 3
  67. #define BUDGET_FS_ACTIVY 4
  68. #define BUDGET_CIN1200S 5
  69. #define BUDGET_CIN1200C 6
  70. #define BUDGET_CIN1200T 7
  71. #define BUDGET_KNC1S 8
  72. #define BUDGET_KNC1C 9
  73. #define BUDGET_KNC1T 10
  74. #define BUDGET_KNC1SP 11
  75. #define BUDGET_KNC1CP 12
  76. #define BUDGET_KNC1TP 13
  77. #define BUDGET_TVSTAR 14
  78. #define BUDGET_CIN1200C_MK3 15
  79. #define BUDGET_KNC1C_MK3 16
  80. #define BUDGET_KNC1CP_MK3 17
  81. #define BUDGET_KNC1S2 18
  82. #define BUDGET_KNC1C_TDA10024 19
  83. #define BUDGET_VIDEO_PORTA 0
  84. #define BUDGET_VIDEO_PORTB 1
  85. extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
  86. struct saa7146_pci_extension_data *info,
  87. struct module *owner, short *adapter_nums);
  88. extern void ttpci_budget_init_hooks(struct budget *budget);
  89. extern int ttpci_budget_deinit(struct budget *budget);
  90. extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr);
  91. extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
  92. extern int ttpci_budget_debiread(struct budget *budget, u32 config, int addr, int count,
  93. int uselocks, int nobusyloop);
  94. extern int ttpci_budget_debiwrite(struct budget *budget, u32 config, int addr, int count, u32 value,
  95. int uselocks, int nobusyloop);
  96. #endif