linux/drivers/media/platform/renesas/sh_vou.c

// SPDX-License-Identifier: GPL-2.0
/*
 * SuperH Video Output Unit (VOU) driver
 *
 * Copyright (C) 2010, Guennadi Liakhovetski <[email protected]>
 */

#include <linux/dma-mapping.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/fs.h>
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/slab.h>
#include <linux/videodev2.h>
#include <linux/module.h>

#include <media/drv-intf/sh_vou.h>
#include <media/v4l2-common.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-mediabus.h>
#include <media/videobuf2-v4l2.h>
#include <media/videobuf2-dma-contig.h>

/* Mirror addresses are not available for all registers */
#define VOUER
#define VOUCR
#define VOUSTR
#define VOUVCR
#define VOUISR
#define VOUBCR
#define VOUDPR
#define VOUDSR
#define VOUVPR
#define VOUIR
#define VOUSRR
#define VOUMSR
#define VOUHIR
#define VOUDFR
#define VOUAD1R
#define VOUAD2R
#define VOUAIR
#define VOUSWR
#define VOURCR
#define VOURPR

enum sh_vou_status {};

#define VOU_MIN_IMAGE_WIDTH
#define VOU_MAX_IMAGE_WIDTH
#define VOU_MIN_IMAGE_HEIGHT

struct sh_vou_buffer {};

static inline struct
sh_vou_buffer *to_sh_vou_buffer(struct vb2_v4l2_buffer *vb2)
{}

struct sh_vou_device {};

/* Register access routines for sides A, B and mirror addresses */
static void sh_vou_reg_a_write(struct sh_vou_device *vou_dev, unsigned int reg,
			       u32 value)
{}

static void sh_vou_reg_ab_write(struct sh_vou_device *vou_dev, unsigned int reg,
				u32 value)
{}

static void sh_vou_reg_m_write(struct sh_vou_device *vou_dev, unsigned int reg,
			       u32 value)
{}

static u32 sh_vou_reg_a_read(struct sh_vou_device *vou_dev, unsigned int reg)
{}

static void sh_vou_reg_a_set(struct sh_vou_device *vou_dev, unsigned int reg,
			     u32 value, u32 mask)
{}

static void sh_vou_reg_b_set(struct sh_vou_device *vou_dev, unsigned int reg,
			     u32 value, u32 mask)
{}

static void sh_vou_reg_ab_set(struct sh_vou_device *vou_dev, unsigned int reg,
			      u32 value, u32 mask)
{}

struct sh_vou_fmt {};

/* Further pixel formats can be added */
static struct sh_vou_fmt vou_fmt[] =;

static void sh_vou_schedule_next(struct sh_vou_device *vou_dev,
				 struct vb2_v4l2_buffer *vbuf)
{}

static void sh_vou_stream_config(struct sh_vou_device *vou_dev)
{}

/* Locking: caller holds fop_lock mutex */
static int sh_vou_queue_setup(struct vb2_queue *vq,
		       unsigned int *nbuffers, unsigned int *nplanes,
		       unsigned int sizes[], struct device *alloc_devs[])
{}

static int sh_vou_buf_prepare(struct vb2_buffer *vb)
{}

/* Locking: caller holds fop_lock mutex and vq->irqlock spinlock */
static void sh_vou_buf_queue(struct vb2_buffer *vb)
{}

static int sh_vou_start_streaming(struct vb2_queue *vq, unsigned int count)
{}

static void sh_vou_stop_streaming(struct vb2_queue *vq)
{}

static const struct vb2_ops sh_vou_qops =;

/* Video IOCTLs */
static int sh_vou_querycap(struct file *file, void  *priv,
			   struct v4l2_capability *cap)
{}

/* Enumerate formats, that the device can accept from the user */
static int sh_vou_enum_fmt_vid_out(struct file *file, void  *priv,
				   struct v4l2_fmtdesc *fmt)
{}

static int sh_vou_g_fmt_vid_out(struct file *file, void *priv,
				struct v4l2_format *fmt)
{}

static const unsigned char vou_scale_h_num[] =;
static const unsigned char vou_scale_h_den[] =;
static const unsigned char vou_scale_h_fld[] =;
static const unsigned char vou_scale_v_num[] =;
static const unsigned char vou_scale_v_den[] =;
static const unsigned char vou_scale_v_fld[] =;

static void sh_vou_configure_geometry(struct sh_vou_device *vou_dev,
				      int pix_idx, int w_idx, int h_idx)
{}

struct sh_vou_geometry {};

/*
 * Find input geometry, that we can use to produce output, closest to the
 * requested rectangle, using VOU scaling
 */
static void vou_adjust_input(struct sh_vou_geometry *geo, v4l2_std_id std)
{}

/*
 * Find output geometry, that we can produce, using VOU scaling, closest to
 * the requested rectangle
 */
static void vou_adjust_output(struct sh_vou_geometry *geo, v4l2_std_id std)
{}

static int sh_vou_try_fmt_vid_out(struct file *file, void *priv,
				  struct v4l2_format *fmt)
{}

static int sh_vou_set_fmt_vid_out(struct sh_vou_device *vou_dev,
				struct v4l2_pix_format *pix)
{}

static int sh_vou_s_fmt_vid_out(struct file *file, void *priv,
				struct v4l2_format *fmt)
{}

static int sh_vou_enum_output(struct file *file, void *fh,
			      struct v4l2_output *a)
{}

static int sh_vou_g_output(struct file *file, void *fh, unsigned int *i)
{}

static int sh_vou_s_output(struct file *file, void *fh, unsigned int i)
{}

static u32 sh_vou_ntsc_mode(enum sh_vou_bus_fmt bus_fmt)
{}

static int sh_vou_s_std(struct file *file, void *priv, v4l2_std_id std_id)
{}

static int sh_vou_g_std(struct file *file, void *priv, v4l2_std_id *std)
{}

static int sh_vou_log_status(struct file *file, void *priv)
{}

static int sh_vou_g_selection(struct file *file, void *fh,
			      struct v4l2_selection *sel)
{}

/* Assume a dull encoder, do all the work ourselves. */
static int sh_vou_s_selection(struct file *file, void *fh,
			      struct v4l2_selection *sel)
{}

static irqreturn_t sh_vou_isr(int irq, void *dev_id)
{}

static int sh_vou_hw_init(struct sh_vou_device *vou_dev)
{}

/* File operations */
static int sh_vou_open(struct file *file)
{}

static int sh_vou_release(struct file *file)
{}

/* sh_vou display ioctl operations */
static const struct v4l2_ioctl_ops sh_vou_ioctl_ops =;

static const struct v4l2_file_operations sh_vou_fops =;

static const struct video_device sh_vou_video_template =;

static int sh_vou_probe(struct platform_device *pdev)
{}

static void sh_vou_remove(struct platform_device *pdev)
{}

static struct platform_driver sh_vou =;

module_platform_driver_probe();

MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_LICENSE();
MODULE_VERSION();
MODULE_ALIAS();