Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
saa7164-types.h
Go to the documentation of this file.
1 /*
2  * Driver for the NXP SAA7164 PCIe bridge
3  *
4  * Copyright (c) 2010 Steven Toth <[email protected]>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
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  *
15  * GNU General Public License for more details.
16  *
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., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 
22 /* TODO: Cleanup and shorten the namespace */
23 
24 /* Some structues are passed directly to/from the firmware and
25  * have strict alignment requirements. This is one of them.
26  */
40 } __attribute__((packed));
41 
42 /* This is DWORD aligned on windows but I can't find the right
43  * gcc syntax to match the binary data from the device.
44  * I've manually padded with Reserved[3] bytes to match the hardware,
45  * but this could break if GCC decies to pack in a different way.
46  */
59 };
60 
68 };
69 
70 enum tmBusType {
71  NONE = 0,
76 };
77 
89 
90  /* All access is protected */
91  struct mutex lock;
92 
93 };
94 
95 struct tmComResInfo {
96  u8 id;
102 } __attribute__((packed));
105  SET_CUR = 0x01,
106  GET_CUR = 0x81,
107  GET_MIN = 0x82,
108  GET_MAX = 0x83,
109  GET_RES = 0x84,
110  GET_LEN = 0x85,
111  GET_INFO = 0x86,
112  GET_DEF = 0x87
113 };
114 
115 struct cmd {
120  struct mutex lock;
122 };
123 
124 struct tmDescriptor {
127  void *descriptor;
128 };
129 
135 } __attribute__((packed));
147 } __attribute__((packed));
148 
149 struct tmComResGPIO {
152 } __attribute__((packed));
159 } __attribute__((packed));
160 
161 /* terminaltype */
163  ITT_ANTENNA = 0x0203,
164  LINE_CONNECTOR = 0x0603,
165  SPDIF_CONNECTOR = 0x0605,
169  STANDARD_DMA = 0xF101
170 };
171 
181 } __attribute__((packed));
182 
193 } __attribute__((packed));
194 
196  /* the buffer does not contain any valid data */
199  /* the buffer is filled with valid data */
201 
202  /* the buffer is the dummy buffer - TODO??? */
204 };
205 
206 struct tmBuffer {
218 };
219 
230 };
231 
236 };
237 
254 } __attribute__((packed));
255 
256 /*
257  *
258  * Description:
259  * This is the transport stream format header.
260  *
261  * Settings:
262  * bLength - The size of this descriptor in bytes.
263  * bDescriptorType - CS_INTERFACE.
264  * bDescriptorSubtype - VS_FORMAT_MPEG2TS descriptor subtype.
265  * bFormatIndex - A non-zero constant that uniquely identifies the
266  * format.
267  * bDataOffset - Offset to TSP packet within MPEG-2 TS transport
268  * stride, in bytes.
269  * bPacketLength - Length of TSP packet, in bytes (typically 188).
270  * bStrideLength - Length of MPEG-2 TS transport stride.
271  * guidStrideFormat - A Globally Unique Identifier indicating the
272  * format of the stride data (if any). Set to zeros
273  * if there is no Stride Data, or if the Stride
274  * Data is to be ignored by the application.
275  *
276  */
286 } __attribute__((packed));
287 
288 /* Encoder related structures */
289 
290 /* A/V Mux Selector */
298 } __attribute__((packed));
299 
300 /* A/V Audio processor definitions */
309 } __attribute__((packed));
310 
311 /* Video bitrate control message */
312 #define EU_VIDEO_BIT_RATE_MODE_CONSTANT (0)
313 #define EU_VIDEO_BIT_RATE_MODE_VARIABLE_AVERAGE (1)
314 #define EU_VIDEO_BIT_RATE_MODE_VARIABLE_PEAK (2)
319 } __attribute__((packed));
321 /* Video Encoder Aspect Ratio message */
325 } __attribute__((packed));
327 /* Video Encoder GOP IBP message */
328 /* 1. IPPPPPPPPPPPPPP */
329 /* 2. IBPBPBPBPBPBPBP */
330 /* 3. IBBPBBPBBPBBP */
331 #define SAA7164_ENCODER_DEFAULT_GOP_DIST (1)
332 #define SAA7164_ENCODER_DEFAULT_GOP_SIZE (15)
334  u8 ucGOPSize; /* GOP Size 12, 15 */
335  u8 ucRefFrameDist; /* Reference Frame Distance */
336 } __attribute__((packed));
338 /* Encoder processor definition */
355 } __attribute__((packed));
356 
357 /* Audio processor definition */
365 } __attribute__((packed));
367 /* Audio control messages */
375 } __attribute__((packed));
377 /* Audio bitrate control message */
382 } __attribute__((packed));
384 /* Tuner / AV Decoder messages */
388 } __attribute__((packed));
392 } __attribute__((packed));
394 /* EEPROM definition for PS stream types */
403 } __attribute__((packed));
404 
405 /* VBI control structure */
409  u8 subtype; /* VS_FORMAT_VBI */
411  u32 VideoStandard; /* See KS_AnalogVideoStandard, NTSC = 1 */
412  u8 StartLine; /* NTSC Start = 10 */
413  u8 EndLine; /* NTSC = 21 */
414  u8 FieldRate; /* 60 for NTSC */
415  u8 bNumLines; /* Unused - scheduled for removal */
416 } __attribute__((packed));
417 
422 } __attribute__((packed));
426 } __attribute__((packed));
431 } __attribute__((packed));
442 } __attribute__((packed));