blob: 4ac0f4d080252c537379716ba34c44c4c36087f1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __BUDGET_DVB__
2#define __BUDGET_DVB__
3
4#include "dvb_frontend.h"
5#include "dvbdev.h"
6#include "demux.h"
7#include "dvb_demux.h"
8#include "dmxdev.h"
9#include "dvb_filter.h"
10#include "dvb_net.h"
11
12#include <linux/module.h>
Ingo Molnar3593cab2006-02-07 06:49:14 -020013#include <linux/mutex.h>
14
Linus Torvalds1da177e2005-04-16 15:20:36 -070015#include <media/saa7146.h>
16
17extern int budget_debug;
18
19#ifdef dprintk
20#undef dprintk
21#endif
22
23#define dprintk(level,args...) \
Sam Ravnborg367cb702006-01-06 21:17:50 +010024 do { if ((budget_debug & level)) { printk("%s: %s(): ", KBUILD_MODNAME, __FUNCTION__); printk(args); } } while (0)
Linus Torvalds1da177e2005-04-16 15:20:36 -070025
26struct budget_info {
27 char *name;
28 int type;
29};
30
31/* place to store all the necessary device information */
32struct budget {
33
34 /* devices */
35 struct dvb_device dvb_dev;
36 struct dvb_net dvb_net;
37
38 struct saa7146_dev *dev;
39
40 struct i2c_adapter i2c_adap;
41 struct budget_info *card;
42
43 unsigned char *grabbing;
44 struct saa7146_pgtable pt;
45
46 struct tasklet_struct fidb_tasklet;
47 struct tasklet_struct vpe_tasklet;
48
49 struct dmxdev dmxdev;
50 struct dvb_demux demux;
51
52 struct dmx_frontend hw_frontend;
53 struct dmx_frontend mem_frontend;
54
55 int fe_synced;
Ingo Molnar3593cab2006-02-07 06:49:14 -020056 struct mutex pid_mutex;
Linus Torvalds1da177e2005-04-16 15:20:36 -070057
58 int ci_present;
59 int video_port;
60
61 u8 tsf;
62 u32 ttbp;
63 int feeding;
64
65 spinlock_t feedlock;
66
67 spinlock_t debilock;
68
Johannes Stezenbachfdc53a62005-05-16 21:54:39 -070069 struct dvb_adapter dvb_adapter;
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 struct dvb_frontend *dvb_frontend;
71 void *priv;
72};
73
74#define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
75static struct budget_info x_var ## _info = { \
76 .name=x_name, \
77 .type=x_type }; \
78static struct saa7146_pci_extension_data x_var = { \
79 .ext_priv = &x_var ## _info, \
80 .ext = &budget_extension };
81
82#define TS_WIDTH (376)
83#define TS_HEIGHT (512)
84#define TS_BUFLEN (TS_WIDTH*TS_HEIGHT)
85#define TS_MAX_PACKETS (TS_BUFLEN/TS_SIZE)
86
87#define BUDGET_TT 0
88#define BUDGET_TT_HW_DISEQC 1
89#define BUDGET_PATCH 3
90#define BUDGET_FS_ACTIVY 4
91#define BUDGET_CIN1200S 5
92#define BUDGET_CIN1200C 6
93#define BUDGET_CIN1200T 7
94#define BUDGET_KNC1S 8
95#define BUDGET_KNC1C 9
96#define BUDGET_KNC1T 10
Johannes Stezenbach2d4f2c22005-05-16 21:54:23 -070097#define BUDGET_KNC1SP 11
98#define BUDGET_KNC1CP 12
99#define BUDGET_KNC1TP 13
Regis Prevotf8bf1342006-01-11 23:31:53 -0200100#define BUDGET_TVSTAR 14
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101
102#define BUDGET_VIDEO_PORTA 0
103#define BUDGET_VIDEO_PORTB 1
104
105extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
106 struct saa7146_pci_extension_data *info,
107 struct module *owner);
108extern int ttpci_budget_deinit(struct budget *budget);
109extern void ttpci_budget_irq10_handler(struct saa7146_dev *dev, u32 * isr);
110extern void ttpci_budget_set_video_port(struct saa7146_dev *dev, int video_port);
111extern int ttpci_budget_debiread(struct budget *budget, u32 config, int addr, int count,
112 int uselocks, int nobusyloop);
113extern int ttpci_budget_debiwrite(struct budget *budget, u32 config, int addr, int count, u32 value,
114 int uselocks, int nobusyloop);
115
116#endif