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