diff options
author | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
---|---|---|
committer | Jonathan Herman <hermanjl@cs.unc.edu> | 2013-01-22 10:38:37 -0500 |
commit | fcc9d2e5a6c89d22b8b773a64fb4ad21ac318446 (patch) | |
tree | a57612d1888735a2ec7972891b68c1ac5ec8faea /include/media | |
parent | 8dea78da5cee153b8af9c07a2745f6c55057fe12 (diff) |
Diffstat (limited to 'include/media')
-rw-r--r-- | include/media/ad5820.h | 41 | ||||
-rw-r--r-- | include/media/ar0832_main.h | 106 | ||||
-rw-r--r-- | include/media/nvc.h | 284 | ||||
-rw-r--r-- | include/media/nvc_focus.h | 63 | ||||
-rw-r--r-- | include/media/nvc_image.h | 194 | ||||
-rw-r--r-- | include/media/nvc_torch.h | 43 | ||||
-rw-r--r-- | include/media/ov14810.h | 47 | ||||
-rw-r--r-- | include/media/ov2710.h | 47 | ||||
-rw-r--r-- | include/media/ov5650.h | 93 | ||||
-rw-r--r-- | include/media/ov9726.h | 62 | ||||
-rw-r--r-- | include/media/pwc-ioctl.h | 324 | ||||
-rw-r--r-- | include/media/sh532u.h | 319 | ||||
-rw-r--r-- | include/media/soc380.h | 59 | ||||
-rw-r--r-- | include/media/ssl3250a.h | 38 | ||||
-rw-r--r-- | include/media/tegra_camera.h | 55 | ||||
-rw-r--r-- | include/media/tegra_dtv.h | 134 | ||||
-rw-r--r-- | include/media/tps61050.h | 36 |
17 files changed, 1945 insertions, 0 deletions
diff --git a/include/media/ad5820.h b/include/media/ad5820.h new file mode 100644 index 00000000000..c3e71011340 --- /dev/null +++ b/include/media/ad5820.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010-2011 NVIDIA Corporation. | ||
3 | * | ||
4 | * Contributors: | ||
5 | * Sachin Nikam <snikam@nvidia.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License version 2 as | ||
9 | * published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
19 | * 02111-1307, USA | ||
20 | */ | ||
21 | |||
22 | #ifndef __AD5820_H__ | ||
23 | #define __AD5820_H__ | ||
24 | |||
25 | #include <linux/ioctl.h> /* For IOCTL macros */ | ||
26 | |||
27 | #define AD5820_IOCTL_GET_CONFIG _IOR('o', 1, struct ad5820_config) | ||
28 | #define AD5820_IOCTL_SET_POSITION _IOW('o', 2, u32) | ||
29 | |||
30 | struct ad5820_config { | ||
31 | __u32 settle_time; | ||
32 | __u32 actuator_range; | ||
33 | __u32 pos_low; | ||
34 | __u32 pos_high; | ||
35 | float focal_length; | ||
36 | float fnumber; | ||
37 | float max_aperture; | ||
38 | }; | ||
39 | |||
40 | #endif /* __AD5820_H__ */ | ||
41 | |||
diff --git a/include/media/ar0832_main.h b/include/media/ar0832_main.h new file mode 100644 index 00000000000..f5e3713b46f --- /dev/null +++ b/include/media/ar0832_main.h | |||
@@ -0,0 +1,106 @@ | |||
1 | /* | ||
2 | * ar0832_main.h | ||
3 | * | ||
4 | * Copyright (c) 2011, NVIDIA, All Rights Reserved. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __AR0832_MAIN_H__ | ||
12 | #define __AR0832_MAIN_H__ | ||
13 | |||
14 | #include <linux/ioctl.h> /* For IOCTL macros */ | ||
15 | |||
16 | #define AR0832_IOCTL_SET_MODE _IOW('o', 0x01, struct ar0832_mode) | ||
17 | #define AR0832_IOCTL_SET_FRAME_LENGTH _IOW('o', 0x02, __u32) | ||
18 | #define AR0832_IOCTL_SET_COARSE_TIME _IOW('o', 0x03, __u32) | ||
19 | #define AR0832_IOCTL_SET_GAIN _IOW('o', 0x04, __u16) | ||
20 | #define AR0832_IOCTL_GET_STATUS _IOR('o', 0x05, __u8) | ||
21 | #define AR0832_IOCTL_GET_OTP _IOR('o', 0x06, struct ar0832_otp_data) | ||
22 | #define AR0832_IOCTL_TEST_PATTERN _IOW('o', 0x07, enum ar0832_test_pattern) | ||
23 | #define AR0832_IOCTL_SET_POWER_ON _IOW('o', 0x08, struct ar0832_mode) | ||
24 | #define AR0832_IOCTL_SET_SENSOR_REGION _IOW('o', 0x09, struct ar0832_stereo_region) | ||
25 | |||
26 | #define AR0832_FOCUSER_IOCTL_GET_CONFIG _IOR('o', 0x10, struct ar0832_focuser_config) | ||
27 | #define AR0832_FOCUSER_IOCTL_SET_POSITION _IOW('o', 0x11, __u32) | ||
28 | |||
29 | #define AR0832_IOCTL_GET_SENSOR_ID _IOR('o', 0x12, __u16) | ||
30 | |||
31 | #define AR0832_SENSOR_ID_8141 0x1006 | ||
32 | #define AR0832_SENSOR_ID_8140 0x3006 | ||
33 | |||
34 | enum ar0832_test_pattern { | ||
35 | TEST_PATTERN_NONE, | ||
36 | TEST_PATTERN_COLORBARS, | ||
37 | TEST_PATTERN_CHECKERBOARD | ||
38 | }; | ||
39 | |||
40 | struct ar0832_otp_data { | ||
41 | /* Only the first 5 bytes are actually used. */ | ||
42 | __u8 sensor_serial_num[6]; | ||
43 | __u8 part_num[8]; | ||
44 | __u8 lens_id[1]; | ||
45 | __u8 manufacture_id[2]; | ||
46 | __u8 factory_id[2]; | ||
47 | __u8 manufacture_date[9]; | ||
48 | __u8 manufacture_line[2]; | ||
49 | |||
50 | __u32 module_serial_num; | ||
51 | __u8 focuser_liftoff[2]; | ||
52 | __u8 focuser_macro[2]; | ||
53 | __u8 reserved1[12]; | ||
54 | __u8 shutter_cal[16]; | ||
55 | __u8 reserved2[183]; | ||
56 | |||
57 | /* Big-endian. CRC16 over 0x00-0x41 (inclusive) */ | ||
58 | __u16 crc; | ||
59 | __u8 reserved3[3]; | ||
60 | __u8 auto_load[2]; | ||
61 | } __attribute__ ((packed)); | ||
62 | |||
63 | struct ar0832_mode { | ||
64 | int xres; | ||
65 | int yres; | ||
66 | __u32 frame_length; | ||
67 | __u32 coarse_time; | ||
68 | __u16 gain; | ||
69 | int stereo; | ||
70 | }; | ||
71 | |||
72 | struct ar0832_point{ | ||
73 | int x; | ||
74 | int y; | ||
75 | }; | ||
76 | |||
77 | struct ar0832_reg { | ||
78 | __u16 addr; | ||
79 | __u16 val; | ||
80 | }; | ||
81 | |||
82 | struct ar0832_stereo_region { | ||
83 | int camera_index; | ||
84 | struct ar0832_point image_start; | ||
85 | struct ar0832_point image_end; | ||
86 | }; | ||
87 | |||
88 | struct ar0832_focuser_config { | ||
89 | __u32 settle_time; | ||
90 | __u32 actuator_range; | ||
91 | __u32 pos_low; | ||
92 | __u32 pos_high; | ||
93 | __u32 focal_length; | ||
94 | __u32 fnumber; | ||
95 | __u32 max_aperture; | ||
96 | }; | ||
97 | |||
98 | #ifdef __KERNEL__ | ||
99 | struct ar0832_platform_data { | ||
100 | int (*power_on)(int is_stereo); | ||
101 | int (*power_off)(int is_stereo); | ||
102 | char *id; | ||
103 | }; | ||
104 | #endif /* __KERNEL__ */ | ||
105 | |||
106 | #endif | ||
diff --git a/include/media/nvc.h b/include/media/nvc.h new file mode 100644 index 00000000000..9b24b0ea019 --- /dev/null +++ b/include/media/nvc.h | |||
@@ -0,0 +1,284 @@ | |||
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_H__ | ||
19 | #define __NVC_H__ | ||
20 | |||
21 | #include <linux/ioctl.h> | ||
22 | |||
23 | #define NVC_INT2FLOAT_DIVISOR_1K 1000 | ||
24 | #define NVC_INT2FLOAT_DIVISOR_1M 1000000 | ||
25 | #define NVC_INT2FLOAT_DIVISOR 1000 | ||
26 | |||
27 | struct nvc_param { | ||
28 | int param; | ||
29 | __u32 sizeofvalue; | ||
30 | void *p_value; | ||
31 | } __packed; | ||
32 | |||
33 | enum nvc_params { | ||
34 | NVC_PARAM_EXPOSURE = 0, | ||
35 | NVC_PARAM_GAIN, | ||
36 | NVC_PARAM_FRAMERATE, | ||
37 | NVC_PARAM_MAX_FRAMERATE, | ||
38 | NVC_PARAM_INPUT_CLOCK, | ||
39 | NVC_PARAM_LOCUS, | ||
40 | NVC_PARAM_FLASH_CAPS, | ||
41 | NVC_PARAM_FLASH_LEVEL, | ||
42 | NVC_PARAM_FLASH_PIN_STATE, | ||
43 | NVC_PARAM_TORCH_CAPS, | ||
44 | NVC_PARAM_TORCH_LEVEL, | ||
45 | NVC_PARAM_FOCAL_LEN, | ||
46 | NVC_PARAM_MAX_APERTURE, | ||
47 | NVC_PARAM_FNUMBER, | ||
48 | NVC_PARAM_EXPOSURE_LIMITS, | ||
49 | NVC_PARAM_GAIN_LIMITS, | ||
50 | NVC_PARAM_FRAMERATE_LIMITS, | ||
51 | NVC_PARAM_FRAME_RATES, | ||
52 | NVC_PARAM_CLOCK_LIMITS, | ||
53 | NVC_PARAM_EXP_LATCH_TIME, | ||
54 | NVC_PARAM_REGION_USED, | ||
55 | NVC_PARAM_CALIBRATION_DATA, | ||
56 | NVC_PARAM_CALIBRATION_OVERRIDES, | ||
57 | NVC_PARAM_SELF_TEST, | ||
58 | NVC_PARAM_STS, | ||
59 | NVC_PARAM_TESTMODE, | ||
60 | NVC_PARAM_EXPECTED_VALUES, | ||
61 | NVC_PARAM_RESET, | ||
62 | NVC_PARAM_OPTIMIZE_RES, | ||
63 | NVC_PARAM_DETECT_COLOR_TEMP, | ||
64 | NVC_PARAM_LINES_PER_SEC, | ||
65 | NVC_PARAM_CAPS, | ||
66 | NVC_PARAM_CUSTOM_BLOCK_INFO, | ||
67 | NVC_PARAM_STEREO_CAP, | ||
68 | NVC_PARAM_FOCUS_STEREO, | ||
69 | NVC_PARAM_STEREO, | ||
70 | NVC_PARAM_INHERENT_GAIN, | ||
71 | NVC_PARAM_VIEW_ANGLE_H, | ||
72 | NVC_PARAM_VIEW_ANGLE_V, | ||
73 | NVC_PARAM_ISP_SETTING, | ||
74 | NVC_PARAM_OPERATION_MODE, | ||
75 | NVC_PARAM_SUPPORT_ISP, | ||
76 | NVC_PARAM_AWB_LOCK, | ||
77 | NVC_PARAM_AE_LOCK, | ||
78 | NVC_PARAM_RES_CHANGE_WAIT_TIME, | ||
79 | NVC_PARAM_FACTORY_CALIBRATION_DATA, | ||
80 | NVC_PARAM_DEV_ID, | ||
81 | NVC_PARAM_GROUP_HOLD, | ||
82 | NVC_PARAM_BEGIN_VENDOR_EXTENSIONS = 0x10000000, | ||
83 | NVC_PARAM_CALIBRATION_STATUS, | ||
84 | NVC_PARAM_TEST_PATTERN, | ||
85 | NVC_PARAM_MODULE_INFO, | ||
86 | NVC_PARAM_FLASH_MAX_POWER, | ||
87 | NVC_PARAM_DIRECTION, | ||
88 | NVC_PARAM_SENSOR_TYPE, | ||
89 | NVC_PARAM_DLI_CHECK, | ||
90 | NVC_PARAM_PARALLEL_DLI_CHECK, | ||
91 | NVC_PARAM_BRACKET_CAPS, | ||
92 | NVC_PARAM_NUM, | ||
93 | NVC_PARAM_I2C, | ||
94 | NVC_PARAM_FORCE32 = 0x7FFFFFFF | ||
95 | }; | ||
96 | |||
97 | /* sync off */ | ||
98 | #define NVC_SYNC_OFF 0 | ||
99 | /* use only this device (the one receiving the call) */ | ||
100 | #define NVC_SYNC_MASTER 1 | ||
101 | /* use only the synced device (the "other" device) */ | ||
102 | #define NVC_SYNC_SLAVE 2 | ||
103 | /* use both synced devices at the same time */ | ||
104 | #define NVC_SYNC_STEREO 3 | ||
105 | |||
106 | #define NVC_RESET_HARD 0 | ||
107 | #define NVC_RESET_SOFT 1 | ||
108 | |||
109 | struct nvc_param_isp { | ||
110 | int attr; | ||
111 | void *p_data; | ||
112 | __u32 data_size; | ||
113 | } __packed; | ||
114 | |||
115 | struct nvc_isp_focus_param { | ||
116 | __s32 min_pos; | ||
117 | __s32 max_pos; | ||
118 | __s32 hyperfocal; | ||
119 | __s32 macro; | ||
120 | __s32 powersave; | ||
121 | } __packed; | ||
122 | |||
123 | struct nvc_isp_focus_pos { | ||
124 | __u32 is_auto; | ||
125 | __s32 value; | ||
126 | } __packed; | ||
127 | |||
128 | struct nvc_isp_focus_region { | ||
129 | __u32 num_region; | ||
130 | __s32 value; | ||
131 | } __packed; | ||
132 | |||
133 | enum nvc_params_isp { | ||
134 | NVC_PARAM_ISP_FOCUS_CAF = 16389, | ||
135 | NVC_PARAM_ISP_FOCUS_CAF_PAUSE, | ||
136 | NVC_PARAM_ISP_FOCUS_CAF_STS, | ||
137 | NVC_PARAM_ISP_FOCUS_POS = 16407, | ||
138 | NVC_PARAM_ISP_FOCUS_RANGE, | ||
139 | NVC_PARAM_ISP_FOCUS_AF_RGN = 16413, | ||
140 | NVC_PARAM_ISP_FOCUS_AF_RGN_MASK, | ||
141 | NVC_PARAM_ISP_FOCUS_AF_RGN_STS, | ||
142 | NVC_PARAM_ISP_FOCUS_CTRL = 16424, | ||
143 | NVC_PARAM_ISP_FOCUS_TRGR, | ||
144 | NVC_PARAM_ISP_FOCUS_STS, | ||
145 | }; | ||
146 | |||
147 | #define NVC_PARAM_ISP_FOCUS_STS_BUSY 0 | ||
148 | #define NVC_PARAM_ISP_FOCUS_STS_LOCKD 1 | ||
149 | #define NVC_PARAM_ISP_FOCUS_STS_FAILD 2 | ||
150 | #define NVC_PARAM_ISP_FOCUS_STS_ERR 3 | ||
151 | |||
152 | #define NVC_PARAM_ISP_FOCUS_CTRL_ON 0 | ||
153 | #define NVC_PARAM_ISP_FOCUS_CTRL_OFF 1 | ||
154 | #define NVC_PARAM_ISP_FOCUS_CTRL_AUTO 2 | ||
155 | #define NVC_PARAM_ISP_FOCUS_CTRL_ALOCK 3 | ||
156 | |||
157 | #define NVC_PARAM_ISP_FOCUS_CAF_CONVRG 1 | ||
158 | #define NVC_PARAM_ISP_FOCUS_CAF_SEARCH 2 | ||
159 | |||
160 | #define NVC_PARAM_ISP_FOCUS_POS_INF 0 | ||
161 | |||
162 | |||
163 | #define NVC_IOCTL_PWR_WR _IOW('o', 102, int) | ||
164 | #define NVC_IOCTL_PWR_RD _IOW('o', 103, int) | ||
165 | #define NVC_IOCTL_PARAM_WR _IOW('o', 104, struct nvc_param) | ||
166 | #define NVC_IOCTL_PARAM_RD _IOWR('o', 105, struct nvc_param) | ||
167 | #define NVC_IOCTL_PARAM_ISP_RD _IOWR('o', 200, struct nvc_param_isp) | ||
168 | #define NVC_IOCTL_PARAM_ISP_WR _IOWR('o', 201, struct nvc_param_isp) | ||
169 | |||
170 | |||
171 | #ifdef __KERNEL__ | ||
172 | |||
173 | #include <linux/regulator/consumer.h> | ||
174 | |||
175 | /* The NVC_CFG_ defines are for the .cfg entry in the | ||
176 | * platform data structure. | ||
177 | */ | ||
178 | /* Device not registered if not found */ | ||
179 | #define NVC_CFG_NODEV (1 << 0) | ||
180 | /* Don't return errors */ | ||
181 | #define NVC_CFG_NOERR (1 << 1) | ||
182 | /* Always go to _PWR_STDBY instead of _PWR_OFF */ | ||
183 | #define NVC_CFG_OFF2STDBY (1 << 2) | ||
184 | /* Init device at sys boot */ | ||
185 | #define NVC_CFG_BOOT_INIT (1 << 3) | ||
186 | /* Sync mode uses an I2C MUX to send at same time */ | ||
187 | #define NVC_CFG_SYNC_I2C_MUX (1 << 4) | ||
188 | |||
189 | /* Expected higher level power calls are: | ||
190 | * 1 = OFF | ||
191 | * 2 = STANDBY | ||
192 | * 3 = ON | ||
193 | * These will be multiplied by 2 before given to the driver's PM code that | ||
194 | * uses the _PWR_ defines. This allows us to insert defines to give more power | ||
195 | * granularity and still remain linear with regards to the power usage and | ||
196 | * full power state transition latency for easy implementation of PM | ||
197 | * algorithms. | ||
198 | * The PM actions: | ||
199 | * _PWR_ERR = Non-valid state. | ||
200 | * _PWR_OFF_FORCE = _PWR_OFF is forced regardless of standby mechanisms. | ||
201 | * _PWR_OFF = Device, regulators, clocks, etc is turned off. The longest | ||
202 | * transition time to _PWR_ON is from this state. | ||
203 | * _PWR_STDBY_OFF = Device is useless but powered. No communication possible. | ||
204 | * Device does not retain programming. Main purpose is for | ||
205 | * faster return to _PWR_ON without regulator delays. | ||
206 | * _PWR_STDBY = Device is in standby. Device retains programming. | ||
207 | * _PWR_COMM = Device is powered enough to communicate with the device. | ||
208 | * _PWR_ON = Device is at full power with active output. | ||
209 | * | ||
210 | * The kernel drivers treat these calls as Guaranteed Level Of Service. | ||
211 | */ | ||
212 | |||
213 | #define NVC_PWR_ERR 0 | ||
214 | #define NVC_PWR_OFF_FORCE 1 | ||
215 | #define NVC_PWR_OFF 2 | ||
216 | #define NVC_PWR_STDBY_OFF 3 | ||
217 | #define NVC_PWR_STDBY 4 | ||
218 | #define NVC_PWR_COMM 5 | ||
219 | #define NVC_PWR_ON 6 | ||
220 | |||
221 | struct nvc_regulator_init { | ||
222 | unsigned vreg_num; | ||
223 | const char *vreg_name; | ||
224 | }; | ||
225 | |||
226 | struct nvc_regulator { | ||
227 | bool vreg_flag; | ||
228 | struct regulator *vreg; | ||
229 | const char *vreg_name; | ||
230 | }; | ||
231 | |||
232 | /* The GPIO mechanism uses the _gpio_type in the device's header file as a key | ||
233 | * to define all the possible GPIO's the device will need. The key is used to | ||
234 | * combine the GPIO's defined in the platform board file using the | ||
235 | * nvc_gpio_pdata structure with the nvc_gpio structure in the nvc kernel | ||
236 | * driver. | ||
237 | */ | ||
238 | struct nvc_gpio_pdata { | ||
239 | /* use a _gpio_type enum from the device's header file */ | ||
240 | unsigned gpio_type; | ||
241 | /* the GPIO system number */ | ||
242 | unsigned gpio; | ||
243 | /* init_en is typically set to true for all GPIO's used by the driver. | ||
244 | * However, some GPIO's are used by multiple drivers (CSI MUX, reset, | ||
245 | * etc.). In this case, this is set true for only one of the drivers | ||
246 | * that uses the GPIO and false for the others. If the platform board | ||
247 | * file initializes the GPIO, then this is false for all of the drivers | ||
248 | * using the GPIO. | ||
249 | */ | ||
250 | bool init_en; | ||
251 | /* this defines the assert level for the general purpose GPIO's | ||
252 | * (_GPIO_TYPE_GPx, etc.). The _GPIO_TYPE_GPx can be used for a GPIO | ||
253 | * that the driver doesn't know about but is needed in order for the | ||
254 | * device to work (CSI select, regulator, etc.). The driver will | ||
255 | * blindly assert the GPIO when the device is operational and deassert | ||
256 | * when the device is turned off. | ||
257 | */ | ||
258 | bool active_high; | ||
259 | }; | ||
260 | |||
261 | struct nvc_gpio_init { | ||
262 | /* key to match in nvc_gpio_pdata */ | ||
263 | unsigned gpio_type; | ||
264 | /* same as in gpio.h */ | ||
265 | unsigned long flags; | ||
266 | /* same as in gpio.h */ | ||
267 | const char *label; | ||
268 | /* used instead of nvc_gpio_pdata.active_high if use_flags true */ | ||
269 | bool active_high; | ||
270 | /* false if nvc_gpio_pdata.active_high used else flags is used */ | ||
271 | bool use_flags; | ||
272 | }; | ||
273 | |||
274 | struct nvc_gpio { | ||
275 | unsigned gpio; /* system GPIO number */ | ||
276 | bool own; /* gets set if driver initializes */ | ||
277 | bool active_high; /* used for GP GPIOs */ | ||
278 | bool flag; /* scratch flag for driver implementation */ | ||
279 | }; | ||
280 | |||
281 | #endif /* __KERNEL__ */ | ||
282 | |||
283 | #endif /* __NVC_H__ */ | ||
284 | |||
diff --git a/include/media/nvc_focus.h b/include/media/nvc_focus.h new file mode 100644 index 00000000000..bed9df11a34 --- /dev/null +++ b/include/media/nvc_focus.h | |||
@@ -0,0 +1,63 @@ | |||
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 | enum nvc_focus_sts { | ||
37 | NVC_FOCUS_STS_UNKNOWN = 1, | ||
38 | NVC_FOCUS_STS_NO_DEVICE, | ||
39 | NVC_FOCUS_STS_INITIALIZING, | ||
40 | NVC_FOCUS_STS_INIT_ERR, | ||
41 | NVC_FOCUS_STS_WAIT_FOR_MOVE_END, | ||
42 | NVC_FOCUS_STS_WAIT_FOR_SETTLE, | ||
43 | NVC_FOCUS_STS_LENS_SETTLED, | ||
44 | NVC_FOCUS_STS_FORCE32 = 0x7FFFFFFF | ||
45 | }; | ||
46 | |||
47 | struct nvc_focus_nvc { | ||
48 | __u32 focal_length; | ||
49 | __u32 fnumber; | ||
50 | __u32 max_aperature; | ||
51 | } __packed; | ||
52 | |||
53 | struct nvc_focus_cap { | ||
54 | __u32 version; | ||
55 | __u32 actuator_range; | ||
56 | __u32 settle_time; | ||
57 | __u32 focus_macro; | ||
58 | __u32 focus_hyper; | ||
59 | __u32 focus_infinity; | ||
60 | } __packed; | ||
61 | |||
62 | #endif /* __NVC_FOCUS_H__ */ | ||
63 | |||
diff --git a/include/media/nvc_image.h b/include/media/nvc_image.h new file mode 100644 index 00000000000..1bf884d8122 --- /dev/null +++ b/include/media/nvc_image.h | |||
@@ -0,0 +1,194 @@ | |||
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_IMAGE_H__ | ||
19 | #define __NVC_IMAGE_H__ | ||
20 | |||
21 | #include <linux/ioctl.h> | ||
22 | |||
23 | #define NVC_IMAGER_API_CAPS_VER 2 | ||
24 | #define NVC_IMAGER_API_STATIC_VER 1 | ||
25 | #define NVC_IMAGER_API_DYNAMIC_VER 1 | ||
26 | #define NVC_IMAGER_API_BAYER_VER 1 | ||
27 | |||
28 | #define NVC_IMAGER_TEST_NONE 0 | ||
29 | #define NVC_IMAGER_TEST_COLORBARS 1 | ||
30 | #define NVC_IMAGER_TEST_CHECKERBOARD 2 | ||
31 | #define NVC_IMAGER_TEST_WALKING1S 3 | ||
32 | |||
33 | #define NVC_IMAGER_CROPMODE_NONE 1 | ||
34 | #define NVC_IMAGER_CROPMODE_PARTIAL 2 | ||
35 | |||
36 | #define NVC_IMAGER_TYPE_HUH 0 | ||
37 | #define NVC_IMAGER_TYPE_RAW 1 | ||
38 | #define NVC_IMAGER_TYPE_SOC 2 | ||
39 | |||
40 | #define NVC_IMAGER_INTERFACE_MIPI_A 3 | ||
41 | #define NVC_IMAGER_INTERFACE_MIPI_B 4 | ||
42 | #define NVC_IMAGER_INTERFACE_MIPI_AB 5 | ||
43 | |||
44 | #define NVC_IMAGER_IDENTIFIER_MAX 32 | ||
45 | #define NVC_IMAGER_FORMAT_MAX 4 | ||
46 | #define NVC_IMAGER_CLOCK_PROFILE_MAX 2 | ||
47 | #define NVC_IMAGER_CAPABILITIES_END ((0x3434 << 16) | \ | ||
48 | NVC_IMAGER_API_CAPS_VER) | ||
49 | |||
50 | #define NVC_IMAGER_INT2FLOAT_DIVISOR 1000 | ||
51 | |||
52 | #define NVC_FOCUS_INTERNAL (0x665F4E5643414D69ULL) | ||
53 | #define NVC_FOCUS_GUID(n) (0x665F4E5643414D30ULL | ((n) & 0xF)) | ||
54 | #define NVC_TORCH_GUID(n) (0x6C5F4E5643414D30ULL | ((n) & 0xF)) | ||
55 | |||
56 | |||
57 | struct nvc_imager_static_nvc { | ||
58 | __u32 api_version; | ||
59 | __u32 sensor_type; | ||
60 | __u32 sensor_id; | ||
61 | __u32 sensor_id_minor; | ||
62 | __u32 focal_len; | ||
63 | __u32 max_aperture; | ||
64 | __u32 fnumber; | ||
65 | __u32 view_angle_h; | ||
66 | __u32 view_angle_v; | ||
67 | __u32 stereo_cap; | ||
68 | __u32 res_chg_wait_time; | ||
69 | __u8 support_isp; | ||
70 | __u8 align1; | ||
71 | __u8 align2; | ||
72 | __u8 align3; | ||
73 | __u32 place_holder1; | ||
74 | __u32 place_holder2; | ||
75 | __u32 place_holder3; | ||
76 | __u32 place_holder4; | ||
77 | } __packed; | ||
78 | |||
79 | struct nvc_imager_dynamic_nvc { | ||
80 | __u32 api_version; | ||
81 | __s32 region_start_x; | ||
82 | __s32 region_start_y; | ||
83 | __u32 x_scale; | ||
84 | __u32 y_scale; | ||
85 | __u32 bracket_caps; | ||
86 | __u32 flush_count; | ||
87 | __u32 init_intra_frame_skip; | ||
88 | __u32 ss_intra_frame_skip; | ||
89 | __u32 ss_frame_number; | ||
90 | __u32 coarse_time; | ||
91 | __u32 max_coarse_diff; | ||
92 | __u32 min_exposure_course; | ||
93 | __u32 max_exposure_course; | ||
94 | __u32 diff_integration_time; | ||
95 | __u32 line_length; | ||
96 | __u32 frame_length; | ||
97 | __u32 min_frame_length; | ||
98 | __u32 max_frame_length; | ||
99 | __u32 min_gain; | ||
100 | __u32 max_gain; | ||
101 | __u32 inherent_gain; | ||
102 | __u32 inherent_gain_bin_en; | ||
103 | __u8 support_bin_control; | ||
104 | __u8 support_fast_mode; | ||
105 | __u8 align2; | ||
106 | __u8 align3; | ||
107 | __u32 pll_mult; | ||
108 | __u32 pll_div; | ||
109 | __u32 place_holder1; | ||
110 | __u32 place_holder2; | ||
111 | __u32 place_holder3; | ||
112 | __u32 place_holder4; | ||
113 | } __packed; | ||
114 | |||
115 | struct nvc_imager_bayer { | ||
116 | __u32 api_version; | ||
117 | __s32 res_x; | ||
118 | __s32 res_y; | ||
119 | __u32 frame_length; | ||
120 | __u32 coarse_time; | ||
121 | __u32 gain; | ||
122 | __u8 bin_en; | ||
123 | __u8 align1; | ||
124 | __u8 align2; | ||
125 | __u8 align3; | ||
126 | __u32 place_holder1; | ||
127 | __u32 place_holder2; | ||
128 | __u32 place_holder3; | ||
129 | __u32 place_holder4; | ||
130 | } __packed; | ||
131 | |||
132 | struct nvc_imager_mode { | ||
133 | __s32 res_x; | ||
134 | __s32 res_y; | ||
135 | __s32 active_start_x; | ||
136 | __s32 active_stary_y; | ||
137 | __u32 peak_frame_rate; | ||
138 | __u32 pixel_aspect_ratio; | ||
139 | __u32 pll_multiplier; | ||
140 | __u32 crop_mode; | ||
141 | } __packed; | ||
142 | |||
143 | struct nvc_imager_dnvc { | ||
144 | __s32 res_x; | ||
145 | __s32 res_y; | ||
146 | struct nvc_imager_mode *p_mode; | ||
147 | struct nvc_imager_dynamic_nvc *p_dnvc; | ||
148 | } __packed; | ||
149 | |||
150 | struct nvc_imager_mode_list { | ||
151 | struct nvc_imager_mode *p_modes; | ||
152 | __u32 *p_num_mode; | ||
153 | } __packed; | ||
154 | |||
155 | struct nvc_clock_profile { | ||
156 | __u32 external_clock_khz; | ||
157 | __u32 clock_multiplier; | ||
158 | } __packed; | ||
159 | |||
160 | struct nvc_imager_cap { | ||
161 | char identifier[NVC_IMAGER_IDENTIFIER_MAX]; | ||
162 | __u32 sensor_nvc_interface; | ||
163 | __u32 pixel_types[NVC_IMAGER_FORMAT_MAX]; | ||
164 | __u32 orientation; | ||
165 | __u32 direction; | ||
166 | __u32 initial_clock_rate_khz; | ||
167 | struct nvc_clock_profile clock_profiles[NVC_IMAGER_CLOCK_PROFILE_MAX]; | ||
168 | __u32 h_sync_edge; | ||
169 | __u32 v_sync_edge; | ||
170 | __u32 mclk_on_vgp0; | ||
171 | __u8 csi_port; | ||
172 | __u8 data_lanes; | ||
173 | __u8 virtual_channel_id; | ||
174 | __u8 discontinuous_clk_mode; | ||
175 | __u8 cil_threshold_settle; | ||
176 | __u8 align1; | ||
177 | __u8 align2; | ||
178 | __u8 align3; | ||
179 | __s32 min_blank_time_width; | ||
180 | __s32 min_blank_time_height; | ||
181 | __u32 preferred_mode_index; | ||
182 | __u64 focuser_guid; | ||
183 | __u64 torch_guid; | ||
184 | __u32 cap_end; | ||
185 | __u32 align4; | ||
186 | } __packed; | ||
187 | |||
188 | #define NVC_IOCTL_CAPS_RD _IOWR('o', 106, struct nvc_imager_cap) | ||
189 | #define NVC_IOCTL_MODE_WR _IOW('o', 107, struct nvc_imager_bayer) | ||
190 | #define NVC_IOCTL_MODE_RD _IOWR('o', 108, struct nvc_imager_mode_list) | ||
191 | #define NVC_IOCTL_STATIC_RD _IOWR('o', 109, struct nvc_imager_static_nvc) | ||
192 | #define NVC_IOCTL_DYNAMIC_RD _IOWR('o', 110, struct nvc_imager_dnvc) | ||
193 | |||
194 | #endif /* __NVC_IMAGE_H__ */ | ||
diff --git a/include/media/nvc_torch.h b/include/media/nvc_torch.h new file mode 100644 index 00000000000..7c88bc75af0 --- /dev/null +++ b/include/media/nvc_torch.h | |||
@@ -0,0 +1,43 @@ | |||
1 | /* Copyright (C) 2011 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_TORCH_H__ | ||
19 | #define __NVC_TORCH_H__ | ||
20 | |||
21 | struct nvc_torch_level_info { | ||
22 | __s32 guidenum; | ||
23 | __u32 sustaintime; | ||
24 | __s32 rechargefactor; | ||
25 | } __packed; | ||
26 | |||
27 | struct nvc_torch_pin_state { | ||
28 | __u16 mask; | ||
29 | __u16 values; | ||
30 | } __packed; | ||
31 | |||
32 | struct nvc_torch_flash_capabilities { | ||
33 | __u32 numberoflevels; | ||
34 | struct nvc_torch_level_info levels[]; | ||
35 | } __packed; | ||
36 | |||
37 | struct nvc_torch_torch_capabilities { | ||
38 | __u32 numberoflevels; | ||
39 | __s32 guidenum[]; | ||
40 | } __packed; | ||
41 | |||
42 | #endif /* __NVC_TORCH_H__ */ | ||
43 | |||
diff --git a/include/media/ov14810.h b/include/media/ov14810.h new file mode 100644 index 00000000000..67a86495918 --- /dev/null +++ b/include/media/ov14810.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 NVIDIA Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
16 | * 02111-1307, USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __OV14810_H__ | ||
20 | #define __OV14810_H__ | ||
21 | |||
22 | #include <linux/ioctl.h> /* For IOCTL macros */ | ||
23 | |||
24 | #define OV14810_IOCTL_SET_MODE _IOW('o', 1, struct ov14810_mode) | ||
25 | #define OV14810_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32) | ||
26 | #define OV14810_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32) | ||
27 | #define OV14810_IOCTL_SET_GAIN _IOW('o', 4, __u16) | ||
28 | #define OV14810_IOCTL_GET_STATUS _IOR('o', 5, __u8) | ||
29 | #define OV14810_IOCTL_SET_CAMERA_MODE _IOW('o', 10, __u32) | ||
30 | #define OV14810_IOCTL_SYNC_SENSORS _IOW('o', 11, __u32) | ||
31 | |||
32 | struct ov14810_mode { | ||
33 | int xres; | ||
34 | int yres; | ||
35 | __u32 frame_length; | ||
36 | __u32 coarse_time; | ||
37 | __u16 gain; | ||
38 | }; | ||
39 | #ifdef __KERNEL__ | ||
40 | struct ov14810_platform_data { | ||
41 | int (*power_on)(void); | ||
42 | int (*power_off)(void); | ||
43 | void (*synchronize_sensors)(void); | ||
44 | }; | ||
45 | #endif /* __KERNEL__ */ | ||
46 | |||
47 | #endif /* __OV14810_H__ */ | ||
diff --git a/include/media/ov2710.h b/include/media/ov2710.h new file mode 100644 index 00000000000..e3d43056d70 --- /dev/null +++ b/include/media/ov2710.h | |||
@@ -0,0 +1,47 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Motorola, Inc. | ||
3 | * Copyright (C) 2011 NVIDIA Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
17 | * 02111-1307, USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __OV2710_H__ | ||
21 | #define __OV2710_H__ | ||
22 | |||
23 | #include <linux/ioctl.h> /* For IOCTL macros */ | ||
24 | |||
25 | #define OV2710_IOCTL_SET_MODE _IOW('o', 1, struct ov2710_mode) | ||
26 | #define OV2710_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32) | ||
27 | #define OV2710_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32) | ||
28 | #define OV2710_IOCTL_SET_GAIN _IOW('o', 4, __u16) | ||
29 | #define OV2710_IOCTL_GET_STATUS _IOR('o', 5, __u8) | ||
30 | |||
31 | struct ov2710_mode { | ||
32 | int xres; | ||
33 | int yres; | ||
34 | __u32 frame_length; | ||
35 | __u32 coarse_time; | ||
36 | __u16 gain; | ||
37 | }; | ||
38 | #ifdef __KERNEL__ | ||
39 | struct ov2710_platform_data { | ||
40 | int (*power_on)(void); | ||
41 | int (*power_off)(void); | ||
42 | |||
43 | }; | ||
44 | #endif /* __KERNEL__ */ | ||
45 | |||
46 | #endif /* __OV2710_H__ */ | ||
47 | |||
diff --git a/include/media/ov5650.h b/include/media/ov5650.h new file mode 100644 index 00000000000..5c4a87cfbe8 --- /dev/null +++ b/include/media/ov5650.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2010 Motorola, Inc. | ||
3 | * Copyright (C) 2011 NVIDIA Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
17 | * 02111-1307, USA | ||
18 | */ | ||
19 | |||
20 | #ifndef __OV5650_H__ | ||
21 | #define __OV5650_H__ | ||
22 | |||
23 | #include <linux/ioctl.h> /* For IOCTL macros */ | ||
24 | |||
25 | #define OV5650_IOCTL_SET_MODE _IOW('o', 1, struct ov5650_mode) | ||
26 | #define OV5650_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32) | ||
27 | #define OV5650_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32) | ||
28 | #define OV5650_IOCTL_SET_GAIN _IOW('o', 4, __u16) | ||
29 | #define OV5650_IOCTL_GET_STATUS _IOR('o', 5, __u8) | ||
30 | #define OV5650_IOCTL_SET_BINNING _IOW('o', 6, __u8) | ||
31 | #define OV5650_IOCTL_TEST_PATTERN _IOW('o', 7, enum ov5650_test_pattern) | ||
32 | #define OV5650_IOCTL_SET_GROUP_HOLD _IOW('o', 8, struct ov5650_ae) | ||
33 | #define OV5650_IOCTL_SET_CAMERA_MODE _IOW('o', 10, __u32) | ||
34 | #define OV5650_IOCTL_SYNC_SENSORS _IOW('o', 11, __u32) | ||
35 | |||
36 | /* OV5650 registers */ | ||
37 | #define OV5650_SRM_GRUP_ACCESS (0x3212) | ||
38 | #define OV5650_ARRAY_CONTROL_01 (0x3621) | ||
39 | #define OV5650_ANALOG_CONTROL_D (0x370D) | ||
40 | #define OV5650_TIMING_TC_REG_18 (0x3818) | ||
41 | #define OV5650_TIMING_CONTROL_HS_HIGH (0x3800) | ||
42 | #define OV5650_TIMING_CONTROL_HS_LOW (0x3801) | ||
43 | #define OV5650_TIMING_CONTROL_VS_HIGH (0x3802) | ||
44 | #define OV5650_TIMING_CONTROL_VS_LOW (0x3803) | ||
45 | #define OV5650_TIMING_HW_HIGH (0x3804) | ||
46 | #define OV5650_TIMING_HW_LOW (0x3805) | ||
47 | #define OV5650_TIMING_VH_HIGH (0x3806) | ||
48 | #define OV5650_TIMING_VH_LOW (0x3807) | ||
49 | #define OV5650_TIMING_TC_REG_18 (0x3818) | ||
50 | #define OV5650_TIMING_HREFST_MAN_HIGH (0x3824) | ||
51 | #define OV5650_TIMING_HREFST_MAN_LOW (0x3825) | ||
52 | #define OV5650_H_BINNING_BIT (1 << 7) | ||
53 | #define OV5650_H_SUBSAMPLING_BIT (1 << 6) | ||
54 | #define OV5650_V_BINNING_BIT (1 << 6) | ||
55 | #define OV5650_V_SUBSAMPLING_BIT (1 << 0) | ||
56 | #define OV5650_GROUP_HOLD_BIT (1 << 7) | ||
57 | #define OV5650_GROUP_LAUNCH_BIT (1 << 5) | ||
58 | #define OV5650_GROUP_HOLD_END_BIT (1 << 4) | ||
59 | #define OV5650_GROUP_ID(id) (id) | ||
60 | |||
61 | enum ov5650_test_pattern { | ||
62 | TEST_PATTERN_NONE, | ||
63 | TEST_PATTERN_COLORBARS, | ||
64 | TEST_PATTERN_CHECKERBOARD | ||
65 | }; | ||
66 | |||
67 | struct ov5650_mode { | ||
68 | int xres; | ||
69 | int yres; | ||
70 | __u32 frame_length; | ||
71 | __u32 coarse_time; | ||
72 | __u16 gain; | ||
73 | }; | ||
74 | |||
75 | struct ov5650_ae { | ||
76 | __u32 frame_length; | ||
77 | __u8 frame_length_enable; | ||
78 | __u32 coarse_time; | ||
79 | __u8 coarse_time_enable; | ||
80 | __s32 gain; | ||
81 | __u8 gain_enable; | ||
82 | }; | ||
83 | |||
84 | #ifdef __KERNEL__ | ||
85 | struct ov5650_platform_data { | ||
86 | int (*power_on)(void); | ||
87 | int (*power_off)(void); | ||
88 | void (*synchronize_sensors)(void); | ||
89 | }; | ||
90 | #endif /* __KERNEL__ */ | ||
91 | |||
92 | #endif /* __OV5650_H__ */ | ||
93 | |||
diff --git a/include/media/ov9726.h b/include/media/ov9726.h new file mode 100644 index 00000000000..b1e759ba583 --- /dev/null +++ b/include/media/ov9726.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* | ||
2 | * ov9726.h | ||
3 | * | ||
4 | * Copyright (c) 2011, NVIDIA, All Rights Reserved. | ||
5 | * | ||
6 | * This file is licensed under the terms of the GNU General Public License | ||
7 | * version 2. This program is licensed "as is" without any warranty of any | ||
8 | * kind, whether express or implied. | ||
9 | */ | ||
10 | |||
11 | #ifndef __OV9726_H__ | ||
12 | #define __OV9726_H__ | ||
13 | |||
14 | #include <linux/ioctl.h> | ||
15 | |||
16 | #define OV9726_I2C_ADDR 0x20 | ||
17 | |||
18 | #define OV9726_IOCTL_SET_MODE _IOW('o', 1, struct ov9726_mode) | ||
19 | #define OV9726_IOCTL_SET_FRAME_LENGTH _IOW('o', 2, __u32) | ||
20 | #define OV9726_IOCTL_SET_COARSE_TIME _IOW('o', 3, __u32) | ||
21 | #define OV9726_IOCTL_SET_GAIN _IOW('o', 4, __u16) | ||
22 | #define OV9726_IOCTL_GET_STATUS _IOR('o', 5, __u8) | ||
23 | |||
24 | struct ov9726_mode { | ||
25 | int mode_id; | ||
26 | int xres; | ||
27 | int yres; | ||
28 | __u32 frame_length; | ||
29 | __u32 coarse_time; | ||
30 | __u16 gain; | ||
31 | }; | ||
32 | |||
33 | struct ov9726_reg { | ||
34 | __u16 addr; | ||
35 | __u16 val; | ||
36 | }; | ||
37 | |||
38 | #ifdef __KERNEL__ | ||
39 | #define OV9726_REG_FRAME_LENGTH_HI 0x340 | ||
40 | #define OV9726_REG_FRAME_LENGTH_LO 0x341 | ||
41 | #define OV9726_REG_COARSE_TIME_HI 0x202 | ||
42 | #define OV9726_REG_COARSE_TIME_LO 0x203 | ||
43 | #define OV9726_REG_GAIN_HI 0x204 | ||
44 | #define OV9726_REG_GAIN_LO 0x205 | ||
45 | |||
46 | #define OV9726_MAX_RETRIES 3 | ||
47 | |||
48 | #define OV9726_TABLE_WAIT_MS 0 | ||
49 | #define OV9726_TABLE_END 1 | ||
50 | |||
51 | struct ov9726_platform_data { | ||
52 | int (*power_on)(void); | ||
53 | int (*power_off)(void); | ||
54 | unsigned gpio_rst; | ||
55 | bool rst_low_active; | ||
56 | unsigned gpio_pwdn; | ||
57 | bool pwdn_low_active; | ||
58 | }; | ||
59 | #endif /* __KERNEL__ */ | ||
60 | |||
61 | #endif /* __OV9726_H__ */ | ||
62 | |||
diff --git a/include/media/pwc-ioctl.h b/include/media/pwc-ioctl.h new file mode 100644 index 00000000000..0f19779c463 --- /dev/null +++ b/include/media/pwc-ioctl.h | |||
@@ -0,0 +1,324 @@ | |||
1 | #ifndef PWC_IOCTL_H | ||
2 | #define PWC_IOCTL_H | ||
3 | |||
4 | /* (C) 2001-2004 Nemosoft Unv. | ||
5 | (C) 2004-2006 Luc Saillard (luc@saillard.org) | ||
6 | |||
7 | NOTE: this version of pwc is an unofficial (modified) release of pwc & pcwx | ||
8 | driver and thus may have bugs that are not present in the original version. | ||
9 | Please send bug reports and support requests to <luc@saillard.org>. | ||
10 | The decompression routines have been implemented by reverse-engineering the | ||
11 | Nemosoft binary pwcx module. Caveat emptor. | ||
12 | |||
13 | This program is free software; you can redistribute it and/or modify | ||
14 | it under the terms of the GNU General Public License as published by | ||
15 | the Free Software Foundation; either version 2 of the License, or | ||
16 | (at your option) any later version. | ||
17 | |||
18 | This program is distributed in the hope that it will be useful, | ||
19 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
20 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
21 | GNU General Public License for more details. | ||
22 | |||
23 | You should have received a copy of the GNU General Public License | ||
24 | along with this program; if not, write to the Free Software | ||
25 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
26 | */ | ||
27 | |||
28 | /* This is pwc-ioctl.h belonging to PWC 10.0.10 | ||
29 | It contains structures and defines to communicate from user space | ||
30 | directly to the driver. | ||
31 | */ | ||
32 | |||
33 | /* | ||
34 | Changes | ||
35 | 2001/08/03 Alvarado Added ioctl constants to access methods for | ||
36 | changing white balance and red/blue gains | ||
37 | 2002/12/15 G. H. Fernandez-Toribio VIDIOCGREALSIZE | ||
38 | 2003/12/13 Nemosft Unv. Some modifications to make interfacing to | ||
39 | PWCX easier | ||
40 | 2006/01/01 Luc Saillard Add raw format definition | ||
41 | */ | ||
42 | |||
43 | /* These are private ioctl() commands, specific for the Philips webcams. | ||
44 | They contain functions not found in other webcams, and settings not | ||
45 | specified in the Video4Linux API. | ||
46 | |||
47 | The #define names are built up like follows: | ||
48 | VIDIOC VIDeo IOCtl prefix | ||
49 | PWC Philps WebCam | ||
50 | G optional: Get | ||
51 | S optional: Set | ||
52 | ... the function | ||
53 | */ | ||
54 | |||
55 | #include <linux/types.h> | ||
56 | #include <linux/version.h> | ||
57 | |||
58 | /* Enumeration of image sizes */ | ||
59 | #define PSZ_SQCIF 0x00 | ||
60 | #define PSZ_QSIF 0x01 | ||
61 | #define PSZ_QCIF 0x02 | ||
62 | #define PSZ_SIF 0x03 | ||
63 | #define PSZ_CIF 0x04 | ||
64 | #define PSZ_VGA 0x05 | ||
65 | #define PSZ_MAX 6 | ||
66 | |||
67 | |||
68 | /* The frame rate is encoded in the video_window.flags parameter using | ||
69 | the upper 16 bits, since some flags are defined nowadays. The following | ||
70 | defines provide a mask and shift to filter out this value. | ||
71 | This value can also be passing using the private flag when using v4l2 and | ||
72 | VIDIOC_S_FMT ioctl. | ||
73 | |||
74 | In 'Snapshot' mode the camera freezes its automatic exposure and colour | ||
75 | balance controls. | ||
76 | */ | ||
77 | #define PWC_FPS_SHIFT 16 | ||
78 | #define PWC_FPS_MASK 0x00FF0000 | ||
79 | #define PWC_FPS_FRMASK 0x003F0000 | ||
80 | #define PWC_FPS_SNAPSHOT 0x00400000 | ||
81 | #define PWC_QLT_MASK 0x03000000 | ||
82 | #define PWC_QLT_SHIFT 24 | ||
83 | |||
84 | |||
85 | /* structure for transferring x & y coordinates */ | ||
86 | struct pwc_coord | ||
87 | { | ||
88 | int x, y; /* guess what */ | ||
89 | int size; /* size, or offset */ | ||
90 | }; | ||
91 | |||
92 | |||
93 | /* Used with VIDIOCPWCPROBE */ | ||
94 | struct pwc_probe | ||
95 | { | ||
96 | char name[32]; | ||
97 | int type; | ||
98 | }; | ||
99 | |||
100 | struct pwc_serial | ||
101 | { | ||
102 | char serial[30]; /* String with serial number. Contains terminating 0 */ | ||
103 | }; | ||
104 | |||
105 | /* pwc_whitebalance.mode values */ | ||
106 | #define PWC_WB_INDOOR 0 | ||
107 | #define PWC_WB_OUTDOOR 1 | ||
108 | #define PWC_WB_FL 2 | ||
109 | #define PWC_WB_MANUAL 3 | ||
110 | #define PWC_WB_AUTO 4 | ||
111 | |||
112 | /* Used with VIDIOCPWC[SG]AWB (Auto White Balance). | ||
113 | Set mode to one of the PWC_WB_* values above. | ||
114 | *red and *blue are the respective gains of these colour components inside | ||
115 | the camera; range 0..65535 | ||
116 | When 'mode' == PWC_WB_MANUAL, 'manual_red' and 'manual_blue' are set or read; | ||
117 | otherwise undefined. | ||
118 | 'read_red' and 'read_blue' are read-only. | ||
119 | */ | ||
120 | struct pwc_whitebalance | ||
121 | { | ||
122 | int mode; | ||
123 | int manual_red, manual_blue; /* R/W */ | ||
124 | int read_red, read_blue; /* R/O */ | ||
125 | }; | ||
126 | |||
127 | /* | ||
128 | 'control_speed' and 'control_delay' are used in automatic whitebalance mode, | ||
129 | and tell the camera how fast it should react to changes in lighting, and | ||
130 | with how much delay. Valid values are 0..65535. | ||
131 | */ | ||
132 | struct pwc_wb_speed | ||
133 | { | ||
134 | int control_speed; | ||
135 | int control_delay; | ||
136 | |||
137 | }; | ||
138 | |||
139 | /* Used with VIDIOCPWC[SG]LED */ | ||
140 | struct pwc_leds | ||
141 | { | ||
142 | int led_on; /* Led on-time; range = 0..25000 */ | ||
143 | int led_off; /* Led off-time; range = 0..25000 */ | ||
144 | }; | ||
145 | |||
146 | /* Image size (used with GREALSIZE) */ | ||
147 | struct pwc_imagesize | ||
148 | { | ||
149 | int width; | ||
150 | int height; | ||
151 | }; | ||
152 | |||
153 | /* Defines and structures for Motorized Pan & Tilt */ | ||
154 | #define PWC_MPT_PAN 0x01 | ||
155 | #define PWC_MPT_TILT 0x02 | ||
156 | #define PWC_MPT_TIMEOUT 0x04 /* for status */ | ||
157 | |||
158 | /* Set angles; when absolute != 0, the angle is absolute and the | ||
159 | driver calculates the relative offset for you. This can only | ||
160 | be used with VIDIOCPWCSANGLE; VIDIOCPWCGANGLE always returns | ||
161 | absolute angles. | ||
162 | */ | ||
163 | struct pwc_mpt_angles | ||
164 | { | ||
165 | int absolute; /* write-only */ | ||
166 | int pan; /* degrees * 100 */ | ||
167 | int tilt; /* degress * 100 */ | ||
168 | }; | ||
169 | |||
170 | /* Range of angles of the camera, both horizontally and vertically. | ||
171 | */ | ||
172 | struct pwc_mpt_range | ||
173 | { | ||
174 | int pan_min, pan_max; /* degrees * 100 */ | ||
175 | int tilt_min, tilt_max; | ||
176 | }; | ||
177 | |||
178 | struct pwc_mpt_status | ||
179 | { | ||
180 | int status; | ||
181 | int time_pan; | ||
182 | int time_tilt; | ||
183 | }; | ||
184 | |||
185 | |||
186 | /* This is used for out-of-kernel decompression. With it, you can get | ||
187 | all the necessary information to initialize and use the decompressor | ||
188 | routines in standalone applications. | ||
189 | */ | ||
190 | struct pwc_video_command | ||
191 | { | ||
192 | int type; /* camera type (645, 675, 730, etc.) */ | ||
193 | int release; /* release number */ | ||
194 | |||
195 | int size; /* one of PSZ_* */ | ||
196 | int alternate; | ||
197 | int command_len; /* length of USB video command */ | ||
198 | unsigned char command_buf[13]; /* Actual USB video command */ | ||
199 | int bandlength; /* >0 = compressed */ | ||
200 | int frame_size; /* Size of one (un)compressed frame */ | ||
201 | }; | ||
202 | |||
203 | /* Flags for PWCX subroutines. Not all modules honour all flags. */ | ||
204 | #define PWCX_FLAG_PLANAR 0x0001 | ||
205 | #define PWCX_FLAG_BAYER 0x0008 | ||
206 | |||
207 | |||
208 | /* IOCTL definitions */ | ||
209 | |||
210 | /* Restore user settings */ | ||
211 | #define VIDIOCPWCRUSER _IO('v', 192) | ||
212 | /* Save user settings */ | ||
213 | #define VIDIOCPWCSUSER _IO('v', 193) | ||
214 | /* Restore factory settings */ | ||
215 | #define VIDIOCPWCFACTORY _IO('v', 194) | ||
216 | |||
217 | /* You can manipulate the compression factor. A compression preference of 0 | ||
218 | means use uncompressed modes when available; 1 is low compression, 2 is | ||
219 | medium and 3 is high compression preferred. Of course, the higher the | ||
220 | compression, the lower the bandwidth used but more chance of artefacts | ||
221 | in the image. The driver automatically chooses a higher compression when | ||
222 | the preferred mode is not available. | ||
223 | */ | ||
224 | /* Set preferred compression quality (0 = uncompressed, 3 = highest compression) */ | ||
225 | #define VIDIOCPWCSCQUAL _IOW('v', 195, int) | ||
226 | /* Get preferred compression quality */ | ||
227 | #define VIDIOCPWCGCQUAL _IOR('v', 195, int) | ||
228 | |||
229 | |||
230 | /* Retrieve serial number of camera */ | ||
231 | #define VIDIOCPWCGSERIAL _IOR('v', 198, struct pwc_serial) | ||
232 | |||
233 | /* This is a probe function; since so many devices are supported, it | ||
234 | becomes difficult to include all the names in programs that want to | ||
235 | check for the enhanced Philips stuff. So in stead, try this PROBE; | ||
236 | it returns a structure with the original name, and the corresponding | ||
237 | Philips type. | ||
238 | To use, fill the structure with zeroes, call PROBE and if that succeeds, | ||
239 | compare the name with that returned from VIDIOCGCAP; they should be the | ||
240 | same. If so, you can be assured it is a Philips (OEM) cam and the type | ||
241 | is valid. | ||
242 | */ | ||
243 | #define VIDIOCPWCPROBE _IOR('v', 199, struct pwc_probe) | ||
244 | |||
245 | /* Set AGC (Automatic Gain Control); int < 0 = auto, 0..65535 = fixed */ | ||
246 | #define VIDIOCPWCSAGC _IOW('v', 200, int) | ||
247 | /* Get AGC; int < 0 = auto; >= 0 = fixed, range 0..65535 */ | ||
248 | #define VIDIOCPWCGAGC _IOR('v', 200, int) | ||
249 | /* Set shutter speed; int < 0 = auto; >= 0 = fixed, range 0..65535 */ | ||
250 | #define VIDIOCPWCSSHUTTER _IOW('v', 201, int) | ||
251 | |||
252 | /* Color compensation (Auto White Balance) */ | ||
253 | #define VIDIOCPWCSAWB _IOW('v', 202, struct pwc_whitebalance) | ||
254 | #define VIDIOCPWCGAWB _IOR('v', 202, struct pwc_whitebalance) | ||
255 | |||
256 | /* Auto WB speed */ | ||
257 | #define VIDIOCPWCSAWBSPEED _IOW('v', 203, struct pwc_wb_speed) | ||
258 | #define VIDIOCPWCGAWBSPEED _IOR('v', 203, struct pwc_wb_speed) | ||
259 | |||
260 | /* LEDs on/off/blink; int range 0..65535 */ | ||
261 | #define VIDIOCPWCSLED _IOW('v', 205, struct pwc_leds) | ||
262 | #define VIDIOCPWCGLED _IOR('v', 205, struct pwc_leds) | ||
263 | |||
264 | /* Contour (sharpness); int < 0 = auto, 0..65536 = fixed */ | ||
265 | #define VIDIOCPWCSCONTOUR _IOW('v', 206, int) | ||
266 | #define VIDIOCPWCGCONTOUR _IOR('v', 206, int) | ||
267 | |||
268 | /* Backlight compensation; 0 = off, otherwise on */ | ||
269 | #define VIDIOCPWCSBACKLIGHT _IOW('v', 207, int) | ||
270 | #define VIDIOCPWCGBACKLIGHT _IOR('v', 207, int) | ||
271 | |||
272 | /* Flickerless mode; = 0 off, otherwise on */ | ||
273 | #define VIDIOCPWCSFLICKER _IOW('v', 208, int) | ||
274 | #define VIDIOCPWCGFLICKER _IOR('v', 208, int) | ||
275 | |||
276 | /* Dynamic noise reduction; 0 off, 3 = high noise reduction */ | ||
277 | #define VIDIOCPWCSDYNNOISE _IOW('v', 209, int) | ||
278 | #define VIDIOCPWCGDYNNOISE _IOR('v', 209, int) | ||
279 | |||
280 | /* Real image size as used by the camera; tells you whether or not there's a gray border around the image */ | ||
281 | #define VIDIOCPWCGREALSIZE _IOR('v', 210, struct pwc_imagesize) | ||
282 | |||
283 | /* Motorized pan & tilt functions */ | ||
284 | #define VIDIOCPWCMPTRESET _IOW('v', 211, int) | ||
285 | #define VIDIOCPWCMPTGRANGE _IOR('v', 211, struct pwc_mpt_range) | ||
286 | #define VIDIOCPWCMPTSANGLE _IOW('v', 212, struct pwc_mpt_angles) | ||
287 | #define VIDIOCPWCMPTGANGLE _IOR('v', 212, struct pwc_mpt_angles) | ||
288 | #define VIDIOCPWCMPTSTATUS _IOR('v', 213, struct pwc_mpt_status) | ||
289 | |||
290 | /* Get the USB set-video command; needed for initializing libpwcx */ | ||
291 | #define VIDIOCPWCGVIDCMD _IOR('v', 215, struct pwc_video_command) | ||
292 | struct pwc_table_init_buffer { | ||
293 | int len; | ||
294 | char *buffer; | ||
295 | |||
296 | }; | ||
297 | #define VIDIOCPWCGVIDTABLE _IOR('v', 216, struct pwc_table_init_buffer) | ||
298 | |||
299 | /* | ||
300 | * This is private command used when communicating with v4l2. | ||
301 | * In the future all private ioctl will be remove/replace to | ||
302 | * use interface offer by v4l2. | ||
303 | */ | ||
304 | |||
305 | #define V4L2_CID_PRIVATE_SAVE_USER (V4L2_CID_PRIVATE_BASE + 0) | ||
306 | #define V4L2_CID_PRIVATE_RESTORE_USER (V4L2_CID_PRIVATE_BASE + 1) | ||
307 | #define V4L2_CID_PRIVATE_RESTORE_FACTORY (V4L2_CID_PRIVATE_BASE + 2) | ||
308 | #define V4L2_CID_PRIVATE_COLOUR_MODE (V4L2_CID_PRIVATE_BASE + 3) | ||
309 | #define V4L2_CID_PRIVATE_AUTOCONTOUR (V4L2_CID_PRIVATE_BASE + 4) | ||
310 | #define V4L2_CID_PRIVATE_CONTOUR (V4L2_CID_PRIVATE_BASE + 5) | ||
311 | #define V4L2_CID_PRIVATE_BACKLIGHT (V4L2_CID_PRIVATE_BASE + 6) | ||
312 | #define V4L2_CID_PRIVATE_FLICKERLESS (V4L2_CID_PRIVATE_BASE + 7) | ||
313 | #define V4L2_CID_PRIVATE_NOISE_REDUCTION (V4L2_CID_PRIVATE_BASE + 8) | ||
314 | |||
315 | struct pwc_raw_frame { | ||
316 | __le16 type; /* type of the webcam */ | ||
317 | __le16 vbandlength; /* Size of 4lines compressed (used by the decompressor) */ | ||
318 | __u8 cmd[4]; /* the four byte of the command (in case of nala, | ||
319 | only the first 3 bytes is filled) */ | ||
320 | __u8 rawframe[0]; /* frame_size = H/4*vbandlength */ | ||
321 | } __attribute__ ((packed)); | ||
322 | |||
323 | |||
324 | #endif | ||
diff --git a/include/media/sh532u.h b/include/media/sh532u.h new file mode 100644 index 00000000000..19da2070b70 --- /dev/null +++ b/include/media/sh532u.h | |||
@@ -0,0 +1,319 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2011 NVIDIA Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License version 2 as | ||
6 | * published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA | ||
16 | * 02111-1307, USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __SH532U_H__ | ||
20 | #define __SH532U_H__ | ||
21 | |||
22 | #include <media/nvc_focus.h> | ||
23 | |||
24 | |||
25 | struct sh532u_platform_data { | ||
26 | int cfg; | ||
27 | int num; | ||
28 | int sync; | ||
29 | const char *dev_name; | ||
30 | struct nvc_focus_nvc (*nvc); | ||
31 | struct nvc_focus_cap (*cap); | ||
32 | struct sh532u_pdata_info (*info); | ||
33 | __u8 i2c_addr_rom; | ||
34 | unsigned gpio_reset; | ||
35 | /* Due to a Linux limitation, a GPIO is defined to "enable" the device. This | ||
36 | * workaround is for when the device's power GPIO's are behind an I2C expander. | ||
37 | * The Linux limitation doesn't allow the I2C GPIO expander to be ready for | ||
38 | * use when this device is probed. | ||
39 | */ | ||
40 | unsigned gpio_en; | ||
41 | }; | ||
42 | |||
43 | struct sh532u_pdata_info { | ||
44 | __s16 pos_low; | ||
45 | __s16 pos_high; | ||
46 | __s16 limit_low; | ||
47 | __s16 limit_high; | ||
48 | int move_timeoutms; | ||
49 | __u32 focus_hyper_ratio; | ||
50 | __u32 focus_hyper_div; | ||
51 | }; | ||
52 | |||
53 | |||
54 | /* Register Definition : Sany Driver IC */ | ||
55 | /* EEPROM addresses */ | ||
56 | #define addrHallOffset 0x10 | ||
57 | #define addrHallBias 0x11 | ||
58 | #define addrInf1 0x12 | ||
59 | #define addrMac1 0x13 | ||
60 | #define addrLoopGainH 0x14 | ||
61 | #define addrLoopGainL 0x15 | ||
62 | #define addrInf2 0x16 | ||
63 | #define addrMac2 0x17 | ||
64 | |||
65 | #define addrInf1_H 0x20 /* bottom mechanical limit of HVCA */ | ||
66 | #define addrInf1_L 0x21 | ||
67 | #define addrMac1_H 0x22 /* top mechanical limit of HVCA */ | ||
68 | #define addrMac1_L 0x23 | ||
69 | #define addrInf2_H 0x24 /* lens position when object is ?120cm */ | ||
70 | #define addrInf2_L 0x25 | ||
71 | #define addrMac2_H 0x26 /* lens position when object is ?10cm */ | ||
72 | #define addrMac2_L 0x27 | ||
73 | #define addrDacDeltaUp_H 0x28 /* difference between face up and down */ | ||
74 | #define addrDacDeltaUp_L 0x29 | ||
75 | #define addrAFoffset_H 0x2A /* best focus position subtract value */ | ||
76 | #define addrAFoffset_L 0x2B | ||
77 | |||
78 | /* Convergence Judgement */ | ||
79 | #define INI_MSSET_211 0x00 | ||
80 | #define CHTGOKN_TIME 0x80 | ||
81 | #define CHTGOKN_WAIT 1 | ||
82 | #define CHTGOKN_TIMEOUT 50 | ||
83 | #define CHTGSTOKN_TOMEOUT 15 | ||
84 | |||
85 | /* StepMove */ | ||
86 | #define STMV_SIZE 0x0180 | ||
87 | |||
88 | #define STMCHTG_ON 0x08 | ||
89 | #define STMSV_ON 0x04 | ||
90 | #define STMLFF_ON 0x02 | ||
91 | #define STMVEN_ON 0x01 | ||
92 | #define STMCHTG_OFF 0x00 | ||
93 | #define STMSV_OFF 0x00 | ||
94 | #define STMLFF_OFF 0x00 | ||
95 | #define STMVEN_OFF 0x00 | ||
96 | |||
97 | #define STMCHTG_SET STMCHTG_ON | ||
98 | #define STMSV_SET STMSV_ON | ||
99 | #define STMLFF_SET STMLFF_OFF | ||
100 | |||
101 | #define CHTGST_ON 0x01 | ||
102 | #define DEFAULT_DADAT 0x8040 | ||
103 | |||
104 | /* Delay RAM 00h ~ 3Fh */ | ||
105 | #define ADHXI_211H 0x00 | ||
106 | #define ADHXI_211L 0x01 | ||
107 | #define PIDZO_211H 0x02 | ||
108 | #define PIDZO_211L 0x03 | ||
109 | #define RZ_211H 0x04 | ||
110 | #define RZ_211L 0x05 | ||
111 | #define DZ1_211H 0x06 | ||
112 | #define DZ1_211L 0x07 | ||
113 | #define DZ2_211H 0x08 | ||
114 | #define DZ2_211L 0x09 | ||
115 | #define UZ1_211H 0x0A | ||
116 | #define UZ1_211L 0x0B | ||
117 | #define UZ2_211H 0x0C | ||
118 | #define UZ2_211L 0x0D | ||
119 | #define IZ1_211H 0x0E | ||
120 | #define IZ1_211L 0x0F | ||
121 | #define IZ2_211H 0x10 | ||
122 | #define IZ2_211L 0x11 | ||
123 | #define MS1Z01_211H 0x12 | ||
124 | #define MS1Z01_211L 0x13 | ||
125 | #define MS1Z11_211H 0x14 | ||
126 | #define MS1Z11_211L 0x15 | ||
127 | #define MS1Z12_211H 0x16 | ||
128 | #define MS1Z12_211L 0x17 | ||
129 | #define MS1Z22_211H 0x18 | ||
130 | #define MS1Z22_211L 0x19 | ||
131 | #define MS2Z01_211H 0x1A | ||
132 | #define MS2Z01_211L 0x1B | ||
133 | #define MS2Z11_211H 0x1C | ||
134 | #define MS2Z11_211L 0x1D | ||
135 | #define MS2Z12_211H 0x1E | ||
136 | #define MS2Z12_211L 0x1F | ||
137 | #define MS2Z22_211H 0x20 | ||
138 | #define MS2Z22_211L 0x21 | ||
139 | #define MS2Z23_211H 0x22 | ||
140 | #define MS2Z23_211L 0x23 | ||
141 | #define OZ1_211H 0x24 | ||
142 | #define OZ1_211L 0x25 | ||
143 | #define OZ2_211H 0x26 | ||
144 | #define OZ2_211L 0x27 | ||
145 | #define DAHLXO_211H 0x28 | ||
146 | #define DAHLXO_211L 0x29 | ||
147 | #define OZ3_211H 0x2A | ||
148 | #define OZ3_211L 0x2B | ||
149 | #define OZ4_211H 0x2C | ||
150 | #define OZ4_211L 0x2D | ||
151 | #define OZ5_211H 0x2E | ||
152 | #define OZ5_211L 0x2F | ||
153 | #define oe_211H 0x30 | ||
154 | #define oe_211L 0x31 | ||
155 | #define MSR1CMAX_211H 0x32 | ||
156 | #define MSR1CMAX_211L 0x33 | ||
157 | #define MSR1CMIN_211H 0x34 | ||
158 | #define MSR1CMIN_211L 0x35 | ||
159 | #define MSR2CMAX_211H 0x36 | ||
160 | #define MSR2CMAX_211L 0x37 | ||
161 | #define MSR2CMIN_211H 0x38 | ||
162 | #define MSR2CMIN_211L 0x39 | ||
163 | #define OFFSET_211H 0x3A | ||
164 | #define OFFSET_211L 0x3B | ||
165 | #define ADOFFSET_211H 0x3C | ||
166 | #define ADOFFSET_211L 0x3D | ||
167 | #define EZ_211H 0x3E | ||
168 | #define EZ_211L 0x3F | ||
169 | |||
170 | /* Coefficient RAM 40h ~ 7Fh */ | ||
171 | #define ag_211H 0x40 | ||
172 | #define ag_211L 0x41 | ||
173 | #define da_211H 0x42 | ||
174 | #define da_211L 0x43 | ||
175 | #define db_211H 0x44 | ||
176 | #define db_211L 0x45 | ||
177 | #define dc_211H 0x46 | ||
178 | #define dc_211L 0x47 | ||
179 | #define dg_211H 0x48 | ||
180 | #define dg_211L 0x49 | ||
181 | #define pg_211H 0x4A | ||
182 | #define pg_211L 0x4B | ||
183 | #define gain1_211H 0x4C | ||
184 | #define gain1_211L 0x4D | ||
185 | #define gain2_211H 0x4E | ||
186 | #define gain2_211L 0x4F | ||
187 | #define ua_211H 0x50 | ||
188 | #define ua_211L 0x51 | ||
189 | #define uc_211H 0x52 | ||
190 | #define uc_211L 0x53 | ||
191 | #define ia_211H 0x54 | ||
192 | #define ia_211L 0x55 | ||
193 | #define ib_211H 0x56 | ||
194 | #define ib_211L 0x57 | ||
195 | #define i_c_211H 0x58 | ||
196 | #define i_c_211L 0x59 | ||
197 | #define ms11a_211H 0x5A | ||
198 | #define ms11a_211L 0x5B | ||
199 | #define ms11c_211H 0x5C | ||
200 | #define ms11c_211L 0x5D | ||
201 | #define ms12a_211H 0x5E | ||
202 | #define ms12a_211L 0x5F | ||
203 | #define ms12c_211H 0x60 | ||
204 | #define ms12c_211L 0x61 | ||
205 | #define ms21a_211H 0x62 | ||
206 | #define ms21a_211L 0x63 | ||
207 | #define ms21b_211H 0x64 | ||
208 | #define ms21b_211L 0x65 | ||
209 | #define ms21c_211H 0x66 | ||
210 | #define ms21c_211L 0x67 | ||
211 | #define ms22a_211H 0x68 | ||
212 | #define ms22a_211L 0x69 | ||
213 | #define ms22c_211H 0x6A | ||
214 | #define ms22c_211L 0x6B | ||
215 | #define ms22d_211H 0x6C | ||
216 | #define ms22d_211L 0x6D | ||
217 | #define ms22e_211H 0x6E | ||
218 | #define ms22e_211L 0x6F | ||
219 | #define ms23p_211H 0x70 | ||
220 | #define ms23p_211L 0x71 | ||
221 | #define oa_211H 0x72 | ||
222 | #define oa_211L 0x73 | ||
223 | #define oc_211H 0x74 | ||
224 | #define oc_211L 0x75 | ||
225 | #define PX12_211H 0x76 | ||
226 | #define PX12_211L 0x77 | ||
227 | #define PX3_211H 0x78 | ||
228 | #define PX3_211L 0x79 | ||
229 | #define MS2X_211H 0x7A | ||
230 | #define MS2X_211L 0x7B | ||
231 | #define CHTGX_211H 0x7C | ||
232 | #define CHTGX_211L 0x7D | ||
233 | #define CHTGN_211H 0x7E | ||
234 | #define CHTGN_211L 0x7F | ||
235 | |||
236 | /* Register 80h ~ 9F */ | ||
237 | #define CLKSEL_211 0x80 | ||
238 | #define ADSET_211 0x81 | ||
239 | #define PWMSEL_211 0x82 | ||
240 | #define SWTCH_211 0x83 | ||
241 | #define STBY_211 0x84 | ||
242 | #define CLR_211 0x85 | ||
243 | #define DSSEL_211 0x86 | ||
244 | #define ENBL_211 0x87 | ||
245 | #define ANA1_211 0x88 | ||
246 | #define STMVEN_211 0x8A | ||
247 | #define STPT_211 0x8B | ||
248 | #define SWFC_211 0x8C | ||
249 | #define SWEN_211 0x8D | ||
250 | #define MSNUM_211 0x8E | ||
251 | #define MSSET_211 0x8F | ||
252 | #define DLYMON_211 0x90 | ||
253 | #define MONA_211 0x91 | ||
254 | #define PWMLIMIT_211 0x92 | ||
255 | #define PINSEL_211 0x93 | ||
256 | #define PWMSEL2_211 0x94 | ||
257 | #define SFTRST_211 0x95 | ||
258 | #define TEST_211 0x96 | ||
259 | #define PWMZONE2_211 0x97 | ||
260 | #define PWMZONE1_211 0x98 | ||
261 | #define PWMZONE0_211 0x99 | ||
262 | #define ZONE3_211 0x9A | ||
263 | #define ZONE2_211 0x9B | ||
264 | #define ZONE1_211 0x9C | ||
265 | #define ZONE0_211 0x9D | ||
266 | #define GCTIM_211 0x9E | ||
267 | #define GCTIM_211NU 0x9F | ||
268 | #define STMINT_211 0xA0 | ||
269 | #define STMVENDH_211 0xA1 | ||
270 | #define STMVENDL_211 0xA2 | ||
271 | #define MSNUMR_211 0xA3 | ||
272 | #define ANA2_211 0xA4 | ||
273 | |||
274 | /* Device ID of HVCA Drive IC */ | ||
275 | #define HVCA_DEVICE_ID 0xE4 | ||
276 | |||
277 | /* Device ID of E2P ROM */ | ||
278 | #define EEP_DEVICE_ID 0xA0 | ||
279 | #define EEP_PAGE0 0x00 | ||
280 | #define EEP_PAGE1 0x02 | ||
281 | #define EEP_PAGE2 0x04 | ||
282 | #define EEP_PAGE3 0x06 | ||
283 | /* E2P ROM has 1023 bytes. So there are 4 pages memory */ | ||
284 | /* E2PROM Device ID = 1 0 1 0 0 P0 P1 0 */ | ||
285 | /* | ||
286 | P0 P1 | ||
287 | 0 0 : Page 0 | ||
288 | 0 1 : Page 1 | ||
289 | 1 0 : Page 2 | ||
290 | 1 1 : Page 3 | ||
291 | */ | ||
292 | /* Page 0: address 0x000~0x0FF, E2PROM Device ID = E2P_DEVICE_ID|E2P_PAGE0 */ | ||
293 | /* Page 1: address 0x100~0x1FF, E2PROM Device ID = E2P_DEVICE_ID|E2P_PAGE1 */ | ||
294 | /* Page 2: address 0x200~0x2FF, E2PROM Device ID = E2P_DEVICE_ID|E2P_PAGE2 */ | ||
295 | /* Page 3: address 0x300~0x3FF, E2PROM Device ID = E2P_DEVICE_ID|E2P_PAGE3 */ | ||
296 | /* | ||
297 | */ | ||
298 | |||
299 | /* E2P data type define of HVCA Initial Value Section */ | ||
300 | #define DIRECT_MODE 0x00 | ||
301 | #define INDIRECT_EEPROM 0x10 | ||
302 | #define INDIRECT_HVCA 0x20 | ||
303 | #define MASK_AND 0x70 | ||
304 | #define MASK_OR 0x80 | ||
305 | |||
306 | #define DATA_1BYTE 0x01 | ||
307 | #define DATA_2BYTE 0x02 | ||
308 | |||
309 | #define START_ADDR 0x0030 | ||
310 | #define END_ADDR 0x01BF | ||
311 | |||
312 | /*Macro define*/ | ||
313 | #if !defined(abs) | ||
314 | #define abs(a) (((a) > 0) ? (a) : -(a)) | ||
315 | #endif | ||
316 | |||
317 | #endif | ||
318 | /* __SH532U_H__ */ | ||
319 | |||
diff --git a/include/media/soc380.h b/include/media/soc380.h new file mode 100644 index 00000000000..254625f74f8 --- /dev/null +++ b/include/media/soc380.h | |||
@@ -0,0 +1,59 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2011, NVIDIA CORPORATION, All rights reserved. | ||
3 | * | ||
4 | * Redistribution and use in source and binary forms, with or without | ||
5 | * modification, are permitted provided that the following conditions are | ||
6 | * met: | ||
7 | * | ||
8 | * Redistributions of source code must retain the above copyright notice, | ||
9 | * this list of conditions and the following disclaimer. | ||
10 | * | ||
11 | * Redistributions in binary form must reproduce the above copyright | ||
12 | * notice, this list of conditions and the following disclaimer in the | ||
13 | * documentation and/or other materials provided with the distribution. | ||
14 | * | ||
15 | * Neither the name of NVIDIA CORPORATION nor the names of its contributors | ||
16 | * may be used to endorse or promote products derived from this software | ||
17 | * without specific prior written permission. | ||
18 | * | ||
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
20 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | ||
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | ||
22 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
23 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
25 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
26 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
27 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
28 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
29 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
30 | */ | ||
31 | |||
32 | #ifndef __SOC380_H__ | ||
33 | #define __SOC380_H__ | ||
34 | |||
35 | #include <linux/ioctl.h> /* For IOCTL macros */ | ||
36 | |||
37 | #define SOC380_IOCTL_SET_MODE _IOW('o', 1, struct soc380_mode) | ||
38 | #define SOC380_IOCTL_GET_STATUS _IOR('o', 2, struct soc380_status) | ||
39 | |||
40 | struct soc380_mode { | ||
41 | int xres; | ||
42 | int yres; | ||
43 | }; | ||
44 | |||
45 | struct soc380_status { | ||
46 | int data; | ||
47 | int status; | ||
48 | }; | ||
49 | |||
50 | #ifdef __KERNEL__ | ||
51 | struct soc380_platform_data { | ||
52 | int (*power_on)(void); | ||
53 | int (*power_off)(void); | ||
54 | |||
55 | }; | ||
56 | #endif /* __KERNEL__ */ | ||
57 | |||
58 | #endif /* __SOC380_H__ */ | ||
59 | |||
diff --git a/include/media/ssl3250a.h b/include/media/ssl3250a.h new file mode 100644 index 00000000000..c4e802fa2ef --- /dev/null +++ b/include/media/ssl3250a.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /* Copyright (C) 2011 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 __SSL3250A_H__ | ||
19 | #define __SSL3250A_H__ | ||
20 | |||
21 | #include <media/nvc_torch.h> | ||
22 | |||
23 | #define SSL3250A_MAX_TORCH_LEVEL 11 | ||
24 | #define SSL3250A_MAX_FLASH_LEVEL 20 | ||
25 | |||
26 | struct ssl3250a_platform_data { | ||
27 | unsigned cfg; /* use the NVC_CFG_ defines */ | ||
28 | unsigned num; /* see implementation notes in driver */ | ||
29 | unsigned sync; /* see implementation notes in driver */ | ||
30 | const char *dev_name; /* see implementation notes in driver */ | ||
31 | struct nvc_torch_pin_state (*pinstate); /* see notes in driver */ | ||
32 | unsigned max_amp_torch; /* maximum torch value allowed */ | ||
33 | unsigned max_amp_flash; /* maximum flash value allowed */ | ||
34 | unsigned gpio_act; /* GPIO connected to the ACT signal */ | ||
35 | }; | ||
36 | |||
37 | #endif /* __SSL3250A_H__ */ | ||
38 | |||
diff --git a/include/media/tegra_camera.h b/include/media/tegra_camera.h new file mode 100644 index 00000000000..d7d08bd9a99 --- /dev/null +++ b/include/media/tegra_camera.h | |||
@@ -0,0 +1,55 @@ | |||
1 | /* | ||
2 | * include/linux/tegra_camera.h | ||
3 | * | ||
4 | * Copyright (C) 2010 Google, Inc. | ||
5 | * | ||
6 | * This software is licensed under the terms of the GNU General Public | ||
7 | * License version 2, as published by the Free Software Foundation, and | ||
8 | * may be copied, distributed, and modified under those terms. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | #ifndef TEGRA_CAMERA_H | ||
17 | #define TEGRA_CAMERA_H | ||
18 | |||
19 | /* this is to enable VI pattern generator (Null Sensor) */ | ||
20 | #define TEGRA_CAMERA_ENABLE_PD2VI_CLK 0x1 | ||
21 | |||
22 | enum { | ||
23 | TEGRA_CAMERA_MODULE_ISP = 0, | ||
24 | TEGRA_CAMERA_MODULE_VI, | ||
25 | TEGRA_CAMERA_MODULE_CSI, | ||
26 | }; | ||
27 | |||
28 | enum { | ||
29 | TEGRA_CAMERA_VI_CLK, | ||
30 | TEGRA_CAMERA_VI_SENSOR_CLK, | ||
31 | }; | ||
32 | |||
33 | struct tegra_camera_clk_info { | ||
34 | uint id; | ||
35 | uint clk_id; | ||
36 | unsigned long rate; | ||
37 | uint flag; /* to inform if any special bits need to enabled/disabled */ | ||
38 | }; | ||
39 | |||
40 | enum StereoCameraMode { | ||
41 | Main = 0x0, /* Sets the default camera to Main */ | ||
42 | StereoCameraMode_Left = 0x01, /* the left camera is on. */ | ||
43 | StereoCameraMode_Right = 0x02, /* the right camera is on. */ | ||
44 | StereoCameraMode_Stereo = 0x03, /* both cameras are on. */ | ||
45 | StereoCameraMode_Force32 = 0x7FFFFFFF | ||
46 | }; | ||
47 | |||
48 | |||
49 | #define TEGRA_CAMERA_IOCTL_ENABLE _IOWR('i', 1, uint) | ||
50 | #define TEGRA_CAMERA_IOCTL_DISABLE _IOWR('i', 2, uint) | ||
51 | #define TEGRA_CAMERA_IOCTL_CLK_SET_RATE \ | ||
52 | _IOWR('i', 3, struct tegra_camera_clk_info) | ||
53 | #define TEGRA_CAMERA_IOCTL_RESET _IOWR('i', 4, uint) | ||
54 | |||
55 | #endif | ||
diff --git a/include/media/tegra_dtv.h b/include/media/tegra_dtv.h new file mode 100644 index 00000000000..798e3e3bf9c --- /dev/null +++ b/include/media/tegra_dtv.h | |||
@@ -0,0 +1,134 @@ | |||
1 | /* | ||
2 | * | ||
3 | * Copyright (c) 2011, NVIDIA Corporation. | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __TEGRA_DTV_H__ | ||
17 | #define __TEGRA_DTV_H__ | ||
18 | |||
19 | #include <linux/ioctl.h> | ||
20 | |||
21 | #define TEGRA_DTV_MAGIC 'v' | ||
22 | |||
23 | #define TEGRA_DTV_IOCTL_START _IO(TEGRA_DTV_MAGIC, 0) | ||
24 | #define TEGRA_DTV_IOCTL_STOP _IO(TEGRA_DTV_MAGIC, 1) | ||
25 | |||
26 | struct tegra_dtv_hw_config { | ||
27 | int clk_edge; /*< clock edge to be used to sample DTV input signals */ | ||
28 | int byte_swz_enabled; /*< byte order during deserialization */ | ||
29 | int bit_swz_enabled; /*< bit order during deserialization */ | ||
30 | |||
31 | int protocol_sel; /*< VD pin configuration. */ | ||
32 | int clk_mode; /*< input clock characteristics */ | ||
33 | int fec_size; /*< FEC size */ | ||
34 | int body_size; /*< BODY size */ | ||
35 | int body_valid_sel; /*< VALID signal gate */ | ||
36 | int start_sel; /*< START of the package */ | ||
37 | int err_pol; /*< ERROR pin polarity */ | ||
38 | int psync_pol; /*< PSYNC pin polarity */ | ||
39 | int valid_pol; /*< VALID pin polarity */ | ||
40 | }; | ||
41 | |||
42 | #define TEGRA_DTV_IOCTL_SET_HW_CONFIG _IOW(TEGRA_DTV_MAGIC, 2, \ | ||
43 | const struct tegra_dtv_hw_config *) | ||
44 | #define TEGRA_DTV_IOCTL_GET_HW_CONFIG _IOR(TEGRA_DTV_MAGIC, 3, \ | ||
45 | struct tegra_dtv_hw_config *) | ||
46 | |||
47 | /** | ||
48 | * clock edge settings for clk_edge | ||
49 | * | ||
50 | * RISE_EDGE: sample input signal at rising edge | ||
51 | * FALL_EDGE: sample input signal at falling edge | ||
52 | */ | ||
53 | enum { | ||
54 | TEGRA_DTV_CLK_RISE_EDGE = 0, | ||
55 | TEGRA_DTV_CLK_FALL_EDGE, | ||
56 | }; | ||
57 | |||
58 | /** | ||
59 | * swizzle settings for byte_swz and bit_swz | ||
60 | * | ||
61 | * ENABLE: enable swizzle during deserialization | ||
62 | * DISABLE: disable swizzle during deserialization | ||
63 | * | ||
64 | * If swizzling is enabled then deserialized data will be re-ordered to | ||
65 | * fit the required format for tegra. | ||
66 | * | ||
67 | * For example, if raw BGR data is inputed into DTV interface, the data | ||
68 | * could be swizzled into RGB. | ||
69 | * | ||
70 | * For TS/MPEG-2 stream, please disable this feature. | ||
71 | */ | ||
72 | enum { | ||
73 | TEGRA_DTV_SWZ_DISABLE = 0, | ||
74 | TEGRA_DTV_SWZ_ENABLE, | ||
75 | }; | ||
76 | |||
77 | /* for selecting the pin configuration for VD(valid). | ||
78 | * NONE : ERROR is tied to 0, PSYNC is tied to 0 | ||
79 | * ERROR: ERROR is tied to VD, PSYNC is tied to 0 | ||
80 | * PSYNC: ERROR is tied to 0, PSYNC is tied to VD | ||
81 | */ | ||
82 | enum { | ||
83 | TEGRA_DTV_PROTOCOL_NONE = 0, | ||
84 | TEGRA_DTV_PROTOCOL_ERROR, | ||
85 | TEGRA_DTV_PROTOCOL_PSYNC, | ||
86 | }; | ||
87 | |||
88 | enum { | ||
89 | TEGRA_DTV_CLK_DISCONTINUOUS = 0, | ||
90 | TEGRA_DTV_CLK_CONTINUOUS, | ||
91 | }; | ||
92 | |||
93 | enum { | ||
94 | TEGRA_DTV_BODY_VALID_IGNORE = 0, | ||
95 | TEGRA_DTV_BODY_VALID_GATE, | ||
96 | }; | ||
97 | |||
98 | enum { | ||
99 | TEGRA_DTV_START_RESERVED = 0, /* never use this */ | ||
100 | TEGRA_DTV_START_PSYNC, | ||
101 | TEGRA_DTV_START_VALID, | ||
102 | TEGRA_DTV_START_BOTH, | ||
103 | }; | ||
104 | |||
105 | enum { | ||
106 | TEGRA_DTV_ERROR_POLARITY_HIGH = 0, | ||
107 | TEGRA_DTV_ERROR_POLARITY_LOW, | ||
108 | }; | ||
109 | |||
110 | enum { | ||
111 | TEGRA_DTV_PSYNC_POLARITY_HIGH = 0, | ||
112 | TEGRA_DTV_PSYNC_POLARITY_LOW, | ||
113 | }; | ||
114 | |||
115 | enum { | ||
116 | TEGRA_DTV_VALID_POLARITY_HIGH = 0, | ||
117 | TEGRA_DTV_VALID_POLARITY_LOW, | ||
118 | }; | ||
119 | |||
120 | #ifdef __KERNEL__ | ||
121 | enum { | ||
122 | TEGRA_DTV_CLK_POSEDGE, | ||
123 | TEGRA_DTV_CLK_NEGEDGE, | ||
124 | }; | ||
125 | |||
126 | struct tegra_dtv_platform_data { | ||
127 | unsigned int dma_buf_size; | ||
128 | int clk_edge; | ||
129 | bool byte_swz_enabled; | ||
130 | bool bit_swz_enabled; | ||
131 | }; | ||
132 | #endif /* __KERNEL__ */ | ||
133 | |||
134 | #endif /* __TEGRA_DTV_H__ */ | ||
diff --git a/include/media/tps61050.h b/include/media/tps61050.h new file mode 100644 index 00000000000..1c289eb3616 --- /dev/null +++ b/include/media/tps61050.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* Copyright (C) 2011 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 __TPS61050_H__ | ||
19 | #define __TPS61050_H__ | ||
20 | |||
21 | #include <media/nvc_torch.h> | ||
22 | |||
23 | #define TPS61050_MAX_TORCH_LEVEL 7 | ||
24 | #define TPS61050_MAX_FLASH_LEVEL 8 | ||
25 | |||
26 | struct tps61050_platform_data { | ||
27 | unsigned cfg; /* use the NVC_CFG_ defines */ | ||
28 | unsigned num; /* see implementation notes in driver */ | ||
29 | unsigned sync; /* see implementation notes in driver */ | ||
30 | const char *dev_name; /* see implementation notes in driver */ | ||
31 | struct nvc_torch_pin_state (*pinstate); /* see notes in driver */ | ||
32 | unsigned max_amp_torch; /* see implementation notes in driver */ | ||
33 | unsigned max_amp_flash; /* see implementation notes in driver */ | ||
34 | }; | ||
35 | |||
36 | #endif /* __TPS61050_H__ */ | ||