brintos

brintos / linux-shallow public Read only

0
0
Text · 16.8 KiB · 8859c0e Raw
479 lines · c
1/* SPDX-License-Identifier: GPL-2.0-or-later */2/*3 *  cx18 header containing common defines.4 *5 *  Copyright (C) 2007  Hans Verkuil <hverkuil@xs4all.nl>6 */7 8#ifndef CX23418_H9#define CX23418_H10 11#include <media/drv-intf/cx2341x.h>12 13#define MGR_CMD_MASK				0x4000000014/* The MSB of the command code indicates that this is the completion of a15   command */16#define MGR_CMD_MASK_ACK			(MGR_CMD_MASK | 0x80000000)17 18/* Description: This command creates a new instance of a certain task19   IN[0]  - Task ID. This is one of the XPU_CMD_MASK_YYY where XPU is20	    the processor on which the task YYY will be created21   OUT[0] - Task handle. This handle is passed along with commands to22	    dispatch to the right instance of the task23   ReturnCode - One of the ERR_SYS_... */24#define CX18_CREATE_TASK			(MGR_CMD_MASK | 0x0001)25 26/* Description: This command destroys an instance of a task27   IN[0] - Task handle. Hanlde of the task to destroy28   ReturnCode - One of the ERR_SYS_... */29#define CX18_DESTROY_TASK			(MGR_CMD_MASK | 0x0002)30 31/* All commands for CPU have the following mask set */32#define CPU_CMD_MASK				0x2000000033#define CPU_CMD_MASK_DEBUG			(CPU_CMD_MASK | 0x00000000)34#define CPU_CMD_MASK_ACK			(CPU_CMD_MASK | 0x80000000)35#define CPU_CMD_MASK_CAPTURE			(CPU_CMD_MASK | 0x00020000)36#define CPU_CMD_MASK_TS				(CPU_CMD_MASK | 0x00040000)37 38#define EPU_CMD_MASK				0x0200000039#define EPU_CMD_MASK_DEBUG			(EPU_CMD_MASK | 0x000000)40#define EPU_CMD_MASK_DE				(EPU_CMD_MASK | 0x040000)41 42#define APU_CMD_MASK				0x1000000043#define APU_CMD_MASK_ACK			(APU_CMD_MASK | 0x80000000)44 45#define CX18_APU_ENCODING_METHOD_MPEG		(0 << 28)46#define CX18_APU_ENCODING_METHOD_AC3		(1 << 28)47 48/* Description: Command APU to start audio49   IN[0] - audio parameters (same as CX18_CPU_SET_AUDIO_PARAMETERS?)50   IN[1] - caller buffer address, or 051   ReturnCode - ??? */52#define CX18_APU_START				(APU_CMD_MASK | 0x01)53 54/* Description: Command APU to stop audio55   IN[0] - encoding method to stop56   ReturnCode - ??? */57#define CX18_APU_STOP				(APU_CMD_MASK | 0x02)58 59/* Description: Command APU to reset the AI60   ReturnCode - ??? */61#define CX18_APU_RESETAI			(APU_CMD_MASK | 0x05)62 63/* Description: This command indicates that a Memory Descriptor List has been64   filled with the requested channel type65   IN[0] - Task handle. Handle of the task66   IN[1] - Offset of the MDL_ACK from the beginning of the local DDR.67   IN[2] - Number of CNXT_MDL_ACK structures in the array pointed to by IN[1]68   ReturnCode - One of the ERR_DE_... */69#define CX18_EPU_DMA_DONE			(EPU_CMD_MASK_DE | 0x0001)70 71/* Something interesting happened72   IN[0] - A value to log73   IN[1] - An offset of a string in the MiniMe memory;74	   0/zero/NULL means "I have nothing to say" */75#define CX18_EPU_DEBUG				(EPU_CMD_MASK_DEBUG | 0x0003)76 77/* Reads memory/registers (32-bit)78   IN[0] - Address79   OUT[1] - Value */80#define CX18_CPU_DEBUG_PEEK32			(CPU_CMD_MASK_DEBUG | 0x0003)81 82/* Description: This command starts streaming with the set channel type83   IN[0] - Task handle. Handle of the task to start84   ReturnCode - One of the ERR_CAPTURE_... */85#define CX18_CPU_CAPTURE_START			(CPU_CMD_MASK_CAPTURE | 0x0002)86 87/* Description: This command stops streaming with the set channel type88   IN[0] - Task handle. Handle of the task to stop89   IN[1] - 0 = stop at end of GOP, 1 = stop at end of frame (MPEG only)90   ReturnCode - One of the ERR_CAPTURE_... */91#define CX18_CPU_CAPTURE_STOP			(CPU_CMD_MASK_CAPTURE | 0x0003)92 93/* Description: This command pauses streaming with the set channel type94   IN[0] - Task handle. Handle of the task to pause95   ReturnCode - One of the ERR_CAPTURE_... */96#define CX18_CPU_CAPTURE_PAUSE			(CPU_CMD_MASK_CAPTURE | 0x0007)97 98/* Description: This command resumes streaming with the set channel type99   IN[0] - Task handle. Handle of the task to resume100   ReturnCode - One of the ERR_CAPTURE_... */101#define CX18_CPU_CAPTURE_RESUME			(CPU_CMD_MASK_CAPTURE | 0x0008)102 103#define CAPTURE_CHANNEL_TYPE_NONE		0104#define CAPTURE_CHANNEL_TYPE_MPEG		1105#define CAPTURE_CHANNEL_TYPE_INDEX		2106#define CAPTURE_CHANNEL_TYPE_YUV		3107#define CAPTURE_CHANNEL_TYPE_PCM		4108#define CAPTURE_CHANNEL_TYPE_VBI		5109#define CAPTURE_CHANNEL_TYPE_SLICED_VBI		6110#define CAPTURE_CHANNEL_TYPE_TS			7111#define CAPTURE_CHANNEL_TYPE_MAX		15112 113/* Description: This command sets the channel type. This can only be done114   when stopped.115   IN[0] - Task handle. Handle of the task to start116   IN[1] - Channel Type. See Below.117   ReturnCode - One of the ERR_CAPTURE_... */118#define CX18_CPU_SET_CHANNEL_TYPE		(CPU_CMD_MASK_CAPTURE + 1)119 120/* Description: Set stream output type121   IN[0] - task handle. Handle of the task to start122   IN[1] - type123   ReturnCode - One of the ERR_CAPTURE_... */124#define CX18_CPU_SET_STREAM_OUTPUT_TYPE		(CPU_CMD_MASK_CAPTURE | 0x0012)125 126/* Description: Set video input resolution and frame rate127   IN[0] - task handle128   IN[1] - reserved129   IN[2] - reserved130   IN[3] - reserved131   IN[4] - reserved132   IN[5] - frame rate, 0 - 29.97f/s, 1 - 25f/s133   ReturnCode - One of the ERR_CAPTURE_... */134#define CX18_CPU_SET_VIDEO_IN			(CPU_CMD_MASK_CAPTURE | 0x0004)135 136/* Description: Set video frame rate137   IN[0] - task handle. Handle of the task to start138   IN[1] - video bit rate mode139   IN[2] - video average rate140   IN[3] - video peak rate141   IN[4] - system mux rate142   ReturnCode - One of the ERR_CAPTURE_... */143#define CX18_CPU_SET_VIDEO_RATE			(CPU_CMD_MASK_CAPTURE | 0x0005)144 145/* Description: Set video output resolution146   IN[0] - task handle147   IN[1] - horizontal size148   IN[2] - vertical size149   ReturnCode - One of the ERR_CAPTURE_... */150#define CX18_CPU_SET_VIDEO_RESOLUTION		(CPU_CMD_MASK_CAPTURE | 0x0006)151 152/* Description: This command set filter parameters153   IN[0] - Task handle. Handle of the task154   IN[1] - type, 0 - temporal, 1 - spatial, 2 - median155   IN[2] - mode,  temporal/spatial: 0 - disable, 1 - static, 2 - dynamic156			median:	0 = disable, 1 = horizontal, 2 = vertical,157				3 = horizontal/vertical, 4 = diagonal158   IN[3] - strength, temporal 0 - 31, spatial 0 - 15159   ReturnCode - One of the ERR_CAPTURE_... */160#define CX18_CPU_SET_FILTER_PARAM		(CPU_CMD_MASK_CAPTURE | 0x0009)161 162/* Description: This command set spatial filter type163   IN[0] - Task handle.164   IN[1] - luma type: 0 = disable, 1 = 1D horizontal only, 2 = 1D vertical only,165		      3 = 2D H/V separable, 4 = 2D symmetric non-separable166   IN[2] - chroma type: 0 - disable, 1 = 1D horizontal167   ReturnCode - One of the ERR_CAPTURE_... */168#define CX18_CPU_SET_SPATIAL_FILTER_TYPE	(CPU_CMD_MASK_CAPTURE | 0x000C)169 170/* Description: This command set coring levels for median filter171   IN[0] - Task handle.172   IN[1] - luma_high173   IN[2] - luma_low174   IN[3] - chroma_high175   IN[4] - chroma_low176   ReturnCode - One of the ERR_CAPTURE_... */177#define CX18_CPU_SET_MEDIAN_CORING		(CPU_CMD_MASK_CAPTURE | 0x000E)178 179/* Description: This command set the picture type mask for index file180   IN[0] - Task handle (ignored by firmware)181   IN[1] -	0 = disable index file output182			1 = output I picture183			2 = P picture184			4 = B picture185			other = illegal */186#define CX18_CPU_SET_INDEXTABLE			(CPU_CMD_MASK_CAPTURE | 0x0010)187 188/* Description: Set audio parameters189   IN[0] - task handle. Handle of the task to start190   IN[1] - audio parameter191   ReturnCode - One of the ERR_CAPTURE_... */192#define CX18_CPU_SET_AUDIO_PARAMETERS		(CPU_CMD_MASK_CAPTURE | 0x0011)193 194/* Description: Set video mute195   IN[0] - task handle. Handle of the task to start196   IN[1] - bit31-24: muteYvalue197	   bit23-16: muteUvalue198	   bit15-8:  muteVvalue199	   bit0:     1:mute, 0: unmute200   ReturnCode - One of the ERR_CAPTURE_... */201#define CX18_CPU_SET_VIDEO_MUTE			(CPU_CMD_MASK_CAPTURE | 0x0013)202 203/* Description: Set audio mute204   IN[0] - task handle. Handle of the task to start205   IN[1] - mute/unmute206   ReturnCode - One of the ERR_CAPTURE_... */207#define CX18_CPU_SET_AUDIO_MUTE			(CPU_CMD_MASK_CAPTURE | 0x0014)208 209/* Description: Set stream output type210   IN[0] - task handle. Handle of the task to start211   IN[1] - subType212	    SET_INITIAL_SCR			1213	    SET_QUALITY_MODE            2214	    SET_VIM_PROTECT_MODE        3215	    SET_PTS_CORRECTION          4216	    SET_USB_FLUSH_MODE          5217	    SET_MERAQPAR_ENABLE         6218	    SET_NAV_PACK_INSERTION      7219	    SET_SCENE_CHANGE_ENABLE     8220   IN[2] - parameter 1221   IN[3] - parameter 2222   ReturnCode - One of the ERR_CAPTURE_... */223#define CX18_CPU_SET_MISC_PARAMETERS		(CPU_CMD_MASK_CAPTURE | 0x0015)224 225/* Description: Set raw VBI parameters226   IN[0] - Task handle227   IN[1] - No. of input lines per field:228				bit[15:0]: field 1,229				bit[31:16]: field 2230   IN[2] - No. of input bytes per line231   IN[3] - No. of output frames per transfer232   IN[4] - start code233   IN[5] - stop code234   ReturnCode */235#define CX18_CPU_SET_RAW_VBI_PARAM		(CPU_CMD_MASK_CAPTURE | 0x0016)236 237/* Description: Set capture line No.238   IN[0] - task handle. Handle of the task to start239   IN[1] - height1240   IN[2] - height2241   ReturnCode - One of the ERR_CAPTURE_... */242#define CX18_CPU_SET_CAPTURE_LINE_NO		(CPU_CMD_MASK_CAPTURE | 0x0017)243 244/* Description: Set copyright245   IN[0] - task handle. Handle of the task to start246   IN[1] - copyright247   ReturnCode - One of the ERR_CAPTURE_... */248#define CX18_CPU_SET_COPYRIGHT			(CPU_CMD_MASK_CAPTURE | 0x0018)249 250/* Description: Set audio PID251   IN[0] - task handle. Handle of the task to start252   IN[1] - PID253   ReturnCode - One of the ERR_CAPTURE_... */254#define CX18_CPU_SET_AUDIO_PID			(CPU_CMD_MASK_CAPTURE | 0x0019)255 256/* Description: Set video PID257   IN[0] - task handle. Handle of the task to start258   IN[1] - PID259   ReturnCode - One of the ERR_CAPTURE_... */260#define CX18_CPU_SET_VIDEO_PID			(CPU_CMD_MASK_CAPTURE | 0x001A)261 262/* Description: Set Vertical Crop Line263   IN[0] - task handle. Handle of the task to start264   IN[1] - Line265   ReturnCode - One of the ERR_CAPTURE_... */266#define CX18_CPU_SET_VER_CROP_LINE		(CPU_CMD_MASK_CAPTURE | 0x001B)267 268/* Description: Set COP structure269   IN[0] - task handle. Handle of the task to start270   IN[1] - M271   IN[2] - N272   ReturnCode - One of the ERR_CAPTURE_... */273#define CX18_CPU_SET_GOP_STRUCTURE		(CPU_CMD_MASK_CAPTURE | 0x001C)274 275/* Description: Set Scene Change Detection276   IN[0] - task handle. Handle of the task to start277   IN[1] - scene change278   ReturnCode - One of the ERR_CAPTURE_... */279#define CX18_CPU_SET_SCENE_CHANGE_DETECTION	(CPU_CMD_MASK_CAPTURE | 0x001D)280 281/* Description: Set Aspect Ratio282   IN[0] - task handle. Handle of the task to start283   IN[1] - AspectRatio284   ReturnCode - One of the ERR_CAPTURE_... */285#define CX18_CPU_SET_ASPECT_RATIO		(CPU_CMD_MASK_CAPTURE | 0x001E)286 287/* Description: Set Skip Input Frame288   IN[0] - task handle. Handle of the task to start289   IN[1] - skip input frames290   ReturnCode - One of the ERR_CAPTURE_... */291#define CX18_CPU_SET_SKIP_INPUT_FRAME		(CPU_CMD_MASK_CAPTURE | 0x001F)292 293/* Description: Set sliced VBI parameters -294   Note This API will only apply to MPEG and Sliced VBI Channels295   IN[0] - Task handle296   IN[1] - output type, 0 - CC, 1 - Moji, 2 - Teletext297   IN[2] - start / stop line298			bit[15:0] start line number299			bit[31:16] stop line number300   IN[3] - number of output frames per interrupt301   IN[4] - VBI insertion mode302			bit 0:	output user data, 1 - enable303			bit 1:	output private stream, 1 - enable304			bit 2:	mux option, 0 - in GOP, 1 - in picture305			bit[7:0]	private stream ID306   IN[5] - insertion period while mux option is in picture307   ReturnCode - VBI data offset */308#define CX18_CPU_SET_SLICED_VBI_PARAM		(CPU_CMD_MASK_CAPTURE | 0x0020)309 310/* Description: Set the user data place holder311   IN[0] - type of data (0 for user)312   IN[1] - Stuffing period313   IN[2] - ID data size in word (less than 10)314   IN[3] - Pointer to ID buffer */315#define CX18_CPU_SET_USERDATA_PLACE_HOLDER	(CPU_CMD_MASK_CAPTURE | 0x0021)316 317 318/* Description:319   In[0] Task Handle320   return parameter:321   Out[0]  Reserved322   Out[1]  Video PTS bit[32:2] of last output video frame.323   Out[2]  Video PTS bit[ 1:0] of last output video frame.324   Out[3]  Hardware Video PTS counter bit[31:0],325	     these bits get incremented on every 90kHz clock tick.326   Out[4]  Hardware Video PTS counter bit32,327	     these bits get incremented on every 90kHz clock tick.328   ReturnCode */329#define CX18_CPU_GET_ENC_PTS			(CPU_CMD_MASK_CAPTURE | 0x0022)330 331/* Description: Set VFC parameters332   IN[0] - task handle333   IN[1] - VFC enable flag, 1 - enable, 0 - disable334*/335#define CX18_CPU_SET_VFC_PARAM                  (CPU_CMD_MASK_CAPTURE | 0x0023)336 337/* Below is the list of commands related to the data exchange */338#define CPU_CMD_MASK_DE				(CPU_CMD_MASK | 0x040000)339 340/* Description: This command provides the physical base address of the local341   DDR as viewed by EPU342   IN[0] - Physical offset where EPU has the local DDR mapped343   ReturnCode - One of the ERR_DE_... */344#define CPU_CMD_DE_SetBase			(CPU_CMD_MASK_DE | 0x0001)345 346/* Description: This command provides the offsets in the device memory where347   the 2 cx18_mdl_ack blocks reside348   IN[0] - Task handle. Handle of the task to start349   IN[1] - Offset of the first cx18_mdl_ack from the beginning of the350	   local DDR.351   IN[2] - Offset of the second cx18_mdl_ack from the beginning of the352	   local DDR.353   ReturnCode - One of the ERR_DE_... */354#define CX18_CPU_DE_SET_MDL_ACK			(CPU_CMD_MASK_DE | 0x0002)355 356/* Description: This command provides the offset to a Memory Descriptor List357   IN[0] - Task handle. Handle of the task to start358   IN[1] - Offset of the MDL from the beginning of the local DDR.359   IN[2] - Number of cx18_mdl_ent structures in the array pointed to by IN[1]360   IN[3] - Buffer ID361   IN[4] - Total buffer length362   ReturnCode - One of the ERR_DE_... */363#define CX18_CPU_DE_SET_MDL			(CPU_CMD_MASK_DE | 0x0005)364 365/* Description: This command requests return of all current Memory366   Descriptor Lists to the driver367   IN[0] - Task handle. Handle of the task to start368   ReturnCode - One of the ERR_DE_... */369#define CX18_CPU_DE_RELEASE_MDL			(CPU_CMD_MASK_DE | 0x0006)370 371/* Description: This command signals the cpu that the dat buffer has been372   consumed and ready for re-use.373   IN[0] - Task handle. Handle of the task374   IN[1] - Offset of the data block from the beginning of the local DDR.375   IN[2] - Number of bytes in the data block376   ReturnCode - One of the ERR_DE_... */377/* #define CX18_CPU_DE_RELEASE_BUFFER           (CPU_CMD_MASK_DE | 0x0007) */378 379/* No Error / Success */380#define CNXT_OK                 0x000000381 382/* Received unknown command */383#define CXERR_UNK_CMD           0x000001384 385/* First parameter in the command is invalid */386#define CXERR_INVALID_PARAM1    0x000002387 388/* Second parameter in the command is invalid */389#define CXERR_INVALID_PARAM2    0x000003390 391/* Device interface is not open/found */392#define CXERR_DEV_NOT_FOUND     0x000004393 394/* Requested function is not implemented/available */395#define CXERR_NOTSUPPORTED      0x000005396 397/* Invalid pointer is provided */398#define CXERR_BADPTR            0x000006399 400/* Unable to allocate memory */401#define CXERR_NOMEM             0x000007402 403/* Object/Link not found */404#define CXERR_LINK              0x000008405 406/* Device busy, command cannot be executed */407#define CXERR_BUSY              0x000009408 409/* File/device/handle is not open. */410#define CXERR_NOT_OPEN          0x00000A411 412/* Value is out of range */413#define CXERR_OUTOFRANGE        0x00000B414 415/* Buffer overflow */416#define CXERR_OVERFLOW          0x00000C417 418/* Version mismatch */419#define CXERR_BADVER            0x00000D420 421/* Operation timed out */422#define CXERR_TIMEOUT           0x00000E423 424/* Operation aborted */425#define CXERR_ABORT             0x00000F426 427/* Specified I2C device not found for read/write */428#define CXERR_I2CDEV_NOTFOUND   0x000010429 430/* Error in I2C data xfer (but I2C device is present) */431#define CXERR_I2CDEV_XFERERR    0x000011432 433/* Channel changing component not ready */434#define CXERR_CHANNELNOTREADY   0x000012435 436/* PPU (Presensation/Decoder) mail box is corrupted */437#define CXERR_PPU_MB_CORRUPT    0x000013438 439/* CPU (Capture/Encoder) mail box is corrupted */440#define CXERR_CPU_MB_CORRUPT    0x000014441 442/* APU (Audio) mail box is corrupted */443#define CXERR_APU_MB_CORRUPT    0x000015444 445/* Unable to open file for reading */446#define CXERR_FILE_OPEN_READ    0x000016447 448/* Unable to open file for writing */449#define CXERR_FILE_OPEN_WRITE   0x000017450 451/* Unable to find the I2C section specified */452#define CXERR_I2C_BADSECTION    0x000018453 454/* Error in I2C data xfer (but I2C device is present) */455#define CXERR_I2CDEV_DATALOW    0x000019456 457/* Error in I2C data xfer (but I2C device is present) */458#define CXERR_I2CDEV_CLOCKLOW   0x00001A459 460/* No Interrupt received from HW (for I2C access) */461#define CXERR_NO_HW_I2C_INTR    0x00001B462 463/* RPU is not ready to accept commands! */464#define CXERR_RPU_NOT_READY     0x00001C465 466/* RPU is not ready to accept commands! */467#define CXERR_RPU_NO_ACK        0x00001D468 469/* The are no buffers ready. Try again soon! */470#define CXERR_NODATA_AGAIN      0x00001E471 472/* The stream is stopping. Function not allowed now! */473#define CXERR_STOPPING_STATUS   0x00001F474 475/* Trying to access hardware when the power is turned OFF */476#define CXERR_DEVPOWER_OFF      0x000020477 478#endif /* CX23418_H */479