2 * Support for Intel Camera Imaging ISP subsystem.
4 * Copyright (c) 2013 Intel Corporation. All Rights Reserved.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License version
8 * 2 as published by the Free Software Foundation.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
18 #include <linux/compat.h>
20 #include <linux/videodev2.h>
22 #include "atomisp_internal.h"
23 #include "atomisp_compat.h"
24 #include "atomisp_compat_ioctl32.h"
26 static int get_atomisp_histogram32(struct atomisp_histogram
*kp
,
27 struct atomisp_histogram32 __user
*up
)
31 if (!access_ok(VERIFY_READ
, up
, sizeof(struct atomisp_histogram32
)) ||
32 get_user(kp
->num_elements
, &up
->num_elements
) ||
33 get_user(tmp
, &up
->data
))
36 kp
->data
= compat_ptr(tmp
);
40 static int put_atomisp_histogram32(struct atomisp_histogram
*kp
,
41 struct atomisp_histogram32 __user
*up
)
43 compat_uptr_t tmp
= (compat_uptr_t
)((uintptr_t)kp
->data
);
45 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct atomisp_histogram32
)) ||
46 put_user(kp
->num_elements
, &up
->num_elements
) ||
47 put_user(tmp
, &up
->data
))
53 static inline int get_v4l2_pix_format(struct v4l2_pix_format
*kp
,
54 struct v4l2_pix_format __user
*up
)
56 if (copy_from_user(kp
, up
, sizeof(struct v4l2_pix_format
)))
61 static inline int put_v4l2_pix_format(struct v4l2_pix_format
*kp
,
62 struct v4l2_pix_format __user
*up
)
64 if (copy_to_user(up
, kp
, sizeof(struct v4l2_pix_format
)))
69 static int get_v4l2_framebuffer32(struct v4l2_framebuffer
*kp
,
70 struct v4l2_framebuffer32 __user
*up
)
74 if (!access_ok(VERIFY_READ
, up
, sizeof(struct v4l2_framebuffer32
)) ||
75 get_user(tmp
, &up
->base
) ||
76 get_user(kp
->capability
, &up
->capability
) ||
77 get_user(kp
->flags
, &up
->flags
))
80 kp
->base
= compat_ptr(tmp
);
81 get_v4l2_pix_format((struct v4l2_pix_format
*)&kp
->fmt
, &up
->fmt
);
85 static int get_atomisp_dis_statistics32(struct atomisp_dis_statistics
*kp
,
86 struct atomisp_dis_statistics32 __user
*up
)
88 compat_uptr_t hor_prod_odd_real
;
89 compat_uptr_t hor_prod_odd_imag
;
90 compat_uptr_t hor_prod_even_real
;
91 compat_uptr_t hor_prod_even_imag
;
92 compat_uptr_t ver_prod_odd_real
;
93 compat_uptr_t ver_prod_odd_imag
;
94 compat_uptr_t ver_prod_even_real
;
95 compat_uptr_t ver_prod_even_imag
;
97 if (!access_ok(VERIFY_READ
, up
,
98 sizeof(struct atomisp_dis_statistics32
)) ||
99 copy_from_user(kp
, up
, sizeof(struct atomisp_dvs_grid_info
)) ||
100 get_user(hor_prod_odd_real
,
101 &up
->dvs2_stat
.hor_prod
.odd_real
) ||
102 get_user(hor_prod_odd_imag
,
103 &up
->dvs2_stat
.hor_prod
.odd_imag
) ||
104 get_user(hor_prod_even_real
,
105 &up
->dvs2_stat
.hor_prod
.even_real
) ||
106 get_user(hor_prod_even_imag
,
107 &up
->dvs2_stat
.hor_prod
.even_imag
) ||
108 get_user(ver_prod_odd_real
,
109 &up
->dvs2_stat
.ver_prod
.odd_real
) ||
110 get_user(ver_prod_odd_imag
,
111 &up
->dvs2_stat
.ver_prod
.odd_imag
) ||
112 get_user(ver_prod_even_real
,
113 &up
->dvs2_stat
.ver_prod
.even_real
) ||
114 get_user(ver_prod_even_imag
,
115 &up
->dvs2_stat
.ver_prod
.even_imag
) ||
116 get_user(kp
->exp_id
, &up
->exp_id
))
119 kp
->dvs2_stat
.hor_prod
.odd_real
= compat_ptr(hor_prod_odd_real
);
120 kp
->dvs2_stat
.hor_prod
.odd_imag
= compat_ptr(hor_prod_odd_imag
);
121 kp
->dvs2_stat
.hor_prod
.even_real
= compat_ptr(hor_prod_even_real
);
122 kp
->dvs2_stat
.hor_prod
.even_imag
= compat_ptr(hor_prod_even_imag
);
123 kp
->dvs2_stat
.ver_prod
.odd_real
= compat_ptr(ver_prod_odd_real
);
124 kp
->dvs2_stat
.ver_prod
.odd_imag
= compat_ptr(ver_prod_odd_imag
);
125 kp
->dvs2_stat
.ver_prod
.even_real
= compat_ptr(ver_prod_even_real
);
126 kp
->dvs2_stat
.ver_prod
.even_imag
= compat_ptr(ver_prod_even_imag
);
130 static int put_atomisp_dis_statistics32(struct atomisp_dis_statistics
*kp
,
131 struct atomisp_dis_statistics32 __user
*up
)
133 compat_uptr_t hor_prod_odd_real
=
134 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.hor_prod
.odd_real
);
135 compat_uptr_t hor_prod_odd_imag
=
136 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.hor_prod
.odd_imag
);
137 compat_uptr_t hor_prod_even_real
=
138 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.hor_prod
.even_real
);
139 compat_uptr_t hor_prod_even_imag
=
140 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.hor_prod
.even_imag
);
141 compat_uptr_t ver_prod_odd_real
=
142 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.ver_prod
.odd_real
);
143 compat_uptr_t ver_prod_odd_imag
=
144 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.ver_prod
.odd_imag
);
145 compat_uptr_t ver_prod_even_real
=
146 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.ver_prod
.even_real
);
147 compat_uptr_t ver_prod_even_imag
=
148 (compat_uptr_t
)((uintptr_t)kp
->dvs2_stat
.ver_prod
.even_imag
);
150 if (!access_ok(VERIFY_WRITE
, up
,
151 sizeof(struct atomisp_dis_statistics32
)) ||
152 copy_to_user(up
, kp
, sizeof(struct atomisp_dvs_grid_info
)) ||
153 put_user(hor_prod_odd_real
,
154 &up
->dvs2_stat
.hor_prod
.odd_real
) ||
155 put_user(hor_prod_odd_imag
,
156 &up
->dvs2_stat
.hor_prod
.odd_imag
) ||
157 put_user(hor_prod_even_real
,
158 &up
->dvs2_stat
.hor_prod
.even_real
) ||
159 put_user(hor_prod_even_imag
,
160 &up
->dvs2_stat
.hor_prod
.even_imag
) ||
161 put_user(ver_prod_odd_real
,
162 &up
->dvs2_stat
.ver_prod
.odd_real
) ||
163 put_user(ver_prod_odd_imag
,
164 &up
->dvs2_stat
.ver_prod
.odd_imag
) ||
165 put_user(ver_prod_even_real
,
166 &up
->dvs2_stat
.ver_prod
.even_real
) ||
167 put_user(ver_prod_even_imag
,
168 &up
->dvs2_stat
.ver_prod
.even_imag
) ||
169 put_user(kp
->exp_id
, &up
->exp_id
))
175 static int get_atomisp_dis_coefficients32(struct atomisp_dis_coefficients
*kp
,
176 struct atomisp_dis_coefficients32 __user
*up
)
178 compat_uptr_t hor_coefs_odd_real
;
179 compat_uptr_t hor_coefs_odd_imag
;
180 compat_uptr_t hor_coefs_even_real
;
181 compat_uptr_t hor_coefs_even_imag
;
182 compat_uptr_t ver_coefs_odd_real
;
183 compat_uptr_t ver_coefs_odd_imag
;
184 compat_uptr_t ver_coefs_even_real
;
185 compat_uptr_t ver_coefs_even_imag
;
187 if (!access_ok(VERIFY_READ
, up
,
188 sizeof(struct atomisp_dis_coefficients32
)) ||
189 copy_from_user(kp
, up
, sizeof(struct atomisp_dvs_grid_info
)) ||
190 get_user(hor_coefs_odd_real
, &up
->hor_coefs
.odd_real
) ||
191 get_user(hor_coefs_odd_imag
, &up
->hor_coefs
.odd_imag
) ||
192 get_user(hor_coefs_even_real
, &up
->hor_coefs
.even_real
) ||
193 get_user(hor_coefs_even_imag
, &up
->hor_coefs
.even_imag
) ||
194 get_user(ver_coefs_odd_real
, &up
->ver_coefs
.odd_real
) ||
195 get_user(ver_coefs_odd_imag
, &up
->ver_coefs
.odd_imag
) ||
196 get_user(ver_coefs_even_real
, &up
->ver_coefs
.even_real
) ||
197 get_user(ver_coefs_even_imag
, &up
->ver_coefs
.even_imag
))
200 kp
->hor_coefs
.odd_real
= compat_ptr(hor_coefs_odd_real
);
201 kp
->hor_coefs
.odd_imag
= compat_ptr(hor_coefs_odd_imag
);
202 kp
->hor_coefs
.even_real
= compat_ptr(hor_coefs_even_real
);
203 kp
->hor_coefs
.even_imag
= compat_ptr(hor_coefs_even_imag
);
204 kp
->ver_coefs
.odd_real
= compat_ptr(ver_coefs_odd_real
);
205 kp
->ver_coefs
.odd_imag
= compat_ptr(ver_coefs_odd_imag
);
206 kp
->ver_coefs
.even_real
= compat_ptr(ver_coefs_even_real
);
207 kp
->ver_coefs
.even_imag
= compat_ptr(ver_coefs_even_imag
);
211 static int get_atomisp_dvs_6axis_config32(struct atomisp_dvs_6axis_config
*kp
,
212 struct atomisp_dvs_6axis_config32 __user
*up
)
213 { compat_uptr_t xcoords_y
;
214 compat_uptr_t ycoords_y
;
215 compat_uptr_t xcoords_uv
;
216 compat_uptr_t ycoords_uv
;
218 if (!access_ok(VERIFY_READ
, up
,
219 sizeof(struct atomisp_dvs_6axis_config32
)) ||
220 get_user(kp
->exp_id
, &up
->exp_id
) ||
221 get_user(kp
->width_y
, &up
->width_y
) ||
222 get_user(kp
->height_y
, &up
->height_y
) ||
223 get_user(kp
->width_uv
, &up
->width_uv
) ||
224 get_user(kp
->height_uv
, &up
->height_uv
) ||
225 get_user(xcoords_y
, &up
->xcoords_y
) ||
226 get_user(ycoords_y
, &up
->ycoords_y
) ||
227 get_user(xcoords_uv
, &up
->xcoords_uv
) ||
228 get_user(ycoords_uv
, &up
->ycoords_uv
))
231 kp
->xcoords_y
= compat_ptr(xcoords_y
);
232 kp
->ycoords_y
= compat_ptr(ycoords_y
);
233 kp
->xcoords_uv
= compat_ptr(xcoords_uv
);
234 kp
->ycoords_uv
= compat_ptr(ycoords_uv
);
238 static int get_atomisp_3a_statistics32(struct atomisp_3a_statistics
*kp
,
239 struct atomisp_3a_statistics32 __user
*up
)
242 compat_uptr_t rgby_data
;
244 if (!access_ok(VERIFY_READ
, up
,
245 sizeof(struct atomisp_3a_statistics32
)) ||
246 copy_from_user(kp
, up
, sizeof(struct atomisp_grid_info
)) ||
247 get_user(rgby_data
, &up
->rgby_data
) ||
248 get_user(data
, &up
->data
) ||
249 get_user(kp
->exp_id
, &up
->exp_id
) ||
250 get_user(kp
->isp_config_id
, &up
->isp_config_id
))
253 kp
->data
= compat_ptr(data
);
254 kp
->rgby_data
= compat_ptr(rgby_data
);
259 static int put_atomisp_3a_statistics32(struct atomisp_3a_statistics
*kp
,
260 struct atomisp_3a_statistics32 __user
*up
)
262 compat_uptr_t data
= (compat_uptr_t
)((uintptr_t)kp
->data
);
263 compat_uptr_t rgby_data
= (compat_uptr_t
)((uintptr_t)kp
->rgby_data
);
265 if (!access_ok(VERIFY_WRITE
, up
,
266 sizeof(struct atomisp_3a_statistics32
)) ||
267 copy_to_user(up
, kp
, sizeof(struct atomisp_grid_info
)) ||
268 put_user(rgby_data
, &up
->rgby_data
) ||
269 put_user(data
, &up
->data
) ||
270 put_user(kp
->exp_id
, &up
->exp_id
) ||
271 put_user(kp
->isp_config_id
, &up
->isp_config_id
))
278 static int get_atomisp_metadata_stat32(struct atomisp_metadata
*kp
,
279 struct atomisp_metadata32 __user
*up
)
282 compat_uptr_t effective_width
;
284 if (!access_ok(VERIFY_READ
, up
,
285 sizeof(struct atomisp_metadata32
)) ||
286 get_user(data
, &up
->data
) ||
287 get_user(kp
->width
, &up
->width
) ||
288 get_user(kp
->height
, &up
->height
) ||
289 get_user(kp
->stride
, &up
->stride
) ||
290 get_user(kp
->exp_id
, &up
->exp_id
) ||
291 get_user(effective_width
, &up
->effective_width
))
294 kp
->data
= compat_ptr(data
);
295 kp
->effective_width
= compat_ptr(effective_width
);
300 static int put_atomisp_metadata_stat32(struct atomisp_metadata
*kp
,
301 struct atomisp_metadata32 __user
*up
)
303 compat_uptr_t data
= (compat_uptr_t
)((uintptr_t)kp
->data
);
304 compat_uptr_t effective_width
=
305 (compat_uptr_t
)((uintptr_t)kp
->effective_width
);
306 if (!access_ok(VERIFY_WRITE
, up
,
307 sizeof(struct atomisp_metadata32
)) ||
308 put_user(data
, &up
->data
) ||
309 put_user(kp
->width
, &up
->width
) ||
310 put_user(kp
->height
, &up
->height
) ||
311 put_user(kp
->stride
, &up
->stride
) ||
312 put_user(kp
->exp_id
, &up
->exp_id
) ||
313 put_user(effective_width
, &up
->effective_width
))
319 static int put_atomisp_metadata_by_type_stat32(
320 struct atomisp_metadata_with_type
*kp
,
321 struct atomisp_metadata_with_type32 __user
*up
)
323 compat_uptr_t data
= (compat_uptr_t
)((uintptr_t)kp
->data
);
324 compat_uptr_t effective_width
=
325 (compat_uptr_t
)((uintptr_t)kp
->effective_width
);
326 if (!access_ok(VERIFY_WRITE
, up
,
327 sizeof(struct atomisp_metadata_with_type32
)) ||
328 put_user(data
, &up
->data
) ||
329 put_user(kp
->width
, &up
->width
) ||
330 put_user(kp
->height
, &up
->height
) ||
331 put_user(kp
->stride
, &up
->stride
) ||
332 put_user(kp
->exp_id
, &up
->exp_id
) ||
333 put_user(effective_width
, &up
->effective_width
) ||
334 put_user(kp
->type
, &up
->type
))
340 static int get_atomisp_metadata_by_type_stat32(
341 struct atomisp_metadata_with_type
*kp
,
342 struct atomisp_metadata_with_type32 __user
*up
)
345 compat_uptr_t effective_width
;
347 if (!access_ok(VERIFY_READ
, up
,
348 sizeof(struct atomisp_metadata_with_type32
)) ||
349 get_user(data
, &up
->data
) ||
350 get_user(kp
->width
, &up
->width
) ||
351 get_user(kp
->height
, &up
->height
) ||
352 get_user(kp
->stride
, &up
->stride
) ||
353 get_user(kp
->exp_id
, &up
->exp_id
) ||
354 get_user(effective_width
, &up
->effective_width
) ||
355 get_user(kp
->type
, &up
->type
))
358 kp
->data
= compat_ptr(data
);
359 kp
->effective_width
= compat_ptr(effective_width
);
363 static int get_atomisp_morph_table32(struct atomisp_morph_table
*kp
,
364 struct atomisp_morph_table32 __user
*up
)
366 unsigned int n
= ATOMISP_MORPH_TABLE_NUM_PLANES
;
368 if (!access_ok(VERIFY_READ
, up
,
369 sizeof(struct atomisp_morph_table32
)) ||
370 get_user(kp
->enabled
, &up
->enabled
) ||
371 get_user(kp
->width
, &up
->width
) ||
372 get_user(kp
->height
, &up
->height
))
376 uintptr_t *coord_kp
= (uintptr_t *)&kp
->coordinates_x
[n
];
378 if (get_user((*coord_kp
), &up
->coordinates_x
[n
]))
381 coord_kp
= (uintptr_t *)&kp
->coordinates_y
[n
];
382 if (get_user((*coord_kp
), &up
->coordinates_y
[n
]))
388 static int put_atomisp_morph_table32(struct atomisp_morph_table
*kp
,
389 struct atomisp_morph_table32 __user
*up
)
391 unsigned int n
= ATOMISP_MORPH_TABLE_NUM_PLANES
;
393 if (!access_ok(VERIFY_WRITE
, up
,
394 sizeof(struct atomisp_morph_table32
)) ||
395 put_user(kp
->enabled
, &up
->enabled
) ||
396 put_user(kp
->width
, &up
->width
) ||
397 put_user(kp
->height
, &up
->height
))
401 uintptr_t *coord_kp
= (uintptr_t *)&kp
->coordinates_x
[n
];
403 if (put_user((*coord_kp
), &up
->coordinates_x
[n
]))
406 coord_kp
= (uintptr_t *)&kp
->coordinates_y
[n
];
407 if (put_user((*coord_kp
), &up
->coordinates_y
[n
]))
413 static int get_atomisp_overlay32(struct atomisp_overlay
*kp
,
414 struct atomisp_overlay32 __user
*up
)
417 if (!access_ok(VERIFY_READ
, up
, sizeof(struct atomisp_overlay32
)) ||
418 get_user(frame
, &up
->frame
) ||
419 get_user(kp
->bg_y
, &up
->bg_y
) ||
420 get_user(kp
->bg_u
, &up
->bg_u
) ||
421 get_user(kp
->bg_v
, &up
->bg_v
) ||
422 get_user(kp
->blend_input_perc_y
, &up
->blend_input_perc_y
) ||
423 get_user(kp
->blend_input_perc_u
, &up
->blend_input_perc_u
) ||
424 get_user(kp
->blend_input_perc_v
, &up
->blend_input_perc_v
) ||
425 get_user(kp
->blend_overlay_perc_y
,
426 &up
->blend_overlay_perc_y
) ||
427 get_user(kp
->blend_overlay_perc_u
,
428 &up
->blend_overlay_perc_u
) ||
429 get_user(kp
->blend_overlay_perc_v
,
430 &up
->blend_overlay_perc_v
) ||
431 get_user(kp
->blend_overlay_perc_u
,
432 &up
->blend_overlay_perc_u
) ||
433 get_user(kp
->overlay_start_x
, &up
->overlay_start_y
))
436 kp
->frame
= compat_ptr(frame
);
440 static int put_atomisp_overlay32(struct atomisp_overlay
*kp
,
441 struct atomisp_overlay32 __user
*up
)
443 compat_uptr_t frame
= (compat_uptr_t
)((uintptr_t)kp
->frame
);
445 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct atomisp_overlay32
)) ||
446 put_user(frame
, &up
->frame
) ||
447 put_user(kp
->bg_y
, &up
->bg_y
) ||
448 put_user(kp
->bg_u
, &up
->bg_u
) ||
449 put_user(kp
->bg_v
, &up
->bg_v
) ||
450 put_user(kp
->blend_input_perc_y
, &up
->blend_input_perc_y
) ||
451 put_user(kp
->blend_input_perc_u
, &up
->blend_input_perc_u
) ||
452 put_user(kp
->blend_input_perc_v
, &up
->blend_input_perc_v
) ||
453 put_user(kp
->blend_overlay_perc_y
,
454 &up
->blend_overlay_perc_y
) ||
455 put_user(kp
->blend_overlay_perc_u
,
456 &up
->blend_overlay_perc_u
) ||
457 put_user(kp
->blend_overlay_perc_v
,
458 &up
->blend_overlay_perc_v
) ||
459 put_user(kp
->blend_overlay_perc_u
,
460 &up
->blend_overlay_perc_u
) ||
461 put_user(kp
->overlay_start_x
, &up
->overlay_start_y
))
467 static int get_atomisp_calibration_group32(
468 struct atomisp_calibration_group
*kp
,
469 struct atomisp_calibration_group32 __user
*up
)
471 compat_uptr_t calb_grp_values
;
473 if (!access_ok(VERIFY_READ
, up
,
474 sizeof(struct atomisp_calibration_group32
)) ||
475 get_user(kp
->size
, &up
->size
) ||
476 get_user(kp
->type
, &up
->type
) ||
477 get_user(calb_grp_values
, &up
->calb_grp_values
))
480 kp
->calb_grp_values
= compat_ptr(calb_grp_values
);
484 static int put_atomisp_calibration_group32(
485 struct atomisp_calibration_group
*kp
,
486 struct atomisp_calibration_group32 __user
*up
)
488 compat_uptr_t calb_grp_values
=
489 (compat_uptr_t
)((uintptr_t)kp
->calb_grp_values
);
491 if (!access_ok(VERIFY_WRITE
, up
,
492 sizeof(struct atomisp_calibration_group32
)) ||
493 put_user(kp
->size
, &up
->size
) ||
494 put_user(kp
->type
, &up
->type
) ||
495 put_user(calb_grp_values
, &up
->calb_grp_values
))
501 static int get_atomisp_acc_fw_load32(struct atomisp_acc_fw_load
*kp
,
502 struct atomisp_acc_fw_load32 __user
*up
)
506 if (!access_ok(VERIFY_READ
, up
,
507 sizeof(struct atomisp_acc_fw_load32
)) ||
508 get_user(kp
->size
, &up
->size
) ||
509 get_user(kp
->fw_handle
, &up
->fw_handle
) ||
510 get_user(data
, &up
->data
))
513 kp
->data
= compat_ptr(data
);
517 static int put_atomisp_acc_fw_load32(struct atomisp_acc_fw_load
*kp
,
518 struct atomisp_acc_fw_load32 __user
*up
)
520 compat_uptr_t data
= (compat_uptr_t
)((uintptr_t)kp
->data
);
522 if (!access_ok(VERIFY_WRITE
, up
,
523 sizeof(struct atomisp_acc_fw_load32
)) ||
524 put_user(kp
->size
, &up
->size
) ||
525 put_user(kp
->fw_handle
, &up
->fw_handle
) ||
526 put_user(data
, &up
->data
))
532 static int get_atomisp_acc_fw_arg32(struct atomisp_acc_fw_arg
*kp
,
533 struct atomisp_acc_fw_arg32 __user
*up
)
537 if (!access_ok(VERIFY_READ
, up
, sizeof(struct atomisp_acc_fw_arg32
)) ||
538 get_user(kp
->fw_handle
, &up
->fw_handle
) ||
539 get_user(kp
->index
, &up
->index
) ||
540 get_user(value
, &up
->value
) ||
541 get_user(kp
->size
, &up
->size
))
544 kp
->value
= compat_ptr(value
);
548 static int put_atomisp_acc_fw_arg32(struct atomisp_acc_fw_arg
*kp
,
549 struct atomisp_acc_fw_arg32 __user
*up
)
551 compat_uptr_t value
= (compat_uptr_t
)((uintptr_t)kp
->value
);
553 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct atomisp_acc_fw_arg32
)) ||
554 put_user(kp
->fw_handle
, &up
->fw_handle
) ||
555 put_user(kp
->index
, &up
->index
) ||
556 put_user(value
, &up
->value
) ||
557 put_user(kp
->size
, &up
->size
))
563 static int get_v4l2_private_int_data32(struct v4l2_private_int_data
*kp
,
564 struct v4l2_private_int_data32 __user
*up
)
568 if (!access_ok(VERIFY_READ
, up
,
569 sizeof(struct v4l2_private_int_data32
)) ||
570 get_user(kp
->size
, &up
->size
) ||
571 get_user(data
, &up
->data
) ||
572 get_user(kp
->reserved
[0], &up
->reserved
[0]) ||
573 get_user(kp
->reserved
[1], &up
->reserved
[1]))
576 kp
->data
= compat_ptr(data
);
580 static int put_v4l2_private_int_data32(struct v4l2_private_int_data
*kp
,
581 struct v4l2_private_int_data32 __user
*up
)
583 compat_uptr_t data
= (compat_uptr_t
)((uintptr_t)kp
->data
);
585 if (!access_ok(VERIFY_WRITE
, up
,
586 sizeof(struct v4l2_private_int_data32
)) ||
587 put_user(kp
->size
, &up
->size
) ||
588 put_user(data
, &up
->data
) ||
589 put_user(kp
->reserved
[0], &up
->reserved
[0]) ||
590 put_user(kp
->reserved
[1], &up
->reserved
[1]))
596 static int get_atomisp_shading_table32(struct atomisp_shading_table
*kp
,
597 struct atomisp_shading_table32 __user
*up
)
599 unsigned int n
= ATOMISP_NUM_SC_COLORS
;
601 if (!access_ok(VERIFY_READ
, up
,
602 sizeof(struct atomisp_shading_table32
)) ||
603 get_user(kp
->enable
, &up
->enable
) ||
604 get_user(kp
->sensor_width
, &up
->sensor_width
) ||
605 get_user(kp
->sensor_height
, &up
->sensor_height
) ||
606 get_user(kp
->width
, &up
->width
) ||
607 get_user(kp
->height
, &up
->height
) ||
608 get_user(kp
->fraction_bits
, &up
->fraction_bits
))
612 uintptr_t *data_p
= (uintptr_t *)&kp
->data
[n
];
614 if (get_user((*data_p
), &up
->data
[n
]))
620 static int get_atomisp_acc_map32(struct atomisp_acc_map
*kp
,
621 struct atomisp_acc_map32 __user
*up
)
623 compat_uptr_t user_ptr
;
625 if (!access_ok(VERIFY_READ
, up
, sizeof(struct atomisp_acc_map32
)) ||
626 get_user(kp
->flags
, &up
->flags
) ||
627 get_user(kp
->length
, &up
->length
) ||
628 get_user(user_ptr
, &up
->user_ptr
) ||
629 get_user(kp
->css_ptr
, &up
->css_ptr
) ||
630 get_user(kp
->reserved
[0], &up
->reserved
[0]) ||
631 get_user(kp
->reserved
[1], &up
->reserved
[1]) ||
632 get_user(kp
->reserved
[2], &up
->reserved
[2]) ||
633 get_user(kp
->reserved
[3], &up
->reserved
[3]))
636 kp
->user_ptr
= compat_ptr(user_ptr
);
640 static int put_atomisp_acc_map32(struct atomisp_acc_map
*kp
,
641 struct atomisp_acc_map32 __user
*up
)
643 compat_uptr_t user_ptr
= (compat_uptr_t
)((uintptr_t)kp
->user_ptr
);
645 if (!access_ok(VERIFY_WRITE
, up
, sizeof(struct atomisp_acc_map32
)) ||
646 put_user(kp
->flags
, &up
->flags
) ||
647 put_user(kp
->length
, &up
->length
) ||
648 put_user(user_ptr
, &up
->user_ptr
) ||
649 put_user(kp
->css_ptr
, &up
->css_ptr
) ||
650 put_user(kp
->reserved
[0], &up
->reserved
[0]) ||
651 put_user(kp
->reserved
[1], &up
->reserved
[1]) ||
652 put_user(kp
->reserved
[2], &up
->reserved
[2]) ||
653 put_user(kp
->reserved
[3], &up
->reserved
[3]))
659 static int get_atomisp_acc_s_mapped_arg32(struct atomisp_acc_s_mapped_arg
*kp
,
660 struct atomisp_acc_s_mapped_arg32 __user
*up
)
662 if (!access_ok(VERIFY_READ
, up
,
663 sizeof(struct atomisp_acc_s_mapped_arg32
)) ||
664 get_user(kp
->fw_handle
, &up
->fw_handle
) ||
665 get_user(kp
->memory
, &up
->memory
) ||
666 get_user(kp
->length
, &up
->length
) ||
667 get_user(kp
->css_ptr
, &up
->css_ptr
))
673 static int put_atomisp_acc_s_mapped_arg32(struct atomisp_acc_s_mapped_arg
*kp
,
674 struct atomisp_acc_s_mapped_arg32 __user
*up
)
676 if (!access_ok(VERIFY_WRITE
, up
,
677 sizeof(struct atomisp_acc_s_mapped_arg32
)) ||
678 put_user(kp
->fw_handle
, &up
->fw_handle
) ||
679 put_user(kp
->memory
, &up
->memory
) ||
680 put_user(kp
->length
, &up
->length
) ||
681 put_user(kp
->css_ptr
, &up
->css_ptr
))
687 static int get_atomisp_parameters32(struct atomisp_parameters
*kp
,
688 struct atomisp_parameters32 __user
*up
)
690 int n
= offsetof(struct atomisp_parameters32
, output_frame
) /
691 sizeof(compat_uptr_t
);
692 unsigned int size
, offset
= 0;
693 void __user
*user_ptr
;
695 unsigned int stp
, mtp
, dcp
, dscp
= 0;
698 if (!access_ok(VERIFY_READ
, up
, sizeof(struct atomisp_parameters32
)))
702 compat_uptr_t
*src
= (compat_uptr_t
*)up
+ n
;
703 uintptr_t *dst
= (uintptr_t *)kp
+ n
;
705 if (get_user((*dst
), src
))
709 if (get_user(kp
->isp_config_id
, &up
->isp_config_id
) ||
711 get_user(kp
->per_frame_setting
, &up
->per_frame_setting
))
713 get_user(kp
->per_frame_setting
, &up
->per_frame_setting
) ||
714 get_user(stp
, &up
->shading_table
) ||
715 get_user(mtp
, &up
->morph_table
) ||
716 get_user(dcp
, &up
->dvs2_coefs
) ||
717 get_user(dscp
, &up
->dvs_6axis_config
))
723 struct atomisp_shading_table shading_table
;
724 struct atomisp_morph_table morph_table
;
725 struct atomisp_dis_coefficients dvs2_coefs
;
726 struct atomisp_dvs_6axis_config dvs_6axis_config
;
729 size
= sizeof(struct atomisp_shading_table
) +
730 sizeof(struct atomisp_morph_table
) +
731 sizeof(struct atomisp_dis_coefficients
) +
732 sizeof(struct atomisp_dvs_6axis_config
);
733 user_ptr
= compat_alloc_user_space(size
);
735 /* handle shading table */
737 if (up
->shading_table
!= 0) {
741 if (get_atomisp_shading_table32(&karg
.shading_table
,
742 (struct atomisp_shading_table32 __user
*)
744 (uintptr_t)up
->shading_table
))
750 kp
->shading_table
= user_ptr
+ offset
;
751 offset
= sizeof(struct atomisp_shading_table
);
752 if (!kp
->shading_table
)
755 if (copy_to_user(kp
->shading_table
,
757 sizeof(struct atomisp_shading_table
)))
761 /* handle morph table */
763 if (up
->morph_table
!= 0) {
767 if (get_atomisp_morph_table32(&karg
.morph_table
,
768 (struct atomisp_morph_table32 __user
*)
770 (uintptr_t)up
->morph_table
))
776 kp
->morph_table
= user_ptr
+ offset
;
777 offset
+= sizeof(struct atomisp_morph_table
);
778 if (!kp
->morph_table
)
781 if (copy_to_user(kp
->morph_table
, &karg
.morph_table
,
782 sizeof(struct atomisp_morph_table
)))
786 /* handle dvs2 coefficients */
788 if (up
->dvs2_coefs
!= 0) {
792 if (get_atomisp_dis_coefficients32(&karg
.dvs2_coefs
,
793 (struct atomisp_dis_coefficients32 __user
*)
795 (uintptr_t)up
->dvs2_coefs
))
801 kp
->dvs2_coefs
= user_ptr
+ offset
;
802 offset
+= sizeof(struct atomisp_dis_coefficients
);
806 if (copy_to_user(kp
->dvs2_coefs
, &karg
.dvs2_coefs
,
807 sizeof(struct atomisp_dis_coefficients
)))
810 /* handle dvs 6axis configuration */
812 if (up
->dvs_6axis_config
!= 0) {
816 if (get_atomisp_dvs_6axis_config32(&karg
.dvs_6axis_config
,
817 (struct atomisp_dvs_6axis_config32 __user
*)
819 (uintptr_t)up
->dvs_6axis_config
))
825 kp
->dvs_6axis_config
= user_ptr
+ offset
;
826 offset
+= sizeof(struct atomisp_dvs_6axis_config
);
827 if (!kp
->dvs_6axis_config
)
830 if (copy_to_user(kp
->dvs_6axis_config
, &karg
.dvs_6axis_config
,
831 sizeof(struct atomisp_dvs_6axis_config
)))
838 static int get_atomisp_acc_fw_load_to_pipe32(
839 struct atomisp_acc_fw_load_to_pipe
*kp
,
840 struct atomisp_acc_fw_load_to_pipe32 __user
*up
)
843 if (!access_ok(VERIFY_READ
, up
,
844 sizeof(struct atomisp_acc_fw_load_to_pipe32
)) ||
845 get_user(kp
->flags
, &up
->flags
) ||
846 get_user(kp
->fw_handle
, &up
->fw_handle
) ||
847 get_user(kp
->size
, &up
->size
) ||
848 get_user(kp
->type
, &up
->type
) ||
849 get_user(kp
->reserved
[0], &up
->reserved
[0]) ||
850 get_user(kp
->reserved
[1], &up
->reserved
[1]) ||
851 get_user(kp
->reserved
[2], &up
->reserved
[2]) ||
852 get_user(data
, &up
->data
))
855 kp
->data
= compat_ptr(data
);
859 static int put_atomisp_acc_fw_load_to_pipe32(
860 struct atomisp_acc_fw_load_to_pipe
*kp
,
861 struct atomisp_acc_fw_load_to_pipe32 __user
*up
)
863 compat_uptr_t data
= (compat_uptr_t
)((uintptr_t)kp
->data
);
864 if (!access_ok(VERIFY_WRITE
, up
,
865 sizeof(struct atomisp_acc_fw_load_to_pipe32
)) ||
866 put_user(kp
->flags
, &up
->flags
) ||
867 put_user(kp
->fw_handle
, &up
->fw_handle
) ||
868 put_user(kp
->size
, &up
->size
) ||
869 put_user(kp
->type
, &up
->type
) ||
870 put_user(kp
->reserved
[0], &up
->reserved
[0]) ||
871 put_user(kp
->reserved
[1], &up
->reserved
[1]) ||
872 put_user(kp
->reserved
[2], &up
->reserved
[2]) ||
873 put_user(data
, &up
->data
))
879 static int get_atomisp_sensor_ae_bracketing_lut(
880 struct atomisp_sensor_ae_bracketing_lut
*kp
,
881 struct atomisp_sensor_ae_bracketing_lut32 __user
*up
)
884 if (!access_ok(VERIFY_READ
, up
,
885 sizeof(struct atomisp_sensor_ae_bracketing_lut32
)) ||
886 get_user(kp
->lut_size
, &up
->lut_size
) ||
887 get_user(lut
, &up
->lut
))
890 kp
->lut
= compat_ptr(lut
);
894 static long native_ioctl(struct file
*file
, unsigned int cmd
, unsigned long arg
)
896 long ret
= -ENOIOCTLCMD
;
898 if (file
->f_op
->unlocked_ioctl
)
899 ret
= file
->f_op
->unlocked_ioctl(file
, cmd
, arg
);
904 long atomisp_do_compat_ioctl(struct file
*file
,
905 unsigned int cmd
, unsigned long arg
)
908 struct atomisp_histogram his
;
909 struct atomisp_dis_statistics dis_s
;
910 struct atomisp_dis_coefficients dis_c
;
911 struct atomisp_dvs_6axis_config dvs_c
;
912 struct atomisp_3a_statistics s3a_s
;
913 struct atomisp_morph_table mor_t
;
914 struct v4l2_framebuffer v4l2_buf
;
915 struct atomisp_overlay overlay
;
916 struct atomisp_calibration_group cal_grp
;
917 struct atomisp_acc_fw_load acc_fw_load
;
918 struct atomisp_acc_fw_arg acc_fw_arg
;
919 struct v4l2_private_int_data v4l2_pri_data
;
920 struct atomisp_shading_table shd_tbl
;
921 struct atomisp_acc_map acc_map
;
922 struct atomisp_acc_s_mapped_arg acc_map_arg
;
923 struct atomisp_parameters param
;
924 struct atomisp_acc_fw_load_to_pipe acc_fw_to_pipe
;
925 struct atomisp_metadata md
;
926 struct atomisp_metadata_with_type md_with_type
;
927 struct atomisp_sensor_ae_bracketing_lut lut
;
930 void __user
*up
= compat_ptr(arg
);
931 long err
= -ENOIOCTLCMD
;
933 /* First, convert the command. */
935 case ATOMISP_IOC_G_HISTOGRAM32
:
936 cmd
= ATOMISP_IOC_G_HISTOGRAM
;
938 case ATOMISP_IOC_S_HISTOGRAM32
:
939 cmd
= ATOMISP_IOC_S_HISTOGRAM
;
941 case ATOMISP_IOC_G_DIS_STAT32
:
942 cmd
= ATOMISP_IOC_G_DIS_STAT
;
944 case ATOMISP_IOC_S_DIS_COEFS32
:
945 cmd
= ATOMISP_IOC_S_DIS_COEFS
;
947 case ATOMISP_IOC_S_DIS_VECTOR32
:
948 cmd
= ATOMISP_IOC_S_DIS_VECTOR
;
950 case ATOMISP_IOC_G_3A_STAT32
:
951 cmd
= ATOMISP_IOC_G_3A_STAT
;
953 case ATOMISP_IOC_G_ISP_GDC_TAB32
:
954 cmd
= ATOMISP_IOC_G_ISP_GDC_TAB
;
956 case ATOMISP_IOC_S_ISP_GDC_TAB32
:
957 cmd
= ATOMISP_IOC_S_ISP_GDC_TAB
;
959 case ATOMISP_IOC_S_ISP_FPN_TABLE32
:
960 cmd
= ATOMISP_IOC_S_ISP_FPN_TABLE
;
962 case ATOMISP_IOC_G_ISP_OVERLAY32
:
963 cmd
= ATOMISP_IOC_G_ISP_OVERLAY
;
965 case ATOMISP_IOC_S_ISP_OVERLAY32
:
966 cmd
= ATOMISP_IOC_S_ISP_OVERLAY
;
968 case ATOMISP_IOC_G_SENSOR_CALIBRATION_GROUP32
:
969 cmd
= ATOMISP_IOC_G_SENSOR_CALIBRATION_GROUP
;
971 case ATOMISP_IOC_ACC_LOAD32
:
972 cmd
= ATOMISP_IOC_ACC_LOAD
;
974 case ATOMISP_IOC_ACC_S_ARG32
:
975 cmd
= ATOMISP_IOC_ACC_S_ARG
;
977 case ATOMISP_IOC_G_SENSOR_PRIV_INT_DATA32
:
978 cmd
= ATOMISP_IOC_G_SENSOR_PRIV_INT_DATA
;
980 case ATOMISP_IOC_S_ISP_SHD_TAB32
:
981 cmd
= ATOMISP_IOC_S_ISP_SHD_TAB
;
983 case ATOMISP_IOC_ACC_DESTAB32
:
984 cmd
= ATOMISP_IOC_ACC_DESTAB
;
986 case ATOMISP_IOC_G_MOTOR_PRIV_INT_DATA32
:
987 cmd
= ATOMISP_IOC_G_MOTOR_PRIV_INT_DATA
;
989 case ATOMISP_IOC_ACC_MAP32
:
990 cmd
= ATOMISP_IOC_ACC_MAP
;
992 case ATOMISP_IOC_ACC_UNMAP32
:
993 cmd
= ATOMISP_IOC_ACC_UNMAP
;
995 case ATOMISP_IOC_ACC_S_MAPPED_ARG32
:
996 cmd
= ATOMISP_IOC_ACC_S_MAPPED_ARG
;
998 case ATOMISP_IOC_S_PARAMETERS32
:
999 cmd
= ATOMISP_IOC_S_PARAMETERS
;
1001 case ATOMISP_IOC_ACC_LOAD_TO_PIPE32
:
1002 cmd
= ATOMISP_IOC_ACC_LOAD_TO_PIPE
;
1004 case ATOMISP_IOC_G_METADATA32
:
1005 cmd
= ATOMISP_IOC_G_METADATA
;
1007 case ATOMISP_IOC_G_METADATA_BY_TYPE32
:
1008 cmd
= ATOMISP_IOC_G_METADATA_BY_TYPE
;
1010 case ATOMISP_IOC_S_SENSOR_AE_BRACKETING_LUT32
:
1011 cmd
= ATOMISP_IOC_S_SENSOR_AE_BRACKETING_LUT
;
1016 case ATOMISP_IOC_G_HISTOGRAM
:
1017 case ATOMISP_IOC_S_HISTOGRAM
:
1018 err
= get_atomisp_histogram32(&karg
.his
, up
);
1020 case ATOMISP_IOC_G_DIS_STAT
:
1021 err
= get_atomisp_dis_statistics32(&karg
.dis_s
, up
);
1023 case ATOMISP_IOC_S_DIS_COEFS
:
1024 err
= get_atomisp_dis_coefficients32(&karg
.dis_c
, up
);
1026 case ATOMISP_IOC_S_DIS_VECTOR
:
1027 err
= get_atomisp_dvs_6axis_config32(&karg
.dvs_c
, up
);
1029 case ATOMISP_IOC_G_3A_STAT
:
1030 err
= get_atomisp_3a_statistics32(&karg
.s3a_s
, up
);
1032 case ATOMISP_IOC_G_ISP_GDC_TAB
:
1033 case ATOMISP_IOC_S_ISP_GDC_TAB
:
1034 err
= get_atomisp_morph_table32(&karg
.mor_t
, up
);
1036 case ATOMISP_IOC_S_ISP_FPN_TABLE
:
1037 err
= get_v4l2_framebuffer32(&karg
.v4l2_buf
, up
);
1039 case ATOMISP_IOC_G_ISP_OVERLAY
:
1040 case ATOMISP_IOC_S_ISP_OVERLAY
:
1041 err
= get_atomisp_overlay32(&karg
.overlay
, up
);
1043 case ATOMISP_IOC_G_SENSOR_CALIBRATION_GROUP
:
1044 err
= get_atomisp_calibration_group32(&karg
.cal_grp
, up
);
1046 case ATOMISP_IOC_ACC_LOAD
:
1047 err
= get_atomisp_acc_fw_load32(&karg
.acc_fw_load
, up
);
1049 case ATOMISP_IOC_ACC_S_ARG
:
1050 case ATOMISP_IOC_ACC_DESTAB
:
1051 err
= get_atomisp_acc_fw_arg32(&karg
.acc_fw_arg
, up
);
1053 case ATOMISP_IOC_G_SENSOR_PRIV_INT_DATA
:
1054 case ATOMISP_IOC_G_MOTOR_PRIV_INT_DATA
:
1055 err
= get_v4l2_private_int_data32(&karg
.v4l2_pri_data
, up
);
1057 case ATOMISP_IOC_S_ISP_SHD_TAB
:
1058 err
= get_atomisp_shading_table32(&karg
.shd_tbl
, up
);
1060 case ATOMISP_IOC_ACC_MAP
:
1061 case ATOMISP_IOC_ACC_UNMAP
:
1062 err
= get_atomisp_acc_map32(&karg
.acc_map
, up
);
1064 case ATOMISP_IOC_ACC_S_MAPPED_ARG
:
1065 err
= get_atomisp_acc_s_mapped_arg32(&karg
.acc_map_arg
, up
);
1067 case ATOMISP_IOC_S_PARAMETERS
:
1068 err
= get_atomisp_parameters32(&karg
.param
, up
);
1070 case ATOMISP_IOC_ACC_LOAD_TO_PIPE
:
1071 err
= get_atomisp_acc_fw_load_to_pipe32(&karg
.acc_fw_to_pipe
,
1074 case ATOMISP_IOC_G_METADATA
:
1075 err
= get_atomisp_metadata_stat32(&karg
.md
, up
);
1077 case ATOMISP_IOC_G_METADATA_BY_TYPE
:
1078 err
= get_atomisp_metadata_by_type_stat32(&karg
.md_with_type
,
1081 case ATOMISP_IOC_S_SENSOR_AE_BRACKETING_LUT
:
1082 err
= get_atomisp_sensor_ae_bracketing_lut(&karg
.lut
, up
);
1090 err
= native_ioctl(file
, cmd
, (unsigned long)&karg
);
1096 case ATOMISP_IOC_G_HISTOGRAM
:
1097 err
= put_atomisp_histogram32(&karg
.his
, up
);
1099 case ATOMISP_IOC_G_DIS_STAT
:
1100 err
= put_atomisp_dis_statistics32(&karg
.dis_s
, up
);
1102 case ATOMISP_IOC_G_3A_STAT
:
1103 err
= put_atomisp_3a_statistics32(&karg
.s3a_s
, up
);
1105 case ATOMISP_IOC_G_ISP_GDC_TAB
:
1106 err
= put_atomisp_morph_table32(&karg
.mor_t
, up
);
1108 case ATOMISP_IOC_G_ISP_OVERLAY
:
1109 err
= put_atomisp_overlay32(&karg
.overlay
, up
);
1111 case ATOMISP_IOC_G_SENSOR_CALIBRATION_GROUP
:
1112 err
= put_atomisp_calibration_group32(&karg
.cal_grp
, up
);
1114 case ATOMISP_IOC_ACC_LOAD
:
1115 err
= put_atomisp_acc_fw_load32(&karg
.acc_fw_load
, up
);
1117 case ATOMISP_IOC_ACC_S_ARG
:
1118 case ATOMISP_IOC_ACC_DESTAB
:
1119 err
= put_atomisp_acc_fw_arg32(&karg
.acc_fw_arg
, up
);
1121 case ATOMISP_IOC_G_SENSOR_PRIV_INT_DATA
:
1122 case ATOMISP_IOC_G_MOTOR_PRIV_INT_DATA
:
1123 err
= put_v4l2_private_int_data32(&karg
.v4l2_pri_data
, up
);
1125 case ATOMISP_IOC_ACC_MAP
:
1126 case ATOMISP_IOC_ACC_UNMAP
:
1127 err
= put_atomisp_acc_map32(&karg
.acc_map
, up
);
1129 case ATOMISP_IOC_ACC_S_MAPPED_ARG
:
1130 err
= put_atomisp_acc_s_mapped_arg32(&karg
.acc_map_arg
, up
);
1132 case ATOMISP_IOC_ACC_LOAD_TO_PIPE
:
1133 err
= put_atomisp_acc_fw_load_to_pipe32(&karg
.acc_fw_to_pipe
,
1136 case ATOMISP_IOC_G_METADATA
:
1137 err
= put_atomisp_metadata_stat32(&karg
.md
, up
);
1139 case ATOMISP_IOC_G_METADATA_BY_TYPE
:
1140 err
= put_atomisp_metadata_by_type_stat32(&karg
.md_with_type
,
1148 long atomisp_compat_ioctl32(struct file
*file
,
1149 unsigned int cmd
, unsigned long arg
)
1152 struct video_device
*vdev
= video_devdata(file
);
1153 struct atomisp_device
*isp
= video_get_drvdata(vdev
);
1154 long ret
= -ENOIOCTLCMD
;
1156 if (!file
->f_op
->unlocked_ioctl
)
1160 case ATOMISP_IOC_G_XNR
:
1161 case ATOMISP_IOC_S_XNR
:
1162 case ATOMISP_IOC_G_NR
:
1163 case ATOMISP_IOC_S_NR
:
1164 case ATOMISP_IOC_G_TNR
:
1165 case ATOMISP_IOC_S_TNR
:
1166 case ATOMISP_IOC_G_BLACK_LEVEL_COMP
:
1167 case ATOMISP_IOC_S_BLACK_LEVEL_COMP
:
1168 case ATOMISP_IOC_G_EE
:
1169 case ATOMISP_IOC_S_EE
:
1170 case ATOMISP_IOC_S_DIS_VECTOR
:
1171 case ATOMISP_IOC_G_ISP_PARM
:
1172 case ATOMISP_IOC_S_ISP_PARM
:
1173 case ATOMISP_IOC_G_ISP_GAMMA
:
1174 case ATOMISP_IOC_S_ISP_GAMMA
:
1175 case ATOMISP_IOC_ISP_MAKERNOTE
:
1176 case ATOMISP_IOC_G_ISP_MACC
:
1177 case ATOMISP_IOC_S_ISP_MACC
:
1178 case ATOMISP_IOC_G_ISP_BAD_PIXEL_DETECTION
:
1179 case ATOMISP_IOC_S_ISP_BAD_PIXEL_DETECTION
:
1180 case ATOMISP_IOC_G_ISP_FALSE_COLOR_CORRECTION
:
1181 case ATOMISP_IOC_S_ISP_FALSE_COLOR_CORRECTION
:
1182 case ATOMISP_IOC_G_ISP_CTC
:
1183 case ATOMISP_IOC_S_ISP_CTC
:
1184 case ATOMISP_IOC_G_ISP_WHITE_BALANCE
:
1185 case ATOMISP_IOC_S_ISP_WHITE_BALANCE
:
1186 case ATOMISP_IOC_CAMERA_BRIDGE
:
1187 case ATOMISP_IOC_G_SENSOR_MODE_DATA
:
1188 case ATOMISP_IOC_S_EXPOSURE
:
1189 case ATOMISP_IOC_G_3A_CONFIG
:
1190 case ATOMISP_IOC_S_3A_CONFIG
:
1191 case ATOMISP_IOC_ACC_UNLOAD
:
1192 case ATOMISP_IOC_ACC_START
:
1193 case ATOMISP_IOC_ACC_WAIT
:
1194 case ATOMISP_IOC_ACC_ABORT
:
1195 case ATOMISP_IOC_G_ISP_GAMMA_CORRECTION
:
1196 case ATOMISP_IOC_S_ISP_GAMMA_CORRECTION
:
1197 case ATOMISP_IOC_S_CONT_CAPTURE_CONFIG
:
1198 case ATOMISP_IOC_G_DVS2_BQ_RESOLUTIONS
:
1199 case ATOMISP_IOC_EXT_ISP_CTRL
:
1200 case ATOMISP_IOC_EXP_ID_UNLOCK
:
1201 case ATOMISP_IOC_EXP_ID_CAPTURE
:
1202 case ATOMISP_IOC_S_ENABLE_DZ_CAPT_PIPE
:
1203 case ATOMISP_IOC_G_FORMATS_CONFIG
:
1204 case ATOMISP_IOC_S_FORMATS_CONFIG
:
1205 case ATOMISP_IOC_S_EXPOSURE_WINDOW
:
1206 case ATOMISP_IOC_S_ACC_STATE
:
1207 case ATOMISP_IOC_G_ACC_STATE
:
1208 case ATOMISP_IOC_INJECT_A_FAKE_EVENT
:
1209 case ATOMISP_IOC_G_SENSOR_AE_BRACKETING_INFO
:
1210 case ATOMISP_IOC_S_SENSOR_AE_BRACKETING_MODE
:
1211 case ATOMISP_IOC_G_SENSOR_AE_BRACKETING_MODE
:
1212 case ATOMISP_IOC_G_INVALID_FRAME_NUM
:
1213 case ATOMISP_IOC_S_ARRAY_RESOLUTION
:
1215 case ATOMISP_IOC_S_SENSOR_RUNMODE
:
1216 case ATOMISP_IOC_G_UPDATE_EXPOSURE
:
1218 ret
= native_ioctl(file
, cmd
, arg
);
1221 case ATOMISP_IOC_G_HISTOGRAM32
:
1222 case ATOMISP_IOC_S_HISTOGRAM32
:
1223 case ATOMISP_IOC_G_DIS_STAT32
:
1224 case ATOMISP_IOC_S_DIS_COEFS32
:
1225 case ATOMISP_IOC_S_DIS_VECTOR32
:
1226 case ATOMISP_IOC_G_3A_STAT32
:
1227 case ATOMISP_IOC_G_ISP_GDC_TAB32
:
1228 case ATOMISP_IOC_S_ISP_GDC_TAB32
:
1229 case ATOMISP_IOC_S_ISP_FPN_TABLE32
:
1230 case ATOMISP_IOC_G_ISP_OVERLAY32
:
1231 case ATOMISP_IOC_S_ISP_OVERLAY32
:
1232 case ATOMISP_IOC_G_SENSOR_CALIBRATION_GROUP32
:
1233 case ATOMISP_IOC_ACC_LOAD32
:
1234 case ATOMISP_IOC_ACC_S_ARG32
:
1235 case ATOMISP_IOC_G_SENSOR_PRIV_INT_DATA32
:
1236 case ATOMISP_IOC_S_ISP_SHD_TAB32
:
1237 case ATOMISP_IOC_ACC_DESTAB32
:
1238 case ATOMISP_IOC_G_MOTOR_PRIV_INT_DATA32
:
1239 case ATOMISP_IOC_ACC_MAP32
:
1240 case ATOMISP_IOC_ACC_UNMAP32
:
1241 case ATOMISP_IOC_ACC_S_MAPPED_ARG32
:
1242 case ATOMISP_IOC_S_PARAMETERS32
:
1243 case ATOMISP_IOC_ACC_LOAD_TO_PIPE32
:
1244 case ATOMISP_IOC_G_METADATA32
:
1245 case ATOMISP_IOC_G_METADATA_BY_TYPE32
:
1246 case ATOMISP_IOC_S_SENSOR_AE_BRACKETING_LUT32
:
1247 ret
= atomisp_do_compat_ioctl(file
, cmd
, arg
);
1252 "%s: unknown ioctl '%c', dir=%d, #%d (0x%08x)\n",
1253 __func__
, _IOC_TYPE(cmd
), _IOC_DIR(cmd
), _IOC_NR(cmd
),
1259 #endif /* CONFIG_COMPAT */