linux/drivers/media/pci/saa7164/saa7164-reg.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 *  Driver for the NXP SAA7164 PCIe bridge
 *
 *  Copyright (c) 2010-2015 Steven Toth <[email protected]>
 */

/* TODO: Retest the driver with errors expressed as negatives */

/* Result codes */
#define SAA_OK
#define SAA_ERR_BAD_PARAMETER
#define SAA_ERR_NO_RESOURCES
#define SAA_ERR_NOT_SUPPORTED
#define SAA_ERR_BUSY
#define SAA_ERR_READ
#define SAA_ERR_TIMEOUT
#define SAA_ERR_OVERFLOW
#define SAA_ERR_EMPTY
#define SAA_ERR_NOT_STARTED
#define SAA_ERR_ALREADY_STARTED
#define SAA_ERR_NOT_STOPPED
#define SAA_ERR_ALREADY_STOPPED
#define SAA_ERR_INVALID_COMMAND
#define SAA_ERR_NULL_PACKET

/* Errors and flags from the silicon */
#define PVC_ERRORCODE_UNKNOWN
#define PVC_ERRORCODE_INVALID_COMMAND
#define PVC_ERRORCODE_INVALID_CONTROL
#define PVC_ERRORCODE_INVALID_DATA
#define PVC_ERRORCODE_TIMEOUT
#define PVC_ERRORCODE_NAK
#define PVC_RESPONSEFLAG_ERROR
#define PVC_RESPONSEFLAG_OVERFLOW
#define PVC_RESPONSEFLAG_RESET
#define PVC_RESPONSEFLAG_INTERFACE
#define PVC_RESPONSEFLAG_CONTINUED
#define PVC_CMDFLAG_INTERRUPT
#define PVC_CMDFLAG_INTERFACE
#define PVC_CMDFLAG_SERIALIZE
#define PVC_CMDFLAG_CONTINUE

/* Silicon Commands */
#define GET_DESCRIPTORS_CONTROL
#define GET_STRING_CONTROL
#define GET_LANGUAGE_CONTROL
#define SET_POWER_CONTROL
#define GET_FW_STATUS_CONTROL
#define GET_FW_VERSION_CONTROL
#define SET_DEBUG_LEVEL_CONTROL
#define GET_DEBUG_DATA_CONTROL
#define GET_PRODUCTION_INFO_CONTROL

/* cmd defines */
#define SAA_CMDFLAG_CONTINUE
#define SAA_CMD_MAX_MSG_UNITS

/* Some defines */
#define SAA_BUS_TIMEOUT
#define SAA_DEVICE_TIMEOUT
#define SAA_DEVICE_MAXREQUESTSIZE

/* Register addresses */
#define SAA_DEVICE_VERSION
#define SAA_DOWNLOAD_FLAGS
#define SAA_DOWNLOAD_FLAG
#define SAA_DOWNLOAD_FLAG_ACK
#define SAA_DATAREADY_FLAG
#define SAA_DATAREADY_FLAG_ACK

/* Boot loader register and bit definitions */
#define SAA_BOOTLOADERERROR_FLAGS
#define SAA_DEVICE_IMAGE_SEARCHING
#define SAA_DEVICE_IMAGE_LOADING
#define SAA_DEVICE_IMAGE_BOOTING
#define SAA_DEVICE_IMAGE_CORRUPT
#define SAA_DEVICE_MEMORY_CORRUPT
#define SAA_DEVICE_NO_IMAGE

/* Register addresses */
#define SAA_DEVICE_2ND_VERSION
#define SAA_DEVICE_2ND_DOWNLOADFLAG_OFFSET

/* Register addresses */
#define SAA_SECONDSTAGEERROR_FLAGS

/* Bootloader regs and flags */
#define SAA_DEVICE_DEADLOCK_DETECTED_OFFSET
#define SAA_DEVICE_DEADLOCK_DETECTED

/* Basic firmware status registers */
#define SAA_DEVICE_SYSINIT_STATUS_OFFSET
#define SAA_DEVICE_SYSINIT_STATUS
#define SAA_DEVICE_SYSINIT_MODE
#define SAA_DEVICE_SYSINIT_SPEC
#define SAA_DEVICE_SYSINIT_INST
#define SAA_DEVICE_SYSINIT_CPULOAD
#define SAA_DEVICE_SYSINIT_REMAINHEAP

#define SAA_DEVICE_DOWNLOAD_OFFSET
#define SAA_DEVICE_BUFFERBLOCKSIZE

#define SAA_DEVICE_2ND_BUFFERBLOCKSIZE
#define SAA_DEVICE_2ND_DOWNLOAD_OFFSET

/* Descriptors */
#define CS_INTERFACE

/* Descriptor subtypes */
#define VC_INPUT_TERMINAL
#define VC_OUTPUT_TERMINAL
#define VC_SELECTOR_UNIT
#define VC_PROCESSING_UNIT
#define FEATURE_UNIT
#define TUNER_UNIT
#define ENCODER_UNIT
#define EXTENSION_UNIT
#define VC_TUNER_PATH
#define PVC_HARDWARE_DESCRIPTOR
#define PVC_INTERFACE_DESCRIPTOR
#define PVC_INFRARED_UNIT
#define DRM_UNIT
#define GENERAL_REQUEST

/* Format Types */
#define VS_FORMAT_TYPE
#define VS_FORMAT_TYPE_I
#define VS_FORMAT_UNCOMPRESSED
#define VS_FRAME_UNCOMPRESSED
#define VS_FORMAT_MPEG2PS
#define VS_FORMAT_MPEG2TS
#define VS_FORMAT_MPEG4SL
#define VS_FORMAT_WM9
#define VS_FORMAT_DIVX
#define VS_FORMAT_VBI
#define VS_FORMAT_RDS

/* Device extension commands */
#define EXU_REGISTER_ACCESS_CONTROL
#define EXU_GPIO_CONTROL
#define EXU_GPIO_GROUP_CONTROL
#define EXU_INTERRUPT_CONTROL

/* State Transition and args */
#define SAA_PROBE_CONTROL
#define SAA_COMMIT_CONTROL
#define SAA_STATE_CONTROL
#define SAA_DMASTATE_STOP
#define SAA_DMASTATE_ACQUIRE
#define SAA_DMASTATE_PAUSE
#define SAA_DMASTATE_RUN

/* A/V Mux Input Selector */
#define SU_INPUT_SELECT_CONTROL

/* Encoder Profiles */
#define EU_PROFILE_PS_DVD
#define EU_PROFILE_TS_HQ
#define EU_VIDEO_FORMAT_MPEG_2

/* Tuner */
#define TU_AUDIO_MODE_CONTROL

/* Video Formats */
#define TU_STANDARD_CONTROL
#define TU_STANDARD_AUTO_CONTROL
#define TU_STANDARD_NONE
#define TU_STANDARD_NTSC_M
#define TU_STANDARD_PAL_I
#define TU_STANDARD_MANUAL
#define TU_STANDARD_AUTO

/* Video Controls */
#define PU_BRIGHTNESS_CONTROL
#define PU_CONTRAST_CONTROL
#define PU_HUE_CONTROL
#define PU_SATURATION_CONTROL
#define PU_SHARPNESS_CONTROL

/* Audio Controls */
#define MUTE_CONTROL
#define VOLUME_CONTROL
#define AUDIO_DEFAULT_CONTROL

/* Default Volume Levels */
#define TMHW_LEV_ADJ_DECLEV_DEFAULT
#define TMHW_LEV_ADJ_MONOLEV_DEFAULT
#define TMHW_LEV_ADJ_NICLEV_DEFAULT
#define TMHW_LEV_ADJ_SAPLEV_DEFAULT
#define TMHW_LEV_ADJ_ADCLEV_DEFAULT

/* Encoder Related Commands */
#define EU_PROFILE_CONTROL
#define EU_VIDEO_FORMAT_CONTROL
#define EU_VIDEO_BIT_RATE_CONTROL
#define EU_VIDEO_RESOLUTION_CONTROL
#define EU_VIDEO_GOP_STRUCTURE_CONTROL
#define EU_VIDEO_INPUT_ASPECT_CONTROL
#define EU_AUDIO_FORMAT_CONTROL
#define EU_AUDIO_BIT_RATE_CONTROL

/* Firmware Debugging */
#define SET_DEBUG_LEVEL_CONTROL
#define GET_DEBUG_DATA_CONTROL