linux/drivers/media/pci/pt3/pt3.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Earthsoft PT3 driver
 *
 * Copyright (C) 2014 Akihiro Tsukada <[email protected]>
 */

#ifndef PT3_H
#define PT3_H

#include <linux/atomic.h>
#include <linux/types.h>

#include <media/dvb_demux.h>
#include <media/dvb_frontend.h>
#include <media/dmxdev.h>

#include "tc90522.h"
#include "mxl301rf.h"
#include "qm1d1c0042.h"

#define DRV_NAME

#define PT3_NUM_FE

/*
 * register index of the FPGA chip
 */
#define REG_VERSION
#define REG_BUS
#define REG_SYSTEM_W
#define REG_SYSTEM_R
#define REG_I2C_W
#define REG_I2C_R
#define REG_RAM_W
#define REG_RAM_R
#define REG_DMA_BASE
#define OFST_DMA_DESC_L
#define OFST_DMA_DESC_H
#define OFST_DMA_CTL
#define OFST_TS_CTL
#define OFST_STATUS
#define OFST_TS_ERR

/*
 * internal buffer for I2C
 */
#define PT3_I2C_MAX
struct pt3_i2cbuf {};

/*
 * DMA things
 */
#define TS_PACKET_SZ
/* DMA transfers must not cross 4GiB, so use one page / transfer */
#define DATA_XFER_SZ
#define DATA_BUF_XFERS
/* (num_bufs * DATA_BUF_SZ) % TS_PACKET_SZ must be 0 */
#define DATA_BUF_SZ
#define MAX_DATA_BUFS
#define MIN_DATA_BUFS

#define DESCS_IN_PAGE
#define MAX_NUM_XFERS
#define MAX_DESC_BUFS

/* DMA transfer description.
 * device is passed a pointer to this struct, dma-reads it,
 * and gets the DMA buffer ring for storing TS data.
 */
struct xfer_desc {};

/* A DMA mapping of a page containing xfer_desc's */
struct xfer_desc_buffer {};

/* A DMA mapping of a data buffer */
struct dma_data_buffer {};

/*
 * device things
 */
struct pt3_adap_config {};

struct pt3_adapter {};


struct pt3_board {};


/*
 * prototypes
 */
extern int  pt3_alloc_dmabuf(struct pt3_adapter *adap);
extern void pt3_init_dmabuf(struct pt3_adapter *adap);
extern void pt3_free_dmabuf(struct pt3_adapter *adap);
extern int  pt3_start_dma(struct pt3_adapter *adap);
extern int  pt3_stop_dma(struct pt3_adapter *adap);
extern int  pt3_proc_dma(struct pt3_adapter *adap);

extern int  pt3_i2c_master_xfer(struct i2c_adapter *adap,
				struct i2c_msg *msgs, int num);
extern u32  pt3_i2c_functionality(struct i2c_adapter *adap);
extern void pt3_i2c_reset(struct pt3_board *pt3);
extern int  pt3_init_all_demods(struct pt3_board *pt3);
extern int  pt3_init_all_mxl301rf(struct pt3_board *pt3);
#endif /* PT3_H */