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