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 40typedef volatile u_int bregister_t; 41/* 42 * if other persuasion endian, then compiler will probably require that 43 * these next 44 * macros be reversed 45 */ 46#define BTBYTE(what) bregister_t what:8; int :24 47#define BTWORD(what) bregister_t what:16; int: 16 48#define BTLONG(what) bregister_t what:32 49 50struct bt848_registers { 51 BTBYTE (dstatus); /* 0, 1,2,3 */ 52#define BT848_DSTATUS_PRES (1<<7) 53#define BT848_DSTATUS_HLOC (1<<6) 54#define BT848_DSTATUS_FIELD (1<<5) 55#define BT848_DSTATUS_NUML (1<<4) 56#define BT848_DSTATUS_CSEL (1<<3) 57#define BT848_DSTATUS_LOF (1<<1) 58#define BT848_DSTATUS_COF (1<<0) 59 BTBYTE (iform); /* 4, 5,6,7 */ 60#define BT848_IFORM_MUXSEL (0x3<<5) 61# define BT848_IFORM_M_MUX1 (0x03<<5) 62# define BT848_IFORM_M_MUX0 (0x02<<5) 63# define BT848_IFORM_M_MUX2 (0x01<<5) 64# define BT848_IFORM_M_RSVD (0x00<<5) 65#define BT848_IFORM_XTSEL (0x3<<3) 66# define BT848_IFORM_X_AUTO (0x03<<3) 67# define BT848_IFORM_X_XT1 (0x02<<3) 68# define BT848_IFORM_X_XT0 (0x01<<3) 69# define BT848_IFORM_X_RSVD (0x00<<3) 70#define BT848_IFORM_FORMAT (0x7<<0) 71# define BT848_IFORM_F_RSVD (0x7) 72# define BT848_IFORM_F_SECAM (0x6) 73# define BT848_IFORM_F_PALN (0x5) 74# define BT848_IFORM_F_PALM (0x4) 75# define BT848_IFORM_F_PALBDGHI (0x3) 76# define BT848_IFORM_F_NTSCJ (0x2) 77# define BT848_IFORM_F_NTSCM (0x1) 78# define BT848_IFORM_F_AUTO (0x0) 79 BTBYTE (tdec); /* 8, 9,a,b */ 80 BTBYTE (e_crop); /* c, d,e,f */ 81 BTBYTE (e_vdelay_lo); /* 10, 11,12,13 */ 82 BTBYTE (e_vactive_lo); /* 14, 15,16,17 */ 83 BTBYTE (e_delay_lo); /* 18, 19,1a,1b */ 84 BTBYTE (e_hactive_lo); /* 1c, 1d,1e,1f */ 85 BTBYTE (e_hscale_hi); /* 20, 21,22,23 */ 86 BTBYTE (e_hscale_lo); /* 24, 25,26,27 */ 87 BTBYTE (bright); /* 28, 29,2a,2b */ 88 BTBYTE (e_control); /* 2c, 2d,2e,2f */ 89#define BT848_E_CONTROL_LNOTCH (1<<7) 90#define BT848_E_CONTROL_COMP (1<<6) 91#define BT848_E_CONTROL_LDEC (1<<5) 92#define BT848_E_CONTROL_CBSENSE (1<<4) 93#define BT848_E_CONTROL_RSVD (1<<3) 94#define BT848_E_CONTROL_CON_MSB (1<<2) 95#define BT848_E_CONTROL_SAT_U_MSB (1<<1) 96#define BT848_E_CONTROL_SAT_V_MSB (1<<0) 97 BTBYTE (contrast_lo); /* 30, 31,32,33 */ 98 BTBYTE (sat_u_lo); /* 34, 35,36,37 */ 99 BTBYTE (sat_v_lo); /* 38, 39,3a,3b */ 100 BTBYTE (hue); /* 3c, 3d,3e,3f */ 101 BTBYTE (e_scloop); /* 40, 41,42,43 */ 102#define BT848_E_SCLOOP_RSVD1 (1<<7) 103#define BT848_E_SCLOOP_CAGC (1<<6) 104#define BT848_E_SCLOOP_CKILL (1<<5) 105#define BT848_E_SCLOOP_HFILT (0x3<<3) 106# define BT848_E_SCLOOP_HFILT_ICON (0x3<<3) 107# define BT848_E_SCLOOP_HFILT_QCIF (0x2<<3) 108# define BT848_E_SCLOOP_HFILT_CIF (0x1<<3) 109# define BT848_E_SCLOOP_HFILT_AUTO (0x0<<3) 110#define BT848_E_SCLOOP_RSVD0 (0x7<<0) 111 int :32; /* 44, 45,46,47 */ 112 BTBYTE (oform); /* 48, 49,4a,4b */ 113 BTBYTE (e_vscale_hi); /* 4c, 4d,4e,4f */ 114 BTBYTE (e_vscale_lo); /* 50, 51,52,53 */ 115 BTBYTE (test); /* 54, 55,56,57 */ 116 int :32; /* 58, 59,5a,5b */ 117 int :32; /* 5c, 5d,5e,5f */ 118 BTLONG (adelay); /* 60, 61,62,63 */ 119 BTBYTE (bdelay); /* 64, 65,66,67 */ 120 BTBYTE (adc); /* 68, 69,6a,6b */ 121#define BT848_ADC_RESERVED (0x80) /* required pattern */ 122#define BT848_ADC_SYNC_T (1<<5) 123#define BT848_ADC_AGC_EN (1<<4) 124#define BT848_ADC_CLK_SLEEP (1<<3) 125#define BT848_ADC_Y_SLEEP (1<<2) 126#define BT848_ADC_C_SLEEP (1<<1) 127#define BT848_ADC_CRUSH (1<<0) 128 BTBYTE (e_vtc); /* 6c, 6d,6e,6f */ 129 int :32; /* 70, 71,72,73 */ 130 int :32; /* 74, 75,76,77 */ 131 int :32; /* 78, 79,7a,7b */ 132 BTLONG (sreset); /* 7c, 7d,7e,7f */ 133 u_char filler[0x8c-0x80]; 134 BTBYTE (o_crop); /* 8c, 8d,8e,8f */ 135 BTBYTE (o_vdelay_lo); /* 90, 91,92,93 */ 136 BTBYTE (o_vactive_lo); /* 94, 95,96,97 */ 137 BTBYTE (o_delay_lo); /* 98, 99,9a,9b */ 138 BTBYTE (o_hactive_lo); /* 9c, 9d,9e,9f */ 139 BTBYTE (o_hscale_hi); /* a0, a1,a2,a3 */ 140 BTBYTE (o_hscale_lo); /* a4, a5,a6,a7 */ 141 int :32; /* a8, a9,aa,ab */ 142 BTBYTE (o_control); /* ac, ad,ae,af */ 143#define BT848_O_CONTROL_LNOTCH (1<<7) 144#define BT848_O_CONTROL_COMP (1<<6) 145#define BT848_O_CONTROL_LDEC (1<<5) 146#define BT848_O_CONTROL_CBSENSE (1<<4) 147#define BT848_O_CONTROL_RSVD (1<<3) 148#define BT848_O_CONTROL_CON_MSB (1<<2) 149#define BT848_O_CONTROL_SAT_U_MSB (1<<1) 150#define BT848_O_CONTROL_SAT_V_MSB (1<<0) 151 u_char fillter1[16]; 152 BTBYTE (o_scloop); /* c0, c1,c2,c3 */ 153#define BT848_O_SCLOOP_RSVD1 (1<<7) 154#define BT848_O_SCLOOP_CAGC (1<<6) 155#define BT848_O_SCLOOP_CKILL (1<<5) 156#define BT848_O_SCLOOP_HFILT (0x3<<3) 157# define BT848_O_SCLOOP_HFILT_ICON (0x3<<3) 158# define BT848_O_SCLOOP_HFILT_QCIF (0x2<<3) 159# define BT848_O_SCLOOP_HFILT_CIF (0x1<<3) 160# define BT848_O_SCLOOP_HFILT_AUTO (0x0<<3) 161#define BT848_O_SCLOOP_RSVD0 (0x7<<0) 162 int :32; /* c4, c5,c6,c7 */ 163 int :32; /* c8, c9,ca,cb */ 164 BTBYTE (o_vscale_hi); /* cc, cd,ce,cf */ 165 BTBYTE (o_vscale_lo); /* d0, d1,d2,d3 */ 166 BTBYTE (color_fmt); /* d4, d5,d6,d7 */ 167 bregister_t color_ctl_swap :4; /* d8 */ 168#define BT848_COLOR_CTL_WSWAP_ODD (1<<3) 169#define BT848_COLOR_CTL_WSWAP_EVEN (1<<2) 170#define BT848_COLOR_CTL_BSWAP_ODD (1<<1) 171#define BT848_COLOR_CTL_BSWAP_EVEN (1<<0) 172 bregister_t color_ctl_gamma :1; 173 bregister_t color_ctl_rgb_ded :1; 174 bregister_t color_ctl_color_bars :1; 175 bregister_t color_ctl_ext_frmrate :1; 176 int :24; /* d9,da,db */ 177 BTBYTE (cap_ctl); /* dc, dd,de,df */ 178#define BT848_CAP_CTL_DITH_FRAME (1<<4) 179#define BT848_CAP_CTL_VBI_ODD (1<<3) 180#define BT848_CAP_CTL_VBI_EVEN (1<<2) 181#define BT848_CAP_CTL_ODD (1<<1) 182#define BT848_CAP_CTL_EVEN (1<<0) 183 BTBYTE (vbi_pack_size); /* e0, e1,e2,e3 */ 184 BTBYTE (vbi_pack_del); /* e4, e5,e6,e7 */ 185 int :32; /* e8, e9,ea,eb */ 186 BTBYTE (o_vtc); /* ec, ed,ee,ef */ 187 u_char filler2[0x100-0xf0]; 188 BTLONG (int_stat); /* 100, 101,102,103 */ 189 BTLONG (int_mask); /* 104, 105,106,107 */ 190#define BT848_INT_RISCS (0xf<<28) 191#define BT848_INT_RISC_EN (1<<27) 192#define BT848_INT_RACK (1<<25) 193#define BT848_INT_FIELD (1<<24) 194#define BT848_INT_MYSTERYBIT (1<<23) 195#define BT848_INT_SCERR (1<<19) 196#define BT848_INT_OCERR (1<<18) 197#define BT848_INT_PABORT (1<<17) 198#define BT848_INT_RIPERR (1<<16) 199#define BT848_INT_PPERR (1<<15) 200#define BT848_INT_FDSR (1<<14) 201#define BT848_INT_FTRGT (1<<13) 202#define BT848_INT_FBUS (1<<12) 203#define BT848_INT_RISCI (1<<11) 204#define BT848_INT_GPINT (1<<9) 205#define BT848_INT_I2CDONE (1<<8) 206#define BT848_INT_RSV1 (1<<7) 207#define BT848_INT_RSV0 (1<<6) 208#define BT848_INT_VPRES (1<<5) 209#define BT848_INT_HLOCK (1<<4) 210#define BT848_INT_OFLOW (1<<3) 211#define BT848_INT_HSYNC (1<<2) 212#define BT848_INT_VSYNC (1<<1) 213#define BT848_INT_FMTCHG (1<<0) 214 int :32; /* 108, 109,10a,10b */ 215 BTWORD (gpio_dma_ctl); /* 10c, 10d,10e,10f */
|