]> nv-tegra.nvidia Code Review - linux-2.6.git/blob - include/media/imx132.h
0c64a8041f765d56b184cf30e2dec0d10a4b9d04
[linux-2.6.git] / include / media / imx132.h
1 /**
2  * Copyright (c) 2012 NVIDIA Corporation.  All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software and related documentation
6  * and any modifications thereto.  Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  */
10
11 #ifndef __IMX132_H__
12 #define __IMX132_H__
13
14 #include <linux/ioctl.h>  /* For IOCTL macros */
15
16 #define IMX132_IOCTL_SET_MODE           _IOW('o', 1, struct imx132_mode)
17 #define IMX132_IOCTL_GET_STATUS         _IOR('o', 2, __u8)
18 #define IMX132_IOCTL_SET_FRAME_LENGTH   _IOW('o', 3, __u32)
19 #define IMX132_IOCTL_SET_COARSE_TIME    _IOW('o', 4, __u32)
20 #define IMX132_IOCTL_SET_GAIN           _IOW('o', 5, __u16)
21 #define IMX132_IOCTL_GET_SENSORDATA     _IOR('o', 6, struct imx132_sensordata)
22 #define IMX132_IOCTL_SET_GROUP_HOLD     _IOW('o', 7, struct imx132_ae)
23
24 /* IMX132 registers */
25 #define IMX132_GROUP_PARAM_HOLD                 (0x0104)
26 #define IMX132_COARSE_INTEGRATION_TIME_15_8     (0x0202)
27 #define IMX132_COARSE_INTEGRATION_TIME_7_0      (0x0203)
28 #define IMX132_ANA_GAIN_GLOBAL                  (0x0205)
29 #define IMX132_FRAME_LEN_LINES_15_8             (0x0340)
30 #define IMX132_FRAME_LEN_LINES_7_0              (0x0341)
31
32 #define NUM_OF_FRAME_LEN_REG            2
33 #define NUM_OF_COARSE_TIME_REG          2
34 #define NUM_OF_SENSOR_ID_SPECIFIC_REG   8
35 struct imx132_mode {
36         int xres;
37         int yres;
38         __u32 frame_length;
39         __u32 coarse_time;
40         __u16 gain;
41 };
42
43 struct imx132_ae {
44         __u32 frame_length;
45         __u8  frame_length_enable;
46         __u32 coarse_time;
47         __u8  coarse_time_enable;
48         __s32 gain;
49         __u8  gain_enable;
50 };
51
52 struct imx132_sensordata {
53         __u32 fuse_id_size;
54         __u8  fuse_id[16];
55 };
56
57 #ifdef __KERNEL__
58 struct imx132_platform_data {
59         int (*power_on)(struct device *);
60         int (*power_off)(struct device *);
61 };
62 #endif /* __KERNEL__ */
63
64 #endif  /* __IMX132_H__ */