blob: 821ef21670eb7aa676f242e2cd053e5471581ea7 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
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>
Ben Cheng4b29af02012-03-07 16:14:53 -080018
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080019#define MT9T013_I2C_IOCTL_MAGIC 'm'
Ben Cheng4b29af02012-03-07 16:14:53 -080020
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#define MT9T013_I2C_IOCTL_W _IOW(MT9T013_I2C_IOCTL_MAGIC, 0, unsigned)
Ben Cheng4b29af02012-03-07 16:14:53 -080022
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080023#define MT9T013_I2C_IOCTL_R _IOR(MT9T013_I2C_IOCTL_MAGIC, 1, unsigned)
Ben Cheng4b29af02012-03-07 16:14:53 -080024
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080025#define MT9T013_I2C_IOCTL_AF_W _IOW(MT9T013_I2C_IOCTL_MAGIC, 2, unsigned)
Ben Cheng4b29af02012-03-07 16:14:53 -080026
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080027#define MT9T013_I2C_IOCTL_CAMIF_PAD_REG_RESET _IO(MT9T013_I2C_IOCTL_MAGIC, 3)
Ben Cheng4b29af02012-03-07 16:14:53 -080028
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#define MT9T013_I2C_IOCTL_CAMIF_PAD_REG_RESET_2 _IO(MT9T013_I2C_IOCTL_MAGIC, 4)
Ben Cheng4b29af02012-03-07 16:14:53 -080030
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080031#define CAMERA_CONFIGURE_GPIOS _IO(MT9T013_I2C_IOCTL_MAGIC, 7)
Ben Cheng4b29af02012-03-07 16:14:53 -080032
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080033#define CAMERA_UNCONFIGURE_GPIOS _IO(MT9T013_I2C_IOCTL_MAGIC, 8)
Ben Cheng4b29af02012-03-07 16:14:53 -080034
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080035#define CAMERA_LENS_POWER_ON _IO(MT9T013_I2C_IOCTL_MAGIC, 9)
Ben Cheng4b29af02012-03-07 16:14:53 -080036
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080037#define CAMERA_LENS_POWER_OFF _IO(MT9T013_I2C_IOCTL_MAGIC, 10)
Ben Cheng4b29af02012-03-07 16:14:53 -080038
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define MT9T013_I2C_IOCTL_CAMIF_APPS_RESET _IO(MT9T013_I2C_IOCTL_MAGIC, 11)
Ben Cheng4b29af02012-03-07 16:14:53 -080040
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041#define CAMIO_VFE_MDC_CLK 1
42#define CAMIO_MDC_CLK 2
43#define CAMIO_VFE_CLK 3
Ben Cheng4b29af02012-03-07 16:14:53 -080044
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080045#define MT9T013_I2C_IOCTL_CLK_ENABLE _IOW(MT9T013_I2C_IOCTL_MAGIC, 12, unsigned)
Ben Cheng4b29af02012-03-07 16:14:53 -080046
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080047#define MT9T013_I2C_IOCTL_CLK_DISABLE _IOW(MT9T013_I2C_IOCTL_MAGIC, 13, unsigned)
Ben Cheng4b29af02012-03-07 16:14:53 -080048
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#define MT9T013_I2C_IOCTL_CLK_SELECT _IOW(MT9T013_I2C_IOCTL_MAGIC, 14, unsigned)
Ben Cheng4b29af02012-03-07 16:14:53 -080050
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080051#define MT9T013_I2C_IOCTL_CLK_FREQ_PROG _IOW(MT9T013_I2C_IOCTL_MAGIC, 15, unsigned)
Ben Cheng4b29af02012-03-07 16:14:53 -080052
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080053#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
Ben Cheng4b29af02012-03-07 16:14:53 -080057
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080058#define MT9T013_I2C_IOCTL_SENSOR_SETTING _IOW(MT9T013_I2C_IOCTL_MAGIC, 16, uint32_t)
Ben Cheng4b29af02012-03-07 16:14:53 -080059
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080060struct 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};
Ben Cheng4b29af02012-03-07 16:14:53 -080082
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080083struct mt9t013_reg_pat {
84 struct mt9t013_reg_struct reg[2];
85};
Ben Cheng4b29af02012-03-07 16:14:53 -080086
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080087#define MT9T013_I2C_IOCTL_GET_REGISTERS _IOR(MT9T013_I2C_IOCTL_MAGIC, 17, struct mt9t013_reg_pat *)
Ben Cheng4b29af02012-03-07 16:14:53 -080088
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080089struct mt9t013_exposure_gain {
90 uint16_t gain;
91 uint16_t line;
The Android Open Source Project78bf5fc2009-03-18 17:39:42 -070092 uint32_t mode;
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080093};
Ben Cheng4b29af02012-03-07 16:14:53 -080094
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080095#define MT9T013_I2C_IOCTL_EXPOSURE_GAIN _IOW(MT9T013_I2C_IOCTL_MAGIC, 18, struct exposure_gain *)
Ben Cheng4b29af02012-03-07 16:14:53 -080096
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080097#define MT9T013_I2C_IOCTL_MOVE_FOCUS _IOW(MT9T013_I2C_IOCTL_MAGIC, 19, uint32_t)
Ben Cheng4b29af02012-03-07 16:14:53 -080098
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080099#define MT9T013_I2C_IOCTL_SET_DEFAULT_FOCUS _IOW(MT9T013_I2C_IOCTL_MAGIC, 20, uint32_t)
Ben Cheng4b29af02012-03-07 16:14:53 -0800100
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800101#define MT9T013_I2C_IOCTL_POWER_DOWN _IO(MT9T013_I2C_IOCTL_MAGIC, 21)
Ben Cheng4b29af02012-03-07 16:14:53 -0800102
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800103struct mt9t013_init {
104 int preview;
105 uint16_t chipid;
106};
Ben Cheng4b29af02012-03-07 16:14:53 -0800107
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800108#define MT9T013_I2C_IOCTL_INIT _IOWR(MT9T013_I2C_IOCTL_MAGIC, 22, struct mt9t013_init *)
Ben Cheng4b29af02012-03-07 16:14:53 -0800109
The Android Open Source Project1dc9e472009-03-03 19:28:35 -0800110#endif
Ben Cheng4b29af02012-03-07 16:14:53 -0800111