vserver 1.9.5.x5
[linux-2.6.git] / drivers / media / dvb / ttpci / budget.h
index 6be1d3b..726394c 100644 (file)
@@ -1,9 +1,6 @@
 #ifndef __BUDGET_DVB__
 #define __BUDGET_DVB__
 
-#include <media/saa7146.h>
-
-#include "dvb_i2c.h"
 #include "dvb_frontend.h"
 #include "dvbdev.h"
 #include "demux.h"
@@ -12,8 +9,18 @@
 #include "dvb_filter.h"
 #include "dvb_net.h"
 
+#include <linux/module.h>
+#include <media/saa7146.h>
+
 extern int budget_debug;
 
+#ifdef dprintk
+#undef dprintk
+#endif
+
+#define dprintk(level,args...) \
+            do { if ((budget_debug & level)) { printk("%s: %s(): ",__stringify(KBUILD_MODNAME), __FUNCTION__); printk(args); } } while (0)
+
 struct budget_info {
        char *name;
        int type;
@@ -28,7 +35,7 @@ struct budget {
 
         struct saa7146_dev     *dev;
 
-       struct dvb_i2c_bus      *i2c_bus;       
+       struct i2c_adapter      i2c_adap;
        struct budget_info      *card;
 
        unsigned char           *grabbing;
@@ -55,7 +62,10 @@ struct budget {
 
        spinlock_t feedlock;
 
+       spinlock_t debilock;
+
         struct dvb_adapter       *dvb_adapter;
+       struct dvb_frontend *dvb_frontend;
        void                     *priv;
 };
 
@@ -76,19 +86,27 @@ static struct saa7146_pci_extension_data x_var = { \
 
 #define BUDGET_TT                 0
 #define BUDGET_TT_HW_DISEQC       1
-#define BUDGET_KNC1               2
 #define BUDGET_PATCH              3
 #define BUDGET_FS_ACTIVY          4
+#define BUDGET_CIN1200S                   5
+#define BUDGET_CIN1200C                   6
+#define BUDGET_CIN1200T                   7
+#define BUDGET_KNC1S              8
+#define BUDGET_KNC1C              9
+#define BUDGET_KNC1T              10
 
 #define BUDGET_VIDEO_PORTA         0
 #define BUDGET_VIDEO_PORTB         1
 
-extern int ttpci_budget_init (struct budget *budget,
-                             struct saa7146_dev* dev,
-                             struct saa7146_pci_extension_data *info);
+extern int ttpci_budget_init(struct budget *budget, struct saa7146_dev *dev,
+                            struct saa7146_pci_extension_data *info,
+                            struct module *owner);
 extern int ttpci_budget_deinit (struct budget *budget);
 extern void ttpci_budget_irq10_handler (struct saa7146_dev* dev, u32 *isr);
 extern void ttpci_budget_set_video_port(struct saa7146_dev* dev, int video_port);
+extern int ttpci_budget_debiread(struct budget *budget, u32 config, int addr, int count,
+                                int uselocks, int nobusyloop);
+extern int ttpci_budget_debiwrite(struct budget *budget, u32 config, int addr, int count, u32 value,
+                                 int uselocks, int nobusyloop);
 
 #endif
-