1 /* SPDX-License-Identifier: GPL-2.0 */
6 #include <media/dvb_frontend.h>
7 #include <media/dvbdev.h>
8 #include <media/demux.h>
9 #include <media/dvb_demux.h>
10 #include <media/dmxdev.h>
11 #include "dvb_filter.h"
12 #include <media/dvb_net.h>
14 #include <linux/module.h>
15 #include <linux/mutex.h>
17 #include <media/drv-intf/saa7146.h>
19 extern int budget_debug
;
25 #define dprintk(level, fmt, arg...) do { \
26 if (level & budget_debug) \
27 printk(KERN_DEBUG KBUILD_MODNAME ": %s(): " fmt, \
37 /* place to store all the necessary device information */
41 struct dvb_device dvb_dev
;
42 struct dvb_net dvb_net
;
44 struct saa7146_dev
*dev
;
46 struct i2c_adapter i2c_adap
;
47 struct budget_info
*card
;
49 unsigned char *grabbing
;
50 struct saa7146_pgtable pt
;
52 struct tasklet_struct fidb_tasklet
;
53 struct tasklet_struct vpe_tasklet
;
56 struct dvb_demux demux
;
58 struct dmx_frontend hw_frontend
;
59 struct dmx_frontend mem_frontend
;
67 u32 buffer_warning_threshold
;
69 unsigned long buffer_warning_time
;
78 struct dvb_adapter dvb_adapter
;
79 struct dvb_frontend
*dvb_frontend
;
80 int (*read_fe_status
)(struct dvb_frontend
*fe
, enum fe_status
*status
);
86 #define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
87 static struct budget_info x_var ## _info = { \
90 static struct saa7146_pci_extension_data x_var = { \
91 .ext_priv = &x_var ## _info, \
92 .ext = &budget_extension };
95 #define BUDGET_TT_HW_DISEQC 1
96 #define BUDGET_PATCH 3
97 #define BUDGET_FS_ACTIVY 4
98 #define BUDGET_CIN1200S 5
99 #define BUDGET_CIN1200C 6
100 #define BUDGET_CIN1200T 7
101 #define BUDGET_KNC1S 8
102 #define BUDGET_KNC1C 9
103 #define BUDGET_KNC1T 10
104 #define BUDGET_KNC1SP 11
105 #define BUDGET_KNC1CP 12
106 #define BUDGET_KNC1TP 13
107 #define BUDGET_TVSTAR 14
108 #define BUDGET_CIN1200C_MK3 15
109 #define BUDGET_KNC1C_MK3 16
110 #define BUDGET_KNC1CP_MK3 17
111 #define BUDGET_KNC1S2 18
112 #define BUDGET_KNC1C_TDA10024 19
114 #define BUDGET_VIDEO_PORTA 0
115 #define BUDGET_VIDEO_PORTB 1
117 extern int ttpci_budget_init(struct budget
*budget
, struct saa7146_dev
*dev
,
118 struct saa7146_pci_extension_data
*info
,
119 struct module
*owner
, short *adapter_nums
);
120 extern void ttpci_budget_init_hooks(struct budget
*budget
);
121 extern int ttpci_budget_deinit(struct budget
*budget
);
122 extern void ttpci_budget_irq10_handler(struct saa7146_dev
*dev
, u32
* isr
);
123 extern void ttpci_budget_set_video_port(struct saa7146_dev
*dev
, int video_port
);
124 extern int ttpci_budget_debiread(struct budget
*budget
, u32 config
, int addr
, int count
,
125 int uselocks
, int nobusyloop
);
126 extern int ttpci_budget_debiwrite(struct budget
*budget
, u32 config
, int addr
, int count
, u32 value
,
127 int uselocks
, int nobusyloop
);