linux/drivers/staging/media/av7110/av7110_hw.h

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _AV7110_HW_H_
#define _AV7110_HW_H_

#include "av7110.h"

/* DEBI transfer mode defs */

#define DEBINOSWAP
#define DEBISWAB
#define DEBISWAP

#define ARM_WAIT_FREE
#define ARM_WAIT_SHAKE
#define ARM_WAIT_OSD

enum av7110_bootstate {};

enum av7110_type_rec_play_format {};

enum av7110_osd_palette_type {};

/* switch defines */
#define SB_GPIO
#define SB_OFF
#define SB_ON
#define SB_WIDE

#define FB_GPIO
#define FB_OFF
#define FB_ON
#define FB_LOOP

enum av7110_video_output_mode {};

/* firmware internal msg q status: */
#define GPMQFull
#define GPMQOver
#define HPQFull
#define HPQOver
#define OSDQFull
#define OSDQOver
#define GPMQBusy
#define HPQBusy
#define OSDQBusy

/* hw section filter flags */
#define SECTION_EIT
#define SECTION_SINGLE
#define SECTION_CYCLE
#define SECTION_CONTINUOS
#define SECTION_MODE
#define SECTION_IPMPE
#define SECTION_HIGH_SPEED
#define DATA_PIPING_FLAG

#define PBUFSIZE_NONE
#define PBUFSIZE_1P
#define PBUFSIZE_2P
#define PBUFSIZE_1K
#define PBUFSIZE_2K
#define PBUFSIZE_4K
#define PBUFSIZE_8K
#define PBUFSIZE_16K
#define PBUFSIZE_32K

/* firmware command codes */
enum av7110_osd_command {};

enum av7110_pid_command {};

enum av7110_mpeg_command {};

enum av7110_audio_command {};

enum av7110_request_command {};

enum av7110_encoder_command {};

enum av7110_rec_play_state {};

enum av7110_fw_cmd_misc {};

enum av7110_command_type {};

#define VID_NONE_PREF
#define VID_PAN_SCAN_PREF
#define VID_VERT_COMP_PREF
#define VID_VC_AND_PS_PREF
#define VID_CENTRE_CUT_PREF

/* MPEG video decoder commands */
#define AV_VIDEO_CMD_STOP
#define AV_VIDEO_CMD_PLAY
#define AV_VIDEO_CMD_FREEZE
#define AV_VIDEO_CMD_FFWD
#define AV_VIDEO_CMD_SLOW

/* MPEG audio decoder commands */
#define AUDIO_CMD_MUTE
#define AUDIO_CMD_UNMUTE
#define AUDIO_CMD_PCM16
#define AUDIO_CMD_STEREO
#define AUDIO_CMD_MONO_L
#define AUDIO_CMD_MONO_R
#define AUDIO_CMD_SYNC_OFF
#define AUDIO_CMD_SYNC_ON

/* firmware data interface codes */
#define DATA_NONE
#define DATA_FSECTION
#define DATA_IPMPE
#define DATA_MPEG_RECORD
#define DATA_DEBUG_MESSAGE
#define DATA_COMMON_INTERFACE
#define DATA_MPEG_PLAY
#define DATA_BMP_LOAD
#define DATA_IRCOMMAND
#define DATA_PIPING
#define DATA_STREAMING
#define DATA_CI_GET
#define DATA_CI_PUT
#define DATA_MPEG_VIDEO_EVENT

#define DATA_PES_RECORD
#define DATA_PES_PLAY
#define DATA_TS_RECORD
#define DATA_TS_PLAY

/* ancient CI command codes, only two are actually still used
 * by the link level CI firmware
 */
#define CI_CMD_ERROR
#define CI_CMD_ACK
#define CI_CMD_SYSTEM_READY
#define CI_CMD_KEYPRESS
#define CI_CMD_ON_TUNED
#define CI_CMD_ON_SWITCH_PROGRAM
#define CI_CMD_SECTION_ARRIVED
#define CI_CMD_SECTION_TIMEOUT
#define CI_CMD_TIME
#define CI_CMD_ENTER_MENU
#define CI_CMD_FAST_PSI
#define CI_CMD_GET_SLOT_INFO

#define CI_MSG_NONE
#define CI_MSG_CI_INFO
#define CI_MSG_MENU
#define CI_MSG_LIST
#define CI_MSG_TEXT
#define CI_MSG_REQUEST_INPUT
#define CI_MSG_INPUT_COMPLETE
#define CI_MSG_LIST_MORE
#define CI_MSG_MENU_MORE
#define CI_MSG_CLOSE_MMI_IMM
#define CI_MSG_SECTION_REQUEST
#define CI_MSG_CLOSE_FILTER
#define CI_PSI_COMPLETE
#define CI_MODULE_READY
#define CI_SWITCH_PRG_REPLY
#define CI_MSG_TEXT_MORE

#define CI_MSG_CA_PMT
#define CI_MSG_ERROR

/* base address of the dual ported RAM which serves as communication
 * area between PCI bus and av7110,
 * as seen by the DEBI bus of the saa7146
 */
#define DPRAM_BASE

/* boot protocol area */
#define AV7110_BOOT_STATE
#define AV7110_BOOT_SIZE
#define AV7110_BOOT_BASE
#define AV7110_BOOT_BLOCK
#define AV7110_BOOT_MAX_SIZE

/* firmware command protocol area */
#define IRQ_STATE
#define IRQ_STATE_EXT
#define MSGSTATE
#define COMMAND
#define COM_BUFF
#define COM_BUFF_SIZE

/* various data buffers */
#define BUFF1_BASE
#define BUFF1_SIZE

#define DATA_BUFF0_BASE
#define DATA_BUFF0_SIZE

#define DATA_BUFF1_BASE
#define DATA_BUFF1_SIZE

#define DATA_BUFF2_BASE
#define DATA_BUFF2_SIZE

#define DATA_BUFF3_BASE
#define DATA_BUFF3_SIZE

#define Reserved
#define Reserved_SIZE

/* firmware status area */
#define STATUS_BASE
#define STATUS_LOOPS

#define STATUS_MPEG_WIDTH
/* ((aspect_ratio & 0xf) << 12) | (height & 0xfff) */
#define STATUS_MPEG_HEIGHT_AR

/* firmware data protocol area */
#define RX_TYPE
#define RX_LEN
#define TX_TYPE
#define TX_LEN

#define RX_BUFF
#define TX_BUFF

#define HANDSHAKE_REG
#define COM_IF_LOCK

#define IRQ_RX
#define IRQ_TX

/* used by boot protocol to load firmware into av7110 DRAM */
#define DRAM_START_CODE
#define DRAM_MAX_CODE_SIZE

/* saa7146 gpio lines */
#define RESET_LINE
#define DEBI_DONE_LINE
#define ARM_IRQ_LINE

int av7110_bootarm(struct av7110 *av7110);
int av7110_firmversion(struct av7110 *av7110);
#define FW_CI_LL_SUPPORT(arm_app)
#define FW_4M_SDRAM(arm_app)
#define FW_VERSION(arm_app)

int av7110_wait_msgstate(struct av7110 *av7110, u16 flags);
int av7110_fw_cmd(struct av7110 *av7110, int type, int com, int num, ...);
int av7110_fw_request(struct av7110 *av7110, u16 *request_buf,
		      int request_buf_len, u16 *reply_buf, int reply_buf_len);

/* DEBI (saa7146 data extension bus interface) access */
int av7110_debiwrite(struct av7110 *av7110, u32 config,
		     int addr, u32 val, unsigned int count);
u32 av7110_debiread(struct av7110 *av7110, u32 config,
		    int addr, unsigned int count);

/* DEBI during interrupt */
/* single word writes */
static inline void iwdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
{}

/* buffer writes */
static inline void mwdebi(struct av7110 *av7110, u32 config, int addr,
			  const u8 *val, int count)
{}

static inline u32 irdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
{}

/* DEBI outside interrupts, only for count <= 4! */
static inline void wdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
{}

static inline u32 rdebi(struct av7110 *av7110, u32 config, int addr, u32 val, unsigned int count)
{}

/* handle mailbox registers of the dual ported RAM */
static inline void ARM_ResetMailBox(struct av7110 *av7110)
{}

static inline void ARM_ClearMailBox(struct av7110 *av7110)
{}

static inline void ARM_ClearIrq(struct av7110 *av7110)
{}

/****************************************************************************
 * Firmware commands
 ****************************************************************************/

static inline int SendDAC(struct av7110 *av7110, u8 addr, u8 data)
{}

static inline int av7710_set_video_mode(struct av7110 *av7110, int mode)
{}

static inline int vidcom(struct av7110 *av7110, u32 com, u32 arg)
{}

static inline int audcom(struct av7110 *av7110, u32 com)
{}

static inline int Set22K(struct av7110 *av7110, int state)
{}

int av7110_diseqc_send(struct av7110 *av7110, int len, u8 *msg, unsigned long burst);

#ifdef CONFIG_DVB_AV7110_OSD
int av7110_osd_cmd(struct av7110 *av7110, osd_cmd_t *dc);
int av7110_osd_capability(struct av7110 *av7110, osd_cap_t *cap);
#endif /* CONFIG_DVB_AV7110_OSD */

#endif /* _AV7110_HW_H_ */