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