1 #ifndef UAPI_MSMB_ISPIF_H 2 #define UAPI_MSMB_ISPIF_H 3 4 #include <linux/types.h> 5 #include <linux/ioctl.h> 6 #include <linux/videodev2.h> 7 8 #define CSID_VERSION_V20 0x02000011 9 #define CSID_VERSION_V22 0x02001000 10 #define CSID_VERSION_V30 0x30000000 11 #define CSID_VERSION_V3 0x30000000 12 13 enum msm_ispif_vfe_intf { 14 VFE0, 15 VFE1, 16 VFE_MAX 17 }; 18 #define VFE0_MASK (1 << VFE0) 19 #define VFE1_MASK (1 << VFE1) 20 21 enum msm_ispif_intftype { 22 PIX0, 23 RDI0, 24 PIX1, 25 RDI1, 26 RDI2, 27 INTF_MAX 28 }; 29 #define MAX_PARAM_ENTRIES (INTF_MAX * 2) 30 #define MAX_CID_CH 8 31 #define MAX_CID_CH_PARAM_ENTRY 3 32 33 #define PIX0_MASK (1 << PIX0) 34 #define PIX1_MASK (1 << PIX1) 35 #define RDI0_MASK (1 << RDI0) 36 #define RDI1_MASK (1 << RDI1) 37 #define RDI2_MASK (1 << RDI2) 38 39 40 enum msm_ispif_vc { 41 VC0, 42 VC1, 43 VC2, 44 VC3, 45 VC_MAX 46 }; 47 48 enum msm_ispif_cid { 49 CID0, 50 CID1, 51 CID2, 52 CID3, 53 CID4, 54 CID5, 55 CID6, 56 CID7, 57 CID8, 58 CID9, 59 CID10, 60 CID11, 61 CID12, 62 CID13, 63 CID14, 64 CID15, 65 CID_MAX 66 }; 67 68 enum msm_ispif_csid { 69 CSID0, 70 CSID1, 71 CSID2, 72 CSID3, 73 CSID_MAX 74 }; 75 76 enum msm_ispif_pixel_odd_even { 77 PIX_EVEN, 78 PIX_ODD 79 }; 80 81 enum msm_ispif_pixel_pack_mode { 82 PACK_BYTE, 83 PACK_PLAIN_PACK, 84 PACK_NV_P8, 85 PACK_NV_P16 86 }; 87 88 struct msm_ispif_pack_cfg { 89 int pixel_swap_en; 90 enum msm_ispif_pixel_odd_even even_odd_sel; 91 enum msm_ispif_pixel_pack_mode pack_mode; 92 }; 93 94 struct msm_ispif_params_entry { 95 enum msm_ispif_vfe_intf vfe_intf; 96 enum msm_ispif_intftype intftype; 97 int num_cids; 98 enum msm_ispif_cid cids[MAX_CID_CH_PARAM_ENTRY]; 99 enum msm_ispif_csid csid; 100 int crop_enable; 101 uint16_t crop_start_pixel; 102 uint16_t crop_end_pixel; 103 }; 104 105 struct msm_ispif_param_data_ext { 106 uint32_t num; 107 struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES]; 108 struct msm_ispif_pack_cfg pack_cfg[CID_MAX]; 109 }; 110 111 struct msm_ispif_param_data { 112 uint32_t num; 113 struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES]; 114 }; 115 116 struct msm_isp_info { 117 uint32_t max_resolution; 118 uint32_t id; 119 uint32_t ver; 120 }; 121 122 struct msm_ispif_vfe_info { 123 int num_vfe; 124 struct msm_isp_info info[VFE_MAX]; 125 }; 126 127 enum ispif_cfg_type_t { 128 ISPIF_CLK_ENABLE, 129 ISPIF_CLK_DISABLE, 130 ISPIF_INIT, 131 ISPIF_CFG, 132 ISPIF_START_FRAME_BOUNDARY, 133 ISPIF_RESTART_FRAME_BOUNDARY, 134 ISPIF_STOP_FRAME_BOUNDARY, 135 ISPIF_STOP_IMMEDIATELY, 136 ISPIF_RELEASE, 137 ISPIF_ENABLE_REG_DUMP, 138 ISPIF_SET_VFE_INFO, 139 ISPIF_CFG2, 140 }; 141 142 struct ispif_cfg_data { 143 enum ispif_cfg_type_t cfg_type; 144 union { 145 int reg_dump; /* ISPIF_ENABLE_REG_DUMP */ 146 uint32_t csid_version; /* ISPIF_INIT */ 147 struct msm_ispif_vfe_info vfe_info; /* ISPIF_SET_VFE_INFO */ 148 struct msm_ispif_param_data params; /* CFG, START, STOP */ 149 }; 150 }; 151 152 struct ispif_cfg_data_ext { 153 enum ispif_cfg_type_t cfg_type; 154 void *data; 155 uint32_t size; 156 }; 157 158 #define ISPIF_RDI_PACK_MODE_SUPPORT 1 159 160 #define VIDIOC_MSM_ISPIF_CFG \ 161 _IOWR('V', BASE_VIDIOC_PRIVATE, struct ispif_cfg_data) 162 163 #define VIDIOC_MSM_ISPIF_CFG_EXT \ 164 _IOWR('V', BASE_VIDIOC_PRIVATE+1, struct ispif_cfg_data_ext) 165 166 #endif 167 168