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 __CSI_RX_GLOBAL_H_INCLUDED__
17 #define __CSI_RX_GLOBAL_H_INCLUDED__
18 
19 #include <type_support.h>
20 
21 typedef enum {
22 	CSI_MIPI_PACKET_TYPE_UNDEFINED = 0,
23 	CSI_MIPI_PACKET_TYPE_LONG,
24 	CSI_MIPI_PACKET_TYPE_SHORT,
25 	CSI_MIPI_PACKET_TYPE_RESERVED,
26 	N_CSI_MIPI_PACKET_TYPE
27 } csi_mipi_packet_type_t;
28 
29 typedef struct csi_rx_backend_lut_entry_s	csi_rx_backend_lut_entry_t;
30 struct csi_rx_backend_lut_entry_s {
31 	u32	long_packet_entry;
32 	u32	short_packet_entry;
33 };
34 
35 typedef struct csi_rx_backend_cfg_s csi_rx_backend_cfg_t;
36 struct csi_rx_backend_cfg_s {
37 	/* LUT entry for the packet */
38 	csi_rx_backend_lut_entry_t lut_entry;
39 
40 	/* can be derived from the Data Type */
41 	csi_mipi_packet_type_t csi_mipi_packet_type;
42 
43 	struct {
44 		bool     comp_enable;
45 		u32 virtual_channel;
46 		u32 data_type;
47 		u32 comp_scheme;
48 		u32 comp_predictor;
49 		u32 comp_bit_idx;
50 	} csi_mipi_cfg;
51 };
52 
53 typedef struct csi_rx_frontend_cfg_s csi_rx_frontend_cfg_t;
54 struct csi_rx_frontend_cfg_s {
55 	u32 active_lanes;
56 };
57 
58 extern const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID];
59 extern const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID];
60 extern const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID];
61 /* sid_width for CSI_RX_BACKEND<N>_ID */
62 extern const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID];
63 
64 #endif /* __CSI_RX_GLOBAL_H_INCLUDED__ */
65