1/*
2 * ispccp2.h
3 *
4 * TI OMAP3 ISP - CCP2 module
5 *
6 * Copyright (C) 2010 Nokia Corporation
7 * Copyright (C) 2010 Texas Instruments, Inc.
8 *
9 * Contacts: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
10 *	     Sakari Ailus <sakari.ailus@iki.fi>
11 *
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License version 2 as
14 * published by the Free Software Foundation.
15 */
16
17#ifndef OMAP3_ISP_CCP2_H
18#define OMAP3_ISP_CCP2_H
19
20#include <linux/videodev2.h>
21
22struct isp_device;
23struct isp_csiphy;
24
25/* Sink and source ccp2 pads */
26#define CCP2_PAD_SINK			0
27#define CCP2_PAD_SOURCE			1
28#define CCP2_PADS_NUM			2
29
30/* CCP2 input media entity */
31enum ccp2_input_entity {
32	CCP2_INPUT_NONE,
33	CCP2_INPUT_SENSOR,
34	CCP2_INPUT_MEMORY,
35};
36
37/* CCP2 output media entity */
38enum ccp2_output_entity {
39	CCP2_OUTPUT_NONE,
40	CCP2_OUTPUT_CCDC,
41	CCP2_OUTPUT_MEMORY,
42};
43
44
45/* Logical channel configuration */
46struct isp_interface_lcx_config {
47	int crc;
48	u32 data_start;
49	u32 data_size;
50	u32 format;
51};
52
53/* Memory channel configuration */
54struct isp_interface_mem_config {
55	u32 dst_port;
56	u32 vsize_count;
57	u32 hsize_count;
58	u32 src_ofst;
59	u32 dst_ofst;
60};
61
62/* CCP2 device */
63struct isp_ccp2_device {
64	struct v4l2_subdev subdev;
65	struct v4l2_mbus_framefmt formats[CCP2_PADS_NUM];
66	struct media_pad pads[CCP2_PADS_NUM];
67
68	enum ccp2_input_entity input;
69	enum ccp2_output_entity output;
70	struct isp_interface_lcx_config if_cfg;
71	struct isp_interface_mem_config mem_cfg;
72	struct isp_video video_in;
73	struct isp_csiphy *phy;
74	struct regulator *vdds_csib;
75	enum isp_pipeline_stream_state state;
76	wait_queue_head_t wait;
77	atomic_t stopping;
78};
79
80/* Function declarations */
81int omap3isp_ccp2_init(struct isp_device *isp);
82void omap3isp_ccp2_cleanup(struct isp_device *isp);
83int omap3isp_ccp2_register_entities(struct isp_ccp2_device *ccp2,
84			struct v4l2_device *vdev);
85void omap3isp_ccp2_unregister_entities(struct isp_ccp2_device *ccp2);
86void omap3isp_ccp2_isr(struct isp_ccp2_device *ccp2);
87
88#endif	/* OMAP3_ISP_CCP2_H */
89