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 enum msm_ispif_vc { 40 VC0, 41 VC1, 42 VC2, 43 VC3, 44 VC_MAX 45 }; 46 47 enum msm_ispif_cid { 48 CID0, 49 CID1, 50 CID2, 51 CID3, 52 CID4, 53 CID5, 54 CID6, 55 CID7, 56 CID8, 57 CID9, 58 CID10, 59 CID11, 60 CID12, 61 CID13, 62 CID14, 63 CID15, 64 CID_MAX 65 }; 66 67 enum msm_ispif_csid { 68 CSID0, 69 CSID1, 70 CSID2, 71 CSID3, 72 CSID_MAX 73 }; 74 75 enum msm_ispif_pixel_odd_even { 76 PIX_EVEN, 77 PIX_ODD 78 }; 79 80 enum msm_ispif_pixel_pack_mode { 81 PACK_BYTE, 82 PACK_PLAIN_PACK, 83 PACK_NV_P8, 84 PACK_NV_P16 85 }; 86 87 struct msm_ispif_pack_cfg { 88 int pixel_swap_en; 89 enum msm_ispif_pixel_odd_even even_odd_sel; 90 enum msm_ispif_pixel_pack_mode pack_mode; 91 }; 92 93 struct msm_ispif_params_entry { 94 enum msm_ispif_vfe_intf vfe_intf; 95 enum msm_ispif_intftype intftype; 96 int num_cids; 97 enum msm_ispif_cid cids[MAX_CID_CH_PARAM_ENTRY]; 98 enum msm_ispif_csid csid; 99 int crop_enable; 100 uint16_t crop_start_pixel; 101 uint16_t crop_end_pixel; 102 }; 103 104 struct msm_ispif_right_param_entry { 105 enum msm_ispif_cid cids[MAX_CID_CH_PARAM_ENTRY]; 106 enum msm_ispif_csid csid; 107 }; 108 109 struct msm_ispif_param_data_ext { 110 uint32_t num; 111 struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES]; 112 struct msm_ispif_pack_cfg pack_cfg[CID_MAX]; 113 struct msm_ispif_right_param_entry right_entries[MAX_PARAM_ENTRIES]; 114 uint32_t stereo_enable; 115 uint16_t line_width[VFE_MAX]; 116 }; 117 118 struct msm_ispif_param_data { 119 uint32_t num; 120 struct msm_ispif_params_entry entries[MAX_PARAM_ENTRIES]; 121 }; 122 123 struct msm_isp_info { 124 uint32_t max_resolution; 125 uint32_t id; 126 uint32_t ver; 127 }; 128 129 struct msm_ispif_vfe_info { 130 int num_vfe; 131 struct msm_isp_info info[VFE_MAX]; 132 }; 133 134 enum ispif_cfg_type_t { 135 ISPIF_CLK_ENABLE, 136 ISPIF_CLK_DISABLE, 137 ISPIF_INIT, 138 ISPIF_CFG, 139 ISPIF_START_FRAME_BOUNDARY, 140 ISPIF_RESTART_FRAME_BOUNDARY, 141 ISPIF_STOP_FRAME_BOUNDARY, 142 ISPIF_STOP_IMMEDIATELY, 143 ISPIF_RELEASE, 144 ISPIF_ENABLE_REG_DUMP, 145 ISPIF_SET_VFE_INFO, 146 ISPIF_CFG2, 147 ISPIF_CFG_STEREO, 148 }; 149 150 struct ispif_cfg_data { 151 enum ispif_cfg_type_t cfg_type; 152 union { 153 int reg_dump; /* ISPIF_ENABLE_REG_DUMP */ 154 uint32_t csid_version; /* ISPIF_INIT */ 155 struct msm_ispif_vfe_info vfe_info; /* ISPIF_SET_VFE_INFO */ 156 struct msm_ispif_param_data params; /* CFG, START, STOP */ 157 }; 158 }; 159 160 struct ispif_cfg_data_ext { 161 enum ispif_cfg_type_t cfg_type; 162 void *data; 163 uint32_t size; 164 }; 165 166 #define ISPIF_RDI_PACK_MODE_SUPPORT 1 167 168 #define ISPIF_3D_SUPPORT 1 169 170 #define ISPIF_LINE_WIDTH_SUPPORT 1 171 172 #define VIDIOC_MSM_ISPIF_CFG \ 173 _IOWR('V', BASE_VIDIOC_PRIVATE, struct ispif_cfg_data) 174 175 #define VIDIOC_MSM_ISPIF_CFG_EXT \ 176 _IOWR('V', BASE_VIDIOC_PRIVATE+1, struct ispif_cfg_data_ext) 177 178 #endif 179 180