1 /**************************************************************************** 2 **************************************************************************** 3 *** 4 *** This header was automatically generated from a Linux kernel header 5 *** of the same name, to make information necessary for userspace to 6 *** call into the kernel available to libc. It contains only constants, 7 *** structures, and macros generated from the original header, and thus, 8 *** contains no copyrightable information. 9 *** 10 *** To edit the content of this header, modify the corresponding 11 *** source file (e.g. under external/kernel-headers/original/) then 12 *** run bionic/libc/kernel/tools/update_all.py 13 *** 14 *** Any manual change here will be lost the next time this script will 15 *** be run. You've been warned! 16 *** 17 **************************************************************************** 18 ****************************************************************************/ 19 #ifndef __UAPI_CAM_SENSOR_H__ 20 #define __UAPI_CAM_SENSOR_H__ 21 #include <linux/types.h> 22 #include <linux/ioctl.h> 23 #include <media/cam_defs.h> 24 #define CAM_SENSOR_PROBE_CMD (CAM_COMMON_OPCODE_MAX + 1) 25 #define CAM_FLASH_MAX_LED_TRIGGERS 3 26 #define MAX_OIS_NAME_SIZE 32 27 #define MAX_RAINBOW_CONFIG_SIZE 32 28 #define CAM_CSIPHY_SECURE_MODE_ENABLED 1 29 enum rainbow_op_type { 30 RAINBOW_SEQ_READ, 31 RAINBOW_RANDOM_READ, 32 RAINBOW_SEQ_WRITE, 33 RAINBOW_RANDOM_WRITE, 34 RAINBOW_ENABLE 35 }; 36 struct rainbow_config { 37 enum rainbow_op_type operation; 38 uint32_t size; 39 uint32_t reg_addr[MAX_RAINBOW_CONFIG_SIZE]; 40 uint32_t reg_data[MAX_RAINBOW_CONFIG_SIZE]; 41 } __attribute__((packed)); 42 #define RAINBOW_CONFIG _IOWR('R', 1, struct rainbow_config) 43 struct cam_sensor_query_cap { 44 uint32_t slot_info; 45 uint32_t secure_camera; 46 uint32_t pos_pitch; 47 uint32_t pos_roll; 48 uint32_t pos_yaw; 49 uint32_t actuator_slot_id; 50 uint32_t eeprom_slot_id; 51 uint32_t ois_slot_id; 52 uint32_t flash_slot_id; 53 uint32_t csiphy_slot_id; 54 } __attribute__((packed)); 55 struct cam_csiphy_query_cap { 56 uint32_t slot_info; 57 uint32_t version; 58 uint32_t clk_lane; 59 uint32_t reserved; 60 } __attribute__((packed)); 61 struct cam_actuator_query_cap { 62 uint32_t slot_info; 63 uint32_t reserved; 64 } __attribute__((packed)); 65 struct cam_eeprom_query_cap_t { 66 uint32_t slot_info; 67 uint16_t eeprom_kernel_probe; 68 uint16_t is_multimodule_mode; 69 } __attribute__((packed)); 70 struct cam_ois_query_cap_t { 71 uint32_t slot_info; 72 uint16_t reserved; 73 } __attribute__((packed)); 74 struct cam_cmd_i2c_info { 75 uint32_t slave_addr; 76 uint8_t i2c_freq_mode; 77 uint8_t cmd_type; 78 uint16_t reserved; 79 } __attribute__((packed)); 80 struct cam_cmd_get_ois_data { 81 uint32_t reg_addr; 82 uint32_t reg_data; 83 uint64_t query_size_handle; 84 uint64_t query_data_handle; 85 } __attribute__((packed)); 86 struct cam_ois_shift { 87 int16_t ois_shift_x; 88 int16_t ois_shift_y; 89 int32_t af_lop1; 90 int64_t time_readout; 91 } __attribute__((packed)); 92 struct cam_ois_opcode { 93 uint32_t prog; 94 uint32_t coeff; 95 uint32_t pheripheral; 96 uint32_t memory; 97 } __attribute__((packed)); 98 struct cam_cmd_ois_info { 99 uint32_t slave_addr; 100 uint8_t i2c_freq_mode; 101 uint8_t cmd_type; 102 uint8_t ois_fw_flag; 103 uint8_t is_ois_calib; 104 char ois_name[MAX_OIS_NAME_SIZE]; 105 struct cam_ois_opcode opcode; 106 } __attribute__((packed)); 107 struct cam_cmd_probe { 108 uint8_t data_type; 109 uint8_t addr_type; 110 uint8_t op_code; 111 uint8_t cmd_type; 112 uint32_t reg_addr; 113 uint32_t expected_data; 114 uint32_t data_mask; 115 uint16_t camera_id; 116 uint8_t fw_update_flag; 117 uint16_t reserved; 118 } __attribute__((packed)); 119 struct cam_power_settings { 120 uint16_t power_seq_type; 121 uint16_t reserved; 122 uint32_t config_val_low; 123 uint32_t config_val_high; 124 } __attribute__((packed)); 125 struct cam_cmd_power { 126 uint32_t count; 127 uint8_t reserved; 128 uint8_t cmd_type; 129 uint16_t more_reserved; 130 struct cam_power_settings power_settings[1]; 131 } __attribute__((packed)); 132 struct i2c_rdwr_header { 133 uint32_t count; 134 uint8_t op_code; 135 uint8_t cmd_type; 136 uint8_t data_type; 137 uint8_t addr_type; 138 } __attribute__((packed)); 139 struct i2c_random_wr_payload { 140 uint32_t reg_addr; 141 uint32_t reg_data; 142 } __attribute__((packed)); 143 struct cam_cmd_i2c_random_wr { 144 struct i2c_rdwr_header header; 145 struct i2c_random_wr_payload random_wr_payload[1]; 146 } __attribute__((packed)); 147 struct cam_cmd_read { 148 uint32_t reg_data; 149 uint32_t reserved; 150 } __attribute__((packed)); 151 struct cam_cmd_i2c_continuous_wr { 152 struct i2c_rdwr_header header; 153 uint32_t reg_addr; 154 struct cam_cmd_read data_read[1]; 155 } __attribute__((packed)); 156 struct cam_cmd_i2c_random_rd { 157 struct i2c_rdwr_header header; 158 struct cam_cmd_read data_read[1]; 159 } __attribute__((packed)); 160 struct cam_cmd_i2c_continuous_rd { 161 struct i2c_rdwr_header header; 162 uint32_t reg_addr; 163 } __attribute__((packed)); 164 struct cam_cmd_conditional_wait { 165 uint8_t data_type; 166 uint8_t addr_type; 167 uint16_t reserved; 168 uint8_t op_code; 169 uint8_t cmd_type; 170 uint16_t timeout; 171 uint32_t reg_addr; 172 uint32_t reg_data; 173 uint32_t data_mask; 174 } __attribute__((packed)); 175 struct cam_cmd_unconditional_wait { 176 int16_t delay; 177 int16_t reserved; 178 uint8_t op_code; 179 uint8_t cmd_type; 180 uint16_t reserved1; 181 } __attribute__((packed)); 182 struct cam_csiphy_info { 183 uint16_t lane_mask; 184 uint16_t lane_assign; 185 uint8_t csiphy_3phase; 186 uint8_t combo_mode; 187 uint8_t lane_cnt; 188 uint8_t secure_mode; 189 uint64_t settle_time; 190 uint64_t data_rate; 191 } __attribute__((packed)); 192 struct cam_csiphy_acquire_dev_info { 193 uint32_t combo_mode; 194 uint32_t reserved; 195 } __attribute__((packed)); 196 struct cam_sensor_acquire_dev { 197 uint32_t session_handle; 198 uint32_t device_handle; 199 uint32_t handle_type; 200 uint32_t reserved; 201 uint64_t info_handle; 202 } __attribute__((packed)); 203 struct cam_sensor_streamon_dev { 204 uint32_t session_handle; 205 uint32_t device_handle; 206 uint32_t handle_type; 207 uint32_t reserved; 208 uint64_t info_handle; 209 } __attribute__((packed)); 210 struct cam_cmd_get_sensor_data { 211 uint32_t reg_addr; 212 uint32_t reg_data; 213 uint64_t query_size_handle; 214 uint64_t query_data_handle; 215 } __attribute__((packed)); 216 struct cam_flash_init { 217 uint32_t flash_type; 218 uint8_t reserved; 219 uint8_t cmd_type; 220 uint16_t reserved1; 221 } __attribute__((packed)); 222 struct cam_flash_set_rer { 223 uint32_t count; 224 uint8_t opcode; 225 uint8_t cmd_type; 226 uint16_t num_iteration; 227 uint32_t led_on_delay_ms; 228 uint32_t led_off_delay_ms; 229 uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS]; 230 } __attribute__((packed)); 231 struct cam_flash_set_on_off { 232 uint32_t count; 233 uint8_t opcode; 234 uint8_t cmd_type; 235 uint16_t reserved; 236 uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS]; 237 } __attribute__((packed)); 238 struct cam_flash_query_curr { 239 uint16_t reserved; 240 uint8_t opcode; 241 uint8_t cmd_type; 242 uint32_t query_current_ma; 243 } __attribute__((packed)); 244 struct cam_flash_query_cap_info { 245 uint32_t slot_info; 246 uint32_t max_current_flash[CAM_FLASH_MAX_LED_TRIGGERS]; 247 uint32_t max_duration_flash[CAM_FLASH_MAX_LED_TRIGGERS]; 248 uint32_t max_current_torch[CAM_FLASH_MAX_LED_TRIGGERS]; 249 } __attribute__((packed)); 250 #endif 251