1/* 2 * Copyright (c) 1995 Mark Tinguely and Jim Lowe 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by Mark Tinguely and Jim Lowe 16 * 4. The name of the author may not be used to endorse or promote products 17 * derived from this software without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31#ifndef PCI_LATENCY_TIMER 32#define PCI_LATENCY_TIMER 0x0c /* pci timer register */ 33#endif 34 35/* 36 * Definitions for the Philips SAA7116 digital video to pci interface. 37 */ 38#define BROOKTREE_848_ID 0x0350109E 39#define BROOKTREE_849_ID 0x0351109E 40#define BROOKTREE_878_ID 0x036E109E 41#define BROOKTREE_879_ID 0x036F109E 42 43typedef volatile u_int bregister_t; 44/* 45 * if other persuasion endian, then compiler will probably require that 46 * these next 47 * macros be reversed 48 */ 49#define BTBYTE(what) bregister_t what:8; int :24 50#define BTWORD(what) bregister_t what:16; int: 16 51#define BTLONG(what) bregister_t what:32 52 53struct bt848_registers { 54 BTBYTE (dstatus); /* 0, 1,2,3 */ 55#define BT848_DSTATUS_PRES (1<<7) 56#define BT848_DSTATUS_HLOC (1<<6) 57#define BT848_DSTATUS_FIELD (1<<5) 58#define BT848_DSTATUS_NUML (1<<4) 59#define BT848_DSTATUS_CSEL (1<<3) 60#define BT848_DSTATUS_LOF (1<<1) 61#define BT848_DSTATUS_COF (1<<0) 62 BTBYTE (iform); /* 4, 5,6,7 */ 63#define BT848_IFORM_MUXSEL (0x3<<5) 64# define BT848_IFORM_M_MUX1 (0x03<<5) 65# define BT848_IFORM_M_MUX0 (0x02<<5) 66# define BT848_IFORM_M_MUX2 (0x01<<5) 67# define BT848_IFORM_M_MUX3 (0x0) 68# define BT848_IFORM_M_RSVD (0x00<<5) 69#define BT848_IFORM_XTSEL (0x3<<3) 70# define BT848_IFORM_X_AUTO (0x03<<3) 71# define BT848_IFORM_X_XT1 (0x02<<3) 72# define BT848_IFORM_X_XT0 (0x01<<3) 73# define BT848_IFORM_X_RSVD (0x00<<3) 74 BTBYTE (tdec); /* 8, 9,a,b */ 75 BTBYTE (e_crop); /* c, d,e,f */ 76 BTBYTE (e_vdelay_lo); /* 10, 11,12,13 */ 77 BTBYTE (e_vactive_lo); /* 14, 15,16,17 */ 78 BTBYTE (e_delay_lo); /* 18, 19,1a,1b */ 79 BTBYTE (e_hactive_lo); /* 1c, 1d,1e,1f */ 80 BTBYTE (e_hscale_hi); /* 20, 21,22,23 */ 81 BTBYTE (e_hscale_lo); /* 24, 25,26,27 */ 82 BTBYTE (bright); /* 28, 29,2a,2b */ 83 BTBYTE (e_control); /* 2c, 2d,2e,2f */ 84#define BT848_E_CONTROL_LNOTCH (1<<7) 85#define BT848_E_CONTROL_COMP (1<<6) 86#define BT848_E_CONTROL_LDEC (1<<5) 87#define BT848_E_CONTROL_CBSENSE (1<<4) 88#define BT848_E_CONTROL_RSVD (1<<3) 89#define BT848_E_CONTROL_CON_MSB (1<<2) 90#define BT848_E_CONTROL_SAT_U_MSB (1<<1) 91#define BT848_E_CONTROL_SAT_V_MSB (1<<0) 92 BTBYTE (contrast_lo); /* 30, 31,32,33 */ 93 BTBYTE (sat_u_lo); /* 34, 35,36,37 */ 94 BTBYTE (sat_v_lo); /* 38, 39,3a,3b */ 95 BTBYTE (hue); /* 3c, 3d,3e,3f */ 96 BTBYTE (e_scloop); /* 40, 41,42,43 */ 97#define BT848_E_SCLOOP_RSVD1 (1<<7) 98#define BT848_E_SCLOOP_CAGC (1<<6) 99#define BT848_E_SCLOOP_CKILL (1<<5) 100#define BT848_E_SCLOOP_HFILT (0x3<<3) 101# define BT848_E_SCLOOP_HFILT_ICON (0x3<<3) 102# define BT848_E_SCLOOP_HFILT_QCIF (0x2<<3) 103# define BT848_E_SCLOOP_HFILT_CIF (0x1<<3) 104# define BT848_E_SCLOOP_HFILT_AUTO (0x0<<3) 105#define BT848_E_SCLOOP_RSVD0 (0x7<<0) 106 int :32; /* 44, 45,46,47 */ 107 BTBYTE (oform); /* 48, 49,4a,4b */ 108 BTBYTE (e_vscale_hi); /* 4c, 4d,4e,4f */ 109 BTBYTE (e_vscale_lo); /* 50, 51,52,53 */ 110 BTBYTE (test); /* 54, 55,56,57 */ 111 int :32; /* 58, 59,5a,5b */ 112 int :32; /* 5c, 5d,5e,5f */ 113 BTLONG (adelay); /* 60, 61,62,63 */ 114 BTBYTE (bdelay); /* 64, 65,66,67 */ 115 BTBYTE (adc); /* 68, 69,6a,6b */ 116#define BT848_ADC_RESERVED (0x80) /* required pattern */ 117#define BT848_ADC_SYNC_T (1<<5) 118#define BT848_ADC_AGC_EN (1<<4) 119#define BT848_ADC_CLK_SLEEP (1<<3) 120#define BT848_ADC_Y_SLEEP (1<<2) 121#define BT848_ADC_C_SLEEP (1<<1) 122#define BT848_ADC_CRUSH (1<<0) 123 BTBYTE (e_vtc); /* 6c, 6d,6e,6f */ 124 int :32; /* 70, 71,72,73 */ 125 int :32; /* 74, 75,76,77 */ 126 int :32; /* 78, 79,7a,7b */ 127 BTLONG (sreset); /* 7c, 7d,7e,7f */ 128 u_char filler[0x8c-0x80]; 129 BTBYTE (o_crop); /* 8c, 8d,8e,8f */ 130 BTBYTE (o_vdelay_lo); /* 90, 91,92,93 */ 131 BTBYTE (o_vactive_lo); /* 94, 95,96,97 */ 132 BTBYTE (o_delay_lo); /* 98, 99,9a,9b */ 133 BTBYTE (o_hactive_lo); /* 9c, 9d,9e,9f */ 134 BTBYTE (o_hscale_hi); /* a0, a1,a2,a3 */ 135 BTBYTE (o_hscale_lo); /* a4, a5,a6,a7 */ 136 int :32; /* a8, a9,aa,ab */ 137 BTBYTE (o_control); /* ac, ad,ae,af */ 138#define BT848_O_CONTROL_LNOTCH (1<<7) 139#define BT848_O_CONTROL_COMP (1<<6) 140#define BT848_O_CONTROL_LDEC (1<<5) 141#define BT848_O_CONTROL_CBSENSE (1<<4) 142#define BT848_O_CONTROL_RSVD (1<<3) 143#define BT848_O_CONTROL_CON_MSB (1<<2) 144#define BT848_O_CONTROL_SAT_U_MSB (1<<1) 145#define BT848_O_CONTROL_SAT_V_MSB (1<<0) 146 u_char fillter1[16]; 147 BTBYTE (o_scloop); /* c0, c1,c2,c3 */ 148#define BT848_O_SCLOOP_RSVD1 (1<<7) 149#define BT848_O_SCLOOP_CAGC (1<<6) 150#define BT848_O_SCLOOP_CKILL (1<<5) 151#define BT848_O_SCLOOP_HFILT (0x3<<3) 152# define BT848_O_SCLOOP_HFILT_ICON (0x3<<3) 153# define BT848_O_SCLOOP_HFILT_QCIF (0x2<<3) 154# define BT848_O_SCLOOP_HFILT_CIF (0x1<<3) 155# define BT848_O_SCLOOP_HFILT_AUTO (0x0<<3) 156#define BT848_O_SCLOOP_RSVD0 (0x7<<0) 157 int :32; /* c4, c5,c6,c7 */ 158 int :32; /* c8, c9,ca,cb */ 159 BTBYTE (o_vscale_hi); /* cc, cd,ce,cf */ 160 BTBYTE (o_vscale_lo); /* d0, d1,d2,d3 */ 161 BTBYTE (color_fmt); /* d4, d5,d6,d7 */ 162 bregister_t color_ctl_swap :4; /* d8 */ 163#define BT848_COLOR_CTL_WSWAP_ODD (1<<3) 164#define BT848_COLOR_CTL_WSWAP_EVEN (1<<2) 165#define BT848_COLOR_CTL_BSWAP_ODD (1<<1) 166#define BT848_COLOR_CTL_BSWAP_EVEN (1<<0) 167 bregister_t color_ctl_gamma :1; 168 bregister_t color_ctl_rgb_ded :1; 169 bregister_t color_ctl_color_bars :1; 170 bregister_t color_ctl_ext_frmrate :1; 171 int :24; /* d9,da,db */ 172 BTBYTE (cap_ctl); /* dc, dd,de,df */ 173#define BT848_CAP_CTL_DITH_FRAME (1<<4) 174#define BT848_CAP_CTL_VBI_ODD (1<<3) 175#define BT848_CAP_CTL_VBI_EVEN (1<<2) 176#define BT848_CAP_CTL_ODD (1<<1) 177#define BT848_CAP_CTL_EVEN (1<<0) 178 BTBYTE (vbi_pack_size); /* e0, e1,e2,e3 */ 179 BTBYTE (vbi_pack_del); /* e4, e5,e6,e7 */ 180 int :32; /* e8, e9,ea,eb */ 181 BTBYTE (o_vtc); /* ec, ed,ee,ef */ 182 u_char filler2[0x100-0xf0]; 183 BTLONG (int_stat); /* 100, 101,102,103 */ 184 BTLONG (int_mask); /* 104, 105,106,107 */ 185#define BT848_INT_RISCS (0xf<<28) 186#define BT848_INT_RISC_EN (1<<27) 187#define BT848_INT_RACK (1<<25) 188#define BT848_INT_FIELD (1<<24) 189#define BT848_INT_MYSTERYBIT (1<<23) 190#define BT848_INT_SCERR (1<<19) 191#define BT848_INT_OCERR (1<<18) 192#define BT848_INT_PABORT (1<<17) 193#define BT848_INT_RIPERR (1<<16) 194#define BT848_INT_PPERR (1<<15) 195#define BT848_INT_FDSR (1<<14) 196#define BT848_INT_FTRGT (1<<13) 197#define BT848_INT_FBUS (1<<12) 198#define BT848_INT_RISCI (1<<11) 199#define BT848_INT_GPINT (1<<9) 200#define BT848_INT_I2CDONE (1<<8) 201#define BT848_INT_RSV1 (1<<7) 202#define BT848_INT_RSV0 (1<<6) 203#define BT848_INT_VPRES (1<<5) 204#define BT848_INT_HLOCK (1<<4) 205#define BT848_INT_OFLOW (1<<3) 206#define BT848_INT_HSYNC (1<<2) 207#define BT848_INT_VSYNC (1<<1) 208#define BT848_INT_FMTCHG (1<<0) 209 int :32; /* 108, 109,10a,10b */ 210 BTWORD (gpio_dma_ctl); /* 10c, 10d,10e,10f */ 211#define BT848_DMA_CTL_PL23TP4 (0<<6) /* planar1 trigger 4 */ 212#define BT848_DMA_CTL_PL23TP8 (1<<6) /* planar1 trigger 8 */ 213#define BT848_DMA_CTL_PL23TP16 (2<<6) /* planar1 trigger 16 */ 214#define BT848_DMA_CTL_PL23TP32 (3<<6) /* planar1 trigger 32 */ 215#define BT848_DMA_CTL_PL1TP4 (0<<4) /* planar1 trigger 4 */ 216#define BT848_DMA_CTL_PL1TP8 (1<<4) /* planar1 trigger 8 */ 217#define BT848_DMA_CTL_PL1TP16 (2<<4) /* planar1 trigger 16 */ 218#define BT848_DMA_CTL_PL1TP32 (3<<4) /* planar1 trigger 32 */ 219#define BT848_DMA_CTL_PKTP4 (0<<2) /* packed trigger 4 */ 220#define BT848_DMA_CTL_PKTP8 (1<<2) /* packed trigger 8 */ 221#define BT848_DMA_CTL_PKTP16 (2<<2) /* packed trigger 16 */ 222#define BT848_DMA_CTL_PKTP32 (3<<2) /* packed trigger 32 */ 223#define BT848_DMA_CTL_RISC_EN (1<<1) 224#define BT848_DMA_CTL_FIFO_EN (1<<0) 225 BTLONG (i2c_data_ctl); /* 110, 111,112,113 */ 226#define BT848_DATA_CTL_I2CDIV (0xf<<4) 227#define BT848_DATA_CTL_I2CSYNC (1<<3) 228#define BT848_DATA_CTL_I2CW3B (1<<2) 229#define BT848_DATA_CTL_I2CSCL (1<<1) 230#define BT848_DATA_CTL_I2CSDA (1<<0) 231 BTLONG (risc_strt_add); /* 114, 115,116,117 */ 232 BTLONG (gpio_out_en); /* 118, 119,11a,11b */ /* really 24 bits */ 233 BTLONG (gpio_reg_inp); /* 11c, 11d,11e,11f */ /* really 24 bits */ 234 BTLONG (risc_count); /* 120, 121,122,123 */ 235 u_char filler3[0x200-0x124]; 236 BTLONG (gpio_data); /* 200, 201,202,203 */ /* really 24 bits */ 237}; 238 239typedef volatile struct bt848_registers* bt848_ptr_t; 240 241 242#if 0 243/* force people to be aware of the new struct */ 244 245#define BKTR_DSTATUS 0x000 246#define BKTR_IFORM 0x004 247#define BKTR_TDEC 0x008 248#define BKTR_EVEN_CROP 0x00C 249#define BKTR_ODD_CROP 0x08C 250#define BKTR_E_VDELAY_LO 0x010 251#define BKTR_O_VDELAY_LO 0x090 252#define BKTR_E_VACTIVE_LO 0x014 253#define BKTR_O_VACTIVE_LO 0x094 254#define BKTR_E_DELAY_LO 0x018 255#define BKTR_O_DELAY_LO 0x098 256#define BKTR_E_HACTIVE_LO 0x01C 257#define BKTR_O_HACTIVE_LO 0x09C 258#define BKTR_E_HSCALE_HI 0x020 259#define BKTR_O_HSCALE_HI 0x0A0 260#define BKTR_E_HSCALE_LO 0x024 261#define BKTR_O_HSCALE_LO 0x0A4 262#define BKTR_BRIGHT 0x028 263#define BKTR_E_CONTROL 0x02C 264#define BKTR_O_CONTROL 0x0AC 265#define BKTR_CONTRAST_LO 0x030 266#define BKTR_SAT_U_LO 0x034 267#define BKTR_SAT_V_LO 0x038 268#define BKTR_HUE 0x03C 269#define BKTR_E_SCLOOP 0x040 270#define BKTR_O_SCLOOP 0x0C0 271#define BKTR_OFORM 0x048 272#define BKTR_E_VSCALE_HI 0x04C 273#define BKTR_O_VSCALE_HI 0x0CC 274#define BKTR_E_VSCALE_LO 0x050 275#define BKTR_O_VSCALE_LO 0x0D0 276#define BKTR_TEST 0x054 277#define BKTR_ADELAY 0x060 278#define BKTR_BDELAY 0x064 279#define BKTR_ADC 0x068 280#define BKTR_E_VTC 0x06C 281#define BKTR_O_VTC 0x0EC 282#define BKTR_SRESET 0x07C 283#define BKTR_COLOR_FMT 0x0D4 284#define BKTR_COLOR_CTL 0x0D8 285#define BKTR_CAP_CTL 0x0DC 286#define BKTR_VBI_PACK_SIZE 0x0E0 287#define BKTR_VBI_PACK_DEL 0x0E4 288#define BKTR_INT_STAT 0x100 289#define BKTR_INT_MASK 0x104 290#define BKTR_RISC_COUNT 0x120 291#define BKTR_RISC_STRT_ADD 0x114 292#define BKTR_GPIO_DMA_CTL 0x10C 293#define BKTR_GPIO_OUT_EN 0x118 294#define BKTR_GPIO_REG_INP 0x11C 295#define BKTR_GPIO_DATA 0x200 296#define BKTR_I2C_CONTROL 0x110 297 298#endif /* 0 */ 299 300/* 301 * device support for onboard tv tuners 302 */ 303 304/* description of the LOGICAL tuner */ 305struct TVTUNER { 306 int frequency; 307 u_char chnlset; 308 u_char channel; 309 u_char band; 310 u_char afc; 311 u_char radio_mode; /* current mode of the radio mode */ 312}; 313 314/* description of the PHYSICAL tuner */ 315struct TUNER { 316 char* name; 317 u_char type; 318 u_char pllAddr; 319 u_char pllControl[4]; 320 u_char bandLimits[ 2 ]; 321 u_char bandAddrs[ 4 ]; /* 3 first for the 3 TV 322 ** bands. Last for radio 323 ** band (0x00=NoRadio). 324 */ 325 326}; 327 328/* description of the card */ 329#define EEPROMBLOCKSIZE 32 330struct CARDTYPE { 331 char* name; 332 const struct TUNER* tuner; 333 u_char dbx; /* Has DBX chip? */ 334 u_char msp3400c; /* Has msp3400c chip? */ 335 u_char eepromAddr; 336 u_char eepromSize; /* bytes / EEPROMBLOCKSIZE */ 337 u_char audiomuxs[ 5 ]; /* tuner, ext, int/unused, 338 mute, present */ 339}; 340 341struct format_params { 342 /* Total lines, lines before image, image lines */ 343 int vtotal, vdelay, vactive; 344 /* Total unscaled horizontal pixels, pixels before image, image pixels */ 345 int htotal, hdelay, hactive;
| 1/* 2 * Copyright (c) 1995 Mark Tinguely and Jim Lowe 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. All advertising materials mentioning features or use of this software 14 * must display the following acknowledgement: 15 * This product includes software developed by Mark Tinguely and Jim Lowe 16 * 4. The name of the author may not be used to endorse or promote products 17 * derived from this software without specific prior written permission. 18 * 19 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 20 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 21 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 22 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, 23 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 25 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 27 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN 28 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 * POSSIBILITY OF SUCH DAMAGE. 30 */ 31#ifndef PCI_LATENCY_TIMER 32#define PCI_LATENCY_TIMER 0x0c /* pci timer register */ 33#endif 34 35/* 36 * Definitions for the Philips SAA7116 digital video to pci interface. 37 */ 38#define BROOKTREE_848_ID 0x0350109E 39#define BROOKTREE_849_ID 0x0351109E 40#define BROOKTREE_878_ID 0x036E109E 41#define BROOKTREE_879_ID 0x036F109E 42 43typedef volatile u_int bregister_t; 44/* 45 * if other persuasion endian, then compiler will probably require that 46 * these next 47 * macros be reversed 48 */ 49#define BTBYTE(what) bregister_t what:8; int :24 50#define BTWORD(what) bregister_t what:16; int: 16 51#define BTLONG(what) bregister_t what:32 52 53struct bt848_registers { 54 BTBYTE (dstatus); /* 0, 1,2,3 */ 55#define BT848_DSTATUS_PRES (1<<7) 56#define BT848_DSTATUS_HLOC (1<<6) 57#define BT848_DSTATUS_FIELD (1<<5) 58#define BT848_DSTATUS_NUML (1<<4) 59#define BT848_DSTATUS_CSEL (1<<3) 60#define BT848_DSTATUS_LOF (1<<1) 61#define BT848_DSTATUS_COF (1<<0) 62 BTBYTE (iform); /* 4, 5,6,7 */ 63#define BT848_IFORM_MUXSEL (0x3<<5) 64# define BT848_IFORM_M_MUX1 (0x03<<5) 65# define BT848_IFORM_M_MUX0 (0x02<<5) 66# define BT848_IFORM_M_MUX2 (0x01<<5) 67# define BT848_IFORM_M_MUX3 (0x0) 68# define BT848_IFORM_M_RSVD (0x00<<5) 69#define BT848_IFORM_XTSEL (0x3<<3) 70# define BT848_IFORM_X_AUTO (0x03<<3) 71# define BT848_IFORM_X_XT1 (0x02<<3) 72# define BT848_IFORM_X_XT0 (0x01<<3) 73# define BT848_IFORM_X_RSVD (0x00<<3) 74 BTBYTE (tdec); /* 8, 9,a,b */ 75 BTBYTE (e_crop); /* c, d,e,f */ 76 BTBYTE (e_vdelay_lo); /* 10, 11,12,13 */ 77 BTBYTE (e_vactive_lo); /* 14, 15,16,17 */ 78 BTBYTE (e_delay_lo); /* 18, 19,1a,1b */ 79 BTBYTE (e_hactive_lo); /* 1c, 1d,1e,1f */ 80 BTBYTE (e_hscale_hi); /* 20, 21,22,23 */ 81 BTBYTE (e_hscale_lo); /* 24, 25,26,27 */ 82 BTBYTE (bright); /* 28, 29,2a,2b */ 83 BTBYTE (e_control); /* 2c, 2d,2e,2f */ 84#define BT848_E_CONTROL_LNOTCH (1<<7) 85#define BT848_E_CONTROL_COMP (1<<6) 86#define BT848_E_CONTROL_LDEC (1<<5) 87#define BT848_E_CONTROL_CBSENSE (1<<4) 88#define BT848_E_CONTROL_RSVD (1<<3) 89#define BT848_E_CONTROL_CON_MSB (1<<2) 90#define BT848_E_CONTROL_SAT_U_MSB (1<<1) 91#define BT848_E_CONTROL_SAT_V_MSB (1<<0) 92 BTBYTE (contrast_lo); /* 30, 31,32,33 */ 93 BTBYTE (sat_u_lo); /* 34, 35,36,37 */ 94 BTBYTE (sat_v_lo); /* 38, 39,3a,3b */ 95 BTBYTE (hue); /* 3c, 3d,3e,3f */ 96 BTBYTE (e_scloop); /* 40, 41,42,43 */ 97#define BT848_E_SCLOOP_RSVD1 (1<<7) 98#define BT848_E_SCLOOP_CAGC (1<<6) 99#define BT848_E_SCLOOP_CKILL (1<<5) 100#define BT848_E_SCLOOP_HFILT (0x3<<3) 101# define BT848_E_SCLOOP_HFILT_ICON (0x3<<3) 102# define BT848_E_SCLOOP_HFILT_QCIF (0x2<<3) 103# define BT848_E_SCLOOP_HFILT_CIF (0x1<<3) 104# define BT848_E_SCLOOP_HFILT_AUTO (0x0<<3) 105#define BT848_E_SCLOOP_RSVD0 (0x7<<0) 106 int :32; /* 44, 45,46,47 */ 107 BTBYTE (oform); /* 48, 49,4a,4b */ 108 BTBYTE (e_vscale_hi); /* 4c, 4d,4e,4f */ 109 BTBYTE (e_vscale_lo); /* 50, 51,52,53 */ 110 BTBYTE (test); /* 54, 55,56,57 */ 111 int :32; /* 58, 59,5a,5b */ 112 int :32; /* 5c, 5d,5e,5f */ 113 BTLONG (adelay); /* 60, 61,62,63 */ 114 BTBYTE (bdelay); /* 64, 65,66,67 */ 115 BTBYTE (adc); /* 68, 69,6a,6b */ 116#define BT848_ADC_RESERVED (0x80) /* required pattern */ 117#define BT848_ADC_SYNC_T (1<<5) 118#define BT848_ADC_AGC_EN (1<<4) 119#define BT848_ADC_CLK_SLEEP (1<<3) 120#define BT848_ADC_Y_SLEEP (1<<2) 121#define BT848_ADC_C_SLEEP (1<<1) 122#define BT848_ADC_CRUSH (1<<0) 123 BTBYTE (e_vtc); /* 6c, 6d,6e,6f */ 124 int :32; /* 70, 71,72,73 */ 125 int :32; /* 74, 75,76,77 */ 126 int :32; /* 78, 79,7a,7b */ 127 BTLONG (sreset); /* 7c, 7d,7e,7f */ 128 u_char filler[0x8c-0x80]; 129 BTBYTE (o_crop); /* 8c, 8d,8e,8f */ 130 BTBYTE (o_vdelay_lo); /* 90, 91,92,93 */ 131 BTBYTE (o_vactive_lo); /* 94, 95,96,97 */ 132 BTBYTE (o_delay_lo); /* 98, 99,9a,9b */ 133 BTBYTE (o_hactive_lo); /* 9c, 9d,9e,9f */ 134 BTBYTE (o_hscale_hi); /* a0, a1,a2,a3 */ 135 BTBYTE (o_hscale_lo); /* a4, a5,a6,a7 */ 136 int :32; /* a8, a9,aa,ab */ 137 BTBYTE (o_control); /* ac, ad,ae,af */ 138#define BT848_O_CONTROL_LNOTCH (1<<7) 139#define BT848_O_CONTROL_COMP (1<<6) 140#define BT848_O_CONTROL_LDEC (1<<5) 141#define BT848_O_CONTROL_CBSENSE (1<<4) 142#define BT848_O_CONTROL_RSVD (1<<3) 143#define BT848_O_CONTROL_CON_MSB (1<<2) 144#define BT848_O_CONTROL_SAT_U_MSB (1<<1) 145#define BT848_O_CONTROL_SAT_V_MSB (1<<0) 146 u_char fillter1[16]; 147 BTBYTE (o_scloop); /* c0, c1,c2,c3 */ 148#define BT848_O_SCLOOP_RSVD1 (1<<7) 149#define BT848_O_SCLOOP_CAGC (1<<6) 150#define BT848_O_SCLOOP_CKILL (1<<5) 151#define BT848_O_SCLOOP_HFILT (0x3<<3) 152# define BT848_O_SCLOOP_HFILT_ICON (0x3<<3) 153# define BT848_O_SCLOOP_HFILT_QCIF (0x2<<3) 154# define BT848_O_SCLOOP_HFILT_CIF (0x1<<3) 155# define BT848_O_SCLOOP_HFILT_AUTO (0x0<<3) 156#define BT848_O_SCLOOP_RSVD0 (0x7<<0) 157 int :32; /* c4, c5,c6,c7 */ 158 int :32; /* c8, c9,ca,cb */ 159 BTBYTE (o_vscale_hi); /* cc, cd,ce,cf */ 160 BTBYTE (o_vscale_lo); /* d0, d1,d2,d3 */ 161 BTBYTE (color_fmt); /* d4, d5,d6,d7 */ 162 bregister_t color_ctl_swap :4; /* d8 */ 163#define BT848_COLOR_CTL_WSWAP_ODD (1<<3) 164#define BT848_COLOR_CTL_WSWAP_EVEN (1<<2) 165#define BT848_COLOR_CTL_BSWAP_ODD (1<<1) 166#define BT848_COLOR_CTL_BSWAP_EVEN (1<<0) 167 bregister_t color_ctl_gamma :1; 168 bregister_t color_ctl_rgb_ded :1; 169 bregister_t color_ctl_color_bars :1; 170 bregister_t color_ctl_ext_frmrate :1; 171 int :24; /* d9,da,db */ 172 BTBYTE (cap_ctl); /* dc, dd,de,df */ 173#define BT848_CAP_CTL_DITH_FRAME (1<<4) 174#define BT848_CAP_CTL_VBI_ODD (1<<3) 175#define BT848_CAP_CTL_VBI_EVEN (1<<2) 176#define BT848_CAP_CTL_ODD (1<<1) 177#define BT848_CAP_CTL_EVEN (1<<0) 178 BTBYTE (vbi_pack_size); /* e0, e1,e2,e3 */ 179 BTBYTE (vbi_pack_del); /* e4, e5,e6,e7 */ 180 int :32; /* e8, e9,ea,eb */ 181 BTBYTE (o_vtc); /* ec, ed,ee,ef */ 182 u_char filler2[0x100-0xf0]; 183 BTLONG (int_stat); /* 100, 101,102,103 */ 184 BTLONG (int_mask); /* 104, 105,106,107 */ 185#define BT848_INT_RISCS (0xf<<28) 186#define BT848_INT_RISC_EN (1<<27) 187#define BT848_INT_RACK (1<<25) 188#define BT848_INT_FIELD (1<<24) 189#define BT848_INT_MYSTERYBIT (1<<23) 190#define BT848_INT_SCERR (1<<19) 191#define BT848_INT_OCERR (1<<18) 192#define BT848_INT_PABORT (1<<17) 193#define BT848_INT_RIPERR (1<<16) 194#define BT848_INT_PPERR (1<<15) 195#define BT848_INT_FDSR (1<<14) 196#define BT848_INT_FTRGT (1<<13) 197#define BT848_INT_FBUS (1<<12) 198#define BT848_INT_RISCI (1<<11) 199#define BT848_INT_GPINT (1<<9) 200#define BT848_INT_I2CDONE (1<<8) 201#define BT848_INT_RSV1 (1<<7) 202#define BT848_INT_RSV0 (1<<6) 203#define BT848_INT_VPRES (1<<5) 204#define BT848_INT_HLOCK (1<<4) 205#define BT848_INT_OFLOW (1<<3) 206#define BT848_INT_HSYNC (1<<2) 207#define BT848_INT_VSYNC (1<<1) 208#define BT848_INT_FMTCHG (1<<0) 209 int :32; /* 108, 109,10a,10b */ 210 BTWORD (gpio_dma_ctl); /* 10c, 10d,10e,10f */ 211#define BT848_DMA_CTL_PL23TP4 (0<<6) /* planar1 trigger 4 */ 212#define BT848_DMA_CTL_PL23TP8 (1<<6) /* planar1 trigger 8 */ 213#define BT848_DMA_CTL_PL23TP16 (2<<6) /* planar1 trigger 16 */ 214#define BT848_DMA_CTL_PL23TP32 (3<<6) /* planar1 trigger 32 */ 215#define BT848_DMA_CTL_PL1TP4 (0<<4) /* planar1 trigger 4 */ 216#define BT848_DMA_CTL_PL1TP8 (1<<4) /* planar1 trigger 8 */ 217#define BT848_DMA_CTL_PL1TP16 (2<<4) /* planar1 trigger 16 */ 218#define BT848_DMA_CTL_PL1TP32 (3<<4) /* planar1 trigger 32 */ 219#define BT848_DMA_CTL_PKTP4 (0<<2) /* packed trigger 4 */ 220#define BT848_DMA_CTL_PKTP8 (1<<2) /* packed trigger 8 */ 221#define BT848_DMA_CTL_PKTP16 (2<<2) /* packed trigger 16 */ 222#define BT848_DMA_CTL_PKTP32 (3<<2) /* packed trigger 32 */ 223#define BT848_DMA_CTL_RISC_EN (1<<1) 224#define BT848_DMA_CTL_FIFO_EN (1<<0) 225 BTLONG (i2c_data_ctl); /* 110, 111,112,113 */ 226#define BT848_DATA_CTL_I2CDIV (0xf<<4) 227#define BT848_DATA_CTL_I2CSYNC (1<<3) 228#define BT848_DATA_CTL_I2CW3B (1<<2) 229#define BT848_DATA_CTL_I2CSCL (1<<1) 230#define BT848_DATA_CTL_I2CSDA (1<<0) 231 BTLONG (risc_strt_add); /* 114, 115,116,117 */ 232 BTLONG (gpio_out_en); /* 118, 119,11a,11b */ /* really 24 bits */ 233 BTLONG (gpio_reg_inp); /* 11c, 11d,11e,11f */ /* really 24 bits */ 234 BTLONG (risc_count); /* 120, 121,122,123 */ 235 u_char filler3[0x200-0x124]; 236 BTLONG (gpio_data); /* 200, 201,202,203 */ /* really 24 bits */ 237}; 238 239typedef volatile struct bt848_registers* bt848_ptr_t; 240 241 242#if 0 243/* force people to be aware of the new struct */ 244 245#define BKTR_DSTATUS 0x000 246#define BKTR_IFORM 0x004 247#define BKTR_TDEC 0x008 248#define BKTR_EVEN_CROP 0x00C 249#define BKTR_ODD_CROP 0x08C 250#define BKTR_E_VDELAY_LO 0x010 251#define BKTR_O_VDELAY_LO 0x090 252#define BKTR_E_VACTIVE_LO 0x014 253#define BKTR_O_VACTIVE_LO 0x094 254#define BKTR_E_DELAY_LO 0x018 255#define BKTR_O_DELAY_LO 0x098 256#define BKTR_E_HACTIVE_LO 0x01C 257#define BKTR_O_HACTIVE_LO 0x09C 258#define BKTR_E_HSCALE_HI 0x020 259#define BKTR_O_HSCALE_HI 0x0A0 260#define BKTR_E_HSCALE_LO 0x024 261#define BKTR_O_HSCALE_LO 0x0A4 262#define BKTR_BRIGHT 0x028 263#define BKTR_E_CONTROL 0x02C 264#define BKTR_O_CONTROL 0x0AC 265#define BKTR_CONTRAST_LO 0x030 266#define BKTR_SAT_U_LO 0x034 267#define BKTR_SAT_V_LO 0x038 268#define BKTR_HUE 0x03C 269#define BKTR_E_SCLOOP 0x040 270#define BKTR_O_SCLOOP 0x0C0 271#define BKTR_OFORM 0x048 272#define BKTR_E_VSCALE_HI 0x04C 273#define BKTR_O_VSCALE_HI 0x0CC 274#define BKTR_E_VSCALE_LO 0x050 275#define BKTR_O_VSCALE_LO 0x0D0 276#define BKTR_TEST 0x054 277#define BKTR_ADELAY 0x060 278#define BKTR_BDELAY 0x064 279#define BKTR_ADC 0x068 280#define BKTR_E_VTC 0x06C 281#define BKTR_O_VTC 0x0EC 282#define BKTR_SRESET 0x07C 283#define BKTR_COLOR_FMT 0x0D4 284#define BKTR_COLOR_CTL 0x0D8 285#define BKTR_CAP_CTL 0x0DC 286#define BKTR_VBI_PACK_SIZE 0x0E0 287#define BKTR_VBI_PACK_DEL 0x0E4 288#define BKTR_INT_STAT 0x100 289#define BKTR_INT_MASK 0x104 290#define BKTR_RISC_COUNT 0x120 291#define BKTR_RISC_STRT_ADD 0x114 292#define BKTR_GPIO_DMA_CTL 0x10C 293#define BKTR_GPIO_OUT_EN 0x118 294#define BKTR_GPIO_REG_INP 0x11C 295#define BKTR_GPIO_DATA 0x200 296#define BKTR_I2C_CONTROL 0x110 297 298#endif /* 0 */ 299 300/* 301 * device support for onboard tv tuners 302 */ 303 304/* description of the LOGICAL tuner */ 305struct TVTUNER { 306 int frequency; 307 u_char chnlset; 308 u_char channel; 309 u_char band; 310 u_char afc; 311 u_char radio_mode; /* current mode of the radio mode */ 312}; 313 314/* description of the PHYSICAL tuner */ 315struct TUNER { 316 char* name; 317 u_char type; 318 u_char pllAddr; 319 u_char pllControl[4]; 320 u_char bandLimits[ 2 ]; 321 u_char bandAddrs[ 4 ]; /* 3 first for the 3 TV 322 ** bands. Last for radio 323 ** band (0x00=NoRadio). 324 */ 325 326}; 327 328/* description of the card */ 329#define EEPROMBLOCKSIZE 32 330struct CARDTYPE { 331 char* name; 332 const struct TUNER* tuner; 333 u_char dbx; /* Has DBX chip? */ 334 u_char msp3400c; /* Has msp3400c chip? */ 335 u_char eepromAddr; 336 u_char eepromSize; /* bytes / EEPROMBLOCKSIZE */ 337 u_char audiomuxs[ 5 ]; /* tuner, ext, int/unused, 338 mute, present */ 339}; 340 341struct format_params { 342 /* Total lines, lines before image, image lines */ 343 int vtotal, vdelay, vactive; 344 /* Total unscaled horizontal pixels, pixels before image, image pixels */ 345 int htotal, hdelay, hactive;
|