/*
* SuperH Video Output Unit (VOU) driver
*
* Copyright (C) 2010, Guennadi Liakhovetski <g.liakhovetski@gmx.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
#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/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/videobuf-dma-contig.h>
/* Mirror addresses are not available for all registers */
#define VOUER 0
#define VOUCR 4
#define VOUSTR 8
#define VOUVCR 0xc
#define VOUISR 0x10
#define VOUBCR 0x14
#define VOUDPR 0x18
#define VOUDSR 0x1c
#define VOUVPR 0x20
#define VOUIR 0x24
#define VOUSRR 0x28
#define VOUMSR 0x2c
#define VOUHIR 0x30
#define VOUDFR 0x34
#define VOUAD1R 0x38
#define VOUAD2R 0x3c
#define VOUAIR 0x40
#define VOUSWR 0x44
#define VOURCR 0x48
#define VOURPR 0x50
enum sh_vou_status {
SH_VOU_IDLE,
SH_VOU_INITIALISING,
SH_VOU_RUNNING,
};
#define VOU_MAX_IMAGE_WIDTH 720
#define VOU_MAX_IMAGE_HEIGHT 576
struct sh_vou_device {
struct v4l2_device v4l2_dev;
struct video_device *vdev;
atomic_t use_count;
struct sh_vou_pdata