#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/err.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_graph.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/time.h>
#include <linux/videodev2.h>
#include <media/v4l2-async.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-dev.h>
#include <media/v4l2-device.h>
#include <media/v4l2-event.h>
#include <media/v4l2-fwnode.h>
#include <media/v4l2-image-sizes.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mediabus.h>
#include <media/videobuf2-dma-contig.h>
#include <media/drv-intf/renesas-ceu.h>
#define DRIVER_NAME …
#define CEU_CAPSR …
#define CEU_CAPCR …
#define CEU_CAMCR …
#define CEU_CAMOR …
#define CEU_CAPWR …
#define CEU_CAIFR …
#define CEU_CRCNTR …
#define CEU_CRCMPR …
#define CEU_CFLCR …
#define CEU_CFSZR …
#define CEU_CDWDR …
#define CEU_CDAYR …
#define CEU_CDACR …
#define CEU_CFWCR …
#define CEU_CDOCR …
#define CEU_CEIER …
#define CEU_CETCR …
#define CEU_CSTSR …
#define CEU_CSRTR …
#define CEU_CAMCR_JPEG …
#define CEU_CAMCR_DTARY_8_UYVY …
#define CEU_CAMCR_DTARY_8_VYUY …
#define CEU_CAMCR_DTARY_8_YUYV …
#define CEU_CAMCR_DTARY_8_YVYU …
#define CEU_CAPCR_BUS_WIDTH256 …
#define CEU_CAMCR_DTIF_16BITS …
#define CEU_CDOCR_NO_DOWSAMPLE …
#define CEU_CDOCR_SWAP_ENDIANNESS …
#define CEU_CAPSR_CPKIL …
#define CEU_CAPSR_CE …
#define CEU_CAPCR_CTNCP …
#define CEU_CSTRST_CPTON …
#define CEU_CETCR_ALL_IRQS_RZ …
#define CEU_CETCR_ALL_IRQS_SH4 …
#define CEU_CETCR_IGRW …
#define CEU_CEIER_CPE …
#define CEU_CEIER_VBP …
#define CEU_CEIER_MASK …
#define CEU_MAX_WIDTH …
#define CEU_MAX_HEIGHT …
#define CEU_MAX_BPL …
#define CEU_W_MAX(w) …
#define CEU_H_MAX(h) …
struct ceu_mbus_fmt { … };
struct ceu_buffer { … };
static inline struct ceu_buffer *vb2_to_ceu(struct vb2_v4l2_buffer *vbuf)
{ … }
struct ceu_subdev { … };
static struct ceu_subdev *to_ceu_subdev(struct v4l2_async_connection *asd)
{ … }
struct ceu_device { … };
static inline struct ceu_device *v4l2_to_ceu(struct v4l2_device *v4l2_dev)
{ … }
struct ceu_fmt { … };
static const struct ceu_fmt ceu_fmt_list[] = …;
static const struct ceu_fmt *get_ceu_fmt_from_fourcc(unsigned int fourcc)
{ … }
static bool ceu_fmt_mplane(struct v4l2_pix_format_mplane *pix)
{ … }
static void ceu_write(struct ceu_device *priv, unsigned int reg_offs, u32 data)
{ … }
static u32 ceu_read(struct ceu_device *priv, unsigned int reg_offs)
{ … }
static int ceu_soft_reset(struct ceu_device *ceudev)
{ … }
static int ceu_hw_config(struct ceu_device *ceudev)
{ … }
static int ceu_capture(struct ceu_device *ceudev)
{ … }
static irqreturn_t ceu_irq(int irq, void *data)
{ … }
static void ceu_update_plane_sizes(struct v4l2_plane_pix_format *plane,
unsigned int bpl, unsigned int szimage)
{ … }
static void ceu_calc_plane_sizes(struct ceu_device *ceudev,
const struct ceu_fmt *ceu_fmt,
struct v4l2_pix_format_mplane *pix)
{ … }
static int ceu_vb2_setup(struct vb2_queue *vq, unsigned int *count,
unsigned int *num_planes, unsigned int sizes[],
struct device *alloc_devs[])
{ … }
static void ceu_vb2_queue(struct vb2_buffer *vb)
{ … }
static int ceu_vb2_prepare(struct vb2_buffer *vb)
{ … }
static int ceu_start_streaming(struct vb2_queue *vq, unsigned int count)
{ … }
static void ceu_stop_streaming(struct vb2_queue *vq)
{ … }
static const struct vb2_ops ceu_vb2_ops = …;
static int __ceu_try_fmt(struct ceu_device *ceudev, struct v4l2_format *v4l2_fmt,
u32 *sd_mbus_code)
{ … }
static int ceu_try_fmt(struct ceu_device *ceudev, struct v4l2_format *v4l2_fmt)
{ … }
static int ceu_set_fmt(struct ceu_device *ceudev, struct v4l2_format *v4l2_fmt)
{ … }
static int ceu_set_default_fmt(struct ceu_device *ceudev)
{ … }
static int ceu_init_mbus_fmt(struct ceu_device *ceudev)
{ … }
static int __maybe_unused ceu_runtime_resume(struct device *dev)
{ … }
static int __maybe_unused ceu_runtime_suspend(struct device *dev)
{ … }
static int ceu_open(struct file *file)
{ … }
static int ceu_release(struct file *file)
{ … }
static const struct v4l2_file_operations ceu_fops = …;
static int ceu_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int ceu_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int ceu_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int ceu_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int ceu_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int ceu_enum_input(struct file *file, void *priv,
struct v4l2_input *inp)
{ … }
static int ceu_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int ceu_s_input(struct file *file, void *priv, unsigned int i)
{ … }
static int ceu_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
{ … }
static int ceu_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
{ … }
static int ceu_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize)
{ … }
static int ceu_enum_frameintervals(struct file *file, void *fh,
struct v4l2_frmivalenum *fival)
{ … }
static const struct v4l2_ioctl_ops ceu_ioctl_ops = …;
static void ceu_vdev_release(struct video_device *vdev)
{ … }
static int ceu_notify_bound(struct v4l2_async_notifier *notifier,
struct v4l2_subdev *v4l2_sd,
struct v4l2_async_connection *asd)
{ … }
static int ceu_notify_complete(struct v4l2_async_notifier *notifier)
{ … }
static const struct v4l2_async_notifier_operations ceu_notify_ops = …;
static int ceu_init_async_subdevs(struct ceu_device *ceudev, unsigned int n_sd)
{ … }
static int ceu_parse_platform_data(struct ceu_device *ceudev,
const struct ceu_platform_data *pdata)
{ … }
static int ceu_parse_dt(struct ceu_device *ceudev)
{ … }
struct ceu_data { … };
static const struct ceu_data ceu_data_sh4 = …;
#if IS_ENABLED(CONFIG_OF)
static const struct ceu_data ceu_data_rz = …;
static const struct of_device_id ceu_of_match[] = …;
MODULE_DEVICE_TABLE(of, ceu_of_match);
#endif
static int ceu_probe(struct platform_device *pdev)
{ … }
static void ceu_remove(struct platform_device *pdev)
{ … }
static const struct dev_pm_ops ceu_pm_ops = …;
static struct platform_driver ceu_driver = …;
module_platform_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;