1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Support for Intel Camera Imaging ISP subsystem. 4 * Copyright (c) 2015, Intel Corporation. 5 */ 6 7 #ifndef __CSI_RX_GLOBAL_H_INCLUDED__ 8 #define __CSI_RX_GLOBAL_H_INCLUDED__ 9 10 #include <type_support.h> 11 12 typedef enum { 13 CSI_MIPI_PACKET_TYPE_UNDEFINED = 0, 14 CSI_MIPI_PACKET_TYPE_LONG, 15 CSI_MIPI_PACKET_TYPE_SHORT, 16 CSI_MIPI_PACKET_TYPE_RESERVED, 17 N_CSI_MIPI_PACKET_TYPE 18 } csi_mipi_packet_type_t; 19 20 typedef struct csi_rx_backend_lut_entry_s csi_rx_backend_lut_entry_t; 21 struct csi_rx_backend_lut_entry_s { 22 u32 long_packet_entry; 23 u32 short_packet_entry; 24 }; 25 26 typedef struct csi_rx_backend_cfg_s csi_rx_backend_cfg_t; 27 struct csi_rx_backend_cfg_s { 28 /* LUT entry for the packet */ 29 csi_rx_backend_lut_entry_t lut_entry; 30 31 /* can be derived from the Data Type */ 32 csi_mipi_packet_type_t csi_mipi_packet_type; 33 34 struct { 35 bool comp_enable; 36 u32 virtual_channel; 37 u32 data_type; 38 u32 comp_scheme; 39 u32 comp_predictor; 40 u32 comp_bit_idx; 41 } csi_mipi_cfg; 42 }; 43 44 typedef struct csi_rx_frontend_cfg_s csi_rx_frontend_cfg_t; 45 struct csi_rx_frontend_cfg_s { 46 u32 active_lanes; 47 }; 48 49 extern const u32 N_SHORT_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID]; 50 extern const u32 N_LONG_PACKET_LUT_ENTRIES[N_CSI_RX_BACKEND_ID]; 51 extern const u32 N_CSI_RX_FE_CTRL_DLANES[N_CSI_RX_FRONTEND_ID]; 52 /* sid_width for CSI_RX_BACKEND<N>_ID */ 53 extern const u32 N_CSI_RX_BE_SID_WIDTH[N_CSI_RX_BACKEND_ID]; 54 55 #endif /* __CSI_RX_GLOBAL_H_INCLUDED__ */ 56