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 **************************************************************************** 11 ****************************************************************************/ 12 #ifndef CAMERA_MT9T013_H 13 #define CAMERA_MT9T013_H 14 #include <linux/cdev.h> 15 #include <linux/types.h> 16 #include <linux/ioctl.h> 17 #include <asm/sizes.h> 18 19 #define MT9T013_I2C_IOCTL_MAGIC 'm' 20 21 #define MT9T013_I2C_IOCTL_W _IOW(MT9T013_I2C_IOCTL_MAGIC, 0, unsigned) 22 23 #define MT9T013_I2C_IOCTL_R _IOR(MT9T013_I2C_IOCTL_MAGIC, 1, unsigned) 24 25 #define MT9T013_I2C_IOCTL_AF_W _IOW(MT9T013_I2C_IOCTL_MAGIC, 2, unsigned) 26 27 #define MT9T013_I2C_IOCTL_CAMIF_PAD_REG_RESET _IO(MT9T013_I2C_IOCTL_MAGIC, 3) 28 29 #define MT9T013_I2C_IOCTL_CAMIF_PAD_REG_RESET_2 _IO(MT9T013_I2C_IOCTL_MAGIC, 4) 30 31 #define CAMERA_CONFIGURE_GPIOS _IO(MT9T013_I2C_IOCTL_MAGIC, 7) 32 33 #define CAMERA_UNCONFIGURE_GPIOS _IO(MT9T013_I2C_IOCTL_MAGIC, 8) 34 35 #define CAMERA_LENS_POWER_ON _IO(MT9T013_I2C_IOCTL_MAGIC, 9) 36 37 #define CAMERA_LENS_POWER_OFF _IO(MT9T013_I2C_IOCTL_MAGIC, 10) 38 39 #define MT9T013_I2C_IOCTL_CAMIF_APPS_RESET _IO(MT9T013_I2C_IOCTL_MAGIC, 11) 40 41 #define CAMIO_VFE_MDC_CLK 1 42 #define CAMIO_MDC_CLK 2 43 #define CAMIO_VFE_CLK 3 44 45 #define MT9T013_I2C_IOCTL_CLK_ENABLE _IOW(MT9T013_I2C_IOCTL_MAGIC, 12, unsigned) 46 47 #define MT9T013_I2C_IOCTL_CLK_DISABLE _IOW(MT9T013_I2C_IOCTL_MAGIC, 13, unsigned) 48 49 #define MT9T013_I2C_IOCTL_CLK_SELECT _IOW(MT9T013_I2C_IOCTL_MAGIC, 14, unsigned) 50 51 #define MT9T013_I2C_IOCTL_CLK_FREQ_PROG _IOW(MT9T013_I2C_IOCTL_MAGIC, 15, unsigned) 52 53 #define CAMSENSOR_REG_INIT 0<<0 54 #define CAMSENSOR_REG_UPDATE_PERIODIC 1<<0 55 #define CAMSENSOR_TYPE_PREVIEW 0<<1 56 #define CAMSENSOR_TYPE_SNAPSHOT 1<<1 57 58 #define MT9T013_I2C_IOCTL_SENSOR_SETTING _IOW(MT9T013_I2C_IOCTL_MAGIC, 16, uint32_t) 59 60 struct mt9t013_reg_struct 61 { 62 uint16_t vt_pix_clk_div; 63 uint16_t vt_sys_clk_div; 64 uint16_t pre_pll_clk_div; 65 uint16_t pll_multiplier; 66 uint16_t op_pix_clk_div; 67 uint16_t op_sys_clk_div; 68 uint16_t scale_m; 69 uint16_t row_speed; 70 uint16_t x_addr_start; 71 uint16_t x_addr_end; 72 uint16_t y_addr_start; 73 uint16_t y_addr_end; 74 uint16_t read_mode; 75 uint16_t x_output_size ; 76 uint16_t y_output_size; 77 uint16_t line_length_pck; 78 uint16_t frame_length_lines; 79 uint16_t coarse_integration_time; 80 uint16_t fine_integration_time; 81 }; 82 83 struct mt9t013_reg_pat { 84 struct mt9t013_reg_struct reg[2]; 85 }; 86 87 #define MT9T013_I2C_IOCTL_GET_REGISTERS _IOR(MT9T013_I2C_IOCTL_MAGIC, 17, struct mt9t013_reg_pat *) 88 89 struct mt9t013_exposure_gain { 90 uint16_t gain; 91 uint16_t line; 92 uint32_t mode; 93 }; 94 95 #define MT9T013_I2C_IOCTL_EXPOSURE_GAIN _IOW(MT9T013_I2C_IOCTL_MAGIC, 18, struct exposure_gain *) 96 97 #define MT9T013_I2C_IOCTL_MOVE_FOCUS _IOW(MT9T013_I2C_IOCTL_MAGIC, 19, uint32_t) 98 99 #define MT9T013_I2C_IOCTL_SET_DEFAULT_FOCUS _IOW(MT9T013_I2C_IOCTL_MAGIC, 20, uint32_t) 100 101 #define MT9T013_I2C_IOCTL_POWER_DOWN _IO(MT9T013_I2C_IOCTL_MAGIC, 21) 102 103 struct mt9t013_init { 104 int preview; 105 uint16_t chipid; 106 }; 107 108 #define MT9T013_I2C_IOCTL_INIT _IOWR(MT9T013_I2C_IOCTL_MAGIC, 22, struct mt9t013_init *) 109 110 #endif 111 112