linux/drivers/media/pci/smipcie/smipcie.h

/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * SMI PCIe driver for DVBSky cards.
 *
 * Copyright (C) 2014 Max nibble <[email protected]>
 */

#ifndef _SMI_PCIE_H_
#define _SMI_PCIE_H_

#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <linux/workqueue.h>
#include <media/rc-core.h>

#include <media/demux.h>
#include <media/dmxdev.h>
#include <media/dvb_demux.h>
#include <media/dvb_frontend.h>
#include <media/dvb_net.h>
#include <media/dvbdev.h>

/* -------- Register Base -------- */
#define MSI_CONTROL_REG_BASE
#define SYSTEM_CONTROL_REG_BASE
#define PCIE_EP_DEBUG_REG_BASE
#define IR_CONTROL_REG_BASE
#define I2C_A_CONTROL_REG_BASE
#define I2C_B_CONTROL_REG_BASE
#define ATV_PORTA_CONTROL_REG_BASE
#define DTV_PORTA_CONTROL_REG_BASE
#define AES_PORTA_CONTROL_REG_BASE
#define DMA_PORTA_CONTROL_REG_BASE
#define ATV_PORTB_CONTROL_REG_BASE
#define DTV_PORTB_CONTROL_REG_BASE
#define AES_PORTB_CONTROL_REG_BASE
#define DMA_PORTB_CONTROL_REG_BASE
#define UART_A_REGISTER_BASE
#define UART_B_REGISTER_BASE
#define GPS_CONTROL_REG_BASE
#define DMA_PORTC_CONTROL_REG_BASE
#define DMA_PORTD_CONTROL_REG_BASE
#define AES_RANDOM_DATA_BASE
#define AES_KEY_IN_BASE
#define RANDOM_DATA_LIB_BASE
#define IR_DATA_BUFFER_BASE
#define PORTA_TS_BUFFER_BASE
#define PORTA_I2S_BUFFER_BASE
#define PORTB_TS_BUFFER_BASE
#define PORTB_I2S_BUFFER_BASE

/* -------- MSI control and state register -------- */
#define MSI_DELAY_TIMER
#define MSI_INT_STATUS
#define MSI_INT_STATUS_CLR
#define MSI_INT_STATUS_SET
#define MSI_INT_ENA
#define MSI_INT_ENA_CLR
#define MSI_INT_ENA_SET
#define MSI_SOFT_RESET
#define MSI_CFG_SRC0

/* -------- Hybird Controller System Control register -------- */
#define MUX_MODE_CTRL
	#define rbPaMSMask
	#define rbPaMSDtvNoGpio
	#define rbPaMSDtv4bitGpio
	#define rbPaMSDtv7bitGpio
	#define rbPaMS8bitGpio
	#define rbPaMSAtv
	#define rbPbMSMask
	#define rbPbMSDtvNoGpio
	#define rbPbMSDtv4bitGpio
	#define rbPbMSDtv7bitGpio
	#define rbPbMS8bitGpio
	#define rbPbMSAtv
	#define rbPaAESEN
	#define rbPbAESEN

#define INTERNAL_RST
#define PERIPHERAL_CTRL
#define GPIO_0to7_CTRL
#define GPIO_8to15_CTRL
#define GPIO_16to24_CTRL
#define GPIO_INT_SRC_CFG
#define SYS_BUF_STATUS
#define PCIE_IP_REG_ACS
#define PCIE_IP_REG_ACS_ADDR
#define PCIE_IP_REG_ACS_DATA

/* -------- IR Control register -------- */
#define IR_Init_Reg
#define IR_Idle_Cnt_Low
#define IR_Idle_Cnt_High
#define IR_Unit_Cnt_Low
#define IR_Unit_Cnt_High
#define IR_Data_Cnt
#define rbIRen
#define rbIRhighidle
#define rbIRlowidle
#define rbIRVld

/* -------- I2C A control and state register -------- */
#define I2C_A_CTL_STATUS
#define I2C_A_ADDR
#define I2C_A_SW_CTL
#define I2C_A_TIME_OUT_CNT
#define I2C_A_FIFO_STATUS
#define I2C_A_FS_EN
#define I2C_A_FIFO_DATA

/* -------- I2C B control and state register -------- */
#define I2C_B_CTL_STATUS
#define I2C_B_ADDR
#define I2C_B_SW_CTL
#define I2C_B_TIME_OUT_CNT
#define I2C_B_FIFO_STATUS
#define I2C_B_FS_EN
#define I2C_B_FIFO_DATA

#define VIDEO_CTRL_STATUS_A

/* -------- Digital TV control register, Port A -------- */
#define MPEG2_CTRL_A
#define SERIAL_IN_ADDR_A
#define VLD_CNT_ADDR_A
#define ERR_CNT_ADDR_A
#define BRD_CNT_ADDR_A

/* -------- DMA Control Register, Port A  -------- */
#define DMA_PORTA_CHAN0_ADDR_LOW
#define DMA_PORTA_CHAN0_ADDR_HI
#define DMA_PORTA_CHAN0_TRANS_STATE
#define DMA_PORTA_CHAN0_CONTROL
#define DMA_PORTA_CHAN1_ADDR_LOW
#define DMA_PORTA_CHAN1_ADDR_HI
#define DMA_PORTA_CHAN1_TRANS_STATE
#define DMA_PORTA_CHAN1_CONTROL
#define DMA_PORTA_MANAGEMENT
#define VIDEO_CTRL_STATUS_B

/* -------- Digital TV control register, Port B -------- */
#define MPEG2_CTRL_B
#define SERIAL_IN_ADDR_B
#define VLD_CNT_ADDR_B
#define ERR_CNT_ADDR_B
#define BRD_CNT_ADDR_B

/* -------- AES control register, Port B -------- */
#define AES_CTRL_B
#define AES_KEY_BASE_B

/* -------- DMA Control Register, Port B  -------- */
#define DMA_PORTB_CHAN0_ADDR_LOW
#define DMA_PORTB_CHAN0_ADDR_HI
#define DMA_PORTB_CHAN0_TRANS_STATE
#define DMA_PORTB_CHAN0_CONTROL
#define DMA_PORTB_CHAN1_ADDR_LOW
#define DMA_PORTB_CHAN1_ADDR_HI
#define DMA_PORTB_CHAN1_TRANS_STATE
#define DMA_PORTB_CHAN1_CONTROL
#define DMA_PORTB_MANAGEMENT

#define DMA_TRANS_UNIT_188

/* -------- Macro define of 24 interrupt resource --------*/
#define DMA_A_CHAN0_DONE_INT
#define DMA_A_CHAN1_DONE_INT
#define DMA_B_CHAN0_DONE_INT
#define DMA_B_CHAN1_DONE_INT
#define DMA_C_CHAN0_DONE_INT
#define DMA_C_CHAN1_DONE_INT
#define DMA_D_CHAN0_DONE_INT
#define DMA_D_CHAN1_DONE_INT
#define DATA_BUF_OVERFLOW_INT
#define UART_0_X_INT
#define UART_1_X_INT
#define IR_X_INT
#define GPIO_0_INT
#define GPIO_1_INT
#define GPIO_2_INT
#define GPIO_3_INT
#define ALL_INT

/* software I2C bit mask */
#define SW_I2C_MSK_MODE
#define SW_I2C_MSK_CLK_OUT
#define SW_I2C_MSK_DAT_OUT
#define SW_I2C_MSK_CLK_EN
#define SW_I2C_MSK_DAT_EN
#define SW_I2C_MSK_DAT_IN
#define SW_I2C_MSK_CLK_IN

#define SMI_VID
#define SMI_PID
#define SMI_TS_DMA_BUF_SIZE

struct smi_cfg_info {};

struct smi_rc {};

struct smi_port {};

struct smi_dev {};

#define smi_read(reg)
#define smi_write(reg, value)

#define smi_andor(reg, mask, value)

#define smi_set(reg, bit)
#define smi_clear(reg, bit)

int smi_ir_irq(struct smi_rc *ir, u32 int_status);
void smi_ir_start(struct smi_rc *ir);
void smi_ir_exit(struct smi_dev *dev);
int smi_ir_init(struct smi_dev *dev);

#endif /* #ifndef _SMI_PCIE_H_ */