Go to the documentation of this file.
27 #include <linux/types.h>
28 #include <linux/sched.h>
30 #include <linux/i2c.h>
45 #define DEVICE_NAME "ngene"
47 #define NGENE_VID 0x18c3
48 #define NGENE_PID 0x0720
51 #define VIDEO_CAP_AVC 128
52 #define VIDEO_CAP_H264 128
53 #define VIDEO_CAP_VC1 256
54 #define VIDEO_CAP_WMV9 256
55 #define VIDEO_CAP_MPEG4 512
84 #define PROGRAM_ROM 0x0000
85 #define PROGRAM_SRAM 0x1000
86 #define PERIPHERALS0 0x8000
87 #define PERIPHERALS1 0x9000
88 #define SHARED_BUFFER 0xC000
90 #define HOST_TO_NGENE (SHARED_BUFFER+0x0000)
91 #define NGENE_TO_HOST (SHARED_BUFFER+0x0100)
92 #define NGENE_COMMAND (SHARED_BUFFER+0x0200)
93 #define NGENE_COMMAND_HI (SHARED_BUFFER+0x0204)
94 #define NGENE_STATUS (SHARED_BUFFER+0x0208)
95 #define NGENE_STATUS_HI (SHARED_BUFFER+0x020C)
96 #define NGENE_EVENT (SHARED_BUFFER+0x0210)
97 #define NGENE_EVENT_HI (SHARED_BUFFER+0x0214)
98 #define VARIABLES (SHARED_BUFFER+0x0210)
100 #define NGENE_INT_COUNTS (SHARED_BUFFER+0x0260)
101 #define NGENE_INT_ENABLE (SHARED_BUFFER+0x0264)
102 #define NGENE_VBI_LINE_COUNT (SHARED_BUFFER+0x0268)
104 #define BUFFER_GP_XMIT (SHARED_BUFFER+0x0800)
105 #define BUFFER_GP_RECV (SHARED_BUFFER+0x0900)
106 #define EEPROM_AREA (SHARED_BUFFER+0x0A00)
108 #define SG_V_IN_1 (SHARED_BUFFER+0x0A80)
109 #define SG_VBI_1 (SHARED_BUFFER+0x0B00)
110 #define SG_A_IN_1 (SHARED_BUFFER+0x0B80)
111 #define SG_V_IN_2 (SHARED_BUFFER+0x0C00)
112 #define SG_VBI_2 (SHARED_BUFFER+0x0C80)
113 #define SG_A_IN_2 (SHARED_BUFFER+0x0D00)
114 #define SG_V_OUT (SHARED_BUFFER+0x0D80)
115 #define SG_A_OUT2 (SHARED_BUFFER+0x0E00)
117 #define DATA_A_IN_1 (SHARED_BUFFER+0x0E80)
118 #define DATA_A_IN_2 (SHARED_BUFFER+0x0F00)
119 #define DATA_A_OUT (SHARED_BUFFER+0x0F80)
120 #define DATA_V_IN_1 (SHARED_BUFFER+0x1000)
121 #define DATA_V_IN_2 (SHARED_BUFFER+0x2000)
122 #define DATA_V_OUT (SHARED_BUFFER+0x3000)
124 #define DATA_FIFO_AREA (SHARED_BUFFER+0x1000)
126 #define TIMESTAMPS 0xA000
127 #define SCRATCHPAD 0xA080
128 #define FORCE_INT 0xA088
129 #define FORCE_NMI 0xA090
130 #define INT_STATUS 0xA0A0
132 #define DEV_VER 0x9004
134 #define FW_DEBUG_DEFAULT (PROGRAM_SRAM+0x00FF)
353 #define AUDIO_BLOCK_SIZE 256
354 #define TS_BLOCK_SIZE 256
467 #define NGENE_INTERFACE_VERSION 0x103
468 #define MAX_VIDEO_BUFFER_SIZE (417792)
469 #define MAX_AUDIO_BUFFER_SIZE (8192)
470 #define MAX_VBI_BUFFER_SIZE (28672)
471 #define MAX_TS_BUFFER_SIZE (98304)
472 #define MAX_HDTV_BUFFER_SIZE (2080768)
475 #define OVERFLOW_BUFFER_SIZE (8192)
477 #define RING_SIZE_VIDEO 4
478 #define RING_SIZE_AUDIO 8
479 #define RING_SIZE_TS 8
481 #define NUM_SCATTER_GATHER_ENTRIES 8
483 #define MAX_DMA_LENGTH (((MAX_VIDEO_BUFFER_SIZE + MAX_VBI_BUFFER_SIZE) * \
484 RING_SIZE_VIDEO * 2) + \
485 (MAX_AUDIO_BUFFER_SIZE * RING_SIZE_AUDIO * 2) + \
486 (MAX_TS_BUFFER_SIZE * RING_SIZE_TS * 4) + \
487 (RING_SIZE_VIDEO * PAGE_SIZE * 2) + \
488 (RING_SIZE_AUDIO * PAGE_SIZE * 2) + \
489 (RING_SIZE_TS * PAGE_SIZE * 4) + \
490 8 * PAGE_SIZE + OVERFLOW_BUFFER_SIZE + PAGE_SIZE)
492 #define EVENT_QUEUE_SIZE 16
506 #define SIZEOF_SBufferHeader ((sizeof(struct SBufferHeader) + 63) & ~63)
576 #define MIXER_ADDR_TVTUNER 0
577 #define MIXER_ADDR_LAST 0
598 struct ngene_overlay {
607 struct ngene_tvnorm {
627 const struct ngene_format *
fmt;
629 const struct ngene_format *ovfmt;
630 struct ngene_overlay ov;
711 struct ngene_vopen
init;
714 struct ngene_buffer *screen;
740 unsigned char *
iomem;
788 #define UART_RBUF_LEN 4096
792 #define TS_FILLER 0x6f
795 #define TSOUT_BUF_SIZE (512*188*8)
799 #define TSIN_BUF_SIZE (512*188*8)
803 #define AIN_BUF_SIZE (128*1024)
808 #define VIN_BUF_SIZE (4*1920*1080)
820 #define NGENE_TERRATEC 1
821 #define NGENE_SIDEWINDER 2
822 #define NGENE_RACER 3
823 #define NGENE_VIPER 4
824 #define NGENE_PYTHON 5
825 #define NGENE_VBOX_V1 6
826 #define NGENE_VBOX_V2 7
833 #define NGENE_IO_NONE 0
834 #define NGENE_IO_TV 1
835 #define NGENE_IO_HDTV 2
836 #define NGENE_IO_TSIN 4
837 #define NGENE_IO_TSOUT 8
838 #define NGENE_IO_AIN 16
860 struct ngene_format {
872 #define RESOURCE_OVERLAY 1
873 #define RESOURCE_VIDEO 2
874 #define RESOURCE_VBI 4
876 struct ngene_buffer {
881 const struct ngene_format *
fmt;