1 /* SPDX-License-Identifier: GPL-2.0 */
10 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
12 #include <media/dvb_frontend.h>
13 #include <media/dvbdev.h>
14 #include <media/demux.h>
15 #include <media/dvb_demux.h>
16 #include <media/dmxdev.h>
17 #include <media/dvb_net.h>
19 #include <linux/module.h>
20 #include <linux/mutex.h>
21 #include <linux/workqueue.h>
23 #include <media/drv-intf/saa7146.h>
25 extern int budget_debug
;
31 #define dprintk(level, fmt, arg...) do { \
32 if ((level) & budget_debug) \
33 pr_info("%s(): " fmt, __func__, ##arg); \
43 /* place to store all the necessary device information */
47 struct dvb_device dvb_dev
;
48 struct dvb_net dvb_net
;
50 struct saa7146_dev
*dev
;
52 struct i2c_adapter i2c_adap
;
53 struct budget_info
*card
;
55 unsigned char *grabbing
;
56 struct saa7146_pgtable pt
;
58 struct work_struct fidb_bh_work
;
59 struct work_struct vpe_bh_work
;
62 struct dvb_demux demux
;
64 struct dmx_frontend hw_frontend
;
65 struct dmx_frontend mem_frontend
;
73 u32 buffer_warning_threshold
;
75 unsigned long buffer_warning_time
;
84 struct dvb_adapter dvb_adapter
;
85 struct dvb_frontend
*dvb_frontend
;
86 int (*read_fe_status
)(struct dvb_frontend
*fe
, enum fe_status
*status
);
92 #define MAKE_BUDGET_INFO(x_var, x_name, x_type) \
93 static struct budget_info x_var ## _info = { \
96 static struct saa7146_pci_extension_data x_var = { \
97 .ext_priv = &x_var ## _info, \
98 .ext = &budget_extension }
101 #define BUDGET_TT_HW_DISEQC 1
102 #define BUDGET_PATCH 3
103 #define BUDGET_FS_ACTIVY 4
104 #define BUDGET_CIN1200S 5
105 #define BUDGET_CIN1200C 6
106 #define BUDGET_CIN1200T 7
107 #define BUDGET_KNC1S 8
108 #define BUDGET_KNC1C 9
109 #define BUDGET_KNC1T 10
110 #define BUDGET_KNC1SP 11
111 #define BUDGET_KNC1CP 12
112 #define BUDGET_KNC1TP 13
113 #define BUDGET_TVSTAR 14
114 #define BUDGET_CIN1200C_MK3 15
115 #define BUDGET_KNC1C_MK3 16
116 #define BUDGET_KNC1CP_MK3 17
117 #define BUDGET_KNC1S2 18
118 #define BUDGET_KNC1C_TDA10024 19
120 #define BUDGET_VIDEO_PORTA 0
121 #define BUDGET_VIDEO_PORTB 1
123 extern int ttpci_budget_init(struct budget
*budget
, struct saa7146_dev
*dev
,
124 struct saa7146_pci_extension_data
*info
,
125 struct module
*owner
, short *adapter_nums
);
126 extern void ttpci_budget_init_hooks(struct budget
*budget
);
127 extern int ttpci_budget_deinit(struct budget
*budget
);
128 extern void ttpci_budget_irq10_handler(struct saa7146_dev
*dev
, u32
*isr
);
129 extern void ttpci_budget_set_video_port(struct saa7146_dev
*dev
, int video_port
);
130 extern int ttpci_budget_debiread(struct budget
*budget
, u32 config
, int addr
, int count
,
131 int uselocks
, int nobusyloop
);
132 extern int ttpci_budget_debiwrite(struct budget
*budget
, u32 config
, int addr
, int count
, u32 value
,
133 int uselocks
, int nobusyloop
);