#define pr_fmt(fmt) …
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/suspend.h>
#include <linux/videodev2.h>
#include <linux/mutex.h>
#include <media/v4l2-common.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-event.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
#include <linux/most.h>
#define V4L2_CMP_MAX_INPUT …
static struct most_component comp;
struct most_video_dev { … };
struct comp_fh { … };
static LIST_HEAD(video_devices);
static DEFINE_SPINLOCK(list_lock);
static inline bool data_ready(struct most_video_dev *mdev)
{ … }
static inline struct mbo *get_top_mbo(struct most_video_dev *mdev)
{ … }
static int comp_vdev_open(struct file *filp)
{ … }
static int comp_vdev_close(struct file *filp)
{ … }
static ssize_t comp_vdev_read(struct file *filp, char __user *buf,
size_t count, loff_t *pos)
{ … }
static __poll_t comp_vdev_poll(struct file *filp, poll_table *wait)
{ … }
static void comp_set_format_struct(struct v4l2_format *f)
{ … }
static int comp_set_format(struct most_video_dev *mdev, unsigned int cmd,
struct v4l2_format *format)
{ … }
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int vidioc_enum_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int vidioc_g_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_try_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vidioc_g_std(struct file *file, void *priv, v4l2_std_id *norm)
{ … }
static int vidioc_enum_input(struct file *file, void *priv,
struct v4l2_input *input)
{ … }
static int vidioc_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
{ … }
static const struct v4l2_file_operations comp_fops = …;
static const struct v4l2_ioctl_ops video_ioctl_ops = …;
static const struct video_device comp_videodev_template = …;
static struct most_video_dev *get_comp_dev(struct most_interface *iface, int channel_idx)
{ … }
static int comp_rx_data(struct mbo *mbo)
{ … }
static int comp_register_videodev(struct most_video_dev *mdev)
{ … }
static void comp_unregister_videodev(struct most_video_dev *mdev)
{ … }
static void comp_v4l2_dev_release(struct v4l2_device *v4l2_dev)
{ … }
static int comp_probe_channel(struct most_interface *iface, int channel_idx,
struct most_channel_config *ccfg, char *name,
char *args)
{ … }
static int comp_disconnect_channel(struct most_interface *iface,
int channel_idx)
{ … }
static struct most_component comp = …;
static int __init comp_init(void)
{ … }
static void __exit comp_exit(void)
{ … }
module_init(…) …;
module_exit(comp_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;