video: tegra: dtv: Add ioctl for buffer size query
[linux-3.10.git] / include / media / nvc_focus.h
1 /* Copyright (C) 2012 NVIDIA Corporation.
2  *
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License version 2 as
5  * published by the Free Software Foundation.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software
14  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
15  * 02111-1307, USA
16  */
17
18 #ifndef __NVC_FOCUS_H__
19 #define __NVC_FOCUS_H__
20
21 /* NVC_FOCUS_CAP_VER0: invalid */
22 /* NVC_FOCUS_CAP_VER1:
23  * __u32 version
24  * __u32 actuator_range
25  * __u32 settle_time
26  */
27 #define NVC_FOCUS_CAP_VER1              1
28 /* NVC_FOCUS_CAP_VER2 adds:
29  * __u32 focus_macro;
30  * __u32 focus_hyper;
31  * __u32 focus_infinity;
32  */
33 #define NVC_FOCUS_CAP_VER2              2
34 #define NVC_FOCUS_CAP_VER               2 /* latest version */
35
36 #define AF_POS_INVALID_VALUE INT_MAX
37
38 /* These are the slew rate values coming down from the configuration */
39 /* Disabled is the same as fastest. Default is the default */
40 /* slew rate configuration in the focuser */
41 #define SLEW_RATE_DISABLED              0
42 #define SLEW_RATE_DEFAULT               1
43 #define SLEW_RATE_SLOWEST               9
44
45
46 enum nvc_focus_sts {
47         NVC_FOCUS_STS_UNKNOWN           = 1,
48         NVC_FOCUS_STS_NO_DEVICE,
49         NVC_FOCUS_STS_INITIALIZING,
50         NVC_FOCUS_STS_INIT_ERR,
51         NVC_FOCUS_STS_WAIT_FOR_MOVE_END,
52         NVC_FOCUS_STS_WAIT_FOR_SETTLE,
53         NVC_FOCUS_STS_LENS_SETTLED,
54         NVC_FOCUS_STS_FORCE32           = 0x7FFFFFFF
55 };
56
57 struct nvc_focus_nvc {
58         __u32 focal_length;
59         __u32 fnumber;
60         __u32 max_aperature;
61 } __packed;
62
63 struct nvc_focus_cap {
64         __u32 version;
65         __s32 actuator_range;
66         __u32 settle_time;
67         __s32 focus_macro;
68         __s32 focus_hyper;
69         __s32 focus_infinity;
70         __u32 slew_rate;
71         __u32 position_translate;
72 } __packed;
73
74
75 #define NV_FOCUSER_SET_MAX              10
76 #define NV_FOCUSER_SET_DISTANCE_PAIR    16
77
78 struct nv_focuser_set_dist_pairs {
79         __s32 fdn;
80         __s32 distance;
81 } __packed;
82
83 struct nv_focuser_set {
84         __s32 posture;
85         __s32 macro;
86         __s32 hyper;
87         __s32 inf;
88         __s32 hysteresis;
89         __u32 settle_time;
90         __s32 macro_offset;
91         __s32 inf_offset;
92         __u32 num_dist_pairs;
93         struct nv_focuser_set_dist_pairs
94                         dist_pair[NV_FOCUSER_SET_DISTANCE_PAIR];
95 } __packed;
96
97 struct nv_focuser_config {
98         __u32 focal_length;
99         __u32 fnumber;
100         __u32 max_aperture;
101         __u32 range_ends_reversed;
102         __s32 pos_working_low;
103         __s32 pos_working_high;
104         __s32 pos_actual_low;
105         __s32 pos_actual_high;
106         __u32 slew_rate;
107         __u32 circle_of_confusion;
108         __u32 num_focuser_sets;
109         struct nv_focuser_set focuser_set[NV_FOCUSER_SET_MAX];
110 } __packed;
111
112
113 #endif /* __NVC_FOCUS_H__ */
114