#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/font.h>
#include <linux/mutex.h>
#include <linux/platform_device.h>
#include <linux/videodev2.h>
#include <linux/v4l2-dv-timings.h>
#include <media/videobuf2-vmalloc.h>
#include <media/videobuf2-dma-contig.h>
#include <media/v4l2-dv-timings.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-event.h>
#include "vivid-core.h"
#include "vivid-vid-common.h"
#include "vivid-vid-cap.h"
#include "vivid-vid-out.h"
#include "vivid-radio-common.h"
#include "vivid-radio-rx.h"
#include "vivid-radio-tx.h"
#include "vivid-sdr-cap.h"
#include "vivid-vbi-cap.h"
#include "vivid-vbi-out.h"
#include "vivid-osd.h"
#include "vivid-cec.h"
#include "vivid-ctrls.h"
#include "vivid-meta-cap.h"
#include "vivid-meta-out.h"
#include "vivid-touch-cap.h"
#define VIVID_MODULE_NAME …
#define MAX_STRING_LENGTH …
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;
unsigned int n_devs = …;
module_param(n_devs, uint, 0444);
MODULE_PARM_DESC(…) …;
static int vid_cap_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int vid_out_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int vbi_cap_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int vbi_out_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int sdr_cap_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int radio_rx_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int radio_tx_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int meta_cap_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int meta_out_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int touch_cap_nr[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int ccs_cap_mode[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static int ccs_out_mode[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned multiplanar[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned int node_types[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned num_inputs[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned input_types[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned num_outputs[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned output_types[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
unsigned vivid_debug;
module_param(vivid_debug, uint, 0644);
MODULE_PARM_DESC(…) …;
static bool no_error_inj;
module_param(no_error_inj, bool, 0444);
MODULE_PARM_DESC(…) …;
static unsigned int allocators[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned int cache_hints[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
static unsigned int supports_requests[VIVID_MAX_DEVS] = …;
module_param_array(…);
MODULE_PARM_DESC(…) …;
struct vivid_dev *vivid_devs[VIVID_MAX_DEVS];
DEFINE_SPINLOCK(…);
struct workqueue_struct *update_hdmi_ctrls_workqueue;
u64 hdmi_to_output_menu_skip_mask;
u64 hdmi_input_update_outputs_mask;
struct vivid_dev *vivid_ctrl_hdmi_to_output_instance[MAX_MENU_ITEMS];
unsigned int vivid_ctrl_hdmi_to_output_index[MAX_MENU_ITEMS];
char *vivid_ctrl_hdmi_to_output_strings[MAX_MENU_ITEMS + 1] = …;
DEFINE_SPINLOCK(…);
struct workqueue_struct *update_svid_ctrls_workqueue;
u64 svid_to_output_menu_skip_mask;
struct vivid_dev *vivid_ctrl_svid_to_output_instance[MAX_MENU_ITEMS];
unsigned int vivid_ctrl_svid_to_output_index[MAX_MENU_ITEMS];
char *vivid_ctrl_svid_to_output_strings[MAX_MENU_ITEMS + 1] = …;
const struct v4l2_rect vivid_min_rect = …;
const struct v4l2_rect vivid_max_rect = …;
static const u8 vivid_hdmi_edid[256] = …;
static int vidioc_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
{ … }
static int vidioc_s_hw_freq_seek(struct file *file, void *fh, const struct v4l2_hw_freq_seek *a)
{ … }
static int vidioc_enum_freq_bands(struct file *file, void *fh, struct v4l2_frequency_band *band)
{ … }
static int vidioc_g_tuner(struct file *file, void *fh, struct v4l2_tuner *vt)
{ … }
static int vidioc_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt)
{ … }
static int vidioc_g_frequency(struct file *file, void *fh, struct v4l2_frequency *vf)
{ … }
static int vidioc_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf)
{ … }
static int vidioc_overlay(struct file *file, void *fh, unsigned i)
{ … }
static int vidioc_g_fbuf(struct file *file, void *fh, struct v4l2_framebuffer *a)
{ … }
static int vidioc_s_fbuf(struct file *file, void *fh, const struct v4l2_framebuffer *a)
{ … }
static int vidioc_s_std(struct file *file, void *fh, v4l2_std_id id)
{ … }
static int vidioc_s_dv_timings(struct file *file, void *fh, struct v4l2_dv_timings *timings)
{ … }
static int vidioc_g_pixelaspect(struct file *file, void *fh,
int type, struct v4l2_fract *f)
{ … }
static int vidioc_g_selection(struct file *file, void *fh,
struct v4l2_selection *sel)
{ … }
static int vidioc_s_selection(struct file *file, void *fh,
struct v4l2_selection *sel)
{ … }
static int vidioc_g_parm(struct file *file, void *fh,
struct v4l2_streamparm *parm)
{ … }
static int vidioc_s_parm(struct file *file, void *fh,
struct v4l2_streamparm *parm)
{ … }
static int vidioc_log_status(struct file *file, void *fh)
{ … }
static ssize_t vivid_radio_read(struct file *file, char __user *buf,
size_t size, loff_t *offset)
{ … }
static ssize_t vivid_radio_write(struct file *file, const char __user *buf,
size_t size, loff_t *offset)
{ … }
static __poll_t vivid_radio_poll(struct file *file, struct poll_table_struct *wait)
{ … }
static int vivid_enum_input(struct file *file, void *priv,
struct v4l2_input *inp)
{ … }
static int vivid_g_input(struct file *file, void *priv, unsigned int *i)
{ … }
static int vivid_s_input(struct file *file, void *priv, unsigned int i)
{ … }
static int vivid_enum_fmt_cap(struct file *file, void *priv,
struct v4l2_fmtdesc *f)
{ … }
static int vivid_g_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vivid_try_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vivid_s_fmt_cap(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vivid_g_fmt_cap_mplane(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vivid_try_fmt_cap_mplane(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static int vivid_s_fmt_cap_mplane(struct file *file, void *priv,
struct v4l2_format *f)
{ … }
static bool vivid_is_in_use(bool valid, struct video_device *vdev)
{ … }
static bool vivid_is_last_user(struct vivid_dev *dev)
{ … }
static void vivid_reconnect(struct vivid_dev *dev)
{ … }
static int vivid_fop_release(struct file *file)
{ … }
static const struct v4l2_file_operations vivid_fops = …;
static const struct v4l2_file_operations vivid_radio_fops = …;
static int vidioc_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p)
{ … }
static int vidioc_create_bufs(struct file *file, void *priv,
struct v4l2_create_buffers *p)
{ … }
static const struct v4l2_ioctl_ops vivid_ioctl_ops = …;
static void vivid_dev_release(struct v4l2_device *v4l2_dev)
{ … }
#ifdef CONFIG_MEDIA_CONTROLLER
static int vivid_req_validate(struct media_request *req)
{ … }
static const struct media_device_ops vivid_media_ops = …;
#endif
static int vivid_create_queue(struct vivid_dev *dev,
struct vb2_queue *q,
u32 buf_type,
unsigned int min_reqbufs_allocation,
const struct vb2_ops *ops)
{ … }
static int vivid_detect_feature_set(struct vivid_dev *dev, int inst,
unsigned node_type,
bool *has_tuner,
bool *has_modulator,
int *ccs_cap,
int *ccs_out,
unsigned in_type_counter[4],
unsigned out_type_counter[4])
{ … }
static void vivid_set_capabilities(struct vivid_dev *dev)
{ … }
static void vivid_disable_unused_ioctls(struct vivid_dev *dev,
bool has_tuner,
bool has_modulator,
unsigned in_type_counter[4],
unsigned out_type_counter[4])
{ … }
static int vivid_init_dv_timings(struct vivid_dev *dev)
{ … }
static int vivid_create_queues(struct vivid_dev *dev)
{ … }
static int vivid_create_devnodes(struct platform_device *pdev,
struct vivid_dev *dev, int inst,
v4l2_std_id tvnorms_cap,
v4l2_std_id tvnorms_out,
unsigned in_type_counter[4],
unsigned out_type_counter[4])
{ … }
static void update_hdmi_ctrls_work_handler(struct work_struct *work)
{ … }
static void update_svid_ctrls_work_handler(struct work_struct *work)
{ … }
static int vivid_create_instance(struct platform_device *pdev, int inst)
{ … }
static int vivid_probe(struct platform_device *pdev)
{ … }
static void vivid_remove(struct platform_device *pdev)
{ … }
static void vivid_pdev_release(struct device *dev)
{ … }
static struct platform_device vivid_pdev = …;
static struct platform_driver vivid_pdrv = …;
static int __init vivid_init(void)
{ … }
static void __exit vivid_exit(void)
{ … }
module_init(…) …;
module_exit(vivid_exit);