]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/blob - include/media/ov4689.h
Kernel: add ov4689 kernel driver
[sojka/nv-tegra/linux-3.10.git] / include / media / ov4689.h
1 /*
2  * ov4689.h - ov4689 sensor driver
3  *
4  * Copyright (c) 2015 NVIDIA Corporation.  All rights reserved.
5  *
6  * Contributors:
7  *  Jerry Chang <jerchang@nvidia.com>
8  *
9  * This file is licensed under the terms of the GNU General Public License
10  * version 2. This program is licensed "as is" without any warranty of any
11  * kind, whether express or implied.
12  */
13
14 #ifndef __OV4689_H__
15 #define __OV4689_H__
16
17 #include <linux/ioctl.h>
18
19 #define OV4689_IOCTL_SET_MODE   _IOW('o', 1, struct ov4689_mode)
20 #define OV4689_IOCTL_SET_FRAME_LENGTH   _IOW('o', 2, __u32)
21 #define OV4689_IOCTL_SET_COARSE_TIME    _IOW('o', 3, __u32)
22 #define OV4689_IOCTL_SET_GAIN   _IOW('o', 4, __u16)
23 #define OV4689_IOCTL_GET_STATUS _IOR('o', 5, __u8)
24 #define OV4689_IOCTL_SET_GROUP_HOLD     _IOW('o', 6, struct ov4689_grouphold)
25 #define OV4689_IOCTL_GET_SENSORDATA     _IOR('o', 7, struct ov4689_sensordata)
26 #define OV4689_IOCTL_SET_FLASH  _IOW('o', 8, struct ov4689_flash_control)
27 #define OV4689_IOCTL_SET_POWER          _IOW('o', 20, __u32)
28
29 struct ov4689_sensordata {
30         __u32 fuse_id_size;
31         __u8 fuse_id[16];
32 };
33
34 struct ov4689_mode {
35         __u32 xres;
36         __u32 yres;
37         __u32 fps;
38         __u32 frame_length;
39         __u32 coarse_time;
40         __u16 gain;
41 };
42
43 struct ov4689_grouphold {
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 ov4689_flash_control {
53         u8 enable;
54         u8 edge_trig_en;
55         u8 start_edge;
56         u8 repeat;
57         u16 delay_frm;
58 };
59
60 #ifdef __KERNEL__
61 struct ov4689_power_rail {
62         struct regulator *dvdd;
63         struct regulator *avdd;
64         struct regulator *iovdd;
65         struct regulator *vif;
66 };
67
68 struct ov4689_platform_data {
69         struct ov4689_flash_control flash_cap;
70         int (*power_on)(struct ov4689_power_rail *pw);
71         int (*power_off)(struct ov4689_power_rail *pw);
72         const char *mclk_name;
73         unsigned int reset_gpio;
74 };
75 #endif /* __KERNEL__ */
76
77 #endif /* __OV4689_H__ */