• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 CAM_CSIPHY_SECURE_MODE_ENABLED 1
28 #define MAX_RAINBOW_CONFIG_SIZE 32
29 enum rainbow_op_type {
30   RAINBOW_SEQ_READ,
31   RAINBOW_RANDOM_READ,
32   RAINBOW_SEQ_WRITE,
33   RAINBOW_RANDOM_WRITE
34 };
35 struct rainbow_config {
36   enum rainbow_op_type operation;
37   uint32_t size;
38   uint32_t reg_addr[MAX_RAINBOW_CONFIG_SIZE];
39   uint32_t reg_data[MAX_RAINBOW_CONFIG_SIZE];
40 } __attribute__((packed));
41 #define RAINBOW_CONFIG _IOWR('R', 1, struct rainbow_config)
42 struct cam_sensor_query_cap {
43   uint32_t slot_info;
44   uint32_t secure_camera;
45   uint32_t pos_pitch;
46   uint32_t pos_roll;
47   uint32_t pos_yaw;
48   uint32_t actuator_slot_id;
49   uint32_t eeprom_slot_id;
50   uint32_t ois_slot_id;
51   uint32_t flash_slot_id;
52   uint32_t csiphy_slot_id;
53 } __attribute__((packed));
54 struct cam_csiphy_query_cap {
55   uint32_t slot_info;
56   uint32_t version;
57   uint32_t clk_lane;
58   uint32_t reserved;
59 } __attribute__((packed));
60 struct cam_actuator_query_cap {
61   uint32_t slot_info;
62   uint32_t reserved;
63 } __attribute__((packed));
64 struct cam_eeprom_query_cap_t {
65   uint32_t slot_info;
66   uint16_t eeprom_kernel_probe;
67   uint16_t reserved;
68 } __attribute__((packed));
69 struct cam_ois_query_cap_t {
70   uint32_t slot_info;
71   uint16_t reserved;
72 } __attribute__((packed));
73 struct cam_cmd_i2c_info {
74   uint16_t slave_addr;
75   uint8_t i2c_freq_mode;
76   uint8_t cmd_type;
77 } __attribute__((packed));
78 struct cam_cmd_get_ois_data {
79   uint32_t reg_addr;
80   uint32_t reg_data;
81   uint64_t query_size_handle;
82   uint64_t query_data_handle;
83 } __attribute__((packed));
84 struct cam_ois_shift {
85   int16_t ois_shift_x;
86   int16_t ois_shift_y;
87   int64_t time_readout;
88 } __attribute__((packed));
89 struct cam_ois_opcode {
90   uint32_t prog;
91   uint32_t coeff;
92   uint32_t pheripheral;
93   uint32_t memory;
94 } __attribute__((packed));
95 struct cam_cmd_ois_info {
96   uint16_t slave_addr;
97   uint8_t i2c_freq_mode;
98   uint8_t cmd_type;
99   uint8_t ois_fw_flag;
100   uint8_t is_ois_calib;
101   char ois_name[MAX_OIS_NAME_SIZE];
102   struct cam_ois_opcode opcode;
103 } __attribute__((packed));
104 struct cam_cmd_probe {
105   uint8_t data_type;
106   uint8_t addr_type;
107   uint8_t op_code;
108   uint8_t cmd_type;
109   uint32_t reg_addr;
110   uint32_t expected_data;
111   uint32_t data_mask;
112   uint16_t camera_id;
113   uint8_t fw_update_flag;
114   uint16_t reserved;
115 } __attribute__((packed));
116 struct cam_power_settings {
117   uint16_t power_seq_type;
118   uint16_t reserved;
119   uint32_t config_val_low;
120   uint32_t config_val_high;
121 } __attribute__((packed));
122 struct cam_cmd_power {
123   uint16_t count;
124   uint8_t reserved;
125   uint8_t cmd_type;
126   struct cam_power_settings power_settings[1];
127 } __attribute__((packed));
128 struct i2c_rdwr_header {
129   uint16_t count;
130   uint8_t op_code;
131   uint8_t cmd_type;
132   uint8_t data_type;
133   uint8_t addr_type;
134   uint16_t slave_addr;
135 } __attribute__((packed));
136 struct i2c_random_wr_payload {
137   uint32_t reg_addr;
138   uint32_t reg_data;
139 } __attribute__((packed));
140 struct cam_cmd_i2c_random_wr {
141   struct i2c_rdwr_header header;
142   struct i2c_random_wr_payload random_wr_payload[1];
143 } __attribute__((packed));
144 struct cam_cmd_read {
145   uint32_t reg_data;
146   uint32_t reserved;
147 } __attribute__((packed));
148 struct cam_cmd_i2c_continuous_wr {
149   struct i2c_rdwr_header header;
150   uint32_t reg_addr;
151   struct cam_cmd_read data_read[1];
152 } __attribute__((packed));
153 struct cam_cmd_i2c_random_rd {
154   struct i2c_rdwr_header header;
155   struct cam_cmd_read data_read[1];
156 } __attribute__((packed));
157 struct cam_cmd_i2c_continuous_rd {
158   struct i2c_rdwr_header header;
159   uint32_t reg_addr;
160 } __attribute__((packed));
161 struct cam_cmd_conditional_wait {
162   uint8_t data_type;
163   uint8_t addr_type;
164   uint8_t op_code;
165   uint8_t cmd_type;
166   uint16_t timeout;
167   uint16_t reserved;
168   uint32_t reg_addr;
169   uint32_t reg_data;
170   uint32_t data_mask;
171 } __attribute__((packed));
172 struct cam_cmd_unconditional_wait {
173   int16_t delay;
174   uint8_t op_code;
175   uint8_t cmd_type;
176 } __attribute__((packed));
177 struct cam_csiphy_info {
178   uint16_t lane_mask;
179   uint16_t lane_assign;
180   uint8_t csiphy_3phase;
181   uint8_t combo_mode;
182   uint8_t lane_cnt;
183   uint8_t secure_mode;
184   uint64_t settle_time;
185   uint64_t data_rate;
186 } __attribute__((packed));
187 struct cam_csiphy_acquire_dev_info {
188   uint32_t combo_mode;
189   uint32_t reserved;
190 } __attribute__((packed));
191 struct cam_sensor_acquire_dev {
192   uint32_t session_handle;
193   uint32_t device_handle;
194   uint32_t handle_type;
195   uint32_t reserved;
196   uint64_t info_handle;
197 } __attribute__((packed));
198 struct cam_sensor_streamon_dev {
199   uint32_t session_handle;
200   uint32_t device_handle;
201   uint32_t handle_type;
202   uint32_t reserved;
203   uint64_t info_handle;
204 } __attribute__((packed));
205 struct cam_flash_init {
206   uint8_t flash_type;
207   uint16_t reserved;
208   uint8_t cmd_type;
209 } __attribute__((packed));
210 struct cam_flash_set_rer {
211   uint16_t count;
212   uint8_t opcode;
213   uint8_t cmd_type;
214   uint16_t num_iteration;
215   uint16_t reserved;
216   uint32_t led_on_delay_ms;
217   uint32_t led_off_delay_ms;
218   uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS];
219 } __attribute__((packed));
220 struct cam_flash_set_on_off {
221   uint16_t count;
222   uint8_t opcode;
223   uint8_t cmd_type;
224   uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS];
225 } __attribute__((packed));
226 struct cam_flash_query_curr {
227   uint16_t reserved;
228   uint8_t opcode;
229   uint8_t cmd_type;
230   uint32_t query_current_ma;
231 } __attribute__((packed));
232 struct cam_flash_query_cap_info {
233   uint32_t slot_info;
234   uint32_t max_current_flash[CAM_FLASH_MAX_LED_TRIGGERS];
235   uint32_t max_duration_flash[CAM_FLASH_MAX_LED_TRIGGERS];
236   uint32_t max_current_torch[CAM_FLASH_MAX_LED_TRIGGERS];
237 } __attribute__((packed));
238 #endif
239 
240