budget.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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 <media/saa7146.h>
  12. extern int budget_debug;
  13. #ifdef dprintk
  14. #undef dprintk
  15. #endif
  16. #define dprintk(level,args...) \
  17. do { if ((budget_debug & level)) { printk("%s: %s(): ",__stringify(KBUILD_MODNAME), __FUNCTION__); printk(args); } } while (0)
  18. struct budget_info {
  19. char *name;
  20. int type;
  21. };
  22. /* place to store all the necessary device information */
  23. struct budget {
  24. /* devices */
  25. struct dvb_device dvb_dev;
  26. struct dvb_net dvb_net;
  27. struct saa7146_dev *dev;
  28. struct i2c_adapter i2c_adap;
  29. struct budget_info *card;
  30. unsigned char *grabbing;
  31. struct saa7146_pgtable pt;
  32. struct tasklet_struct fidb_tasklet;
  33. struct tasklet_struct vpe_tasklet;
  34. struct dmxdev dmxdev;
  35. struct dvb_demux demux;
  36. struct dmx_frontend hw_frontend;
  37. struct dmx_frontend mem_frontend;
  38. int fe_synced;
  39. struct semaphore pid_mutex;
  40. int ci_present;
  41. int video_port;
  42. u8 tsf;
  43. u32 ttbp;
  44. int feeding;
  45. spinlock_t feedlock;
  46. spinlock_t debilock;
  47. struct dvb_adapter dvb_adapter;
  48. struct dvb_frontend *dvb_frontend;
  49. void *priv;
  50. };
  51. #define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
  52. static struct budget_info x_var ## _info = { \
  53. .name=x_name, \
  54. .type=x_type }; \
  55. static struct saa7146_pci_extension_data x_var = { \
  56. .ext_priv = &x_var ## _info, \
  57. .ext = &budget_extension };
  58. #define TS_WIDTH (376)
  59. #define TS_HEIGHT (512)
  60. #define TS_BUFLEN (TS_WIDTH*TS_HEIGHT)
  61. #define TS_MAX_PACKETS (TS_BUFLEN/TS_SIZE)
  62. #define BUDGET_TT 0
  63. #define BUDGET_TT_HW_DISEQC 1
  64. #define BUDGET_PATCH 3
  65. #define BUDGET_FS_ACTIVY 4
  66. #define BUDGET_CIN1200S 5
  67. #define BUDGET_CIN1200C 6
  68. #define BUDGET_CIN1200T 7
  69. #define BUDGET_KNC1S 8
  70. #define BUDGET_KNC1C 9
  71. #define BUDGET_KNC1T 10
  72. #define BUDGET_KNC1SP 11
  73. #define BUDGET_KNC1CP 12
  74. #define BUDGET_KNC1TP 13
  75. #define BUDGET_VIDEO_PORTA 0
  76. #define BUDGET_VIDEO_PORTB 1
  77. extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
  78. struct saa7146_pci_extension_data *info,
  79. struct module *owner);
  80. extern int ttpci_budget_deinit(struct budget *budget);
  81. extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr);
  82. extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
  83. extern int ttpci_budget_debiread(struct budget *budget, u32 config, int addr, int count,
  84. int uselocks, int nobusyloop);
  85. extern int ttpci_budget_debiwrite(struct budget *budget, u32 config, int addr, int count, u32 value,
  86. int uselocks, int nobusyloop);
  87. #endif