ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / drivers / media / dvb / ttpci / budget.h
1 #ifndef __BUDGET_DVB__
2 #define __BUDGET_DVB__
3
4 #include <media/saa7146.h>
5
6 #include "dvb_i2c.h"
7 #include "dvb_frontend.h"
8 #include "dvbdev.h"
9 #include "demux.h"
10 #include "dvb_demux.h"
11 #include "dmxdev.h"
12 #include "dvb_filter.h"
13 #include "dvb_net.h"
14
15 extern int budget_debug;
16
17 struct budget_info {
18         char *name;
19         int type;
20 };
21
22 /* place to store all the necessary device information */
23 struct budget {
24
25         /* devices */
26         struct dvb_device       dvb_dev;
27         struct dvb_net               dvb_net;
28
29         struct saa7146_dev      *dev;
30
31         struct dvb_i2c_bus      *i2c_bus;       
32         struct budget_info      *card;
33
34         unsigned char           *grabbing;
35         struct saa7146_pgtable  pt;
36
37         struct tasklet_struct   fidb_tasklet;
38         struct tasklet_struct   vpe_tasklet;
39
40         struct dmxdev                dmxdev;
41         struct dvb_demux        demux;
42
43         struct dmx_frontend          hw_frontend;
44         struct dmx_frontend          mem_frontend;
45
46         int                     fe_synced; 
47         struct semaphore        pid_mutex;
48
49         int                     ci_present;
50         int                     video_port;
51
52         u8 tsf;
53         u32 ttbp;
54         int feeding;
55
56         spinlock_t feedlock;
57
58         struct dvb_adapter       *dvb_adapter;
59         void                     *priv;
60 };
61
62
63
64 #define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
65 static struct budget_info x_var ## _info = { \
66         .name=x_name,   \
67         .type=x_type }; \
68 static struct saa7146_pci_extension_data x_var = { \
69         .ext_priv = &x_var ## _info, \
70         .ext = &budget_extension };
71
72 #define TS_WIDTH  (376)
73 #define TS_HEIGHT (512)
74 #define TS_BUFLEN (TS_WIDTH*TS_HEIGHT)
75 #define TS_MAX_PACKETS (TS_BUFLEN/TS_SIZE)
76
77 #define BUDGET_TT                  0
78 #define BUDGET_TT_HW_DISEQC        1
79 #define BUDGET_KNC1                2
80 #define BUDGET_PATCH               3
81 #define BUDGET_FS_ACTIVY           4
82
83 #define BUDGET_VIDEO_PORTA         0
84 #define BUDGET_VIDEO_PORTB         1
85
86 extern int ttpci_budget_init (struct budget *budget,
87                               struct saa7146_dev* dev,
88                               struct saa7146_pci_extension_data *info);
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
93 #endif
94