2 * ngene.h: nGene PCIe bridge driver
4 * Copyright (C) 2005-2007 Micronas
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * version 2 only, as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 * Or, point your browser to http://www.gnu.org/copyleft/gpl.html
27 #include <linux/types.h>
28 #include <linux/sched.h>
29 #include <linux/interrupt.h>
30 #include <linux/i2c.h>
32 #include <linux/scatterlist.h>
34 #include <linux/dvb/frontend.h>
38 #include "dvb_demux.h"
39 #include "dvb_frontend.h"
40 #include "dvb_ringbuffer.h"
42 #define NGENE_VID 0x18c3
43 #define NGENE_PID 0x0720
46 #define VIDEO_CAP_AVC 128
47 #define VIDEO_CAP_H264 128
48 #define VIDEO_CAP_VC1 256
49 #define VIDEO_CAP_WMV9 256
50 #define VIDEO_CAP_MPEG4 512
54 STREAM_VIDEOIN1
= 0, /* ITU656 or TS Input */
56 STREAM_AUDIOIN1
, /* I2S or SPI Input */
63 SMODE_AUDIO_SPDIF
= 0x20,
65 SMODE_TRANSPORT_STREAM
= 0x08,
66 SMODE_AUDIO_CAPTURE
= 0x04,
67 SMODE_VBI_CAPTURE
= 0x02,
68 SMODE_VIDEO_CAPTURE
= 0x01
71 enum STREAM_FLAG_BITS
{
72 SFLAG_CHROMA_FORMAT_2COMP
= 0x01, /* Chroma Format : 2's complement */
73 SFLAG_CHROMA_FORMAT_OFFSET
= 0x00, /* Chroma Format : Binary offset */
74 SFLAG_ORDER_LUMA_CHROMA
= 0x02, /* Byte order: Y,Cb,Y,Cr */
75 SFLAG_ORDER_CHROMA_LUMA
= 0x00, /* Byte order: Cb,Y,Cr,Y */
76 SFLAG_COLORBAR
= 0x04, /* Select colorbar */
79 #define PROGRAM_ROM 0x0000
80 #define PROGRAM_SRAM 0x1000
81 #define PERIPHERALS0 0x8000
82 #define PERIPHERALS1 0x9000
83 #define SHARED_BUFFER 0xC000
85 #define HOST_TO_NGENE (SHARED_BUFFER+0x0000)
86 #define NGENE_TO_HOST (SHARED_BUFFER+0x0100)
87 #define NGENE_COMMAND (SHARED_BUFFER+0x0200)
88 #define NGENE_COMMAND_HI (SHARED_BUFFER+0x0204)
89 #define NGENE_STATUS (SHARED_BUFFER+0x0208)
90 #define NGENE_STATUS_HI (SHARED_BUFFER+0x020C)
91 #define NGENE_EVENT (SHARED_BUFFER+0x0210)
92 #define NGENE_EVENT_HI (SHARED_BUFFER+0x0214)
93 #define VARIABLES (SHARED_BUFFER+0x0210)
95 #define NGENE_INT_COUNTS (SHARED_BUFFER+0x0260)
96 #define NGENE_INT_ENABLE (SHARED_BUFFER+0x0264)
97 #define NGENE_VBI_LINE_COUNT (SHARED_BUFFER+0x0268)
99 #define BUFFER_GP_XMIT (SHARED_BUFFER+0x0800)
100 #define BUFFER_GP_RECV (SHARED_BUFFER+0x0900)
101 #define EEPROM_AREA (SHARED_BUFFER+0x0A00)
103 #define SG_V_IN_1 (SHARED_BUFFER+0x0A80)
104 #define SG_VBI_1 (SHARED_BUFFER+0x0B00)
105 #define SG_A_IN_1 (SHARED_BUFFER+0x0B80)
106 #define SG_V_IN_2 (SHARED_BUFFER+0x0C00)
107 #define SG_VBI_2 (SHARED_BUFFER+0x0C80)
108 #define SG_A_IN_2 (SHARED_BUFFER+0x0D00)
109 #define SG_V_OUT (SHARED_BUFFER+0x0D80)
110 #define SG_A_OUT2 (SHARED_BUFFER+0x0E00)
112 #define DATA_A_IN_1 (SHARED_BUFFER+0x0E80)
113 #define DATA_A_IN_2 (SHARED_BUFFER+0x0F00)
114 #define DATA_A_OUT (SHARED_BUFFER+0x0F80)
115 #define DATA_V_IN_1 (SHARED_BUFFER+0x1000)
116 #define DATA_V_IN_2 (SHARED_BUFFER+0x2000)
117 #define DATA_V_OUT (SHARED_BUFFER+0x3000)
119 #define DATA_FIFO_AREA (SHARED_BUFFER+0x1000)
121 #define TIMESTAMPS 0xA000
122 #define SCRATCHPAD 0xA080
123 #define FORCE_INT 0xA088
124 #define FORCE_NMI 0xA090
125 #define INT_STATUS 0xA0A0
127 #define DEV_VER 0x9004
129 #define FW_DEBUG_DEFAULT (PROGRAM_SRAM+0x00FF)
137 } __attribute__ ((__packed__
));
139 struct SHARED_MEMORY
{
152 u8 pad1
[0xc260 - 0xc218];
159 u8 pad2
[0xd000 - 0xc268];
161 } __attribute__ ((__packed__
));
163 struct BUFFER_STREAM_RESULTS
{
164 u32 Clock
; /* Stream time in 100ns units */
165 u16 RemainingLines
; /* Remaining lines in this field.
166 0 for complete field */
167 u8 FieldCount
; /* Video field number */
168 u8 Flags
; /* Bit 7 = Done, Bit 6 = seen, Bit 5 = overflow,
170 u16 BlockCount
; /* Audio block count (unused) */
173 } __attribute__ ((__packed__
));
175 struct HW_SCATTER_GATHER_ELEMENT
{
179 } __attribute__ ((__packed__
));
181 struct BUFFER_HEADER
{
183 struct BUFFER_STREAM_RESULTS SR
;
185 u32 Number_of_entries_1
;
187 u64 Address_of_first_entry_1
;
189 u32 Number_of_entries_2
;
191 u64 Address_of_first_entry_2
;
192 } __attribute__ ((__packed__
));
194 struct EVENT_BUFFER
{
201 } __attribute__ ((__packed__
));
203 /* Firmware commands. */
207 CMD_FWLOAD_PREPARE
= 0x01,
208 CMD_FWLOAD_FINISH
= 0x02,
210 CMD_I2C_WRITE
= 0x04,
212 CMD_I2C_WRITE_NOSTOP
= 0x05,
213 CMD_I2C_CONTINUE_WRITE
= 0x06,
214 CMD_I2C_CONTINUE_WRITE_NOSTOP
= 0x07,
216 CMD_DEBUG_OUTPUT
= 0x09,
219 CMD_CONFIGURE_BUFFER
= 0x11,
220 CMD_CONFIGURE_FREE_BUFFER
= 0x12,
223 CMD_SPI_WRITE
= 0x14,
226 CMD_MEM_WRITE
= 0x21,
228 CMD_SFR_WRITE
= 0x23,
229 CMD_IRAM_READ
= 0x24,
230 CMD_IRAM_WRITE
= 0x25,
231 CMD_SET_GPIO_PIN
= 0x26,
232 CMD_SET_GPIO_INT
= 0x27,
233 CMD_CONFIGURE_UART
= 0x28,
234 CMD_WRITE_UART
= 0x29,
246 } __attribute__ ((__packed__
));
248 struct FW_I2C_WRITE
{
249 struct FW_HEADER hdr
;
252 } __attribute__ ((__packed__
));
254 struct FW_I2C_CONTINUE_WRITE
{
255 struct FW_HEADER hdr
;
257 } __attribute__ ((__packed__
));
260 struct FW_HEADER hdr
;
262 u8 Data
[252]; /* followed by two bytes of read data count */
263 } __attribute__ ((__packed__
));
265 struct FW_SPI_WRITE
{
266 struct FW_HEADER hdr
;
269 } __attribute__ ((__packed__
));
272 struct FW_HEADER hdr
;
274 u8 Data
[252]; /* followed by two bytes of read data count */
275 } __attribute__ ((__packed__
));
277 struct FW_FWLOAD_PREPARE
{
278 struct FW_HEADER hdr
;
279 } __attribute__ ((__packed__
));
281 struct FW_FWLOAD_FINISH
{
282 struct FW_HEADER hdr
;
283 u16 Address
; /* address of final block */
285 } __attribute__ ((__packed__
));
288 * Meaning of FW_STREAM_CONTROL::Mode bits:
289 * Bit 7: Loopback PEXin to PEXout using TVOut channel
291 * Bit 5: Audio select; 0=I2S, 1=SPDIF
293 * Bit 3: Enable transport stream
294 * Bit 2: Enable audio capture
295 * Bit 1: Enable ITU-Video VBI capture
296 * Bit 0: Enable ITU-Video capture
298 * Meaning of FW_STREAM_CONTROL::Control bits (see UVI1_CTL)
299 * Bit 7: continuous capture
300 * Bit 6: capture one field
301 * Bit 5: capture one frame
303 * Bit 3: starting field; 0=odd, 1=even
304 * Bit 2: sample size; 0=8-bit, 1=10-bit
305 * Bit 1: data format; 0=UYVY, 1=YUY2
306 * Bit 0: resets buffer pointers
310 SMODE_LOOPBACK
= 0x80,
312 _SMODE_AUDIO_SPDIF
= 0x20,
313 _SMODE_AVSYNC
= 0x10,
314 _SMODE_TRANSPORT_STREAM
= 0x08,
315 _SMODE_AUDIO_CAPTURE
= 0x04,
316 _SMODE_VBI_CAPTURE
= 0x02,
317 _SMODE_VIDEO_CAPTURE
= 0x01
321 /* Meaning of FW_STREAM_CONTROL::Stream bits:
322 * Bit 3: Audio sample count: 0 = relative, 1 = absolute
323 * Bit 2: color bar select; 1=color bars, 0=CV3 decoder
324 * Bits 1-0: stream select, UVI1, UVI2, TVOUT
327 struct FW_STREAM_CONTROL
{
328 struct FW_HEADER hdr
;
329 u8 Stream
; /* Stream number (UVI1, UVI2, TVOUT) */
330 u8 Control
; /* Value written to UVI1_CTL */
331 u8 Mode
; /* Controls clock source */
332 u8 SetupDataLen
; /* Length of setup data, MSB=1 write
334 u16 CaptureBlockCount
; /* Blocks (a 256 Bytes) to capture per buffer
336 u64 Buffer_Address
; /* Address of first buffer header */
337 u16 BytesPerVideoLine
;
338 u16 MaxLinesPerField
;
339 u16 MinLinesPerField
;
342 u16 MaxVBILinesPerField
;
343 u16 MinVBILinesPerField
;
344 u16 SetupDataAddr
; /* ngene relative address of setup data */
345 u8 SetupData
[32]; /* setup data */
346 } __attribute__((__packed__
));
348 #define AUDIO_BLOCK_SIZE 256
349 #define TS_BLOCK_SIZE 256
352 struct FW_HEADER hdr
;
354 } __attribute__ ((__packed__
));
356 struct FW_MEM_WRITE
{
357 struct FW_HEADER hdr
;
360 } __attribute__ ((__packed__
));
362 struct FW_SFR_IRAM_READ
{
363 struct FW_HEADER hdr
;
365 } __attribute__ ((__packed__
));
367 struct FW_SFR_IRAM_WRITE
{
368 struct FW_HEADER hdr
;
371 } __attribute__ ((__packed__
));
373 struct FW_SET_GPIO_PIN
{
374 struct FW_HEADER hdr
;
376 } __attribute__ ((__packed__
));
378 struct FW_SET_GPIO_INT
{
379 struct FW_HEADER hdr
;
381 } __attribute__ ((__packed__
));
383 struct FW_SET_DEBUGMODE
{
384 struct FW_HEADER hdr
;
386 } __attribute__ ((__packed__
));
388 struct FW_CONFIGURE_BUFFERS
{
389 struct FW_HEADER hdr
;
391 } __attribute__ ((__packed__
));
393 enum _BUFFER_CONFIGS
{
394 /* 4k UVI1, 4k UVI2, 2k AUD1, 2k AUD2 (standard usage) */
395 BUFFER_CONFIG_4422
= 0,
396 /* 3k UVI1, 3k UVI2, 3k AUD1, 3k AUD2 (4x TS input usage) */
397 BUFFER_CONFIG_3333
= 1,
398 /* 8k UVI1, 0k UVI2, 2k AUD1, 2k I2SOut (HDTV decoder usage) */
399 BUFFER_CONFIG_8022
= 2,
400 BUFFER_CONFIG_FW17
= 255, /* Use new FW 17 command */
403 struct FW_CONFIGURE_FREE_BUFFERS
{
404 struct FW_HEADER hdr
;
405 u8 UVI1_BufferLength
;
406 u8 UVI2_BufferLength
;
408 u8 AUD1_BufferLength
;
409 u8 AUD2_BufferLength
;
411 } __attribute__ ((__packed__
));
413 struct FW_CONFIGURE_UART
{
414 struct FW_HEADER hdr
;
416 } __attribute__ ((__packed__
));
419 _UART_BAUDRATE_19200
= 0,
420 _UART_BAUDRATE_9600
= 1,
421 _UART_BAUDRATE_4800
= 2,
422 _UART_BAUDRATE_2400
= 3,
423 _UART_RX_ENABLE
= 0x40,
424 _UART_TX_ENABLE
= 0x80,
427 struct FW_WRITE_UART
{
428 struct FW_HEADER hdr
;
430 } __attribute__ ((__packed__
));
433 struct ngene_command
{
439 struct FW_HEADER hdr
;
440 struct FW_I2C_WRITE I2CWrite
;
441 struct FW_I2C_CONTINUE_WRITE I2CContinueWrite
;
442 struct FW_I2C_READ I2CRead
;
443 struct FW_STREAM_CONTROL StreamControl
;
444 struct FW_FWLOAD_PREPARE FWLoadPrepare
;
445 struct FW_FWLOAD_FINISH FWLoadFinish
;
446 struct FW_MEM_READ MemoryRead
;
447 struct FW_MEM_WRITE MemoryWrite
;
448 struct FW_SFR_IRAM_READ SfrIramRead
;
449 struct FW_SFR_IRAM_WRITE SfrIramWrite
;
450 struct FW_SPI_WRITE SPIWrite
;
451 struct FW_SPI_READ SPIRead
;
452 struct FW_SET_GPIO_PIN SetGpioPin
;
453 struct FW_SET_GPIO_INT SetGpioInt
;
454 struct FW_SET_DEBUGMODE SetDebugMode
;
455 struct FW_CONFIGURE_BUFFERS ConfigureBuffers
;
456 struct FW_CONFIGURE_FREE_BUFFERS ConfigureFreeBuffers
;
457 struct FW_CONFIGURE_UART ConfigureUart
;
458 struct FW_WRITE_UART WriteUart
;
460 } __attribute__ ((__packed__
));
462 #define NGENE_INTERFACE_VERSION 0x103
463 #define MAX_VIDEO_BUFFER_SIZE (417792) /* 288*1440 rounded up to next page */
464 #define MAX_AUDIO_BUFFER_SIZE (8192) /* Gives room for about 23msec@48KHz */
465 #define MAX_VBI_BUFFER_SIZE (28672) /* 1144*18 rounded up to next page */
466 #define MAX_TS_BUFFER_SIZE (98304) /* 512*188 rounded up to next page */
467 #define MAX_HDTV_BUFFER_SIZE (2080768) /* 541*1920*2 rounded up to next page
468 Max: (1920x1080i60) */
470 #define OVERFLOW_BUFFER_SIZE (8192)
472 #define RING_SIZE_VIDEO 4
473 #define RING_SIZE_AUDIO 8
474 #define RING_SIZE_TS 8
476 #define NUM_SCATTER_GATHER_ENTRIES 8
478 #define MAX_DMA_LENGTH (((MAX_VIDEO_BUFFER_SIZE + MAX_VBI_BUFFER_SIZE) * \
479 RING_SIZE_VIDEO * 2) + \
480 (MAX_AUDIO_BUFFER_SIZE * RING_SIZE_AUDIO * 2) + \
481 (MAX_TS_BUFFER_SIZE * RING_SIZE_TS * 4) + \
482 (RING_SIZE_VIDEO * PAGE_SIZE * 2) + \
483 (RING_SIZE_AUDIO * PAGE_SIZE * 2) + \
484 (RING_SIZE_TS * PAGE_SIZE * 4) + \
485 8 * PAGE_SIZE + OVERFLOW_BUFFER_SIZE + PAGE_SIZE)
487 #define EVENT_QUEUE_SIZE 16
489 /* Gathers the current state of a single channel. */
491 struct SBufferHeader
{
492 struct BUFFER_HEADER ngeneBuffer
; /* Physical descriptor */
493 struct SBufferHeader
*Next
;
495 struct HW_SCATTER_GATHER_ELEMENT
*scList1
;
497 struct HW_SCATTER_GATHER_ELEMENT
*scList2
;
500 /* Sizeof SBufferHeader aligned to next 64 Bit boundary (hw restriction) */
501 #define SIZEOF_SBufferHeader ((sizeof(struct SBufferHeader) + 63) & ~63)
517 struct SRingBufferDescriptor
{
518 struct SBufferHeader
*Head
; /* Points to first buffer in ring buffer
520 u64 PAHead
; /* Physical address of first buffer */
521 u32 MemSize
; /* Memory size of allocated ring buffers
522 (needed for freeing) */
523 u32 NumBuffers
; /* Number of buffers in the ring */
524 u32 Buffer1Length
; /* Allocated length of Buffer 1 */
525 u32 Buffer2Length
; /* Allocated length of Buffer 2 */
526 void *SCListMem
; /* Memory to hold scatter gather lists for this
528 u64 PASCListMem
; /* Physical address .. */
529 u32 SCListMemSize
; /* Size of this memory */
532 enum STREAMMODEFLAGS
{
533 StreamMode_NONE
= 0, /* Stream not used */
534 StreamMode_ANALOG
= 1, /* Analog: Stream 0,1 = Video, 2,3 = Audio */
535 StreamMode_TSIN
= 2, /* Transport stream input (all) */
536 StreamMode_HDTV
= 4, /* HDTV: Maximum 1920x1080p30,1920x1080i60
538 StreamMode_TSOUT
= 8, /* Transport stream output (only stream 3) */
542 enum BufferExchangeFlags
{
543 BEF_EVEN_FIELD
= 0x00000001,
544 BEF_CONTINUATION
= 0x00000002,
545 BEF_MORE_DATA
= 0x00000004,
546 BEF_OVERFLOW
= 0x00000008,
547 DF_SWAP32
= 0x00010000,
550 typedef void *(IBufferExchange
)(void *, void *, u32
, u32
, u32
);
552 struct MICI_STREAMINFO
{
553 IBufferExchange
*pExchange
;
554 IBufferExchange
*pExchangeVBI
; /* Secondary (VBI, ancillary) */
560 u16 nBytesPerLineVideo
;
562 u16 nBytesPerLineVBI
;
563 u32 CaptureLength
; /* Used for audio and transport stream */
566 /****************************************************************************/
567 /* STRUCTS ******************************************************************/
568 /****************************************************************************/
570 /* sound hardware definition */
571 #define MIXER_ADDR_TVTUNER 0
572 #define MIXER_ADDR_LAST 0
574 struct ngene_channel
;
576 /*struct sound chip*/
579 struct ngene_channel
*chan
;
580 struct snd_card
*card
;
582 struct snd_pcm_substream
*substream
;
586 spinlock_t mixer_lock
;
588 int mixer_volume
[MIXER_ADDR_LAST
+ 1][2];
589 int capture_source
[MIXER_ADDR_LAST
+ 1][2];
593 struct ngene_overlay
{
596 enum v4l2_field field
;
597 struct v4l2_clip
*clips
;
602 struct ngene_tvnorm
{
605 u16 swidth
, sheight
; /* scaled standard width, height */
611 struct ngene_channel
*ch
;
612 enum v4l2_priority prio
;
616 struct videobuf_queue vbuf_q
;
617 struct videobuf_queue vbi
;
621 enum v4l2_buf_type type
;
622 const struct ngene_format
*fmt
;
624 const struct ngene_format
*ovfmt
;
625 struct ngene_overlay ov
;
629 struct ngene_channel
{
630 struct device device
;
631 struct i2c_adapter i2c_adapter
;
638 struct dvb_frontend
*fe
;
639 struct dmxdev dmxdev
;
640 struct dvb_demux demux
;
641 struct dmx_frontend hw_frontend
;
642 struct dmx_frontend mem_frontend
;
644 struct video_device
*v4l_dev
;
645 struct tasklet_struct demux_tasklet
;
647 struct SBufferHeader
*nextBuffer
;
649 enum HWSTATE HWState
;
653 IBufferExchange
*pBufferExchange
;
654 IBufferExchange
*pBufferExchange2
;
656 spinlock_t state_lock
;
660 u16 nBytesPerVBILine
;
664 struct SRingBufferDescriptor RingBuffer
;
665 struct SRingBufferDescriptor TSRingBuffer
;
666 struct SRingBufferDescriptor TSIdleBuffer
;
673 int (*set_tone
)(struct dvb_frontend
*, fe_sec_tone_mode_t
);
676 /* stuff from analog driver */
679 struct mychip
*mychip
;
680 struct snd_card
*soundcard
;
685 int soundbuffisallocated
;
692 struct ngene_tvnorm
*tvnorms
;
698 struct v4l2_prio_state prio
;
699 struct ngene_vopen init
;
701 struct v4l2_framebuffer fbuf
;
702 struct ngene_buffer
*screen
; /* overlay */
703 struct list_head capture
; /* video capture queue */
705 struct semaphore reslock
;
713 typedef void (rx_cb_t
)(struct ngene
*, u32
, u8
);
714 typedef void (tx_cb_t
)(struct ngene
*, u32
);
718 struct pci_dev
*pci_dev
;
719 unsigned char *iomem
;
721 /*struct i2c_adapter i2c_adapter;*/
724 u32 fw_interface_version
;
729 void *OverflowBuffer
;
730 dma_addr_t PAOverflowBuffer
;
731 void *FWInterfaceBuffer
;
732 dma_addr_t PAFWInterfaceBuffer
;
736 struct EVENT_BUFFER EventQueue
[EVENT_QUEUE_SIZE
];
737 int EventQueueOverflowCount
;
738 int EventQueueOverflowFlag
;
739 struct tasklet_struct event_tasklet
;
740 struct EVENT_BUFFER
*EventBuffer
;
741 int EventQueueWriteIndex
;
742 int EventQueueReadIndex
;
744 wait_queue_head_t cmd_wq
;
746 struct semaphore cmd_mutex
;
747 struct semaphore stream_mutex
;
748 struct semaphore pll_mutex
;
749 struct semaphore i2c_switch_mutex
;
750 int i2c_current_channel
;
754 struct dvb_adapter adapter
[MAX_STREAM
];
755 struct ngene_channel channel
[MAX_STREAM
];
757 struct ngene_info
*card_info
;
759 tx_cb_t
*TxEventNotify
;
760 rx_cb_t
*RxEventNotify
;
762 wait_queue_head_t tx_wq
;
763 wait_queue_head_t rx_wq
;
764 #define UART_RBUF_LEN 4096
765 u8 uart_rbuf
[UART_RBUF_LEN
];
766 int uart_rp
, uart_wp
;
769 #define TSOUT_BUF_SIZE (512*188*8)
770 struct dvb_ringbuffer tsout_rbuf
;
773 #define AIN_BUF_SIZE (128*1024)
774 struct dvb_ringbuffer ain_rbuf
;
778 #define VIN_BUF_SIZE (4*1920*1080)
779 struct dvb_ringbuffer vin_rbuf
;
781 unsigned long exp_val
;
788 #define NGENE_TERRATEC 1
789 #define NGENE_SIDEWINDER 2
790 #define NGENE_RACER 3
791 #define NGENE_VIPER 4
792 #define NGENE_PYTHON 5
793 #define NGENE_VBOX_V1 6
794 #define NGENE_VBOX_V2 7
799 int io_type
[MAX_STREAM
];
800 #define NGENE_IO_NONE 0
801 #define NGENE_IO_TV 1
802 #define NGENE_IO_HDTV 2
803 #define NGENE_IO_TSIN 4
804 #define NGENE_IO_TSOUT 8
805 #define NGENE_IO_AIN 16
808 void *tuner_config
[4];
810 int (*demod_attach
[4])(struct ngene_channel
*);
811 int (*tuner_attach
[4])(struct ngene_channel
*);
822 int (*gate_ctrl
)(struct dvb_frontend
*, int);
823 int (*switch_ctrl
)(struct ngene_channel
*, int, int);
829 int fourcc
; /* video4linux 2 */
830 int btformat
; /* BT848_COLOR_FMT_* */
832 int btswap
; /* BT848_COLOR_CTL_* */
833 int depth
; /* bit/pixel */
835 int hshift
, vshift
; /* for planar modes */
839 #define RESOURCE_OVERLAY 1
840 #define RESOURCE_VIDEO 2
841 #define RESOURCE_VBI 4
843 struct ngene_buffer
{
844 /* common v4l buffer stuff -- must be first */
845 struct videobuf_buffer vb
;
848 const struct ngene_format
*fmt
;