#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/interrupt.h>
#include <linux/ioctl.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/pm_runtime.h>
#include <media/jpeg.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-jpeg.h>
#include <media/v4l2-rect.h>
#include <media/v4l2-mem2mem.h>
#include <media/videobuf2-dma-contig.h>
#include <media/videobuf2-v4l2.h>
#include "e5010-jpeg-enc.h"
#include "e5010-jpeg-enc-hw.h"
static const struct of_device_id e5010_of_match[];
static const struct v4l2_file_operations e5010_fops;
static const struct v4l2_ioctl_ops e5010_ioctl_ops;
static const struct vb2_ops e5010_video_ops;
static const struct v4l2_m2m_ops e5010_m2m_ops;
static struct e5010_fmt e5010_formats[] = …;
static unsigned int debug;
module_param(debug, uint, 0644);
MODULE_PARM_DESC(…) …;
#define dprintk(dev, lvl, fmt, arg...) …
static const struct v4l2_event e5010_eos_event = …;
static const char *type_name(enum v4l2_buf_type type)
{ … }
static struct e5010_q_data *get_queue(struct e5010_context *ctx, enum v4l2_buf_type type)
{ … }
static void calculate_qp_tables(struct e5010_context *ctx)
{ … }
static int update_qp_tables(struct e5010_context *ctx)
{ … }
static int e5010_set_input_subsampling(void __iomem *core_base, int subsampling)
{ … }
static int e5010_querycap(struct file *file, void *priv, struct v4l2_capability *cap)
{ … }
static struct e5010_fmt *find_format(struct v4l2_format *f)
{ … }
static int e5010_enum_fmt(struct file *file, void *priv, struct v4l2_fmtdesc *f)
{ … }
static int e5010_g_fmt(struct file *file, void *priv, struct v4l2_format *f)
{ … }
static int e5010_jpeg_try_fmt(struct v4l2_format *f, struct e5010_context *ctx)
{ … }
static int e5010_try_fmt(struct file *file, void *priv, struct v4l2_format *f)
{ … }
static int e5010_s_fmt(struct file *file, void *priv, struct v4l2_format *f)
{ … }
static int e5010_enum_framesizes(struct file *file, void *priv, struct v4l2_frmsizeenum *fsize)
{ … }
static int e5010_g_selection(struct file *file, void *fh, struct v4l2_selection *s)
{ … }
static int e5010_s_selection(struct file *file, void *fh, struct v4l2_selection *s)
{ … }
static int e5010_subscribe_event(struct v4l2_fh *fh, const struct v4l2_event_subscription *sub)
{ … }
static int queue_init(void *priv, struct vb2_queue *src_vq, struct vb2_queue *dst_vq)
{ … }
static int e5010_s_ctrl(struct v4l2_ctrl *ctrl)
{ … }
static const struct v4l2_ctrl_ops e5010_ctrl_ops = …;
static void e5010_encode_ctrls(struct e5010_context *ctx)
{ … }
static int e5010_ctrls_setup(struct e5010_context *ctx)
{ … }
static void e5010_jpeg_set_default_params(struct e5010_context *ctx)
{ … }
static int e5010_open(struct file *file)
{ … }
static int e5010_release(struct file *file)
{ … }
static void header_write(struct e5010_context *ctx, u8 *addr, unsigned int *offset,
unsigned int no_bytes, unsigned long bits)
{ … }
static void encode_marker_segment(struct e5010_context *ctx, void *addr, unsigned int *offset)
{ … }
static void encode_frame_header(struct e5010_context *ctx, void *addr, unsigned int *offset)
{ … }
static void jpg_encode_sos_header(struct e5010_context *ctx, void *addr, unsigned int *offset)
{ … }
static void write_header(struct e5010_context *ctx, void *addr)
{ … }
static irqreturn_t e5010_irq(int irq, void *data)
{ … }
static int e5010_init_device(struct e5010_dev *e5010)
{ … }
static int e5010_probe(struct platform_device *pdev)
{ … }
static void e5010_remove(struct platform_device *pdev)
{ … }
static void e5010_vb2_buffers_return(struct vb2_queue *q, enum vb2_buffer_state state)
{ … }
static int e5010_queue_setup(struct vb2_queue *vq, unsigned int *nbuffers, unsigned int *nplanes,
unsigned int sizes[], struct device *alloc_devs[])
{ … }
static void e5010_buf_finish(struct vb2_buffer *vb)
{ … }
static int e5010_buf_out_validate(struct vb2_buffer *vb)
{ … }
static int e5010_buf_prepare(struct vb2_buffer *vb)
{ … }
static void e5010_buf_queue(struct vb2_buffer *vb)
{ … }
static int e5010_encoder_cmd(struct file *file, void *priv,
struct v4l2_encoder_cmd *cmd)
{ … }
static int e5010_start_streaming(struct vb2_queue *q, unsigned int count)
{ … }
static void e5010_stop_streaming(struct vb2_queue *q)
{ … }
static void e5010_device_run(void *priv)
{ … }
#ifdef CONFIG_PM
static int e5010_runtime_resume(struct device *dev)
{ … }
static int e5010_runtime_suspend(struct device *dev)
{ … }
#endif
#ifdef CONFIG_PM_SLEEP
static int e5010_suspend(struct device *dev)
{ … }
static int e5010_resume(struct device *dev)
{ … }
#endif
static const struct dev_pm_ops e5010_pm_ops = …;
static const struct v4l2_ioctl_ops e5010_ioctl_ops = …;
static const struct vb2_ops e5010_video_ops = …;
static const struct v4l2_file_operations e5010_fops = …;
static const struct v4l2_m2m_ops e5010_m2m_ops = …;
static const struct of_device_id e5010_of_match[] = …;
MODULE_DEVICE_TABLE(of, e5010_of_match);
static struct platform_driver e5010_driver = …;
module_platform_driver(…) …;
MODULE_LICENSE(…) …;
MODULE_DESCRIPTION(…) …;