home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / lxapi32.zip / Include / Linux / bt848.h < prev    next >
C/C++ Source or Header  |  2002-04-26  |  12KB  |  359 lines

  1. /* $Id: bt848.h,v 1.2 2002/04/26 23:09:03 smilcke Exp $ */
  2.  
  3. /* 
  4.     bt848.h - Bt848 register offsets
  5.  
  6.     Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
  7.  
  8.     This program is free software; you can redistribute it and/or modify
  9.     it under the terms of the GNU General Public License as published by
  10.     the Free Software Foundation; either version 2 of the License, or
  11.     (at your option) any later version.
  12.  
  13.     This program is distributed in the hope that it will be useful,
  14.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16.     GNU General Public License for more details.
  17.  
  18.     You should have received a copy of the GNU General Public License
  19.     along with this program; if not, write to the Free Software
  20.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21. */
  22.  
  23. #ifndef _BT848_H_
  24. #define _BT848_H_
  25.  
  26. #ifndef PCI_VENDOR_ID_BROOKTREE
  27. #define PCI_VENDOR_ID_BROOKTREE 0x109e 
  28. #endif
  29. #ifndef PCI_DEVICE_ID_BT848
  30. #define PCI_DEVICE_ID_BT848     0x350    
  31. #endif
  32. #ifndef PCI_DEVICE_ID_BT849
  33. #define PCI_DEVICE_ID_BT849     0x351
  34. #endif
  35. #ifndef PCI_DEVICE_ID_BT878
  36. #define PCI_DEVICE_ID_BT878     0x36e
  37. #endif
  38. #ifndef PCI_DEVICE_ID_BT879
  39. #define PCI_DEVICE_ID_BT879     0x36f
  40. #endif
  41.  
  42.  
  43. /* Brooktree 848 registers */
  44.  
  45. #define BT848_DSTATUS          0x000
  46. #define BT848_DSTATUS_PRES     (1<<7)
  47. #define BT848_DSTATUS_HLOC     (1<<6)
  48. #define BT848_DSTATUS_FIELD    (1<<5)
  49. #define BT848_DSTATUS_NUML     (1<<4)
  50. #define BT848_DSTATUS_CSEL     (1<<3)
  51. #define BT848_DSTATUS_PLOCK    (1<<2)
  52. #define BT848_DSTATUS_LOF      (1<<1)
  53. #define BT848_DSTATUS_COF      (1<<0)
  54.  
  55. #define BT848_IFORM            0x004  
  56. #define BT848_IFORM_HACTIVE    (1<<7)
  57. #define BT848_IFORM_MUXSEL     (3<<5)
  58. #define BT848_IFORM_MUX0       (2<<5)
  59. #define BT848_IFORM_MUX1       (3<<5)
  60. #define BT848_IFORM_MUX2       (1<<5)
  61. #define BT848_IFORM_XTSEL      (3<<3)
  62. #define BT848_IFORM_XT0        (1<<3)
  63. #define BT848_IFORM_XT1        (2<<3)
  64. #define BT848_IFORM_XTAUTO     (3<<3)
  65. #define BT848_IFORM_XTBOTH     (3<<3)
  66. #define BT848_IFORM_NTSC       1
  67. #define BT848_IFORM_NTSC_J     2
  68. #define BT848_IFORM_PAL_BDGHI  3
  69. #define BT848_IFORM_PAL_M      4
  70. #define BT848_IFORM_PAL_N      5
  71. #define BT848_IFORM_SECAM      6
  72. #define BT848_IFORM_PAL_NC     7
  73. #define BT848_IFORM_AUTO       0
  74. #define BT848_IFORM_NORM       7
  75.  
  76. #define BT848_TDEC             0x008  
  77. #define BT848_TDEC_DEC_FIELD   (1<<7)
  78. #define BT848_TDEC_FLDALIGN    (1<<6)
  79. #define BT848_TDEC_DEC_RAT     (0x1f)
  80.  
  81. #define BT848_E_CROP           0x00C
  82. #define BT848_O_CROP           0x08C
  83.  
  84. #define BT848_E_VDELAY_LO      0x010
  85. #define BT848_O_VDELAY_LO      0x090
  86.  
  87. #define BT848_E_VACTIVE_LO     0x014
  88. #define BT848_O_VACTIVE_LO     0x094
  89.  
  90. #define BT848_E_HDELAY_LO      0x018
  91. #define BT848_O_HDELAY_LO      0x098
  92.  
  93. #define BT848_E_HACTIVE_LO     0x01C
  94. #define BT848_O_HACTIVE_LO     0x09C
  95.  
  96. #define BT848_E_HSCALE_HI      0x020
  97. #define BT848_O_HSCALE_HI      0x0A0
  98.  
  99. #define BT848_E_HSCALE_LO      0x024
  100. #define BT848_O_HSCALE_LO      0x0A4
  101.  
  102. #define BT848_BRIGHT           0x028
  103.  
  104. #define BT848_E_CONTROL        0x02C
  105. #define BT848_O_CONTROL        0x0AC
  106. #define BT848_CONTROL_LNOTCH    (1<<7)
  107. #define BT848_CONTROL_COMP      (1<<6)
  108. #define BT848_CONTROL_LDEC      (1<<5)
  109. #define BT848_CONTROL_CBSENSE   (1<<4)
  110. #define BT848_CONTROL_CON_MSB   (1<<2)
  111. #define BT848_CONTROL_SAT_U_MSB (1<<1)
  112. #define BT848_CONTROL_SAT_V_MSB (1<<0)
  113.  
  114. #define BT848_CONTRAST_LO      0x030
  115. #define BT848_SAT_U_LO         0x034
  116. #define BT848_SAT_V_LO         0x038
  117. #define BT848_HUE              0x03C
  118.  
  119. #define BT848_E_SCLOOP         0x040
  120. #define BT848_O_SCLOOP         0x0C0
  121. #define BT848_SCLOOP_CAGC       (1<<6)
  122. #define BT848_SCLOOP_CKILL      (1<<5)
  123. #define BT848_SCLOOP_HFILT_AUTO (0<<3)
  124. #define BT848_SCLOOP_HFILT_CIF  (1<<3)
  125. #define BT848_SCLOOP_HFILT_QCIF (2<<3)
  126. #define BT848_SCLOOP_HFILT_ICON (3<<3)
  127.  
  128. #define BT848_SCLOOP_PEAK       (1<<7)
  129. #define BT848_SCLOOP_HFILT_MINP (1<<3)
  130. #define BT848_SCLOOP_HFILT_MEDP (2<<3)
  131. #define BT848_SCLOOP_HFILT_MAXP (3<<3)
  132.  
  133.  
  134. #define BT848_OFORM            0x048
  135. #define BT848_OFORM_RANGE      (1<<7)
  136. #define BT848_OFORM_CORE0      (0<<5)
  137. #define BT848_OFORM_CORE8      (1<<5)
  138. #define BT848_OFORM_CORE16     (2<<5)
  139. #define BT848_OFORM_CORE32     (3<<5)
  140.  
  141. #define BT848_E_VSCALE_HI      0x04C
  142. #define BT848_O_VSCALE_HI      0x0CC
  143. #define BT848_VSCALE_YCOMB     (1<<7)
  144. #define BT848_VSCALE_COMB      (1<<6)
  145. #define BT848_VSCALE_INT       (1<<5)
  146. #define BT848_VSCALE_HI        15
  147.  
  148. #define BT848_E_VSCALE_LO      0x050
  149. #define BT848_O_VSCALE_LO      0x0D0
  150. #define BT848_TEST             0x054
  151. #define BT848_ADELAY           0x060
  152. #define BT848_BDELAY           0x064
  153.  
  154. #define BT848_ADC              0x068
  155. #define BT848_ADC_RESERVED     (2<<6)
  156. #define BT848_ADC_SYNC_T       (1<<5)
  157. #define BT848_ADC_AGC_EN       (1<<4)
  158. #define BT848_ADC_CLK_SLEEP    (1<<3)
  159. #define BT848_ADC_Y_SLEEP      (1<<2)
  160. #define BT848_ADC_C_SLEEP      (1<<1)
  161. #define BT848_ADC_CRUSH        (1<<0)
  162.  
  163. #define BT848_E_VTC            0x06C
  164. #define BT848_O_VTC            0x0EC
  165. #define BT848_VTC_HSFMT        (1<<7)
  166. #define BT848_VTC_VFILT_2TAP   0
  167. #define BT848_VTC_VFILT_3TAP   1
  168. #define BT848_VTC_VFILT_4TAP   2
  169. #define BT848_VTC_VFILT_5TAP   3
  170.  
  171. #define BT848_SRESET           0x07C
  172.  
  173. #define BT848_COLOR_FMT             0x0D4
  174. #define BT848_COLOR_FMT_O_RGB32     (0<<4)
  175. #define BT848_COLOR_FMT_O_RGB24     (1<<4)
  176. #define BT848_COLOR_FMT_O_RGB16     (2<<4)
  177. #define BT848_COLOR_FMT_O_RGB15     (3<<4)
  178. #define BT848_COLOR_FMT_O_YUY2      (4<<4)
  179. #define BT848_COLOR_FMT_O_BtYUV     (5<<4)
  180. #define BT848_COLOR_FMT_O_Y8        (6<<4)
  181. #define BT848_COLOR_FMT_O_RGB8      (7<<4)
  182. #define BT848_COLOR_FMT_O_YCrCb422  (8<<4)
  183. #define BT848_COLOR_FMT_O_YCrCb411  (9<<4)
  184. #define BT848_COLOR_FMT_O_RAW       (14<<4)
  185. #define BT848_COLOR_FMT_E_RGB32     0
  186. #define BT848_COLOR_FMT_E_RGB24     1
  187. #define BT848_COLOR_FMT_E_RGB16     2
  188. #define BT848_COLOR_FMT_E_RGB15     3
  189. #define BT848_COLOR_FMT_E_YUY2      4
  190. #define BT848_COLOR_FMT_E_BtYUV     5
  191. #define BT848_COLOR_FMT_E_Y8        6
  192. #define BT848_COLOR_FMT_E_RGB8      7
  193. #define BT848_COLOR_FMT_E_YCrCb422  8
  194. #define BT848_COLOR_FMT_E_YCrCb411  9
  195. #define BT848_COLOR_FMT_E_RAW       14
  196.  
  197. #define BT848_COLOR_FMT_RGB32       0x00
  198. #define BT848_COLOR_FMT_RGB24       0x11
  199. #define BT848_COLOR_FMT_RGB16       0x22
  200. #define BT848_COLOR_FMT_RGB15       0x33
  201. #define BT848_COLOR_FMT_YUY2        0x44
  202. #define BT848_COLOR_FMT_BtYUV       0x55
  203. #define BT848_COLOR_FMT_Y8          0x66
  204. #define BT848_COLOR_FMT_RGB8        0x77
  205. #define BT848_COLOR_FMT_YCrCb422    0x88
  206. #define BT848_COLOR_FMT_YCrCb411    0x99
  207. #define BT848_COLOR_FMT_RAW         0xee
  208.  
  209. #define BT848_COLOR_CTL                0x0D8
  210. #define BT848_COLOR_CTL_EXT_FRMRATE    (1<<7)
  211. #define BT848_COLOR_CTL_COLOR_BARS     (1<<6)
  212. #define BT848_COLOR_CTL_RGB_DED        (1<<5)
  213. #define BT848_COLOR_CTL_GAMMA          (1<<4)
  214. #define BT848_COLOR_CTL_WSWAP_ODD      (1<<3)
  215. #define BT848_COLOR_CTL_WSWAP_EVEN     (1<<2)
  216. #define BT848_COLOR_CTL_BSWAP_ODD      (1<<1)
  217. #define BT848_COLOR_CTL_BSWAP_EVEN     (1<<0)
  218.  
  219. #define BT848_CAP_CTL                  0x0DC
  220. #define BT848_CAP_CTL_DITH_FRAME       (1<<4)
  221. #define BT848_CAP_CTL_CAPTURE_VBI_ODD  (1<<3)
  222. #define BT848_CAP_CTL_CAPTURE_VBI_EVEN (1<<2)
  223. #define BT848_CAP_CTL_CAPTURE_ODD      (1<<1)
  224. #define BT848_CAP_CTL_CAPTURE_EVEN     (1<<0)
  225.  
  226. #define BT848_VBI_PACK_SIZE    0x0E0
  227.  
  228. #define BT848_VBI_PACK_DEL     0x0E4
  229. #define BT848_VBI_PACK_DEL_VBI_HDELAY 0xfc
  230. #define BT848_VBI_PACK_DEL_EXT_FRAME  2
  231. #define BT848_VBI_PACK_DEL_VBI_PKT_HI 1
  232.  
  233.  
  234. #define BT848_INT_STAT         0x100
  235. #define BT848_INT_MASK         0x104
  236.  
  237. #define BT848_INT_ETBF         (1<<23)
  238.  
  239. #define BT848_INT_RISCS   (0xf<<28)
  240. #define BT848_INT_RISC_EN (1<<27)
  241. #define BT848_INT_RACK    (1<<25)
  242. #define BT848_INT_FIELD   (1<<24)
  243. #define BT848_INT_SCERR   (1<<19)
  244. #define BT848_INT_OCERR   (1<<18)
  245. #define BT848_INT_PABORT  (1<<17)
  246. #define BT848_INT_RIPERR  (1<<16)
  247. #define BT848_INT_PPERR   (1<<15)
  248. #define BT848_INT_FDSR    (1<<14)
  249. #define BT848_INT_FTRGT   (1<<13)
  250. #define BT848_INT_FBUS    (1<<12)
  251. #define BT848_INT_RISCI   (1<<11)
  252. #define BT848_INT_GPINT   (1<<9)
  253. #define BT848_INT_I2CDONE (1<<8)
  254. #define BT848_INT_VPRES   (1<<5)
  255. #define BT848_INT_HLOCK   (1<<4)
  256. #define BT848_INT_OFLOW   (1<<3)
  257. #define BT848_INT_HSYNC   (1<<2)
  258. #define BT848_INT_VSYNC   (1<<1)
  259. #define BT848_INT_FMTCHG  (1<<0)
  260.  
  261.  
  262. #define BT848_GPIO_DMA_CTL             0x10C
  263. #define BT848_GPIO_DMA_CTL_GPINTC      (1<<15)
  264. #define BT848_GPIO_DMA_CTL_GPINTI      (1<<14)
  265. #define BT848_GPIO_DMA_CTL_GPWEC       (1<<13)
  266. #define BT848_GPIO_DMA_CTL_GPIOMODE    (3<<11)
  267. #define BT848_GPIO_DMA_CTL_GPCLKMODE   (1<<10)
  268. #define BT848_GPIO_DMA_CTL_PLTP23_4    (0<<6)
  269. #define BT848_GPIO_DMA_CTL_PLTP23_8    (1<<6)
  270. #define BT848_GPIO_DMA_CTL_PLTP23_16   (2<<6)
  271. #define BT848_GPIO_DMA_CTL_PLTP23_32   (3<<6)
  272. #define BT848_GPIO_DMA_CTL_PLTP1_4     (0<<4)
  273. #define BT848_GPIO_DMA_CTL_PLTP1_8     (1<<4)
  274. #define BT848_GPIO_DMA_CTL_PLTP1_16    (2<<4)
  275. #define BT848_GPIO_DMA_CTL_PLTP1_32    (3<<4)
  276. #define BT848_GPIO_DMA_CTL_PKTP_4      (0<<2)
  277. #define BT848_GPIO_DMA_CTL_PKTP_8      (1<<2)
  278. #define BT848_GPIO_DMA_CTL_PKTP_16     (2<<2)
  279. #define BT848_GPIO_DMA_CTL_PKTP_32     (3<<2)
  280. #define BT848_GPIO_DMA_CTL_RISC_ENABLE (1<<1)
  281. #define BT848_GPIO_DMA_CTL_FIFO_ENABLE (1<<0)
  282.  
  283. #define BT848_I2C              0x110
  284. #define BT848_I2C_DIV          (0xf<<4)
  285. #define BT848_I2C_SYNC         (1<<3)
  286. #define BT848_I2C_W3B           (1<<2)
  287. #define BT848_I2C_SCL          (1<<1)
  288. #define BT848_I2C_SDA          (1<<0)
  289.  
  290.  
  291. #define BT848_RISC_STRT_ADD    0x114
  292. #define BT848_GPIO_OUT_EN      0x118
  293. #define BT848_GPIO_REG_INP     0x11C
  294. #define BT848_RISC_COUNT       0x120
  295. #define BT848_GPIO_DATA        0x200
  296.  
  297.  
  298. /* Bt848 RISC commands */
  299.  
  300. /* only for the SYNC RISC command */
  301. #define BT848_FIFO_STATUS_FM1  0x06
  302. #define BT848_FIFO_STATUS_FM3  0x0e
  303. #define BT848_FIFO_STATUS_SOL  0x02
  304. #define BT848_FIFO_STATUS_EOL4 0x01
  305. #define BT848_FIFO_STATUS_EOL3 0x0d
  306. #define BT848_FIFO_STATUS_EOL2 0x09
  307. #define BT848_FIFO_STATUS_EOL1 0x05
  308. #define BT848_FIFO_STATUS_VRE  0x04
  309. #define BT848_FIFO_STATUS_VRO  0x0c
  310. #define BT848_FIFO_STATUS_PXV  0x00
  311.  
  312. #define BT848_RISC_RESYNC      (1<<15)
  313.  
  314. /* WRITE and SKIP */
  315. /* disable which bytes of each DWORD */
  316. #define BT848_RISC_BYTE0       (1<<12)
  317. #define BT848_RISC_BYTE1       (1<<13)
  318. #define BT848_RISC_BYTE2       (1<<14)
  319. #define BT848_RISC_BYTE3       (1<<15)
  320. #define BT848_RISC_BYTE_ALL    (0x0f<<12)
  321. #define BT848_RISC_BYTE_NONE   0
  322. /* cause RISCI */
  323. #define BT848_RISC_IRQ         (1<<24)
  324. /* RISC command is last one in this line */
  325. #define BT848_RISC_EOL         (1<<26)
  326. /* RISC command is first one in this line */
  327. #define BT848_RISC_SOL         (1<<27)
  328.  
  329. #define BT848_RISC_WRITE       (0x01<<28)
  330. #define BT848_RISC_SKIP        (0x02<<28)
  331. #define BT848_RISC_WRITEC      (0x05<<28)
  332. #define BT848_RISC_JUMP        (0x07<<28)
  333. #define BT848_RISC_SYNC        (0x08<<28)
  334.  
  335. #define BT848_RISC_WRITE123    (0x09<<28)
  336. #define BT848_RISC_SKIP123     (0x0a<<28)
  337. #define BT848_RISC_WRITE1S23   (0x0b<<28)
  338.  
  339.  
  340.  
  341. /* Bt848A and higher only !! */
  342. #define BT848_TGLB             0x080
  343. #define BT848_TGCTRL           0x084
  344. #define BT848_FCAP             0x0E8
  345. #define BT848_PLL_F_LO         0x0F0
  346. #define BT848_PLL_F_HI         0x0F4
  347.  
  348. #define BT848_PLL_XCI          0x0F8
  349. #define BT848_PLL_X            (1<<7)
  350. #define BT848_PLL_C            (1<<6)
  351.  
  352. /* Bt878 register */
  353.  
  354. #define BT878_DEVCTRL 0x40
  355. #define BT878_EN_TBFX 0x02
  356. #define BT878_EN_VSFX 0x04
  357.  
  358. #endif
  359.