xref: /openbmc/linux/drivers/media/pci/cx18/cx23418.h (revision 75bf465f0bc33e9b776a46d6a1b9b990f5fb7c37)
1*c942fddfSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
2b285192aSMauro Carvalho Chehab /*
3b285192aSMauro Carvalho Chehab  *  cx18 header containing common defines.
4b285192aSMauro Carvalho Chehab  *
5b285192aSMauro Carvalho Chehab  *  Copyright (C) 2007  Hans Verkuil <hverkuil@xs4all.nl>
6b285192aSMauro Carvalho Chehab  */
7b285192aSMauro Carvalho Chehab 
8b285192aSMauro Carvalho Chehab #ifndef CX23418_H
9b285192aSMauro Carvalho Chehab #define CX23418_H
10b285192aSMauro Carvalho Chehab 
11d647f0b7SMauro Carvalho Chehab #include <media/drv-intf/cx2341x.h>
12b285192aSMauro Carvalho Chehab 
13b285192aSMauro Carvalho Chehab #define MGR_CMD_MASK				0x40000000
14b285192aSMauro Carvalho Chehab /* The MSB of the command code indicates that this is the completion of a
15b285192aSMauro Carvalho Chehab    command */
16b285192aSMauro Carvalho Chehab #define MGR_CMD_MASK_ACK			(MGR_CMD_MASK | 0x80000000)
17b285192aSMauro Carvalho Chehab 
18b285192aSMauro Carvalho Chehab /* Description: This command creates a new instance of a certain task
19b285192aSMauro Carvalho Chehab    IN[0]  - Task ID. This is one of the XPU_CMD_MASK_YYY where XPU is
20b285192aSMauro Carvalho Chehab 	    the processor on which the task YYY will be created
21b285192aSMauro Carvalho Chehab    OUT[0] - Task handle. This handle is passed along with commands to
22b285192aSMauro Carvalho Chehab 	    dispatch to the right instance of the task
23b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_SYS_... */
24b285192aSMauro Carvalho Chehab #define CX18_CREATE_TASK			(MGR_CMD_MASK | 0x0001)
25b285192aSMauro Carvalho Chehab 
26b285192aSMauro Carvalho Chehab /* Description: This command destroys an instance of a task
27b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Hanlde of the task to destroy
28b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_SYS_... */
29b285192aSMauro Carvalho Chehab #define CX18_DESTROY_TASK			(MGR_CMD_MASK | 0x0002)
30b285192aSMauro Carvalho Chehab 
31b285192aSMauro Carvalho Chehab /* All commands for CPU have the following mask set */
32b285192aSMauro Carvalho Chehab #define CPU_CMD_MASK				0x20000000
33b285192aSMauro Carvalho Chehab #define CPU_CMD_MASK_DEBUG			(CPU_CMD_MASK | 0x00000000)
34b285192aSMauro Carvalho Chehab #define CPU_CMD_MASK_ACK			(CPU_CMD_MASK | 0x80000000)
35b285192aSMauro Carvalho Chehab #define CPU_CMD_MASK_CAPTURE			(CPU_CMD_MASK | 0x00020000)
36b285192aSMauro Carvalho Chehab #define CPU_CMD_MASK_TS				(CPU_CMD_MASK | 0x00040000)
37b285192aSMauro Carvalho Chehab 
38b285192aSMauro Carvalho Chehab #define EPU_CMD_MASK				0x02000000
39b285192aSMauro Carvalho Chehab #define EPU_CMD_MASK_DEBUG			(EPU_CMD_MASK | 0x000000)
40b285192aSMauro Carvalho Chehab #define EPU_CMD_MASK_DE				(EPU_CMD_MASK | 0x040000)
41b285192aSMauro Carvalho Chehab 
42b285192aSMauro Carvalho Chehab #define APU_CMD_MASK				0x10000000
43b285192aSMauro Carvalho Chehab #define APU_CMD_MASK_ACK			(APU_CMD_MASK | 0x80000000)
44b285192aSMauro Carvalho Chehab 
45b285192aSMauro Carvalho Chehab #define CX18_APU_ENCODING_METHOD_MPEG		(0 << 28)
46b285192aSMauro Carvalho Chehab #define CX18_APU_ENCODING_METHOD_AC3		(1 << 28)
47b285192aSMauro Carvalho Chehab 
48b285192aSMauro Carvalho Chehab /* Description: Command APU to start audio
49b285192aSMauro Carvalho Chehab    IN[0] - audio parameters (same as CX18_CPU_SET_AUDIO_PARAMETERS?)
50b285192aSMauro Carvalho Chehab    IN[1] - caller buffer address, or 0
51b285192aSMauro Carvalho Chehab    ReturnCode - ??? */
52b285192aSMauro Carvalho Chehab #define CX18_APU_START				(APU_CMD_MASK | 0x01)
53b285192aSMauro Carvalho Chehab 
54b285192aSMauro Carvalho Chehab /* Description: Command APU to stop audio
55b285192aSMauro Carvalho Chehab    IN[0] - encoding method to stop
56b285192aSMauro Carvalho Chehab    ReturnCode - ??? */
57b285192aSMauro Carvalho Chehab #define CX18_APU_STOP				(APU_CMD_MASK | 0x02)
58b285192aSMauro Carvalho Chehab 
59b285192aSMauro Carvalho Chehab /* Description: Command APU to reset the AI
60b285192aSMauro Carvalho Chehab    ReturnCode - ??? */
61b285192aSMauro Carvalho Chehab #define CX18_APU_RESETAI			(APU_CMD_MASK | 0x05)
62b285192aSMauro Carvalho Chehab 
63b285192aSMauro Carvalho Chehab /* Description: This command indicates that a Memory Descriptor List has been
64b285192aSMauro Carvalho Chehab    filled with the requested channel type
65b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task
66b285192aSMauro Carvalho Chehab    IN[1] - Offset of the MDL_ACK from the beginning of the local DDR.
67b285192aSMauro Carvalho Chehab    IN[2] - Number of CNXT_MDL_ACK structures in the array pointed to by IN[1]
68b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_DE_... */
69b285192aSMauro Carvalho Chehab #define CX18_EPU_DMA_DONE			(EPU_CMD_MASK_DE | 0x0001)
70b285192aSMauro Carvalho Chehab 
71b285192aSMauro Carvalho Chehab /* Something interesting happened
72b285192aSMauro Carvalho Chehab    IN[0] - A value to log
73b285192aSMauro Carvalho Chehab    IN[1] - An offset of a string in the MiniMe memory;
74b285192aSMauro Carvalho Chehab 	   0/zero/NULL means "I have nothing to say" */
75b285192aSMauro Carvalho Chehab #define CX18_EPU_DEBUG				(EPU_CMD_MASK_DEBUG | 0x0003)
76b285192aSMauro Carvalho Chehab 
77b285192aSMauro Carvalho Chehab /* Reads memory/registers (32-bit)
78b285192aSMauro Carvalho Chehab    IN[0] - Address
79b285192aSMauro Carvalho Chehab    OUT[1] - Value */
80b285192aSMauro Carvalho Chehab #define CX18_CPU_DEBUG_PEEK32			(CPU_CMD_MASK_DEBUG | 0x0003)
81b285192aSMauro Carvalho Chehab 
82b285192aSMauro Carvalho Chehab /* Description: This command starts streaming with the set channel type
83b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to start
84b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
85b285192aSMauro Carvalho Chehab #define CX18_CPU_CAPTURE_START			(CPU_CMD_MASK_CAPTURE | 0x0002)
86b285192aSMauro Carvalho Chehab 
87b285192aSMauro Carvalho Chehab /* Description: This command stops streaming with the set channel type
88b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to stop
89b285192aSMauro Carvalho Chehab    IN[1] - 0 = stop at end of GOP, 1 = stop at end of frame (MPEG only)
90b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
91b285192aSMauro Carvalho Chehab #define CX18_CPU_CAPTURE_STOP			(CPU_CMD_MASK_CAPTURE | 0x0003)
92b285192aSMauro Carvalho Chehab 
93b285192aSMauro Carvalho Chehab /* Description: This command pauses streaming with the set channel type
94b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to pause
95b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
96b285192aSMauro Carvalho Chehab #define CX18_CPU_CAPTURE_PAUSE			(CPU_CMD_MASK_CAPTURE | 0x0007)
97b285192aSMauro Carvalho Chehab 
98b285192aSMauro Carvalho Chehab /* Description: This command resumes streaming with the set channel type
99b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to resume
100b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
101b285192aSMauro Carvalho Chehab #define CX18_CPU_CAPTURE_RESUME			(CPU_CMD_MASK_CAPTURE | 0x0008)
102b285192aSMauro Carvalho Chehab 
103b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_NONE		0
104b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_MPEG		1
105b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_INDEX		2
106b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_YUV		3
107b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_PCM		4
108b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_VBI		5
109b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_SLICED_VBI		6
110b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_TS			7
111b285192aSMauro Carvalho Chehab #define CAPTURE_CHANNEL_TYPE_MAX		15
112b285192aSMauro Carvalho Chehab 
113b285192aSMauro Carvalho Chehab /* Description: This command sets the channel type. This can only be done
114b285192aSMauro Carvalho Chehab    when stopped.
115b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to start
116b285192aSMauro Carvalho Chehab    IN[1] - Channel Type. See Below.
117b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
118b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_CHANNEL_TYPE		(CPU_CMD_MASK_CAPTURE + 1)
119b285192aSMauro Carvalho Chehab 
120b285192aSMauro Carvalho Chehab /* Description: Set stream output type
121b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
122b285192aSMauro Carvalho Chehab    IN[1] - type
123b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
124b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_STREAM_OUTPUT_TYPE		(CPU_CMD_MASK_CAPTURE | 0x0012)
125b285192aSMauro Carvalho Chehab 
126b285192aSMauro Carvalho Chehab /* Description: Set video input resolution and frame rate
127b285192aSMauro Carvalho Chehab    IN[0] - task handle
128b285192aSMauro Carvalho Chehab    IN[1] - reserved
129b285192aSMauro Carvalho Chehab    IN[2] - reserved
130b285192aSMauro Carvalho Chehab    IN[3] - reserved
131b285192aSMauro Carvalho Chehab    IN[4] - reserved
132b285192aSMauro Carvalho Chehab    IN[5] - frame rate, 0 - 29.97f/s, 1 - 25f/s
133b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
134b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_VIDEO_IN			(CPU_CMD_MASK_CAPTURE | 0x0004)
135b285192aSMauro Carvalho Chehab 
136b285192aSMauro Carvalho Chehab /* Description: Set video frame rate
137b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
138b285192aSMauro Carvalho Chehab    IN[1] - video bit rate mode
139b285192aSMauro Carvalho Chehab    IN[2] - video average rate
140b285192aSMauro Carvalho Chehab    IN[3] - video peak rate
141b285192aSMauro Carvalho Chehab    IN[4] - system mux rate
142b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
143b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_VIDEO_RATE			(CPU_CMD_MASK_CAPTURE | 0x0005)
144b285192aSMauro Carvalho Chehab 
145b285192aSMauro Carvalho Chehab /* Description: Set video output resolution
146b285192aSMauro Carvalho Chehab    IN[0] - task handle
147b285192aSMauro Carvalho Chehab    IN[1] - horizontal size
148b285192aSMauro Carvalho Chehab    IN[2] - vertical size
149b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
150b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_VIDEO_RESOLUTION		(CPU_CMD_MASK_CAPTURE | 0x0006)
151b285192aSMauro Carvalho Chehab 
152b285192aSMauro Carvalho Chehab /* Description: This command set filter parameters
153b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task
154b285192aSMauro Carvalho Chehab    IN[1] - type, 0 - temporal, 1 - spatial, 2 - median
155b285192aSMauro Carvalho Chehab    IN[2] - mode,  temporal/spatial: 0 - disable, 1 - static, 2 - dynamic
156b285192aSMauro Carvalho Chehab 			median:	0 = disable, 1 = horizontal, 2 = vertical,
157b285192aSMauro Carvalho Chehab 				3 = horizontal/vertical, 4 = diagonal
158b285192aSMauro Carvalho Chehab    IN[3] - strength, temporal 0 - 31, spatial 0 - 15
159b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
160b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_FILTER_PARAM		(CPU_CMD_MASK_CAPTURE | 0x0009)
161b285192aSMauro Carvalho Chehab 
162b285192aSMauro Carvalho Chehab /* Description: This command set spatial filter type
163b285192aSMauro Carvalho Chehab    IN[0] - Task handle.
164b285192aSMauro Carvalho Chehab    IN[1] - luma type: 0 = disable, 1 = 1D horizontal only, 2 = 1D vertical only,
165b285192aSMauro Carvalho Chehab 		      3 = 2D H/V separable, 4 = 2D symmetric non-separable
166b285192aSMauro Carvalho Chehab    IN[2] - chroma type: 0 - disable, 1 = 1D horizontal
167b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
168b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_SPATIAL_FILTER_TYPE	(CPU_CMD_MASK_CAPTURE | 0x000C)
169b285192aSMauro Carvalho Chehab 
170b285192aSMauro Carvalho Chehab /* Description: This command set coring levels for median filter
171b285192aSMauro Carvalho Chehab    IN[0] - Task handle.
172b285192aSMauro Carvalho Chehab    IN[1] - luma_high
173b285192aSMauro Carvalho Chehab    IN[2] - luma_low
174b285192aSMauro Carvalho Chehab    IN[3] - chroma_high
175b285192aSMauro Carvalho Chehab    IN[4] - chroma_low
176b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
177b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_MEDIAN_CORING		(CPU_CMD_MASK_CAPTURE | 0x000E)
178b285192aSMauro Carvalho Chehab 
179b285192aSMauro Carvalho Chehab /* Description: This command set the picture type mask for index file
180b285192aSMauro Carvalho Chehab    IN[0] - Task handle (ignored by firmware)
181b285192aSMauro Carvalho Chehab    IN[1] -	0 = disable index file output
182b285192aSMauro Carvalho Chehab 			1 = output I picture
183b285192aSMauro Carvalho Chehab 			2 = P picture
184b285192aSMauro Carvalho Chehab 			4 = B picture
185b285192aSMauro Carvalho Chehab 			other = illegal */
186b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_INDEXTABLE			(CPU_CMD_MASK_CAPTURE | 0x0010)
187b285192aSMauro Carvalho Chehab 
188b285192aSMauro Carvalho Chehab /* Description: Set audio parameters
189b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
190b285192aSMauro Carvalho Chehab    IN[1] - audio parameter
191b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
192b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_AUDIO_PARAMETERS		(CPU_CMD_MASK_CAPTURE | 0x0011)
193b285192aSMauro Carvalho Chehab 
194b285192aSMauro Carvalho Chehab /* Description: Set video mute
195b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
196b285192aSMauro Carvalho Chehab    IN[1] - bit31-24: muteYvalue
197b285192aSMauro Carvalho Chehab 	   bit23-16: muteUvalue
198b285192aSMauro Carvalho Chehab 	   bit15-8:  muteVvalue
199b285192aSMauro Carvalho Chehab 	   bit0:     1:mute, 0: unmute
200b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
201b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_VIDEO_MUTE			(CPU_CMD_MASK_CAPTURE | 0x0013)
202b285192aSMauro Carvalho Chehab 
203b285192aSMauro Carvalho Chehab /* Description: Set audio mute
204b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
205b285192aSMauro Carvalho Chehab    IN[1] - mute/unmute
206b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
207b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_AUDIO_MUTE			(CPU_CMD_MASK_CAPTURE | 0x0014)
208b285192aSMauro Carvalho Chehab 
209b285192aSMauro Carvalho Chehab /* Description: Set stream output type
210b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
211b285192aSMauro Carvalho Chehab    IN[1] - subType
212b285192aSMauro Carvalho Chehab 	    SET_INITIAL_SCR			1
213b285192aSMauro Carvalho Chehab 	    SET_QUALITY_MODE            2
214b285192aSMauro Carvalho Chehab 	    SET_VIM_PROTECT_MODE        3
215b285192aSMauro Carvalho Chehab 	    SET_PTS_CORRECTION          4
216b285192aSMauro Carvalho Chehab 	    SET_USB_FLUSH_MODE          5
217b285192aSMauro Carvalho Chehab 	    SET_MERAQPAR_ENABLE         6
218b285192aSMauro Carvalho Chehab 	    SET_NAV_PACK_INSERTION      7
219b285192aSMauro Carvalho Chehab 	    SET_SCENE_CHANGE_ENABLE     8
220b285192aSMauro Carvalho Chehab    IN[2] - parameter 1
221b285192aSMauro Carvalho Chehab    IN[3] - parameter 2
222b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
223b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_MISC_PARAMETERS		(CPU_CMD_MASK_CAPTURE | 0x0015)
224b285192aSMauro Carvalho Chehab 
225b285192aSMauro Carvalho Chehab /* Description: Set raw VBI parameters
226b285192aSMauro Carvalho Chehab    IN[0] - Task handle
227b285192aSMauro Carvalho Chehab    IN[1] - No. of input lines per field:
228b285192aSMauro Carvalho Chehab 				bit[15:0]: field 1,
229b285192aSMauro Carvalho Chehab 				bit[31:16]: field 2
230b285192aSMauro Carvalho Chehab    IN[2] - No. of input bytes per line
231b285192aSMauro Carvalho Chehab    IN[3] - No. of output frames per transfer
232b285192aSMauro Carvalho Chehab    IN[4] - start code
233b285192aSMauro Carvalho Chehab    IN[5] - stop code
234b285192aSMauro Carvalho Chehab    ReturnCode */
235b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_RAW_VBI_PARAM		(CPU_CMD_MASK_CAPTURE | 0x0016)
236b285192aSMauro Carvalho Chehab 
237b285192aSMauro Carvalho Chehab /* Description: Set capture line No.
238b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
239b285192aSMauro Carvalho Chehab    IN[1] - height1
240b285192aSMauro Carvalho Chehab    IN[2] - height2
241b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
242b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_CAPTURE_LINE_NO		(CPU_CMD_MASK_CAPTURE | 0x0017)
243b285192aSMauro Carvalho Chehab 
244b285192aSMauro Carvalho Chehab /* Description: Set copyright
245b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
246b285192aSMauro Carvalho Chehab    IN[1] - copyright
247b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
248b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_COPYRIGHT			(CPU_CMD_MASK_CAPTURE | 0x0018)
249b285192aSMauro Carvalho Chehab 
250b285192aSMauro Carvalho Chehab /* Description: Set audio PID
251b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
252b285192aSMauro Carvalho Chehab    IN[1] - PID
253b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
254b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_AUDIO_PID			(CPU_CMD_MASK_CAPTURE | 0x0019)
255b285192aSMauro Carvalho Chehab 
256b285192aSMauro Carvalho Chehab /* Description: Set video PID
257b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
258b285192aSMauro Carvalho Chehab    IN[1] - PID
259b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
260b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_VIDEO_PID			(CPU_CMD_MASK_CAPTURE | 0x001A)
261b285192aSMauro Carvalho Chehab 
262b285192aSMauro Carvalho Chehab /* Description: Set Vertical Crop Line
263b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
264b285192aSMauro Carvalho Chehab    IN[1] - Line
265b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
266b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_VER_CROP_LINE		(CPU_CMD_MASK_CAPTURE | 0x001B)
267b285192aSMauro Carvalho Chehab 
268b285192aSMauro Carvalho Chehab /* Description: Set COP structure
269b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
270b285192aSMauro Carvalho Chehab    IN[1] - M
271b285192aSMauro Carvalho Chehab    IN[2] - N
272b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
273b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_GOP_STRUCTURE		(CPU_CMD_MASK_CAPTURE | 0x001C)
274b285192aSMauro Carvalho Chehab 
275b285192aSMauro Carvalho Chehab /* Description: Set Scene Change Detection
276b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
277b285192aSMauro Carvalho Chehab    IN[1] - scene change
278b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
279b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_SCENE_CHANGE_DETECTION	(CPU_CMD_MASK_CAPTURE | 0x001D)
280b285192aSMauro Carvalho Chehab 
281b285192aSMauro Carvalho Chehab /* Description: Set Aspect Ratio
282b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
283b285192aSMauro Carvalho Chehab    IN[1] - AspectRatio
284b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
285b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_ASPECT_RATIO		(CPU_CMD_MASK_CAPTURE | 0x001E)
286b285192aSMauro Carvalho Chehab 
287b285192aSMauro Carvalho Chehab /* Description: Set Skip Input Frame
288b285192aSMauro Carvalho Chehab    IN[0] - task handle. Handle of the task to start
289b285192aSMauro Carvalho Chehab    IN[1] - skip input frames
290b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_CAPTURE_... */
291b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_SKIP_INPUT_FRAME		(CPU_CMD_MASK_CAPTURE | 0x001F)
292b285192aSMauro Carvalho Chehab 
293b285192aSMauro Carvalho Chehab /* Description: Set sliced VBI parameters -
294b285192aSMauro Carvalho Chehab    Note This API will only apply to MPEG and Sliced VBI Channels
295b285192aSMauro Carvalho Chehab    IN[0] - Task handle
296b285192aSMauro Carvalho Chehab    IN[1] - output type, 0 - CC, 1 - Moji, 2 - Teletext
297b285192aSMauro Carvalho Chehab    IN[2] - start / stop line
298b285192aSMauro Carvalho Chehab 			bit[15:0] start line number
299b285192aSMauro Carvalho Chehab 			bit[31:16] stop line number
300b285192aSMauro Carvalho Chehab    IN[3] - number of output frames per interrupt
301b285192aSMauro Carvalho Chehab    IN[4] - VBI insertion mode
302b285192aSMauro Carvalho Chehab 			bit 0:	output user data, 1 - enable
303b285192aSMauro Carvalho Chehab 			bit 1:	output private stream, 1 - enable
304b285192aSMauro Carvalho Chehab 			bit 2:	mux option, 0 - in GOP, 1 - in picture
305b285192aSMauro Carvalho Chehab 			bit[7:0]	private stream ID
306b285192aSMauro Carvalho Chehab    IN[5] - insertion period while mux option is in picture
307b285192aSMauro Carvalho Chehab    ReturnCode - VBI data offset */
308b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_SLICED_VBI_PARAM		(CPU_CMD_MASK_CAPTURE | 0x0020)
309b285192aSMauro Carvalho Chehab 
310b285192aSMauro Carvalho Chehab /* Description: Set the user data place holder
311b285192aSMauro Carvalho Chehab    IN[0] - type of data (0 for user)
312b285192aSMauro Carvalho Chehab    IN[1] - Stuffing period
313b285192aSMauro Carvalho Chehab    IN[2] - ID data size in word (less than 10)
314b285192aSMauro Carvalho Chehab    IN[3] - Pointer to ID buffer */
315b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_USERDATA_PLACE_HOLDER	(CPU_CMD_MASK_CAPTURE | 0x0021)
316b285192aSMauro Carvalho Chehab 
317b285192aSMauro Carvalho Chehab 
318b285192aSMauro Carvalho Chehab /* Description:
319b285192aSMauro Carvalho Chehab    In[0] Task Handle
320b285192aSMauro Carvalho Chehab    return parameter:
321b285192aSMauro Carvalho Chehab    Out[0]  Reserved
322b285192aSMauro Carvalho Chehab    Out[1]  Video PTS bit[32:2] of last output video frame.
323b285192aSMauro Carvalho Chehab    Out[2]  Video PTS bit[ 1:0] of last output video frame.
324b285192aSMauro Carvalho Chehab    Out[3]  Hardware Video PTS counter bit[31:0],
325b285192aSMauro Carvalho Chehab 	     these bits get incremented on every 90kHz clock tick.
326b285192aSMauro Carvalho Chehab    Out[4]  Hardware Video PTS counter bit32,
327b285192aSMauro Carvalho Chehab 	     these bits get incremented on every 90kHz clock tick.
328b285192aSMauro Carvalho Chehab    ReturnCode */
329b285192aSMauro Carvalho Chehab #define CX18_CPU_GET_ENC_PTS			(CPU_CMD_MASK_CAPTURE | 0x0022)
330b285192aSMauro Carvalho Chehab 
331b285192aSMauro Carvalho Chehab /* Description: Set VFC parameters
332b285192aSMauro Carvalho Chehab    IN[0] - task handle
333b285192aSMauro Carvalho Chehab    IN[1] - VFC enable flag, 1 - enable, 0 - disable
334b285192aSMauro Carvalho Chehab */
335b285192aSMauro Carvalho Chehab #define CX18_CPU_SET_VFC_PARAM                  (CPU_CMD_MASK_CAPTURE | 0x0023)
336b285192aSMauro Carvalho Chehab 
337b285192aSMauro Carvalho Chehab /* Below is the list of commands related to the data exchange */
338b285192aSMauro Carvalho Chehab #define CPU_CMD_MASK_DE				(CPU_CMD_MASK | 0x040000)
339b285192aSMauro Carvalho Chehab 
340b285192aSMauro Carvalho Chehab /* Description: This command provides the physical base address of the local
341b285192aSMauro Carvalho Chehab    DDR as viewed by EPU
342b285192aSMauro Carvalho Chehab    IN[0] - Physical offset where EPU has the local DDR mapped
343b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_DE_... */
344b285192aSMauro Carvalho Chehab #define CPU_CMD_DE_SetBase			(CPU_CMD_MASK_DE | 0x0001)
345b285192aSMauro Carvalho Chehab 
346b285192aSMauro Carvalho Chehab /* Description: This command provides the offsets in the device memory where
347b285192aSMauro Carvalho Chehab    the 2 cx18_mdl_ack blocks reside
348b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to start
349b285192aSMauro Carvalho Chehab    IN[1] - Offset of the first cx18_mdl_ack from the beginning of the
350b285192aSMauro Carvalho Chehab 	   local DDR.
351b285192aSMauro Carvalho Chehab    IN[2] - Offset of the second cx18_mdl_ack from the beginning of the
352b285192aSMauro Carvalho Chehab 	   local DDR.
353b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_DE_... */
354b285192aSMauro Carvalho Chehab #define CX18_CPU_DE_SET_MDL_ACK			(CPU_CMD_MASK_DE | 0x0002)
355b285192aSMauro Carvalho Chehab 
356b285192aSMauro Carvalho Chehab /* Description: This command provides the offset to a Memory Descriptor List
357b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to start
358b285192aSMauro Carvalho Chehab    IN[1] - Offset of the MDL from the beginning of the local DDR.
359b285192aSMauro Carvalho Chehab    IN[2] - Number of cx18_mdl_ent structures in the array pointed to by IN[1]
360b285192aSMauro Carvalho Chehab    IN[3] - Buffer ID
361b285192aSMauro Carvalho Chehab    IN[4] - Total buffer length
362b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_DE_... */
363b285192aSMauro Carvalho Chehab #define CX18_CPU_DE_SET_MDL			(CPU_CMD_MASK_DE | 0x0005)
364b285192aSMauro Carvalho Chehab 
365b285192aSMauro Carvalho Chehab /* Description: This command requests return of all current Memory
366b285192aSMauro Carvalho Chehab    Descriptor Lists to the driver
367b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task to start
368b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_DE_... */
369b285192aSMauro Carvalho Chehab #define CX18_CPU_DE_RELEASE_MDL			(CPU_CMD_MASK_DE | 0x0006)
370b285192aSMauro Carvalho Chehab 
371b285192aSMauro Carvalho Chehab /* Description: This command signals the cpu that the dat buffer has been
372b285192aSMauro Carvalho Chehab    consumed and ready for re-use.
373b285192aSMauro Carvalho Chehab    IN[0] - Task handle. Handle of the task
374b285192aSMauro Carvalho Chehab    IN[1] - Offset of the data block from the beginning of the local DDR.
375b285192aSMauro Carvalho Chehab    IN[2] - Number of bytes in the data block
376b285192aSMauro Carvalho Chehab    ReturnCode - One of the ERR_DE_... */
377b285192aSMauro Carvalho Chehab /* #define CX18_CPU_DE_RELEASE_BUFFER           (CPU_CMD_MASK_DE | 0x0007) */
378b285192aSMauro Carvalho Chehab 
379b285192aSMauro Carvalho Chehab /* No Error / Success */
380b285192aSMauro Carvalho Chehab #define CNXT_OK                 0x000000
381b285192aSMauro Carvalho Chehab 
382b285192aSMauro Carvalho Chehab /* Received unknown command */
383b285192aSMauro Carvalho Chehab #define CXERR_UNK_CMD           0x000001
384b285192aSMauro Carvalho Chehab 
385b285192aSMauro Carvalho Chehab /* First parameter in the command is invalid */
386b285192aSMauro Carvalho Chehab #define CXERR_INVALID_PARAM1    0x000002
387b285192aSMauro Carvalho Chehab 
388b285192aSMauro Carvalho Chehab /* Second parameter in the command is invalid */
389b285192aSMauro Carvalho Chehab #define CXERR_INVALID_PARAM2    0x000003
390b285192aSMauro Carvalho Chehab 
391b285192aSMauro Carvalho Chehab /* Device interface is not open/found */
392b285192aSMauro Carvalho Chehab #define CXERR_DEV_NOT_FOUND     0x000004
393b285192aSMauro Carvalho Chehab 
394b285192aSMauro Carvalho Chehab /* Requested function is not implemented/available */
395b285192aSMauro Carvalho Chehab #define CXERR_NOTSUPPORTED      0x000005
396b285192aSMauro Carvalho Chehab 
397b285192aSMauro Carvalho Chehab /* Invalid pointer is provided */
398b285192aSMauro Carvalho Chehab #define CXERR_BADPTR            0x000006
399b285192aSMauro Carvalho Chehab 
400b285192aSMauro Carvalho Chehab /* Unable to allocate memory */
401b285192aSMauro Carvalho Chehab #define CXERR_NOMEM             0x000007
402b285192aSMauro Carvalho Chehab 
403b285192aSMauro Carvalho Chehab /* Object/Link not found */
404b285192aSMauro Carvalho Chehab #define CXERR_LINK              0x000008
405b285192aSMauro Carvalho Chehab 
406b285192aSMauro Carvalho Chehab /* Device busy, command cannot be executed */
407b285192aSMauro Carvalho Chehab #define CXERR_BUSY              0x000009
408b285192aSMauro Carvalho Chehab 
409b285192aSMauro Carvalho Chehab /* File/device/handle is not open. */
410b285192aSMauro Carvalho Chehab #define CXERR_NOT_OPEN          0x00000A
411b285192aSMauro Carvalho Chehab 
412b285192aSMauro Carvalho Chehab /* Value is out of range */
413b285192aSMauro Carvalho Chehab #define CXERR_OUTOFRANGE        0x00000B
414b285192aSMauro Carvalho Chehab 
415b285192aSMauro Carvalho Chehab /* Buffer overflow */
416b285192aSMauro Carvalho Chehab #define CXERR_OVERFLOW          0x00000C
417b285192aSMauro Carvalho Chehab 
418b285192aSMauro Carvalho Chehab /* Version mismatch */
419b285192aSMauro Carvalho Chehab #define CXERR_BADVER            0x00000D
420b285192aSMauro Carvalho Chehab 
421b285192aSMauro Carvalho Chehab /* Operation timed out */
422b285192aSMauro Carvalho Chehab #define CXERR_TIMEOUT           0x00000E
423b285192aSMauro Carvalho Chehab 
424b285192aSMauro Carvalho Chehab /* Operation aborted */
425b285192aSMauro Carvalho Chehab #define CXERR_ABORT             0x00000F
426b285192aSMauro Carvalho Chehab 
427b285192aSMauro Carvalho Chehab /* Specified I2C device not found for read/write */
428b285192aSMauro Carvalho Chehab #define CXERR_I2CDEV_NOTFOUND   0x000010
429b285192aSMauro Carvalho Chehab 
430b285192aSMauro Carvalho Chehab /* Error in I2C data xfer (but I2C device is present) */
431b285192aSMauro Carvalho Chehab #define CXERR_I2CDEV_XFERERR    0x000011
432b285192aSMauro Carvalho Chehab 
43316790554SMauro Carvalho Chehab /* Channel changing component not ready */
434b285192aSMauro Carvalho Chehab #define CXERR_CHANNELNOTREADY   0x000012
435b285192aSMauro Carvalho Chehab 
436b285192aSMauro Carvalho Chehab /* PPU (Presensation/Decoder) mail box is corrupted */
437b285192aSMauro Carvalho Chehab #define CXERR_PPU_MB_CORRUPT    0x000013
438b285192aSMauro Carvalho Chehab 
439b285192aSMauro Carvalho Chehab /* CPU (Capture/Encoder) mail box is corrupted */
440b285192aSMauro Carvalho Chehab #define CXERR_CPU_MB_CORRUPT    0x000014
441b285192aSMauro Carvalho Chehab 
442b285192aSMauro Carvalho Chehab /* APU (Audio) mail box is corrupted */
443b285192aSMauro Carvalho Chehab #define CXERR_APU_MB_CORRUPT    0x000015
444b285192aSMauro Carvalho Chehab 
445b285192aSMauro Carvalho Chehab /* Unable to open file for reading */
446b285192aSMauro Carvalho Chehab #define CXERR_FILE_OPEN_READ    0x000016
447b285192aSMauro Carvalho Chehab 
448b285192aSMauro Carvalho Chehab /* Unable to open file for writing */
449b285192aSMauro Carvalho Chehab #define CXERR_FILE_OPEN_WRITE   0x000017
450b285192aSMauro Carvalho Chehab 
451b285192aSMauro Carvalho Chehab /* Unable to find the I2C section specified */
452b285192aSMauro Carvalho Chehab #define CXERR_I2C_BADSECTION    0x000018
453b285192aSMauro Carvalho Chehab 
454b285192aSMauro Carvalho Chehab /* Error in I2C data xfer (but I2C device is present) */
455b285192aSMauro Carvalho Chehab #define CXERR_I2CDEV_DATALOW    0x000019
456b285192aSMauro Carvalho Chehab 
457b285192aSMauro Carvalho Chehab /* Error in I2C data xfer (but I2C device is present) */
458b285192aSMauro Carvalho Chehab #define CXERR_I2CDEV_CLOCKLOW   0x00001A
459b285192aSMauro Carvalho Chehab 
460b285192aSMauro Carvalho Chehab /* No Interrupt received from HW (for I2C access) */
461b285192aSMauro Carvalho Chehab #define CXERR_NO_HW_I2C_INTR    0x00001B
462b285192aSMauro Carvalho Chehab 
463b285192aSMauro Carvalho Chehab /* RPU is not ready to accept commands! */
464b285192aSMauro Carvalho Chehab #define CXERR_RPU_NOT_READY     0x00001C
465b285192aSMauro Carvalho Chehab 
466b285192aSMauro Carvalho Chehab /* RPU is not ready to accept commands! */
467b285192aSMauro Carvalho Chehab #define CXERR_RPU_NO_ACK        0x00001D
468b285192aSMauro Carvalho Chehab 
469b285192aSMauro Carvalho Chehab /* The are no buffers ready. Try again soon! */
470b285192aSMauro Carvalho Chehab #define CXERR_NODATA_AGAIN      0x00001E
471b285192aSMauro Carvalho Chehab 
472b285192aSMauro Carvalho Chehab /* The stream is stopping. Function not allowed now! */
473b285192aSMauro Carvalho Chehab #define CXERR_STOPPING_STATUS   0x00001F
474b285192aSMauro Carvalho Chehab 
475b285192aSMauro Carvalho Chehab /* Trying to access hardware when the power is turned OFF */
476b285192aSMauro Carvalho Chehab #define CXERR_DEVPOWER_OFF      0x000020
477b285192aSMauro Carvalho Chehab 
478b285192aSMauro Carvalho Chehab #endif /* CX23418_H */
479