1 /* SPDX-License-Identifier: GPL-2.0 */
2 // SPDX-License-Identifier: GPL-2.0-or-later
4 * (c) 2020 Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
7 #include "type_support.h"
8 #include "input_system_global.h"
11 INPUT_SYSTEM_PORT_A = 0,
15 } input_system_csi_port_t;
17 typedef struct ctrl_unit_cfg_s ctrl_unit_cfg_t;
18 typedef struct input_system_network_cfg_s input_system_network_cfg_t;
19 typedef struct target_cfg2400_s target_cfg2400_t;
20 typedef struct channel_cfg_s channel_cfg_t;
21 typedef struct backend_channel_cfg_s backend_channel_cfg_t;
22 typedef struct input_system_cfg2400_s input_system_cfg2400_t;
23 typedef struct mipi_port_state_s mipi_port_state_t;
24 typedef struct rx_channel_state_s rx_channel_state_t;
25 typedef struct input_switch_cfg_channel_s input_switch_cfg_channel_t;
26 typedef struct input_switch_cfg_s input_switch_cfg_t;
28 struct ctrl_unit_cfg_s {
29 isp2400_ib_buffer_t buffer_mipi[N_CAPTURE_UNIT_ID];
30 isp2400_ib_buffer_t buffer_acquire[N_ACQUISITION_UNIT_ID];
33 struct input_system_network_cfg_s {
34 input_system_connection_t multicast_cfg[N_CAPTURE_UNIT_ID];
35 input_system_multiplex_t mux_cfg;
36 ctrl_unit_cfg_t ctrl_unit_cfg[N_CTRL_UNIT_ID];
52 } target_strm2mem_cfg_t;
54 struct input_switch_cfg_channel_s {
55 u32 hsync_data_reg[2];
59 struct backend_channel_cfg_s {
60 u32 fmt_control_word_1; // Format config.
61 u32 fmt_control_word_2;
69 gpfifo_cfg_t gpfifo_cfg;
72 struct input_switch_cfg_s {
73 u32 hsync_data_reg[N_RX_CHANNEL_ID * 2];
78 * In 2300 ports can be configured independently and stream
79 * formats need to be specified. In 2400, there are only 8
80 * supported configurations but the HW is fused to support
83 * In 2300 the compressed format types are programmed by the
84 * user. In 2400 all stream formats are encoded on the stream.
86 * Use the enum to check validity of a user configuration
100 #define UNCOMPRESSED_BITS_PER_PIXEL_10 10
101 #define UNCOMPRESSED_BITS_PER_PIXEL_12 12
102 #define COMPRESSED_BITS_PER_PIXEL_6 6
103 #define COMPRESSED_BITS_PER_PIXEL_7 7
104 #define COMPRESSED_BITS_PER_PIXEL_8 8
105 enum mipi_compressor {
106 MIPI_COMPRESSOR_NONE = 0,
107 MIPI_COMPRESSOR_10_6_10,
108 MIPI_COMPRESSOR_10_7_10,
109 MIPI_COMPRESSOR_10_8_10,
110 MIPI_COMPRESSOR_12_6_12,
111 MIPI_COMPRESSOR_12_7_12,
112 MIPI_COMPRESSOR_12_8_12,
113 N_MIPI_COMPRESSOR_METHODS
116 typedef enum mipi_compressor mipi_compressor_t;
119 MIPI_PREDICTOR_NONE = 0,
120 MIPI_PREDICTOR_TYPE1,
121 MIPI_PREDICTOR_TYPE2,
122 N_MIPI_PREDICTOR_TYPES
125 typedef struct rx_cfg_s rx_cfg_t;
131 rx_mode_t mode; /* The HW config */
132 enum mipi_port_id port; /* The port ID to apply the control on */
133 unsigned int timeout;
134 unsigned int initcount;
135 unsigned int synccount;
136 unsigned int rxcount;
137 mipi_predictor_t comp; /* Just for backward compatibility */
142 # include "isp2401_input_system_local.h"
144 # include "isp2400_input_system_local.h"