Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost
[cris-mirror.git] / drivers / media / pci / ttpci / budget.h
bloba7463daf39f15f01a0bb868a831e61c670990f06
1 /* SPDX-License-Identifier: GPL-2.0 */
3 #ifndef __BUDGET_DVB__
4 #define __BUDGET_DVB__
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;
21 #ifdef dprintk
22 #undef dprintk
23 #endif
25 #define dprintk(level, fmt, arg...) do { \
26 if (level & budget_debug) \
27 printk(KERN_DEBUG KBUILD_MODNAME ": %s(): " fmt, \
28 __func__, ##arg); \
29 } while (0)
32 struct budget_info {
33 char *name;
34 int type;
37 /* place to store all the necessary device information */
38 struct budget {
40 /* devices */
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;
55 struct dmxdev dmxdev;
56 struct dvb_demux demux;
58 struct dmx_frontend hw_frontend;
59 struct dmx_frontend mem_frontend;
61 int ci_present;
62 int video_port;
64 u32 buffer_width;
65 u32 buffer_height;
66 u32 buffer_size;
67 u32 buffer_warning_threshold;
68 u32 buffer_warnings;
69 unsigned long buffer_warning_time;
71 u32 ttbp;
72 int feeding;
74 spinlock_t feedlock;
76 spinlock_t debilock;
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);
81 int fe_synced;
83 void *priv;
86 #define MAKE_BUDGET_INFO(x_var,x_name,x_type) \
87 static struct budget_info x_var ## _info = { \
88 .name=x_name, \
89 .type=x_type }; \
90 static struct saa7146_pci_extension_data x_var = { \
91 .ext_priv = &x_var ## _info, \
92 .ext = &budget_extension };
94 #define BUDGET_TT 0
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);
129 #endif