/* Copyright (c) 2012, Code Aurora Forum. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#ifndef VCAP_V4L2_H
#define VCAP_V4L2_H

#define TOP_FIELD_FIX
#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/videodev2.h>
#include <linux/platform_device.h>
#include <linux/workqueue.h>
#include <media/videobuf2-vmalloc.h>
#include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h>
#include <media/v4l2-fh.h>
#include <media/v4l2-common.h>
#include <media/vcap_fmt.h>
#include <mach/board.h>
#include <mach/iommu_domains.h>

#define to_client_data(val)     container_of(val, struct vcap_client_data, vfh)

#define writel_iowmb(val, addr)		\
	do {							\
		__iowmb();					\
		writel_relaxed(val, addr);	\
	} while (0)

#define VCAP_USEC (1000000)
#define VCAP_BASE (dev->vcapbase)
#define VCAP_OFFSET(off) (VCAP_BASE + off)

#define VCAP_SW_RESET_REQ (VCAP_BASE + 0x024)
#define VCAP_SW_RESET_STATUS (VCAP_BASE + 0x028)

#define VCAP_VP_MIN_BUF 4
#define VCAP_VC_MAX_BUF 6
#define VCAP_VC_MIN_BUF 2
struct vcap_client_data;

enum vp_state {
	VP_UNKNOWN = 0,
	VP_FRAME1,
	VP_FRAME2,
	VP_FRAME3,
	VP_NORMAL,
};

enum nr_buf_pos {
	BUF_NOT_IN_USE = 0,
	NRT2_BUF,
	T1_BUF,
	T0_BUF,
	TM1_BUF,
};

struct vcap_buf_info {
	unsigned long vaddr;
	unsigned long size;
};

enum vcap_op_mode {
	UNKNOWN_VCAP_OP = 0,
	VC_VCAP_OP,
	VP_VCAP_OP,
	VC_AND_VP_VCAP_OP,
};

struct vc_action {
	struct list_head		active;

	/* thread for generating video stream*/
	wait_queue_head_t		wq;

	/* Buffer index */
	uint8_t					tot_buf;
	uint8_t					buf_num;

	struct timeval			vc_ts;
	uint32_t				last_ts;

	/* Buffers inside vc */
	struct vcap_buffer      *buf[6];
};

struct nr_buffer {
	struct ion_handle			*nr_handle;
	unsigned long				paddr;
	enum nr_buf_pos				nr_pos;
};

struct vp_action {
	struct list_head		in_active;
	struct list_head		out_active;

	/* Buffer index */
	enum vp_state			vp_state;
#ifdef TOP_FIELD_FIX
	bool					top_field;
#endif

	/* Buffers inside vc */
	struct vcap_buffer      *bufTm1;
	struct vcap_buffer      *bufT0;
	struct vcap_buffer      *bufT1;
	struct vcap_buffer      *bufT2;
	struct vcap_buffer      *bufNRT2;

	struct vcap_buffer      *bufOut;

	struct ion_handle		*motionHandle;
	void					*bufMotion;
	struct nr_buffer		bufNR;
};

struct vp_work_t {
	struct work_struct work;
	struct vcap_client_data *cd;
};

struct vcap_dev {
	struct v4l2_device		v4l2_dev;

	struct video_device		*vfd;
	struct ion_client       *ion_client;

	struct resource         *vcirq;
	struct resource         *vpirq;

	struct resource			*vcapmem;
	struct resource			*vcapio;
	void __iomem			*vcapbase;

	struct vcap_platform_data	*vcap_pdata;

	struct regulator		*fs_vcap;
	struct clk				*vcap_clk;
	struct clk				*vcap_p_clk;
	struct clk				*vcap_npl_clk;
	struct device			*ddev;
	/*struct platform_device	*pdev;*/

	uint32_t				bus_client_handle;

	struct vcap_client_data *vc_client;
	struct vcap_client_data *vp_client;

	atomic_t			    vc_enabled;
	atomic_t			    vp_enabled;

	struct mutex			dev_mutex;
	atomic_t			    open_clients;
	bool					vc_resource;
	bool					vp_resource;
	bool					vp_dummy_event;
	bool					vp_dummy_complete;
	bool					vp_shutdown;
	wait_queue_head_t		vp_dummy_waitq;

	uint8_t					vc_tot_buf;

	struct workqueue_struct	*vcap_wq;
	struct vp_work_t		vp_work;
	struct vp_work_t		vc_to_vp_work;
	struct vp_work_t		vp_to_vc_work;

	struct nr_param			nr_param;
	bool					nr_update;
};

struct vp_format_data {
	unsigned int		width, height;
	unsigned int		pixfmt;
};

struct vcap_buffer {
	/* common v4l buffer stuff -- must be first */
	struct vb2_buffer	vb;
	struct list_head	list;
	unsigned long		paddr;
	struct ion_handle   *ion_handle;
};

struct vcap_client_data {
	bool set_cap, set_decode, set_vp_o;
	struct vcap_dev *dev;

	struct vb2_queue		vc_vidq;
	struct vb2_queue		vp_in_vidq;
	struct vb2_queue		vp_out_vidq;

	enum vcap_op_mode		op_mode;

	struct v4l2_format_vc_ext vc_format;

	enum v4l2_buf_type		vp_buf_type_field;
	struct vp_format_data	vp_in_fmt;
	struct vp_format_data	vp_out_fmt;

	struct vc_action		vc_action;
	struct vp_action		vp_action;
	struct workqueue_struct *vcap_work_q;
	struct ion_handle			*vc_ion_handle;

	uint32_t				hold_vc;
	uint32_t				hold_vp;

	spinlock_t				cap_slock;
	bool					streaming;

	struct v4l2_fh			vfh;
};

struct vcap_hacked_vals {
	uint32_t	value;
	uint32_t	offset;
};

extern struct vcap_hacked_vals hacked_buf[];

#endif
int vcvp_qbuf(struct vb2_queue *q, struct v4l2_buffer *b);
int vcvp_dqbuf(struct vb2_queue *q, struct v4l2_buffer *b);
#endif
