xref: /linux/drivers/staging/media/atomisp/pci/ia_css_input_port.h (revision 4b4193256c8d3bc3a5397b5cd9494c2ad386317d)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 /* For MIPI_PORT0_ID to MIPI_PORT2_ID */
17 #include "system_global.h"
18 
19 #ifndef __IA_CSS_INPUT_PORT_H
20 #define __IA_CSS_INPUT_PORT_H
21 
22 /* @file
23  * This file contains information about the possible input ports for CSS
24  */
25 
26 /* Backward compatible for CSS API 2.0 only
27  *  TO BE REMOVED when all drivers move to CSS	API 2.1
28  */
29 #define	IA_CSS_CSI2_PORT_4LANE MIPI_PORT0_ID
30 #define	IA_CSS_CSI2_PORT_1LANE MIPI_PORT1_ID
31 #define	IA_CSS_CSI2_PORT_2LANE MIPI_PORT2_ID
32 
33 /* The CSI2 interface supports 2 types of compression or can
34  *  be run without compression.
35  */
36 enum ia_css_csi2_compression_type {
37 	IA_CSS_CSI2_COMPRESSION_TYPE_NONE, /** No compression */
38 	IA_CSS_CSI2_COMPRESSION_TYPE_1,    /** Compression scheme 1 */
39 	IA_CSS_CSI2_COMPRESSION_TYPE_2     /** Compression scheme 2 */
40 };
41 
42 struct ia_css_csi2_compression {
43 	enum ia_css_csi2_compression_type type;
44 	/** Compression used */
45 	unsigned int                      compressed_bits_per_pixel;
46 	/** Compressed bits per pixel (only when compression is enabled) */
47 	unsigned int                      uncompressed_bits_per_pixel;
48 	/** Uncompressed bits per pixel (only when compression is enabled) */
49 };
50 
51 /* Input port structure.
52  */
53 struct ia_css_input_port {
54 	enum mipi_port_id port; /** Physical CSI-2 port */
55 	unsigned int num_lanes; /** Number of lanes used (4-lane port only) */
56 	unsigned int timeout;   /** Timeout value */
57 	unsigned int rxcount;   /** Register value, should include all lanes */
58 	struct ia_css_csi2_compression compression; /** Compression used */
59 };
60 
61 #endif /* __IA_CSS_INPUT_PORT_H */
62