summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/ttpci-budget/budget.h
blob: 0a0a5b16b0442ca69b13415931023fea9004bcd0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef __BUDGET_DVB__
#define __BUDGET_DVB__

#include "dvb_i2c.h"
#include "dvb_frontend.h"
#include "dvbdev.h"
#include "demux.h"
#include "dvb_demux.h"
#include "dmxdev.h"
#include "dvb_filter.h"
#include "dvb_net.h"
#include "saa7146.h"


extern int budget_debug;

struct budget_info {
	char *name;
	int type;
};

/* place to store all the necessary device information */
struct budget_s {

        /* devices */
        struct dvb_device       dvb_dev;
        dvb_net_t               dvb_net;

        struct saa7146_dev	*dev;

	struct dvb_i2c_bus	*i2c_bus;	
	struct budget_info	*card;

	unsigned char		*grabbing;
	struct saa7146_pgtable	pt;

	struct tasklet_struct   fidb_tasklet;

        dmxdev_t                dmxdev;
        struct dvb_demux	demux;
        char                    demux_id[16];

        dmx_frontend_t          hw_frontend;
        dmx_frontend_t          mem_frontend;

        int                     fe_synced; 
        struct semaphore        pid_mutex;

        u8 tsf;
        u16 ttbp;
        int feeding;

        int registered;
	
        struct dvb_adapter       *dvb_adapter;
	void			 *priv;
};

#define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
static struct budget_info x_var ## _info = { \
	.name=x_name,	\
	.type=x_type };	\
static struct saa7146_pci_extension_data x_var = { \
	.ext_priv = &x_var ## _info, \
	.ext = &budget_extension };

#define TS_WIDTH  (4*188)
#define TS_HEIGHT (1024/4)
#define TS_BUFLEN (TS_WIDTH*TS_HEIGHT)

#define TS_PACKETS	1
#define TS_QUANTUM	(TS_PACKETS*TS_SIZE)
#define TS_MAX_PACKETS	(TS_BUFLEN/TS_QUANTUM)

#define BUDGET_TT		   0
#define BUDGET_TT_HW_DISEQC	   1
#define BUDGET_KNC1		   2
#define BUDGET_PATCH		   3

int budget_probe(struct saa7146_dev *, unsigned int subvendor, unsigned int subdevice);
void budget_irq(struct saa7146_dev *, u32 *isr);
int budget_attach (struct saa7146_dev* dev, struct saa7146_pci_extension_data *info);
int budget_detach (struct saa7146_dev *);
int budget_register(struct budget_s *budget);

#endif