1730b0ac3SDaniel Graefe/* SPDX-License-Identifier: GPL-2.0+ */
271414826SSergio Aguirre/*
371414826SSergio Aguirre * TI OMAP4 ISS V4L2 Driver - ISP IPIPE module
471414826SSergio Aguirre *
571414826SSergio Aguirre * Copyright (C) 2012 Texas Instruments, Inc.
671414826SSergio Aguirre *
771414826SSergio Aguirre * Author: Sergio Aguirre <sergio.a.aguirre@gmail.com>
871414826SSergio Aguirre */
971414826SSergio Aguirre
1071414826SSergio Aguirre#ifndef OMAP4_ISS_IPIPE_H
1171414826SSergio Aguirre#define OMAP4_ISS_IPIPE_H
1271414826SSergio Aguirre
1371414826SSergio Aguirre#include "iss_video.h"
1471414826SSergio Aguirre
1571414826SSergio Aguirreenum ipipe_input_entity {
1671414826SSergio Aguirre	IPIPE_INPUT_NONE,
1771414826SSergio Aguirre	IPIPE_INPUT_IPIPEIF,
1871414826SSergio Aguirre};
1971414826SSergio Aguirre
20422de35aSAmarjargal Gundjalam#define IPIPE_OUTPUT_VP				BIT(0)
2171414826SSergio Aguirre
2271414826SSergio Aguirre/* Sink and source IPIPE pads */
2371414826SSergio Aguirre#define IPIPE_PAD_SINK				0
2471414826SSergio Aguirre#define IPIPE_PAD_SOURCE_VP			1
2571414826SSergio Aguirre#define IPIPE_PADS_NUM				2
2671414826SSergio Aguirre
2771414826SSergio Aguirre/*
2871414826SSergio Aguirre * struct iss_ipipe_device - Structure for the IPIPE module to store its own
2971414826SSergio Aguirre *			    information
3071414826SSergio Aguirre * @subdev: V4L2 subdevice
3171414826SSergio Aguirre * @pads: Sink and source media entity pads
3271414826SSergio Aguirre * @formats: Active video formats
3371414826SSergio Aguirre * @input: Active input
3471414826SSergio Aguirre * @output: Active outputs
3571414826SSergio Aguirre * @error: A hardware error occurred during capture
3671414826SSergio Aguirre * @state: Streaming state
3771414826SSergio Aguirre * @wait: Wait queue used to stop the module
3871414826SSergio Aguirre * @stopping: Stopping state
3971414826SSergio Aguirre */
4071414826SSergio Aguirrestruct iss_ipipe_device {
4171414826SSergio Aguirre	struct v4l2_subdev subdev;
4271414826SSergio Aguirre	struct media_pad pads[IPIPE_PADS_NUM];
4371414826SSergio Aguirre	struct v4l2_mbus_framefmt formats[IPIPE_PADS_NUM];
4471414826SSergio Aguirre
4571414826SSergio Aguirre	enum ipipe_input_entity input;
4671414826SSergio Aguirre	unsigned int output;
4771414826SSergio Aguirre	unsigned int error;
4871414826SSergio Aguirre
4971414826SSergio Aguirre	enum iss_pipeline_stream_state state;
5071414826SSergio Aguirre	wait_queue_head_t wait;
5171414826SSergio Aguirre	atomic_t stopping;
5271414826SSergio Aguirre};
5371414826SSergio Aguirre
5471414826SSergio Aguirrestruct iss_device;
5571414826SSergio Aguirre
5671414826SSergio Aguirreint omap4iss_ipipe_register_entities(struct iss_ipipe_device *ipipe,
57b9e50a06SAmarjargal Gundjalam				     struct v4l2_device *vdev);
5871414826SSergio Aguirrevoid omap4iss_ipipe_unregister_entities(struct iss_ipipe_device *ipipe);
5971414826SSergio Aguirre
6071414826SSergio Aguirreint omap4iss_ipipe_init(struct iss_device *iss);
6171414826SSergio Aguirrevoid omap4iss_ipipe_cleanup(struct iss_device *iss);
6271414826SSergio Aguirre
6371414826SSergio Aguirre#endif	/* OMAP4_ISS_IPIPE_H */
64