1 2 /* 3 * configs for cameras. 4 * 5 * Copyright (c) 2017 by Allwinnertech Co., Ltd. http://www.allwinnertech.com 6 * 7 * Authors: Zhao Wei <zhaowei@allwinnertech.com> 8 * Yang Feng <yangfeng@allwinnertech.com> 9 * 10 * This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License version 2 as 12 * published by the Free Software Foundation. 13 */ 14 15 #ifndef __CAMERA_CFG_H__ 16 #define __CAMERA_CFG_H__ 17 18 enum sensor_pad { 19 /*SENSOR_PAD_SINK,*/ 20 SENSOR_PAD_SOURCE, 21 SENSOR_PAD_NUM, 22 }; 23 24 enum sensor_type_t { 25 SENSOR_YUV = 0, 26 SENSOR_RAW = 1, 27 }; 28 29 typedef enum tag_CAMERA_IO_CMD { 30 GET_CURRENT_WIN_CFG, 31 SET_FPS, 32 SET_FLASH_CTRL, 33 GET_SENSOR_EXIF, 34 SET_AUTO_FOCUS_WIN, 35 SET_AUTO_EXPOSURE_WIN, 36 GET_FLASH_FLAG, 37 GET_COMBO_SYNC_CODE, 38 GET_COMBO_LANE_MAP, 39 GET_COMBO_WDR_CFG, 40 SET_SENSOR_STANDBY, 41 } __camera_cmd_t; 42 43 struct sensor_exif_attribute { 44 __u32 exposure_time_num; 45 __u32 exposure_time_den; 46 __u32 fnumber; 47 __u32 focal_length; 48 __u32 iso_speed; 49 __u32 flash_fire; 50 __u32 brightness; 51 }; 52 53 struct sensor_win_size { 54 /*sensor output w = width + 2*hoffset, h = height + 2*voffset */ 55 unsigned int width; /*csi parser crop width */ 56 unsigned int height; /*csi parser crop height */ 57 unsigned int hoffset; /*csi parser crop hoffset*/ 58 unsigned int voffset; /*csi parser crop voffset*/ 59 unsigned int hts; /*h size of timing, unit: pclk */ 60 unsigned int vts; /*v size of timing, unit: line */ 61 unsigned int pclk; /*pixel clock in Hz */ 62 unsigned int mipi_bps; /*mipi clock in bps, config for mipi*/ 63 unsigned int fps_fixed; /*fps mode 1=fixed fps */ 64 unsigned int if_mode; /*interface mode, normal = 0, wdr != 0 */ 65 unsigned int wdr_mode; /*wdr mode, normal = 0, dol = 1, command = 2 */ 66 unsigned int lp_mode; /*0 = continuous 1 = discontinuous*/ 67 unsigned int bin_factor;/*binning factor */ 68 unsigned int intg_min; /*integration min, unit: line, Q4 */ 69 unsigned int intg_max; /*integration max, unit: line, Q4 */ 70 unsigned int gain_min; /*sensor gain min, Q4 */ 71 unsigned int gain_max; /*sensor gain max, Q4 */ 72 unsigned int width_input; /*isp width input, after isp crop*/ 73 unsigned int height_input; /*isp height input, after isp crop*/ 74 unsigned int vipp_hoff; /*vipp crop hoffset */ 75 unsigned int vipp_voff; /*vipp crop voffset */ 76 unsigned int vipp_w; /*vipp crop width */ 77 unsigned int vipp_h; /*vipp crop height */ 78 unsigned int vipp_wshrink;/*vipp shrink width */ 79 unsigned int vipp_hshrink;/*vipp shrink height */ 80 unsigned long top_clk; 81 unsigned long isp_clk; 82 83 void *regs; /* Regs to tweak */ 84 int regs_size; 85 int (*set_size) (struct v4l2_subdev *sd); 86 }; 87 88 #endif /*__CAMERA_CFG_H__*/ 89