OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [drivers/] [media/] [video/] [bttvp.h] - Blame information for rev 1765

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
    bttv - Bt848 frame grabber driver
3
 
4
    bttv's *private* header file  --  nobody else than bttv itself
5
    should ever include this file.
6
 
7
    Copyright (C) 1996,97 Ralph Metzler (rjkm@thp.uni-koeln.de)
8
    (c) 1999,2000 Gerd Knorr <kraxel@goldbach.in-berlin.de>
9
 
10
    This program is free software; you can redistribute it and/or modify
11
    it under the terms of the GNU General Public License as published by
12
    the Free Software Foundation; either version 2 of the License, or
13
    (at your option) any later version.
14
 
15
    This program is distributed in the hope that it will be useful,
16
    but WITHOUT ANY WARRANTY; without even the implied warranty of
17
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
    GNU General Public License for more details.
19
 
20
    You should have received a copy of the GNU General Public License
21
    along with this program; if not, write to the Free Software
22
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
23
*/
24
 
25
#ifndef _BTTVP_H_
26
#define _BTTVP_H_
27
 
28
#include <linux/version.h>
29
#define BTTV_VERSION_CODE KERNEL_VERSION(0,7,108)
30
 
31
#include <linux/types.h>
32
#include <linux/wait.h>
33
#include <linux/i2c.h>
34
#include <linux/i2c-algo-bit.h>
35
 
36
#include "bt848.h"
37
#include "bttv.h"
38
#include "audiochip.h"
39
#include "tuner.h"
40
#include "i2c-compat.h"
41
 
42
#ifdef __KERNEL__
43
 
44
/* ---------------------------------------------------------- */
45
/* bttv-driver.c                                              */
46
 
47
/* insmod options / kernel args */
48
extern unsigned int no_overlay;
49
extern unsigned int bttv_verbose;
50
extern unsigned int bttv_debug;
51
extern unsigned int bttv_gpio;
52
extern void bttv_gpio_tracking(struct bttv *btv, char *comment);
53
extern int init_bttv_i2c(struct bttv *btv);
54
extern int pvr_boot(struct bttv *btv);
55
 
56
#define dprintk         if (bttv_debug)   printk
57
#define vprintk         if (bttv_verbose) printk
58
 
59
#define BTTV_MAX 16
60
extern unsigned int bttv_num;                   /* number of Bt848s in use */
61
extern struct bttv bttvs[BTTV_MAX];
62
 
63
#define UNSET -1U
64
 
65
#ifdef VIDEODAT_HACK
66
# define VBI_MAXLINES   19
67
#else
68
# define VBI_MAXLINES   16
69
#endif
70
#define VBIBUF_SIZE     (2048*VBI_MAXLINES*2)
71
#define MAX_GBUFFERS    64
72
#define RISCMEM_LEN     (32744*2)
73
 
74
#define BTTV_MAX_FBUF   0x208000
75
 
76
struct bttv_window
77
{
78
        int x, y;
79
        ushort width, height;
80
        ushort bpp, bpl;
81
        ushort swidth, sheight;
82
        unsigned long vidadr;
83
        ushort freq;
84
        int norm;
85
        int interlace;
86
        int color_fmt;
87
        ushort depth;
88
};
89
 
90
struct bttv_pll_info {
91
        unsigned int pll_ifreq;    /* PLL input frequency        */
92
        unsigned int pll_ofreq;    /* PLL output frequency       */
93
        unsigned int pll_crystal;  /* Crystal used for input     */
94
        unsigned int pll_current;  /* Currently programmed ofreq */
95
};
96
 
97
struct bttv_gbuf {
98
        int stat;
99
#define GBUFFER_UNUSED       0
100
#define GBUFFER_GRABBING     1
101
#define GBUFFER_DONE         2
102
#define GBUFFER_ERROR        3
103
        struct timeval tv;
104
 
105
        u16 width;
106
        u16 height;
107
        u16 fmt;
108
 
109
        u32 *risc;
110
        unsigned long ro;
111
        unsigned long re;
112
};
113
 
114
struct bttv {
115
        struct video_device video_dev;
116
        struct video_device radio_dev;
117
        struct video_device vbi_dev;
118
        struct video_picture picture;           /* Current picture params */
119
        struct video_audio audio_dev;           /* Current audio params */
120
 
121
        spinlock_t s_lock;
122
        struct semaphore lock;
123
        unsigned int user;
124
 
125
        /* i2c */
126
        struct i2c_adapter         i2c_adap;
127
        struct i2c_algo_bit_data   i2c_algo;
128
        struct i2c_client          i2c_client;
129
        int                        i2c_state, i2c_rc;
130
 
131
        unsigned int tuner_type;
132
        unsigned int pinnacle_id;
133
        unsigned int channel;
134
        unsigned int svhs;
135
 
136
        unsigned int nr;
137
        unsigned short id;
138
        struct pci_dev *dev;
139
        unsigned char revision;
140
        unsigned long bt848_adr;      /* bus address of IO mem returned by PCI BIOS */
141
        unsigned char *bt848_mem;   /* pointer to mapped IO memory */
142
        unsigned long busriscmem;
143
        u32 *riscmem;
144
 
145
        unsigned char *vbibuf;
146
        struct bttv_window win;
147
        int fb_color_ctl;
148
        int type;            /* card type  */
149
        unsigned int cardid;
150
        int audio;           /* audio mode */
151
        int audio_chip;      /* set to one of the chips supported by bttv.c */
152
        int radio;
153
        int has_radio;
154
        int has_remote;
155
 
156
        /* miro/pinnacle + Aimslab VHX
157
           philips matchbox (tea5757 radio tuner) support */
158
        int has_matchbox;
159
        int mbox_we;
160
        int mbox_data;
161
        int mbox_clk;
162
        int mbox_most;
163
        int mbox_mask;
164
 
165
        /* ISA stuff (Terratec Active Radio Upgrade) */
166
        int mbox_ior;
167
        int mbox_iow;
168
        int mbox_csel;
169
 
170
        u32 *risc_jmp;
171
        u32 *vbi_odd;
172
        u32 *vbi_even;
173
        u32 bus_vbi_even;
174
        u32 bus_vbi_odd;
175
        wait_queue_head_t vbiq;
176
        wait_queue_head_t capq;
177
        unsigned int vbip;
178
 
179
        u32 *risc_scr_odd;
180
        u32 *risc_scr_even;
181
        u32 risc_cap_odd;
182
        u32 risc_cap_even;
183
        int scr_on;
184
        int vbi_on;
185
        struct video_clip *cliprecs;
186
 
187
        struct bttv_gbuf *gbuf;
188
        int gqueue[MAX_GBUFFERS];
189
        int gq_in,gq_out,gq_grab,gq_start;
190
        char *fbuffer;
191
 
192
        struct bttv_pll_info pll;
193
        unsigned int Fsc;
194
        unsigned int field;
195
        unsigned int last_field; /* number of last grabbed field */
196
        int i2c_command;
197
        int triton1;
198
 
199
        int errors;
200
        int needs_restart;
201
 
202
        wait_queue_head_t gpioq;
203
        int shutdown;
204
        void (*audio_hook)(struct bttv *btv, struct video_audio *v, int set);
205
};
206
#endif
207
 
208
#define btwrite(dat,adr)    writel((dat), (char *) (btv->bt848_mem+(adr)))
209
#define btread(adr)         readl(btv->bt848_mem+(adr))
210
 
211
#define btand(dat,adr)      btwrite((dat) & btread(adr), adr)
212
#define btor(dat,adr)       btwrite((dat) | btread(adr), adr)
213
#define btaor(dat,mask,adr) btwrite((dat) | ((mask) & btread(adr)), adr)
214
 
215
/* bttv ioctls */
216
 
217
#define BTTV_READEE             _IOW('v',  BASE_VIDIOCPRIVATE+0, char [256])
218
#define BTTV_WRITEE             _IOR('v',  BASE_VIDIOCPRIVATE+1, char [256])
219
#define BTTV_FIELDNR            _IOR('v' , BASE_VIDIOCPRIVATE+2, unsigned int)
220
#define BTTV_PLLSET             _IOW('v' , BASE_VIDIOCPRIVATE+3, struct bttv_pll_info)
221
#define BTTV_BURST_ON           _IOR('v' , BASE_VIDIOCPRIVATE+4, int)
222
#define BTTV_BURST_OFF          _IOR('v' , BASE_VIDIOCPRIVATE+5, int)
223
#define BTTV_VERSION            _IOR('v' , BASE_VIDIOCPRIVATE+6, int)
224
#define BTTV_PICNR              _IOR('v' , BASE_VIDIOCPRIVATE+7, int)
225
#define BTTV_VBISIZE            _IOR('v' , BASE_VIDIOCPRIVATE+8, int)
226
 
227
#define TDA9850            0x01
228
#define TDA9840            0x02
229
#define TDA8425            0x03
230
#define TEA6300            0x04
231
 
232
#endif /* _BTTVP_H_ */
233
 
234
/*
235
 * Local variables:
236
 * c-basic-offset: 8
237
 * End:
238
 */

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.