• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * This file is auto-generated. Modifications will be lost.
3  *
4  * See https://android.googlesource.com/platform/bionic/+/master/libc/kernel/
5  * for more information.
6  */
7 #ifndef __UAPI_CAM_SENSOR_H__
8 #define __UAPI_CAM_SENSOR_H__
9 #include <linux/types.h>
10 #include <linux/ioctl.h>
11 #include <media/cam_defs.h>
12 #define CAM_SENSOR_PROBE_CMD (CAM_COMMON_OPCODE_MAX + 1)
13 #define CAM_FLASH_MAX_LED_TRIGGERS 3
14 #define MAX_OIS_NAME_SIZE 32
15 #define MAX_RAINBOW_CONFIG_SIZE 32
16 #define CAM_CSIPHY_SECURE_MODE_ENABLED 1
17 enum rainbow_op_type {
18   RAINBOW_SEQ_READ,
19   RAINBOW_RANDOM_READ,
20   RAINBOW_SEQ_WRITE,
21   RAINBOW_RANDOM_WRITE,
22   RAINBOW_ENABLE
23 };
24 struct rainbow_config {
25   enum rainbow_op_type operation;
26   uint32_t size;
27   uint32_t reg_addr[MAX_RAINBOW_CONFIG_SIZE];
28   uint32_t reg_data[MAX_RAINBOW_CONFIG_SIZE];
29 } __attribute__((packed));
30 #define RAINBOW_CONFIG _IOWR('R', 1, struct rainbow_config)
31 struct cam_sensor_query_cap {
32   uint32_t slot_info;
33   uint32_t secure_camera;
34   uint32_t pos_pitch;
35   uint32_t pos_roll;
36   uint32_t pos_yaw;
37   uint32_t actuator_slot_id;
38   uint32_t eeprom_slot_id;
39   uint32_t ois_slot_id;
40   uint32_t flash_slot_id;
41   uint32_t csiphy_slot_id;
42 } __attribute__((packed));
43 struct cam_csiphy_query_cap {
44   uint32_t slot_info;
45   uint32_t version;
46   uint32_t clk_lane;
47   uint32_t reserved;
48 } __attribute__((packed));
49 struct cam_actuator_query_cap {
50   uint32_t slot_info;
51   uint32_t reserved;
52 } __attribute__((packed));
53 struct cam_eeprom_query_cap_t {
54   uint32_t slot_info;
55   uint16_t eeprom_kernel_probe;
56   uint16_t is_multimodule_mode;
57 } __attribute__((packed));
58 struct cam_ois_query_cap_t {
59   uint32_t slot_info;
60   uint16_t reserved;
61 } __attribute__((packed));
62 struct cam_cmd_i2c_info {
63   uint32_t slave_addr;
64   uint8_t i2c_freq_mode;
65   uint8_t cmd_type;
66   uint16_t reserved;
67 } __attribute__((packed));
68 struct cam_cmd_get_ois_data {
69   uint32_t reg_addr;
70   uint32_t reg_data;
71   uint64_t query_size_handle;
72   uint64_t query_data_handle;
73 } __attribute__((packed));
74 struct cam_ois_shift {
75   int16_t ois_shift_x;
76   int16_t ois_shift_y;
77   int32_t af_lop1;
78   int64_t time_readout;
79 } __attribute__((packed));
80 struct cam_ois_opcode {
81   uint32_t prog;
82   uint32_t coeff;
83   uint32_t pheripheral;
84   uint32_t memory;
85 } __attribute__((packed));
86 struct cam_cmd_ois_info {
87   uint32_t slave_addr;
88   uint8_t i2c_freq_mode;
89   uint8_t cmd_type;
90   uint8_t ois_fw_flag;
91   uint8_t is_ois_calib;
92   char ois_name[MAX_OIS_NAME_SIZE];
93   struct cam_ois_opcode opcode;
94 } __attribute__((packed));
95 struct cam_cmd_probe {
96   uint8_t data_type;
97   uint8_t addr_type;
98   uint8_t op_code;
99   uint8_t cmd_type;
100   uint32_t reg_addr;
101   uint32_t expected_data;
102   uint32_t data_mask;
103   uint16_t camera_id;
104   uint8_t fw_update_flag;
105   uint16_t reserved;
106 } __attribute__((packed));
107 struct cam_power_settings {
108   uint16_t power_seq_type;
109   uint16_t reserved;
110   uint32_t config_val_low;
111   uint32_t config_val_high;
112 } __attribute__((packed));
113 struct cam_cmd_power {
114   uint32_t count;
115   uint8_t reserved;
116   uint8_t cmd_type;
117   uint16_t more_reserved;
118   struct cam_power_settings power_settings[1];
119 } __attribute__((packed));
120 struct i2c_rdwr_header {
121   uint32_t count;
122   uint8_t op_code;
123   uint8_t cmd_type;
124   uint8_t data_type;
125   uint8_t addr_type;
126 } __attribute__((packed));
127 struct i2c_random_wr_payload {
128   uint32_t reg_addr;
129   uint32_t reg_data;
130 } __attribute__((packed));
131 struct cam_cmd_i2c_random_wr {
132   struct i2c_rdwr_header header;
133   struct i2c_random_wr_payload random_wr_payload[1];
134 } __attribute__((packed));
135 struct cam_cmd_read {
136   uint32_t reg_data;
137   uint32_t reserved;
138 } __attribute__((packed));
139 struct cam_cmd_i2c_continuous_wr {
140   struct i2c_rdwr_header header;
141   uint32_t reg_addr;
142   struct cam_cmd_read data_read[1];
143 } __attribute__((packed));
144 struct cam_cmd_i2c_random_rd {
145   struct i2c_rdwr_header header;
146   struct cam_cmd_read data_read[1];
147 } __attribute__((packed));
148 struct cam_cmd_i2c_continuous_rd {
149   struct i2c_rdwr_header header;
150   uint32_t reg_addr;
151 } __attribute__((packed));
152 struct cam_cmd_conditional_wait {
153   uint8_t data_type;
154   uint8_t addr_type;
155   uint16_t reserved;
156   uint8_t op_code;
157   uint8_t cmd_type;
158   uint16_t timeout;
159   uint32_t reg_addr;
160   uint32_t reg_data;
161   uint32_t data_mask;
162 } __attribute__((packed));
163 struct cam_cmd_unconditional_wait {
164   int16_t delay;
165   int16_t reserved;
166   uint8_t op_code;
167   uint8_t cmd_type;
168   uint16_t reserved1;
169 } __attribute__((packed));
170 struct cam_csiphy_info {
171   uint16_t lane_mask;
172   uint16_t lane_assign;
173   uint8_t csiphy_3phase;
174   uint8_t combo_mode;
175   uint8_t lane_cnt;
176   uint8_t secure_mode;
177   uint64_t settle_time;
178   uint64_t data_rate;
179 } __attribute__((packed));
180 struct cam_csiphy_acquire_dev_info {
181   uint32_t combo_mode;
182   uint32_t reserved;
183 } __attribute__((packed));
184 struct cam_sensor_acquire_dev {
185   uint32_t session_handle;
186   uint32_t device_handle;
187   uint32_t handle_type;
188   uint32_t reserved;
189   uint64_t info_handle;
190 } __attribute__((packed));
191 struct cam_sensor_streamon_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_cmd_get_sensor_data {
199   uint32_t reg_addr;
200   uint32_t reg_data;
201   uint64_t query_size_handle;
202   uint64_t query_data_handle;
203 } __attribute__((packed));
204 struct cam_flash_init {
205   uint32_t flash_type;
206   uint8_t reserved;
207   uint8_t cmd_type;
208   uint16_t reserved1;
209 } __attribute__((packed));
210 struct cam_flash_set_rer {
211   uint32_t count;
212   uint8_t opcode;
213   uint8_t cmd_type;
214   uint16_t num_iteration;
215   uint32_t led_on_delay_ms;
216   uint32_t led_off_delay_ms;
217   uint32_t led_current_ma[CAM_FLASH_MAX_LED_TRIGGERS];
218 } __attribute__((packed));
219 struct cam_flash_set_on_off {
220   uint32_t count;
221   uint8_t opcode;
222   uint8_t cmd_type;
223   uint16_t reserved;
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