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