1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * TI OMAP4 ISS V4L2 Driver - ISP IPIPE module
4  *
5  * Copyright (C) 2012 Texas Instruments, Inc.
6  *
7  * Author: Sergio Aguirre <sergio.a.aguirre@gmail.com>
8  */
9 
10 #ifndef OMAP4_ISS_IPIPE_H
11 #define OMAP4_ISS_IPIPE_H
12 
13 #include "iss_video.h"
14 
15 enum ipipe_input_entity {
16 	IPIPE_INPUT_NONE,
17 	IPIPE_INPUT_IPIPEIF,
18 };
19 
20 #define IPIPE_OUTPUT_VP				BIT(0)
21 
22 /* Sink and source IPIPE pads */
23 #define IPIPE_PAD_SINK				0
24 #define IPIPE_PAD_SOURCE_VP			1
25 #define IPIPE_PADS_NUM				2
26 
27 /*
28  * struct iss_ipipe_device - Structure for the IPIPE module to store its own
29  *			    information
30  * @subdev: V4L2 subdevice
31  * @pads: Sink and source media entity pads
32  * @formats: Active video formats
33  * @input: Active input
34  * @output: Active outputs
35  * @error: A hardware error occurred during capture
36  * @state: Streaming state
37  * @wait: Wait queue used to stop the module
38  * @stopping: Stopping state
39  */
40 struct iss_ipipe_device {
41 	struct v4l2_subdev subdev;
42 	struct media_pad pads[IPIPE_PADS_NUM];
43 	struct v4l2_mbus_framefmt formats[IPIPE_PADS_NUM];
44 
45 	enum ipipe_input_entity input;
46 	unsigned int output;
47 	unsigned int error;
48 
49 	enum iss_pipeline_stream_state state;
50 	wait_queue_head_t wait;
51 	atomic_t stopping;
52 };
53 
54 struct iss_device;
55 
56 int omap4iss_ipipe_register_entities(struct iss_ipipe_device *ipipe,
57 				     struct v4l2_device *vdev);
58 void omap4iss_ipipe_unregister_entities(struct iss_ipipe_device *ipipe);
59 
60 int omap4iss_ipipe_init(struct iss_device *iss);
61 void omap4iss_ipipe_cleanup(struct iss_device *iss);
62 
63 #endif	/* OMAP4_ISS_IPIPE_H */
64