#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/kthread.h>
#include <linux/freezer.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-common.h>
#include <media/v4l2-event.h>
#include <media/videobuf2-dma-sg.h>
#include "solo6x10.h"
#include "solo6x10-tw28.h"
#include "solo6x10-jpeg.h"
#define MIN_VID_BUFFERS …
#define FRAME_BUF_SIZE …
#define MP4_QS …
#define DMA_ALIGN …
static u8 vop_6010_ntsc_d1[] = …;
static u8 vop_6010_ntsc_cif[] = …;
static u8 vop_6010_pal_d1[] = …;
static u8 vop_6010_pal_cif[] = …;
static u8 vop_6110_ntsc_d1[] = …;
static u8 vop_6110_ntsc_cif[] = …;
static u8 vop_6110_pal_d1[] = …;
static u8 vop_6110_pal_cif[] = …;
vop_header;
struct solo_enc_buf { … };
static int solo_is_motion_on(struct solo_enc_dev *solo_enc)
{ … }
static int solo_motion_detected(struct solo_enc_dev *solo_enc)
{ … }
static void solo_motion_toggle(struct solo_enc_dev *solo_enc, int on)
{ … }
void solo_update_mode(struct solo_enc_dev *solo_enc)
{ … }
static int solo_enc_on(struct solo_enc_dev *solo_enc)
{ … }
static void solo_enc_off(struct solo_enc_dev *solo_enc)
{ … }
static int enc_get_mpeg_dma(struct solo_dev *solo_dev, dma_addr_t dma,
unsigned int off, unsigned int size)
{ … }
static int solo_send_desc(struct solo_enc_dev *solo_enc, int skip,
struct sg_table *vbuf, int off, int size,
unsigned int base, unsigned int base_size)
{ … }
static inline __always_unused int vop_interlaced(const vop_header *vh)
{ … }
static inline __always_unused u8 vop_channel(const vop_header *vh)
{ … }
static inline u8 vop_type(const vop_header *vh)
{ … }
static inline u32 vop_mpeg_size(const vop_header *vh)
{ … }
static inline u8 __always_unused vop_hsize(const vop_header *vh)
{ … }
static inline u8 __always_unused vop_vsize(const vop_header *vh)
{ … }
static inline u32 vop_mpeg_offset(const vop_header *vh)
{ … }
static inline u32 vop_jpeg_offset(const vop_header *vh)
{ … }
static inline u32 vop_jpeg_size(const vop_header *vh)
{ … }
static inline u32 __always_unused vop_sec(const vop_header *vh)
{ … }
static inline __always_unused u32 vop_usec(const vop_header *vh)
{ … }
static int solo_fill_jpeg(struct solo_enc_dev *solo_enc,
struct vb2_buffer *vb, const vop_header *vh)
{ … }
static int solo_fill_mpeg(struct solo_enc_dev *solo_enc,
struct vb2_buffer *vb, const vop_header *vh)
{ … }
static int solo_enc_fillbuf(struct solo_enc_dev *solo_enc,
struct vb2_buffer *vb, struct solo_enc_buf *enc_buf)
{ … }
static void solo_enc_handle_one(struct solo_enc_dev *solo_enc,
struct solo_enc_buf *enc_buf)
{ … }
void solo_enc_v4l2_isr(struct solo_dev *solo_dev)
{ … }
static void solo_handle_ring(struct solo_dev *solo_dev)
{ … }
static int solo_ring_thread(void *data)
{ … }
static int solo_enc_queue_setup(struct vb2_queue *q,
unsigned int *num_buffers,
unsigned int *num_planes, unsigned int sizes[],
struct device *alloc_devs[])
{ … }
static void solo_enc_buf_queue(struct vb2_buffer *vb)
{ … }
static int solo_ring_start(struct solo_dev *solo_dev)
{ … }
static void solo_ring_stop(struct solo_dev *solo_dev)
{ … }
static int solo_enc_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void solo_enc_stop_streaming(struct vb2_queue *q)
{ … }
static void solo_enc_buf_finish(struct vb2_buffer *vb)
{ … }
static const struct vb2_ops solo_enc_video_qops = …;
static int solo_enc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int solo_enc_enum_input(struct file *file, void *priv,
struct v4l2_input *input)
{ … }
static int solo_enc_set_input(struct file *file, void *priv,
unsigned int index)
{ … }
static int solo_enc_get_input(struct file *file, void *priv,
unsigned int *index)
{ … }
static int solo_enc_enum_fmt_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static inline int solo_valid_pixfmt(u32 pixfmt, int dev_type)
{ … }
static int solo_enc_try_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int solo_enc_set_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int solo_enc_get_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int solo_enc_g_std(struct file *file, void *priv, v4l2_std_id *i)
{ … }
static int solo_enc_s_std(struct file *file, void *priv, v4l2_std_id std)
{ … }
static int solo_enum_framesizes(struct file *file, void *priv,
struct v4l2_frmsizeenum *fsize)
{ … }
static int solo_enum_frameintervals(struct file *file, void *priv,
struct v4l2_frmivalenum *fintv)
{ … }
static int solo_g_parm(struct file *file, void *priv,
struct v4l2_streamparm *sp)
{ … }
static inline int calc_interval(u8 fps, u32 n, u32 d)
{ … }
static int solo_s_parm(struct file *file, void *priv,
struct v4l2_streamparm *sp)
{ … }
static int solo_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static int solo_subscribe_event(struct v4l2_fh *fh,
const struct v4l2_event_subscription *sub)
{ … }
static const struct v4l2_file_operations solo_enc_fops = …;
static const struct v4l2_ioctl_ops solo_enc_ioctl_ops = …;
static const struct video_device solo_enc_template = …;
static const struct v4l2_ctrl_ops solo_ctrl_ops = …;
static const struct v4l2_ctrl_config solo_osd_text_ctrl = …;
static const struct v4l2_ctrl_config solo_md_thresholds = …;
static struct solo_enc_dev *solo_enc_alloc(struct solo_dev *solo_dev,
u8 ch, unsigned nr)
{ … }
static void solo_enc_free(struct solo_enc_dev *solo_enc)
{ … }
int solo_enc_v4l2_init(struct solo_dev *solo_dev, unsigned nr)
{ … }
void solo_enc_v4l2_exit(struct solo_dev *solo_dev)
{ … }