bt8xx.h revision 1.3 1 1.3 wiz /* $NetBSD: bt8xx.h,v 1.3 2000/12/30 16:52:36 wiz Exp $ */
2 1.1 wiz
3 1.1 wiz /* This file is merged from ioctl_meteor.h and ioctl_bt848.h from FreeBSD. */
4 1.1 wiz /* The copyright below only applies to the ioctl_meteor.h part of this file. */
5 1.2 wiz
6 1.2 wiz #ifndef _DEV_IC_BT8XX_H_
7 1.2 wiz #define _DEV_IC_BT8XX_H_
8 1.1 wiz /*
9 1.1 wiz * Copyright (c) 1995 Mark Tinguely and Jim Lowe
10 1.1 wiz * All rights reserved.
11 1.1 wiz *
12 1.1 wiz * Redistribution and use in source and binary forms, with or without
13 1.1 wiz * modification, are permitted provided that the following conditions
14 1.1 wiz * are met:
15 1.1 wiz * 1. Redistributions of source code must retain the above copyright
16 1.1 wiz * notice, this list of conditions and the following disclaimer.
17 1.1 wiz * 2. Redistributions in binary form must reproduce the above copyright
18 1.1 wiz * notice, this list of conditions and the following disclaimer in the
19 1.1 wiz * documentation and/or other materials provided with the distribution.
20 1.1 wiz * 3. All advertising materials mentioning features or use of this software
21 1.1 wiz * must display the following acknowledgement:
22 1.1 wiz * This product includes software developed by Mark Tinguely and Jim Lowe
23 1.1 wiz * 4. The name of the author may not be used to endorse or promote products
24 1.1 wiz * derived from this software without specific prior written permission.
25 1.1 wiz *
26 1.1 wiz * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
27 1.1 wiz * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28 1.1 wiz * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29 1.1 wiz * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
30 1.1 wiz * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31 1.1 wiz * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
32 1.1 wiz * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 1.1 wiz * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
34 1.1 wiz * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
35 1.1 wiz * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 wiz * POSSIBILITY OF SUCH DAMAGE.
37 1.3 wiz *
38 1.3 wiz * FreeBSD: src/sys/i386/include/ioctl_meteor.h,v 1.11 1999/12/29 04:33:02 peter Exp
39 1.1 wiz */
40 1.1 wiz /*
41 1.1 wiz * ioctl constants for Matrox Meteor Capture card.
42 1.1 wiz */
43 1.1 wiz
44 1.1 wiz
45 1.3 wiz #ifndef _KERNEL
46 1.1 wiz #include <sys/types.h>
47 1.1 wiz #endif
48 1.1 wiz #include <sys/ioccom.h>
49 1.1 wiz
50 1.1 wiz struct meteor_capframe {
51 1.1 wiz short command; /* see below for valid METEORCAPFRM commands */
52 1.1 wiz short lowat; /* start transfer if < this number */
53 1.1 wiz short hiwat; /* stop transfer if > this number */
54 1.1 wiz } ;
55 1.1 wiz
56 1.1 wiz /* structure for METEOR[GS]ETGEO - get/set geometry */
57 1.1 wiz struct meteor_geomet {
58 1.1 wiz u_short rows;
59 1.1 wiz u_short columns;
60 1.1 wiz u_short frames;
61 1.1 wiz u_long oformat;
62 1.1 wiz } ;
63 1.1 wiz
64 1.1 wiz /* structure for METEORGCOUNT-get count of frames, fifo errors and dma errors */
65 1.1 wiz struct meteor_counts {
66 1.1 wiz u_long fifo_errors; /* count of fifo errors since open */
67 1.1 wiz u_long dma_errors; /* count of dma errors since open */
68 1.1 wiz u_long frames_captured; /* count of frames captured since open */
69 1.1 wiz u_long even_fields_captured; /* count of even fields captured */
70 1.1 wiz u_long odd_fields_captured; /* count of odd fields captured */
71 1.1 wiz } ;
72 1.1 wiz
73 1.1 wiz /* structure for getting and setting direct transfers to vram */
74 1.1 wiz struct meteor_video {
75 1.1 wiz u_long addr; /* Address of location to dma to */
76 1.1 wiz u_long width; /* Width of memory area */
77 1.1 wiz u_long banksize; /* Size of Vram bank */
78 1.1 wiz u_long ramsize; /* Size of Vram */
79 1.1 wiz };
80 1.1 wiz
81 1.1 wiz #define METEORCAPTUR _IOW('x', 1, int) /* capture a frame */
82 1.1 wiz #define METEORCAPFRM _IOW('x', 2, struct meteor_capframe) /* sync capture */
83 1.1 wiz #define METEORSETGEO _IOW('x', 3, struct meteor_geomet) /* set geometry */
84 1.1 wiz #define METEORGETGEO _IOR('x', 4, struct meteor_geomet) /* get geometry */
85 1.1 wiz #define METEORSTATUS _IOR('x', 5, unsigned short) /* get status */
86 1.1 wiz #define METEORSHUE _IOW('x', 6, signed char) /* set hue */
87 1.1 wiz #define METEORGHUE _IOR('x', 6, signed char) /* get hue */
88 1.1 wiz #define METEORSFMT _IOW('x', 7, unsigned long) /* set format */
89 1.1 wiz #define METEORGFMT _IOR('x', 7, unsigned long) /* get format */
90 1.1 wiz #define METEORSINPUT _IOW('x', 8, unsigned long) /* set input dev */
91 1.1 wiz #define METEORGINPUT _IOR('x', 8, unsigned long) /* get input dev */
92 1.1 wiz #define METEORSCHCV _IOW('x', 9, unsigned char) /* set uv gain */
93 1.1 wiz #define METEORGCHCV _IOR('x', 9, unsigned char) /* get uv gain */
94 1.1 wiz #define METEORSCOUNT _IOW('x',10, struct meteor_counts)
95 1.1 wiz #define METEORGCOUNT _IOR('x',10, struct meteor_counts)
96 1.1 wiz #define METEORSFPS _IOW('x',11, unsigned short) /* set fps */
97 1.1 wiz #define METEORGFPS _IOR('x',11, unsigned short) /* get fps */
98 1.1 wiz #define METEORSSIGNAL _IOW('x', 12, unsigned int) /* set signal */
99 1.1 wiz #define METEORGSIGNAL _IOR('x', 12, unsigned int) /* get signal */
100 1.1 wiz #define METEORSVIDEO _IOW('x', 13, struct meteor_video) /* set video */
101 1.1 wiz #define METEORGVIDEO _IOR('x', 13, struct meteor_video) /* get video */
102 1.1 wiz #define METEORSBRIG _IOW('x', 14, unsigned char) /* set brightness */
103 1.1 wiz #define METEORGBRIG _IOR('x', 14, unsigned char) /* get brightness */
104 1.1 wiz #define METEORSCSAT _IOW('x', 15, unsigned char) /* set chroma sat */
105 1.1 wiz #define METEORGCSAT _IOR('x', 15, unsigned char) /* get uv saturation */
106 1.1 wiz #define METEORSCONT _IOW('x', 16, unsigned char) /* set contrast */
107 1.1 wiz #define METEORGCONT _IOR('x', 16, unsigned char) /* get contrast */
108 1.1 wiz #define METEORSBT254 _IOW('x', 17, unsigned short) /* set Bt254 reg */
109 1.1 wiz #define METEORGBT254 _IOR('x', 17, unsigned short) /* get Bt254 reg */
110 1.1 wiz #define METEORSHWS _IOW('x', 18, unsigned char) /* set hor start reg */
111 1.1 wiz #define METEORGHWS _IOR('x', 18, unsigned char) /* get hor start reg */
112 1.1 wiz #define METEORSVWS _IOW('x', 19, unsigned char) /* set vert start reg */
113 1.1 wiz #define METEORGVWS _IOR('x', 19, unsigned char) /* get vert start reg */
114 1.1 wiz #define METEORSTS _IOW('x', 20, unsigned char) /* set time stamp */
115 1.1 wiz #define METEORGTS _IOR('x', 20, unsigned char) /* get time stamp */
116 1.1 wiz
117 1.1 wiz #define METEOR_STATUS_ID_MASK 0xf000 /* ID of 7196 */
118 1.1 wiz #define METEOR_STATUS_DIR 0x0800 /* Direction of Expansion port YUV */
119 1.1 wiz #define METEOR_STATUS_OEF 0x0200 /* Field detected: Even/Odd */
120 1.1 wiz #define METEOR_STATUS_SVP 0x0100 /* State of VRAM Port:inactive/active */
121 1.1 wiz #define METEOR_STATUS_STTC 0x0080 /* Time Constant: TV/VCR */
122 1.1 wiz #define METEOR_STATUS_HCLK 0x0040 /* Horiz PLL: locked/unlocked */
123 1.1 wiz #define METEOR_STATUS_FIDT 0x0020 /* Field detect: 50/60hz */
124 1.1 wiz #define METEOR_STATUS_ALTD 0x0002 /* Line alt: no line alt/line alt */
125 1.1 wiz #define METEOR_STATUS_CODE 0x0001 /* Colour info: no colour/colour */
126 1.1 wiz
127 1.1 wiz /* METEORCAPTUR capture options */
128 1.1 wiz #define METEOR_CAP_SINGLE 0x0001 /* capture one frame */
129 1.1 wiz #define METEOR_CAP_CONTINOUS 0x0002 /* continuously capture */
130 1.1 wiz #define METEOR_CAP_STOP_CONT 0x0004 /* stop the continuous capture */
131 1.1 wiz
132 1.1 wiz /* METEORCAPFRM capture commands */
133 1.1 wiz #define METEOR_CAP_N_FRAMES 0x0001 /* capture N frames */
134 1.1 wiz #define METEOR_CAP_STOP_FRAMES 0x0002 /* stop capture N frames */
135 1.1 wiz #define METEOR_HALT_N_FRAMES 0x0003 /* halt of capture N frames */
136 1.1 wiz #define METEOR_CONT_N_FRAMES 0x0004 /* continue after above halt */
137 1.1 wiz
138 1.1 wiz /* valid video input formats: */
139 1.1 wiz #define METEOR_FMT_NTSC 0x00100 /* NTSC -- initialized default */
140 1.1 wiz #define METEOR_FMT_PAL 0x00200 /* PAL */
141 1.1 wiz #define METEOR_FMT_SECAM 0x00400 /* SECAM */
142 1.1 wiz #define METEOR_FMT_AUTOMODE 0x00800 /* auto-mode */
143 1.1 wiz #define METEOR_INPUT_DEV0 0x01000 /* camera input 0 -- default */
144 1.1 wiz #define METEOR_INPUT_DEV_RCA METEOR_INPUT_DEV0
145 1.1 wiz #define METEOR_INPUT_DEV1 0x02000 /* camera input 1 */
146 1.1 wiz #define METEOR_INPUT_DEV2 0x04000 /* camera input 2 */
147 1.1 wiz #define METEOR_INPUT_DEV3 0x08000 /* camera input 3 */
148 1.1 wiz #define METEOR_INPUT_DEV_RGB 0x0a000 /* for rgb version of meteor */
149 1.1 wiz #define METEOR_INPUT_DEV_SVIDEO 0x06000 /* S-video input port */
150 1.1 wiz
151 1.1 wiz /* valid video output formats: */
152 1.1 wiz #define METEOR_GEO_RGB16 0x0010000 /* packed -- initialized default */
153 1.1 wiz #define METEOR_GEO_RGB24 0x0020000 /* RBG 24 bits packed */
154 1.1 wiz /* internally stored in 32 bits */
155 1.1 wiz #define METEOR_GEO_YUV_PACKED 0x0040000 /* 4-2-2 YUV 16 bits packed */
156 1.1 wiz #define METEOR_GEO_YUV_PLANAR 0x0080000 /* 4-2-2 YUV 16 bits planer */
157 1.1 wiz #define METEOR_GEO_YUV_PLANER METEOR_GEO_YUV_PLANAR
158 1.1 wiz #define METEOR_GEO_UNSIGNED 0x0400000 /* unsigned uv outputs */
159 1.1 wiz #define METEOR_GEO_EVEN_ONLY 0x1000000 /* set for even only field capture */
160 1.1 wiz #define METEOR_GEO_ODD_ONLY 0x2000000 /* set for odd only field capture */
161 1.1 wiz #define METEOR_GEO_FIELD_MASK 0x3000000
162 1.1 wiz #define METEOR_GEO_YUV_422 0x4000000 /* 4-2-2 YUV in Y-U-V combined */
163 1.1 wiz #define METEOR_GEO_OUTPUT_MASK 0x40f0000
164 1.1 wiz #define METEOR_GEO_YUV_12 0x10000000 /* YUV 12 format */
165 1.1 wiz #define METEOR_GEO_YUV_9 0x40000000 /* YUV 9 format */
166 1.1 wiz
167 1.1 wiz #define METEOR_FIELD_MODE 0x80000000 /* Field cap or Frame cap */
168 1.1 wiz
169 1.1 wiz #define METEOR_SIG_MODE_MASK 0xffff0000
170 1.1 wiz #define METEOR_SIG_FRAME 0x00000000 /* signal every frame */
171 1.1 wiz #define METEOR_SIG_FIELD 0x00010000 /* signal every field */
172 1.1 wiz
173 1.1 wiz /* following structure is used to coordinate the synchronous */
174 1.1 wiz
175 1.1 wiz struct meteor_mem {
176 1.1 wiz /* kernel write only */
177 1.1 wiz int frame_size; /* row*columns*depth */
178 1.1 wiz unsigned num_bufs; /* number of frames in buffer (1-32) */
179 1.1 wiz /* user and kernel change these */
180 1.1 wiz int lowat; /* kernel starts capture if < this number */
181 1.1 wiz int hiwat; /* kernel stops capture if > this number.
182 1.1 wiz hiwat <= numbufs */
183 1.1 wiz unsigned active; /* bit mask of active frame buffers
184 1.1 wiz kernel sets, user clears */
185 1.1 wiz int num_active_bufs; /* count of active frame buffer
186 1.1 wiz kernel increments, user decrements */
187 1.1 wiz
188 1.1 wiz /* reference to mmapped data */
189 1.1 wiz caddr_t buf; /* The real space (virtual addr) */
190 1.1 wiz } ;
191 1.1 wiz
192 1.1 wiz /*
193 1.1 wiz * extensions to ioctl_meteor.h for the bt848 cards
194 1.1 wiz *
195 1.3 wiz * FreeBSD: src/sys/i386/include/ioctl_bt848.h,v 1.27 2000/10/26 16:41:48 roger Exp
196 1.1 wiz */
197 1.1 wiz
198 1.1 wiz
199 1.1 wiz /*
200 1.1 wiz * frequency sets
201 1.1 wiz */
202 1.1 wiz #define CHNLSET_NABCST 1
203 1.1 wiz #define CHNLSET_CABLEIRC 2
204 1.1 wiz #define CHNLSET_CABLEHRC 3
205 1.1 wiz #define CHNLSET_WEUROPE 4
206 1.1 wiz #define CHNLSET_JPNBCST 5
207 1.1 wiz #define CHNLSET_JPNCABLE 6
208 1.1 wiz #define CHNLSET_XUSSR 7
209 1.1 wiz #define CHNLSET_AUSTRALIA 8
210 1.1 wiz #define CHNLSET_FRANCE 9
211 1.1 wiz #define CHNLSET_MIN CHNLSET_NABCST
212 1.1 wiz #define CHNLSET_MAX CHNLSET_FRANCE
213 1.1 wiz
214 1.1 wiz
215 1.1 wiz /*
216 1.1 wiz * constants for various tuner registers
217 1.1 wiz */
218 1.1 wiz #define BT848_HUEMIN (-90)
219 1.1 wiz #define BT848_HUEMAX 90
220 1.1 wiz #define BT848_HUECENTER 0
221 1.1 wiz #define BT848_HUERANGE 179.3
222 1.1 wiz #define BT848_HUEREGMIN (-128)
223 1.1 wiz #define BT848_HUEREGMAX 127
224 1.1 wiz #define BT848_HUESTEPS 256
225 1.1 wiz
226 1.1 wiz #define BT848_BRIGHTMIN (-50)
227 1.1 wiz #define BT848_BRIGHTMAX 50
228 1.1 wiz #define BT848_BRIGHTCENTER 0
229 1.1 wiz #define BT848_BRIGHTRANGE 99.6
230 1.1 wiz #define BT848_BRIGHTREGMIN (-128)
231 1.1 wiz #define BT848_BRIGHTREGMAX 127
232 1.1 wiz #define BT848_BRIGHTSTEPS 256
233 1.1 wiz
234 1.1 wiz #define BT848_CONTRASTMIN 0
235 1.1 wiz #define BT848_CONTRASTMAX 237
236 1.1 wiz #define BT848_CONTRASTCENTER 100
237 1.1 wiz #define BT848_CONTRASTRANGE 236.57
238 1.1 wiz #define BT848_CONTRASTREGMIN 0
239 1.1 wiz #define BT848_CONTRASTREGMAX 511
240 1.1 wiz #define BT848_CONTRASTSTEPS 512
241 1.1 wiz
242 1.1 wiz #define BT848_CHROMAMIN 0
243 1.1 wiz #define BT848_CHROMAMAX 284
244 1.1 wiz #define BT848_CHROMACENTER 100
245 1.1 wiz #define BT848_CHROMARANGE 283.89
246 1.1 wiz #define BT848_CHROMAREGMIN 0
247 1.1 wiz #define BT848_CHROMAREGMAX 511
248 1.1 wiz #define BT848_CHROMASTEPS 512
249 1.1 wiz
250 1.1 wiz #define BT848_SATUMIN 0
251 1.1 wiz #define BT848_SATUMAX 202
252 1.1 wiz #define BT848_SATUCENTER 100
253 1.1 wiz #define BT848_SATURANGE 201.18
254 1.1 wiz #define BT848_SATUREGMIN 0
255 1.1 wiz #define BT848_SATUREGMAX 511
256 1.1 wiz #define BT848_SATUSTEPS 512
257 1.1 wiz
258 1.1 wiz #define BT848_SATVMIN 0
259 1.1 wiz #define BT848_SATVMAX 284
260 1.1 wiz #define BT848_SATVCENTER 100
261 1.1 wiz #define BT848_SATVRANGE 283.89
262 1.1 wiz #define BT848_SATVREGMIN 0
263 1.1 wiz #define BT848_SATVREGMAX 511
264 1.1 wiz #define BT848_SATVSTEPS 512
265 1.1 wiz
266 1.1 wiz
267 1.1 wiz /*
268 1.1 wiz * audio stuff
269 1.1 wiz */
270 1.1 wiz #define AUDIO_TUNER 0x00 /* command for the audio routine */
271 1.1 wiz #define AUDIO_EXTERN 0x01 /* don't confuse them with bit */
272 1.1 wiz #define AUDIO_INTERN 0x02 /* settings */
273 1.1 wiz #define AUDIO_MUTE 0x80
274 1.1 wiz #define AUDIO_UNMUTE 0x81
275 1.1 wiz
276 1.1 wiz
277 1.1 wiz /*
278 1.1 wiz * EEProm stuff
279 1.1 wiz */
280 1.1 wiz struct eeProm {
281 1.1 wiz short offset;
282 1.1 wiz short count;
283 1.1 wiz u_char bytes[ 256 ];
284 1.1 wiz };
285 1.1 wiz
286 1.1 wiz
287 1.1 wiz /*
288 1.1 wiz * XXX: this is a hack, should be in ioctl_meteor.h
289 1.1 wiz * here to avoid touching that file for now...
290 1.1 wiz */
291 1.1 wiz #define TVTUNER_SETCHNL _IOW('x', 32, unsigned int) /* set channel */
292 1.1 wiz #define TVTUNER_GETCHNL _IOR('x', 32, unsigned int) /* get channel */
293 1.1 wiz #define TVTUNER_SETTYPE _IOW('x', 33, unsigned int) /* set tuner type */
294 1.1 wiz #define TVTUNER_GETTYPE _IOR('x', 33, unsigned int) /* get tuner type */
295 1.1 wiz #define TVTUNER_GETSTATUS _IOR('x', 34, unsigned int) /* get tuner status */
296 1.1 wiz #define TVTUNER_SETFREQ _IOW('x', 35, unsigned int) /* set frequency */
297 1.1 wiz #define TVTUNER_GETFREQ _IOR('x', 36, unsigned int) /* get frequency */
298 1.1 wiz
299 1.1 wiz
300 1.1 wiz #define BT848_SHUE _IOW('x', 37, int) /* set hue */
301 1.1 wiz #define BT848_GHUE _IOR('x', 37, int) /* get hue */
302 1.1 wiz #define BT848_SBRIG _IOW('x', 38, int) /* set brightness */
303 1.1 wiz #define BT848_GBRIG _IOR('x', 38, int) /* get brightness */
304 1.1 wiz #define BT848_SCSAT _IOW('x', 39, int) /* set chroma sat */
305 1.1 wiz #define BT848_GCSAT _IOR('x', 39, int) /* get UV saturation */
306 1.1 wiz #define BT848_SCONT _IOW('x', 40, int) /* set contrast */
307 1.1 wiz #define BT848_GCONT _IOR('x', 40, int) /* get contrast */
308 1.1 wiz #define BT848_SVSAT _IOW('x', 41, int) /* set chroma V sat */
309 1.1 wiz #define BT848_GVSAT _IOR('x', 41, int) /* get V saturation */
310 1.1 wiz #define BT848_SUSAT _IOW('x', 42, int) /* set chroma U sat */
311 1.1 wiz #define BT848_GUSAT _IOR('x', 42, int) /* get U saturation */
312 1.1 wiz
313 1.1 wiz #define BT848_SCBARS _IOR('x', 43, int) /* set colorbar */
314 1.1 wiz #define BT848_CCBARS _IOR('x', 44, int) /* clear colorbar */
315 1.1 wiz
316 1.1 wiz
317 1.1 wiz #define BT848_SAUDIO _IOW('x', 46, int) /* set audio channel */
318 1.1 wiz #define BT848_GAUDIO _IOR('x', 47, int) /* get audio channel */
319 1.1 wiz #define BT848_SBTSC _IOW('x', 48, int) /* set audio channel */
320 1.1 wiz
321 1.1 wiz #define BT848_GSTATUS _IOR('x', 49, unsigned int) /* reap status */
322 1.1 wiz
323 1.1 wiz #define BT848_WEEPROM _IOWR('x', 50, struct eeProm) /* write to EEProm */
324 1.1 wiz #define BT848_REEPROM _IOWR('x', 51, struct eeProm) /* read from EEProm */
325 1.1 wiz
326 1.1 wiz #define BT848_SIGNATURE _IOWR('x', 52, struct eeProm) /* read card sig */
327 1.1 wiz
328 1.1 wiz #define TVTUNER_SETAFC _IOW('x', 53, int) /* turn AFC on/off */
329 1.1 wiz #define TVTUNER_GETAFC _IOR('x', 54, int) /* query AFC on/off */
330 1.1 wiz #define BT848_SLNOTCH _IOW('x', 55, int) /* set luma notch */
331 1.1 wiz #define BT848_GLNOTCH _IOR('x', 56, int) /* get luma notch */
332 1.1 wiz
333 1.1 wiz /* Read/Write the BT848's I2C bus directly
334 1.1 wiz * b7-b0: data (read/write)
335 1.1 wiz * b15-b8: internal peripheral register (write)
336 1.1 wiz * b23-b16: i2c addr (write)
337 1.1 wiz * b31-b24: 1 = write, 0 = read
338 1.1 wiz */
339 1.1 wiz #define BT848_I2CWR _IOWR('x', 57, u_long) /* i2c read-write */
340 1.3 wiz
341 1.3 wiz struct bktr_msp_control {
342 1.3 wiz unsigned char function;
343 1.3 wiz unsigned int address;
344 1.3 wiz unsigned int data;
345 1.3 wiz };
346 1.3 wiz
347 1.3 wiz #define BT848_MSP_RESET _IO('x', 76) /* MSP chip reset */
348 1.3 wiz #define BT848_MSP_READ _IOWR('x', 77, struct bktr_msp_control) /* MSP chip reset */
349 1.3 wiz #define BT848_MSP_WRITE _IOWR('x', 78, struct bktr_msp_control) /* MSP chip reset */
350 1.1 wiz
351 1.1 wiz /* Support for radio tuner */
352 1.1 wiz #define RADIO_SETMODE _IOW('x', 58, unsigned int) /* set radio modes */
353 1.1 wiz #define RADIO_GETMODE _IOR('x', 58, unsigned char) /* get radio modes */
354 1.1 wiz #define RADIO_AFC 0x01 /* These modes will probably not */
355 1.1 wiz #define RADIO_MONO 0x02 /* work on the FRxxxx. It does */
356 1.1 wiz #define RADIO_MUTE 0x08 /* work on the FMxxxx. */
357 1.1 wiz #define RADIO_SETFREQ _IOW('x', 59, unsigned int) /* set frequency */
358 1.1 wiz #define RADIO_GETFREQ _IOR('x', 59, unsigned int) /* set frequency */
359 1.1 wiz /* Argument is frequency*100MHz */
360 1.1 wiz
361 1.1 wiz /*
362 1.1 wiz * XXX: more bad magic,
363 1.1 wiz * we need to fix the METEORGINPUT to return something public
364 1.1 wiz * duplicate them here for now...
365 1.1 wiz */
366 1.1 wiz #define METEOR_DEV0 0x00001000
367 1.1 wiz #define METEOR_DEV1 0x00002000
368 1.1 wiz #define METEOR_DEV2 0x00004000
369 1.1 wiz #define METEOR_DEV3 0x00008000
370 1.1 wiz #define METEOR_DEV_SVIDEO 0x00006000
371 1.1 wiz /*
372 1.1 wiz * right now I don't know were to put these, but as they are suppose to be
373 1.1 wiz * a part of a common video capture interface, these should be relocated to
374 1.1 wiz * another place. Probably most of the METEOR_xxx defines need to be
375 1.1 wiz * renamed and moved to a common header
376 1.1 wiz */
377 1.1 wiz
378 1.1 wiz typedef enum { METEOR_PIXTYPE_RGB, METEOR_PIXTYPE_YUV,
379 1.1 wiz METEOR_PIXTYPE_YUV_PACKED,
380 1.1 wiz METEOR_PIXTYPE_YUV_12 } METEOR_PIXTYPE;
381 1.1 wiz
382 1.1 wiz
383 1.1 wiz struct meteor_pixfmt {
384 1.1 wiz u_int index; /* Index in supported pixfmt list */
385 1.1 wiz METEOR_PIXTYPE type; /* What's the board gonna feed us */
386 1.1 wiz u_int Bpp; /* Bytes per pixel */
387 1.1 wiz u_long masks[3]; /* R,G,B or Y,U,V masks, respectively */
388 1.1 wiz unsigned swap_bytes :1; /* Bytes swapped within shorts */
389 1.1 wiz unsigned swap_shorts:1; /* Shorts swapped within longs */
390 1.1 wiz };
391 1.1 wiz
392 1.1 wiz
393 1.1 wiz struct bktr_clip {
394 1.1 wiz int x_min;
395 1.1 wiz int x_max;
396 1.1 wiz int y_min;
397 1.1 wiz int y_max;
398 1.1 wiz };
399 1.1 wiz
400 1.1 wiz #define BT848_MAX_CLIP_NODE 100
401 1.1 wiz struct _bktr_clip {
402 1.1 wiz struct bktr_clip x[BT848_MAX_CLIP_NODE];
403 1.1 wiz };
404 1.1 wiz
405 1.1 wiz /*
406 1.1 wiz * I'm using METEOR_xxx just because that will be common to other interface
407 1.1 wiz * and less of a surprise
408 1.1 wiz */
409 1.1 wiz #define METEORSACTPIXFMT _IOW('x', 64, int )
410 1.1 wiz #define METEORGACTPIXFMT _IOR('x', 64, int )
411 1.1 wiz #define METEORGSUPPIXFMT _IOWR('x', 65, struct meteor_pixfmt)
412 1.1 wiz
413 1.1 wiz /* set clip list */
414 1.1 wiz #define BT848SCLIP _IOW('x', 66, struct _bktr_clip )
415 1.1 wiz #define BT848GCLIP _IOR('x', 66, struct _bktr_clip )
416 1.1 wiz
417 1.1 wiz
418 1.1 wiz /* set input format */
419 1.1 wiz #define BT848SFMT _IOW('x', 67, unsigned long )
420 1.1 wiz #define BT848GFMT _IOR('x', 67, unsigned long )
421 1.1 wiz
422 1.1 wiz /* set clear-buffer-on-start */
423 1.1 wiz #define BT848SCBUF _IOW('x', 68, int)
424 1.1 wiz #define BT848GCBUF _IOR('x', 68, int)
425 1.1 wiz
426 1.1 wiz /* set capture area */
427 1.1 wiz /* The capture area is the area of the video image which is grabbed */
428 1.1 wiz /* Usually the capture area is 640x480 (768x576 PAL) pixels */
429 1.1 wiz /* This area is then scaled to the dimensions the user requires */
430 1.1 wiz /* using the METEORGEO ioctl */
431 1.1 wiz /* However, the capture area could be 400x300 pixels from the top right */
432 1.1 wiz /* corner of the video image */
433 1.1 wiz struct bktr_capture_area {
434 1.1 wiz int x_offset;
435 1.1 wiz int y_offset;
436 1.1 wiz int x_size;
437 1.1 wiz int y_size;
438 1.1 wiz };
439 1.1 wiz #define BT848_SCAPAREA _IOW('x', 69, struct bktr_capture_area)
440 1.1 wiz #define BT848_GCAPAREA _IOR('x', 69, struct bktr_capture_area)
441 1.1 wiz
442 1.1 wiz
443 1.1 wiz /* Get channel Set */
444 1.1 wiz #define BT848_MAX_CHNLSET_NAME_LEN 16
445 1.1 wiz struct bktr_chnlset {
446 1.1 wiz short index;
447 1.1 wiz short max_channel;
448 1.1 wiz char name[BT848_MAX_CHNLSET_NAME_LEN];
449 1.1 wiz };
450 1.1 wiz #define TVTUNER_GETCHNLSET _IOWR('x', 70, struct bktr_chnlset)
451 1.1 wiz
452 1.1 wiz
453 1.1 wiz
454 1.1 wiz /* Infra Red Remote Control */
455 1.1 wiz struct bktr_remote {
456 1.1 wiz unsigned char data[3];
457 1.1 wiz };
458 1.1 wiz #define REMOTE_GETKEY _IOR('x', 71, struct bktr_remote)/*read the remote */
459 1.1 wiz /*control receiver*/
460 1.1 wiz /*returns raw data*/
461 1.1 wiz
462 1.1 wiz
463 1.1 wiz /*
464 1.1 wiz * Direct access to GPIO pins. You must add BKTR_GPIO_ACCESS to your kernel
465 1.1 wiz * configuration file to use these
466 1.1 wiz */
467 1.1 wiz #define BT848_GPIO_SET_EN _IOW('x', 72, int) /* set gpio_out_en */
468 1.1 wiz #define BT848_GPIO_GET_EN _IOR('x', 73, int) /* get gpio_out_en */
469 1.1 wiz #define BT848_GPIO_SET_DATA _IOW('x', 74, int) /* set gpio_data */
470 1.1 wiz #define BT848_GPIO_GET_DATA _IOR('x', 75, int) /* get gpio_data */
471 1.1 wiz
472 1.1 wiz
473 1.1 wiz
474 1.1 wiz /* XXX - Copied from /sys/pci/brktree_reg.h */
475 1.1 wiz #define BT848_IFORM_FORMAT (0x7<<0)
476 1.1 wiz # define BT848_IFORM_F_RSVD (0x7)
477 1.1 wiz # define BT848_IFORM_F_SECAM (0x6)
478 1.1 wiz # define BT848_IFORM_F_PALN (0x5)
479 1.1 wiz # define BT848_IFORM_F_PALM (0x4)
480 1.1 wiz # define BT848_IFORM_F_PALBDGHI (0x3)
481 1.1 wiz # define BT848_IFORM_F_NTSCJ (0x2)
482 1.1 wiz # define BT848_IFORM_F_NTSCM (0x1)
483 1.1 wiz # define BT848_IFORM_F_AUTO (0x0)
484 1.1 wiz
485 1.1 wiz
486 1.1 wiz
487 1.2 wiz #endif /* _DEV_IC_BT8XX_H_ */
488