GNU Linux-libre 4.14.266-gnu1
[releases.git] / drivers / staging / media / atomisp / pci / atomisp2 / css2400 / css_2401_csi2p_system / host / input_system_local.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 __INPUT_SYSTEM_LOCAL_H_INCLUDED__
16 #define __INPUT_SYSTEM_LOCAL_H_INCLUDED__
17
18 #include "type_support.h"
19 #include "input_system_global.h"
20
21 #include "ibuf_ctrl.h"
22 #include "csi_rx.h"
23 #include "pixelgen.h"
24 #include "isys_stream2mmio.h"
25 #include "isys_irq.h"
26
27 typedef input_system_err_t input_system_error_t;
28
29 typedef enum {
30         MIPI_FORMAT_SHORT1 = 0x08,
31         MIPI_FORMAT_SHORT2,
32         MIPI_FORMAT_SHORT3,
33         MIPI_FORMAT_SHORT4,
34         MIPI_FORMAT_SHORT5,
35         MIPI_FORMAT_SHORT6,
36         MIPI_FORMAT_SHORT7,
37         MIPI_FORMAT_SHORT8,
38         MIPI_FORMAT_EMBEDDED = 0x12,
39         MIPI_FORMAT_YUV420_8 = 0x18,
40         MIPI_FORMAT_YUV420_10,
41         MIPI_FORMAT_YUV420_8_LEGACY,
42         MIPI_FORMAT_YUV420_8_SHIFT = 0x1C,
43         MIPI_FORMAT_YUV420_10_SHIFT,
44         MIPI_FORMAT_YUV422_8 = 0x1E,
45         MIPI_FORMAT_YUV422_10,
46         MIPI_FORMAT_RGB444 = 0x20,
47         MIPI_FORMAT_RGB555,
48         MIPI_FORMAT_RGB565,
49         MIPI_FORMAT_RGB666,
50         MIPI_FORMAT_RGB888,
51         MIPI_FORMAT_RAW6 = 0x28,
52         MIPI_FORMAT_RAW7,
53         MIPI_FORMAT_RAW8,
54         MIPI_FORMAT_RAW10,
55         MIPI_FORMAT_RAW12,
56         MIPI_FORMAT_RAW14,
57         MIPI_FORMAT_CUSTOM0 = 0x30,
58         MIPI_FORMAT_CUSTOM1,
59         MIPI_FORMAT_CUSTOM2,
60         MIPI_FORMAT_CUSTOM3,
61         MIPI_FORMAT_CUSTOM4,
62         MIPI_FORMAT_CUSTOM5,
63         MIPI_FORMAT_CUSTOM6,
64         MIPI_FORMAT_CUSTOM7,
65         //MIPI_FORMAT_RAW16, /*not supported by 2401*/
66         //MIPI_FORMAT_RAW18,
67         N_MIPI_FORMAT
68 } mipi_format_t;
69
70 #define N_MIPI_FORMAT_CUSTOM    8
71
72 /* The number of stores for compressed format types */
73 #define N_MIPI_COMPRESSOR_CONTEXT       (N_RX_CHANNEL_ID * N_MIPI_FORMAT_CUSTOM)
74 #define UNCOMPRESSED_BITS_PER_PIXEL_10  10
75 #define UNCOMPRESSED_BITS_PER_PIXEL_12  12
76 #define COMPRESSED_BITS_PER_PIXEL_6     6
77 #define COMPRESSED_BITS_PER_PIXEL_7     7
78 #define COMPRESSED_BITS_PER_PIXEL_8     8
79 enum mipi_compressor {
80         MIPI_COMPRESSOR_NONE = 0,
81         MIPI_COMPRESSOR_10_6_10,
82         MIPI_COMPRESSOR_10_7_10,
83         MIPI_COMPRESSOR_10_8_10,
84         MIPI_COMPRESSOR_12_6_12,
85         MIPI_COMPRESSOR_12_7_12,
86         MIPI_COMPRESSOR_12_8_12,
87         N_MIPI_COMPRESSOR_METHODS
88 };
89
90 typedef enum {
91         MIPI_PREDICTOR_NONE = 0,
92         MIPI_PREDICTOR_TYPE1,
93         MIPI_PREDICTOR_TYPE2,
94         N_MIPI_PREDICTOR_TYPES
95 } mipi_predictor_t;
96
97 typedef struct input_system_state_s     input_system_state_t;
98 struct input_system_state_s {
99         ibuf_ctrl_state_t       ibuf_ctrl_state[N_IBUF_CTRL_ID];
100         csi_rx_fe_ctrl_state_t  csi_rx_fe_ctrl_state[N_CSI_RX_FRONTEND_ID];
101         csi_rx_be_ctrl_state_t  csi_rx_be_ctrl_state[N_CSI_RX_BACKEND_ID];
102         pixelgen_ctrl_state_t   pixelgen_ctrl_state[N_PIXELGEN_ID];
103         stream2mmio_state_t     stream2mmio_state[N_STREAM2MMIO_ID];
104         isys_irqc_state_t       isys_irqc_state[N_ISYS_IRQ_ID];
105 };
106 #endif /* __INPUT_SYSTEM_LOCAL_H_INCLUDED__ */