2 *************************************************************************
3 * Rockchip driver for CIF ISP 1.0
4 * (Based on Intel driver for sofiaxxx)
6 * Copyright (C) 2015 Intel Mobile Communications GmbH
7 * Copyright (C) 2016 Fuzhou Rockchip Electronics Co., Ltd.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *************************************************************************
17 #ifndef _V4L2_CONFIG_ROCKCHIP_H
18 #define _V4L2_CONFIG_ROCKCHIP_H
20 #define CAMERA_STRLEN 32
21 #define CAMERA_METADATA_LEN (2 * PAGE_SIZE)
23 /* Sensor resolution specific data for AE calculation.*/
24 struct isp_supplemental_sensor_mode_data {
25 unsigned int coarse_integration_time_min;
26 unsigned int coarse_integration_time_max_margin;
27 unsigned int fine_integration_time_min;
28 unsigned int fine_integration_time_max_margin;
29 unsigned int frame_length_lines;
30 unsigned int line_length_pck;
31 unsigned int vt_pix_clk_freq_hz;
32 unsigned int crop_horizontal_start; /* Sensor crop start cord. (x0,y0)*/
33 unsigned int crop_vertical_start;
34 unsigned int crop_horizontal_end; /* Sensor crop end cord. (x1,y1)*/
35 unsigned int crop_vertical_end;
36 unsigned int sensor_output_width; /* input size to ISP */
37 unsigned int sensor_output_height;
38 unsigned int isp_input_horizontal_start; /* cif isp input */
39 unsigned int isp_input_vertical_start;
40 unsigned int isp_input_width;
41 unsigned int isp_input_height;
42 unsigned int isp_output_width; /* cif isp output */
43 unsigned int isp_output_height;
44 unsigned char binning_factor_x; /* horizontal binning factor used */
45 unsigned char binning_factor_y; /* vertical binning factor used */
46 unsigned char exposure_valid_frame;
51 struct camera_module_info_s {
52 char sensor_name[CAMERA_STRLEN];
53 char module_name[CAMERA_STRLEN];
54 char len_name[CAMERA_STRLEN];
55 char fov_h[CAMERA_STRLEN];
56 char fov_v[CAMERA_STRLEN];
57 char focal_length[CAMERA_STRLEN];
58 char focus_distance[CAMERA_STRLEN];
64 int flash_exp_percent;
67 struct flash_timeinfo_s {
68 struct timeval preflash_start_t;
69 struct timeval preflash_end_t;
70 struct timeval mainflash_start_t;
71 struct timeval mainflash_end_t;
72 int flash_turn_on_time;
76 struct frame_timeinfo_s {
81 struct sensor_metadata_s {
82 unsigned int exp_time;
86 struct v4l2_buffer_metadata_s {
87 unsigned int frame_id;
88 struct frame_timeinfo_s frame_t;
89 struct flash_timeinfo_s flash_t;
90 struct sensor_metadata_s sensor;
91 unsigned char isp[CAMERA_METADATA_LEN - 512];