#include <linux/pci.h>
#include <linux/videodev2.h>
#include <linux/notifier.h>
#include <linux/delay.h>
#include <linux/mutex.h>
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/videobuf2-dma-sg.h>
#include "tw5864-reg.h"
#define PCI_DEVICE_ID_TECHWELL_5864 …
#define TW5864_NORMS …
#define TW5864_INPUTS …
#define MD_CELLS_HOR …
#define MD_CELLS_VERT …
#define MD_CELLS …
#define H264_VLC_BUF_SIZE …
#define H264_MV_BUF_SIZE …
#define QP_VALUE …
#define MAX_GOP_SIZE …
#define GOP_SIZE …
enum resolution { … };
struct tw5864_dev;
struct tw5864_buf { … };
struct tw5864_dma_buf { … };
enum tw5864_vid_std { … };
struct tw5864_input { … };
struct tw5864_h264_frame { … };
struct tw5864_dev { … };
#define tw_readl(reg) …
#define tw_mask_readl(reg, mask) …
#define tw_mask_shift_readl(reg, mask, shift) …
#define tw_writel(reg, value) …
#define tw_mask_writel(reg, mask, value) …
#define tw_mask_shift_writel(reg, mask, shift, value) …
#define tw_setl(reg, bit) …
#define tw_clearl(reg, bit) …
u8 tw5864_indir_readb(struct tw5864_dev *dev, u16 addr);
#define tw_indir_readb(addr) …
void tw5864_indir_writeb(struct tw5864_dev *dev, u16 addr, u8 data);
#define tw_indir_writeb(addr, data) …
void tw5864_irqmask_apply(struct tw5864_dev *dev);
int tw5864_video_init(struct tw5864_dev *dev, int *video_nr);
void tw5864_video_fini(struct tw5864_dev *dev);
void tw5864_prepare_frame_headers(struct tw5864_input *input);
void tw5864_h264_put_stream_header(u8 **buf, size_t *space_left, int qp,
int width, int height);
void tw5864_h264_put_slice_header(u8 **buf, size_t *space_left,
unsigned int idr_pic_id,
unsigned int frame_gop_seqno,
int *tail_nb_bits, u8 *tail);
void tw5864_request_encoded_frame(struct tw5864_input *input);