blob: 4ffdc64e20161e1bdc070fffe0b28c9db6b890db [file] [log] [blame]
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001/*
2 * Z-star vc0321 library
3 * Copyright (C) 2006 Koninski Artur takeshi87@o2.pl
4 * Copyright (C) 2006 Michel Xhaard
5 *
6 * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#define MODULE_NAME "vc032x"
24
25#include "gspca.h"
26
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030027MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
28MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver");
29MODULE_LICENSE("GPL");
30
31/* specific webcam descriptor */
32struct sd {
33 struct gspca_dev gspca_dev; /* !! must be the first item */
34
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030035 __u8 hflip;
36 __u8 vflip;
37 __u8 lightfreq;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -030038 __u8 sharpness;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030039
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030040 char bridge;
41#define BRIDGE_VC0321 0
42#define BRIDGE_VC0323 1
43 char sensor;
44#define SENSOR_HV7131R 0
Jean-Francois Moinecbb05542008-11-26 16:17:13 -030045#define SENSOR_MI0360 1
46#define SENSOR_MI1320 2
47#define SENSOR_MI1310_SOC 3
48#define SENSOR_OV7660 4
49#define SENSOR_OV7670 5
Jean-Francois Moine88521532008-12-10 05:06:13 -030050#define SENSOR_PO1200 6
51#define SENSOR_PO3130NC 7
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030052};
53
54/* V4L2 controls supported by the driver */
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030055static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val);
56static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val);
57static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val);
58static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030059static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val);
60static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine47a42b02008-12-13 07:45:34 -030061static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val);
62static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030063
64static struct ctrl sd_ctrls[] = {
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030065/* next 2 controls work with ov7660 and ov7670 only */
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030066#define HFLIP_IDX 0
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030067 {
68 {
69 .id = V4L2_CID_HFLIP,
70 .type = V4L2_CTRL_TYPE_BOOLEAN,
71 .name = "Mirror",
72 .minimum = 0,
73 .maximum = 1,
74 .step = 1,
75#define HFLIP_DEF 0
76 .default_value = HFLIP_DEF,
77 },
78 .set = sd_sethflip,
79 .get = sd_gethflip,
80 },
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030081#define VFLIP_IDX 1
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -030082 {
83 {
84 .id = V4L2_CID_VFLIP,
85 .type = V4L2_CTRL_TYPE_BOOLEAN,
86 .name = "Vflip",
87 .minimum = 0,
88 .maximum = 1,
89 .step = 1,
90#define VFLIP_DEF 0
91 .default_value = VFLIP_DEF,
92 },
93 .set = sd_setvflip,
94 .get = sd_getvflip,
95 },
Jean-Francois Moine34e21c32008-12-08 05:17:32 -030096#define LIGHTFREQ_IDX 2
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -030097 {
98 {
99 .id = V4L2_CID_POWER_LINE_FREQUENCY,
100 .type = V4L2_CTRL_TYPE_MENU,
101 .name = "Light frequency filter",
102 .minimum = 0,
Jean-Francois Moined0d0e392008-07-10 07:06:44 -0300103 .maximum = 2, /* 0: No, 1: 50Hz, 2:60Hz */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300104 .step = 1,
Jean-Francois Moined0d0e392008-07-10 07:06:44 -0300105#define FREQ_DEF 1
106 .default_value = FREQ_DEF,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300107 },
108 .set = sd_setfreq,
109 .get = sd_getfreq,
110 },
Jean-Francois Moine47a42b02008-12-13 07:45:34 -0300111/* po1200 only */
112#define SHARPNESS_IDX 3
113 {
114 {
115 .id = V4L2_CID_SHARPNESS,
116 .type = V4L2_CTRL_TYPE_INTEGER,
117 .name = "Sharpness",
118 .minimum = 0,
119 .maximum = 2,
120 .step = 1,
121#define SHARPNESS_DEF 1
122 .default_value = SHARPNESS_DEF,
123 },
124 .set = sd_setsharpness,
125 .get = sd_getsharpness,
126 },
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300127};
128
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300129static const struct v4l2_pix_format vc0321_mode[] = {
Jean-Francois Moine20122542008-09-03 17:12:20 -0300130 {320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Jean-Francois Moine00b27ce2008-07-30 05:47:54 -0300131 .bytesperline = 320,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300132 .sizeimage = 320 * 240 * 2,
133 .colorspace = V4L2_COLORSPACE_SRGB,
134 .priv = 1},
Jean-Francois Moine20122542008-09-03 17:12:20 -0300135 {640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
Jean-Francois Moine00b27ce2008-07-30 05:47:54 -0300136 .bytesperline = 640,
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300137 .sizeimage = 640 * 480 * 2,
138 .colorspace = V4L2_COLORSPACE_SRGB,
139 .priv = 0},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300140};
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300141static const struct v4l2_pix_format vc0323_mode[] = {
Jean-Francois Moinec2446b32008-07-05 11:49:20 -0300142 {320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
143 .bytesperline = 320,
144 .sizeimage = 320 * 240 * 3 / 8 + 590,
145 .colorspace = V4L2_COLORSPACE_JPEG,
146 .priv = 1},
147 {640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
148 .bytesperline = 640,
149 .sizeimage = 640 * 480 * 3 / 8 + 590,
150 .colorspace = V4L2_COLORSPACE_JPEG,
151 .priv = 0},
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300152 {1280, 1024, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, /* mi1310_soc only */
153 .bytesperline = 1280,
154 .sizeimage = 1280 * 1024 * 1 / 4 + 590,
155 .colorspace = V4L2_COLORSPACE_JPEG,
156 .priv = 2},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300157};
158
Jean-Francois Moinecc611b82008-12-29 07:49:41 -0300159static const struct v4l2_pix_format svga_mode[] = {
Jean-Francois Moine88521532008-12-10 05:06:13 -0300160 {800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
161 .bytesperline = 800,
162 .sizeimage = 800 * 600 * 1 / 4 + 590,
163 .colorspace = V4L2_COLORSPACE_JPEG,
164 .priv = 0},
165};
166
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -0300167/* OV7660/7670 registers */
168#define OV7660_REG_MVFP 0x1e
169#define OV7660_MVFP_MIRROR 0x20
170#define OV7660_MVFP_VFLIP 0x10
171
Jean-Francois Moinecbb05542008-11-26 16:17:13 -0300172static const __u8 mi0360_matrix[9] = {
173 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
174};
175
176static const __u8 mi0360_initVGA_JPG[][4] = {
177 {0xb0, 0x03, 0x19, 0xcc},
178 {0xb0, 0x04, 0x02, 0xcc},
179 {0xb3, 0x00, 0x24, 0xcc},
180 {0xb3, 0x00, 0x25, 0xcc},
181 {0xb3, 0x08, 0x01, 0xcc},
182 {0xb3, 0x09, 0x0c, 0xcc},
183 {0xb3, 0x05, 0x01, 0xcc},
184 {0xb3, 0x06, 0x03, 0xcc},
185 {0xb3, 0x03, 0x0a, 0xcc},
186 {0xb3, 0x20, 0x00, 0xcc},
187 {0xb3, 0x21, 0x00, 0xcc},
188 {0xb3, 0x22, 0x01, 0xcc},
189 {0xb3, 0x23, 0xe0, 0xcc},
190 {0xb3, 0x04, 0x05, 0xcc},
191 {0xb3, 0x14, 0x00, 0xcc},
192 {0xb3, 0x15, 0x00, 0xcc},
193 {0xb3, 0x16, 0x02, 0xcc},
194 {0xb3, 0x17, 0x7f, 0xcc},
195 {0xb3, 0x35, 0xdd, 0xcc},
196 {0xb3, 0x34, 0x02, 0xcc},
197 {0xb3, 0x00, 0x25, 0xcc},
198 {0xbc, 0x00, 0x71, 0xcc},
199 {0xb8, 0x00, 0x13, 0xcc},
200 {0xb8, 0x27, 0x20, 0xcc},
201 {0xb8, 0x2c, 0x50, 0xcc},
202 {0xb8, 0x2d, 0xf8, 0xcc},
203 {0xb8, 0x2e, 0xf8, 0xcc},
204 {0xb8, 0x2f, 0xf8, 0xcc},
205 {0xb8, 0x30, 0x50, 0xcc},
206 {0xb8, 0x31, 0xf8, 0xcc},
207 {0xb8, 0x32, 0xf8, 0xcc},
208 {0xb8, 0x33, 0xf8, 0xcc},
209 {0xb8, 0x34, 0x50, 0xcc},
210 {0xb8, 0x35, 0x00, 0xcc},
211 {0xb8, 0x36, 0x00, 0xcc},
212 {0xb8, 0x37, 0x00, 0xcc},
213 {0xb8, 0x01, 0x79, 0xcc},
214 {0xb8, 0x08, 0xe0, 0xcc},
215 {0xb3, 0x01, 0x41, 0xcc},
216 {0xb8, 0x01, 0x79, 0xcc},
217 {0xb8, 0x14, 0x18, 0xcc},
218 {0xb8, 0xb2, 0x0a, 0xcc},
219 {0xb8, 0xb4, 0x0a, 0xcc},
220 {0xb8, 0xb5, 0x0a, 0xcc},
221 {0xb8, 0xfe, 0x00, 0xcc},
222 {0xb8, 0xff, 0x28, 0xcc},
223 {0xb9, 0x00, 0x28, 0xcc},
224 {0xb9, 0x01, 0x28, 0xcc},
225 {0xb9, 0x02, 0x28, 0xcc},
226 {0xb9, 0x03, 0x00, 0xcc},
227 {0xb9, 0x04, 0x00, 0xcc},
228 {0xb9, 0x05, 0x3c, 0xcc},
229 {0xb9, 0x06, 0x3c, 0xcc},
230 {0xb9, 0x07, 0x3c, 0xcc},
231 {0xb9, 0x08, 0x3c, 0xcc},
232 {0xb8, 0x8e, 0x00, 0xcc},
233 {0xb8, 0x8f, 0xff, 0xcc},
234 {0xb8, 0x81, 0x09, 0xcc},
235 {0x31, 0x00, 0x00, 0xbb},
236 {0x09, 0x01, 0xc7, 0xbb},
237 {0x34, 0x01, 0x00, 0xbb},
238 {0x2b, 0x00, 0x28, 0xbb},
239 {0x2c, 0x00, 0x30, 0xbb},
240 {0x2d, 0x00, 0x30, 0xbb},
241 {0x2e, 0x00, 0x28, 0xbb},
242 {0x62, 0x04, 0x11, 0xbb},
243 {0x03, 0x01, 0xe0, 0xbb},
244 {0x2c, 0x00, 0x2c, 0xbb},
245 {0x20, 0xd0, 0x00, 0xbb},
246 {0x01, 0x00, 0x08, 0xbb},
247 {0x06, 0x00, 0x10, 0xbb},
248 {0x05, 0x00, 0x20, 0xbb},
249 {0x20, 0x00, 0x00, 0xbb},
250 {0xb6, 0x00, 0x00, 0xcc},
251 {0xb6, 0x03, 0x02, 0xcc},
252 {0xb6, 0x02, 0x80, 0xcc},
253 {0xb6, 0x05, 0x01, 0xcc},
254 {0xb6, 0x04, 0xe0, 0xcc},
255 {0xb6, 0x12, 0x78, 0xcc},
256 {0xb6, 0x18, 0x02, 0xcc},
257 {0xb6, 0x17, 0x58, 0xcc},
258 {0xb6, 0x16, 0x00, 0xcc},
259 {0xb6, 0x22, 0x12, 0xcc},
260 {0xb6, 0x23, 0x0b, 0xcc},
261 {0xb3, 0x02, 0x02, 0xcc},
262 {0xbf, 0xc0, 0x39, 0xcc},
263 {0xbf, 0xc1, 0x04, 0xcc},
264 {0xbf, 0xcc, 0x10, 0xcc},
265 {0xb9, 0x12, 0x00, 0xcc},
266 {0xb9, 0x13, 0x0a, 0xcc},
267 {0xb9, 0x14, 0x0a, 0xcc},
268 {0xb9, 0x15, 0x0a, 0xcc},
269 {0xb9, 0x16, 0x0a, 0xcc},
270 {0xb9, 0x18, 0x00, 0xcc},
271 {0xb9, 0x19, 0x0f, 0xcc},
272 {0xb9, 0x1a, 0x0f, 0xcc},
273 {0xb9, 0x1b, 0x0f, 0xcc},
274 {0xb9, 0x1c, 0x0f, 0xcc},
275 {0xb8, 0x8e, 0x00, 0xcc},
276 {0xb8, 0x8f, 0xff, 0xcc},
277 {0xb6, 0x12, 0xf8, 0xcc},
278 {0xb8, 0x0c, 0x20, 0xcc},
279 {0xb8, 0x0d, 0x70, 0xcc},
280 {0xb6, 0x13, 0x13, 0xcc},
281 {0x35, 0x00, 0x60, 0xbb},
282 {0xb3, 0x5c, 0x01, 0xcc},
283 {}
284};
285static const __u8 mi0360_initQVGA_JPG[][4] = {
286 {0xb0, 0x03, 0x19, 0xcc},
287 {0xb0, 0x04, 0x02, 0xcc},
288 {0xb3, 0x00, 0x24, 0xcc},
289 {0xb3, 0x00, 0x25, 0xcc},
290 {0xb3, 0x08, 0x01, 0xcc},
291 {0xb3, 0x09, 0x0c, 0xcc},
292 {0xb3, 0x05, 0x01, 0xcc},
293 {0xb3, 0x06, 0x03, 0xcc},
294 {0xb3, 0x03, 0x0a, 0xcc},
295 {0xb3, 0x20, 0x00, 0xcc},
296 {0xb3, 0x21, 0x00, 0xcc},
297 {0xb3, 0x22, 0x01, 0xcc},
298 {0xb3, 0x23, 0xe0, 0xcc},
299 {0xb3, 0x04, 0x05, 0xcc},
300 {0xb3, 0x14, 0x00, 0xcc},
301 {0xb3, 0x15, 0x00, 0xcc},
302 {0xb3, 0x16, 0x02, 0xcc},
303 {0xb3, 0x17, 0x7f, 0xcc},
304 {0xb3, 0x35, 0xdd, 0xcc},
305 {0xb3, 0x34, 0x02, 0xcc},
306 {0xb3, 0x00, 0x25, 0xcc},
307 {0xbc, 0x00, 0xd1, 0xcc},
308 {0xb8, 0x00, 0x13, 0xcc},
309 {0xb8, 0x27, 0x20, 0xcc},
310 {0xb8, 0x2c, 0x50, 0xcc},
311 {0xb8, 0x2d, 0xf8, 0xcc},
312 {0xb8, 0x2e, 0xf8, 0xcc},
313 {0xb8, 0x2f, 0xf8, 0xcc},
314 {0xb8, 0x30, 0x50, 0xcc},
315 {0xb8, 0x31, 0xf8, 0xcc},
316 {0xb8, 0x32, 0xf8, 0xcc},
317 {0xb8, 0x33, 0xf8, 0xcc},
318 {0xb8, 0x34, 0x50, 0xcc},
319 {0xb8, 0x35, 0x00, 0xcc},
320 {0xb8, 0x36, 0x00, 0xcc},
321 {0xb8, 0x37, 0x00, 0xcc},
322 {0xb8, 0x01, 0x79, 0xcc},
323 {0xb8, 0x08, 0xe0, 0xcc},
324 {0xb3, 0x01, 0x41, 0xcc},
325 {0xb8, 0x01, 0x79, 0xcc},
326 {0xb8, 0x14, 0x18, 0xcc},
327 {0xb8, 0xb2, 0x0a, 0xcc},
328 {0xb8, 0xb4, 0x0a, 0xcc},
329 {0xb8, 0xb5, 0x0a, 0xcc},
330 {0xb8, 0xfe, 0x00, 0xcc},
331 {0xb8, 0xff, 0x28, 0xcc},
332 {0xb9, 0x00, 0x28, 0xcc},
333 {0xb9, 0x01, 0x28, 0xcc},
334 {0xb9, 0x02, 0x28, 0xcc},
335 {0xb9, 0x03, 0x00, 0xcc},
336 {0xb9, 0x04, 0x00, 0xcc},
337 {0xb9, 0x05, 0x3c, 0xcc},
338 {0xb9, 0x06, 0x3c, 0xcc},
339 {0xb9, 0x07, 0x3c, 0xcc},
340 {0xb9, 0x08, 0x3c, 0xcc},
341 {0xb8, 0x8e, 0x00, 0xcc},
342 {0xb8, 0x8f, 0xff, 0xcc},
343 {0xb8, 0x81, 0x09, 0xcc},
344 {0x31, 0x00, 0x00, 0xbb},
345 {0x09, 0x01, 0xc7, 0xbb},
346 {0x34, 0x01, 0x00, 0xbb},
347 {0x2b, 0x00, 0x28, 0xbb},
348 {0x2c, 0x00, 0x30, 0xbb},
349 {0x2d, 0x00, 0x30, 0xbb},
350 {0x2e, 0x00, 0x28, 0xbb},
351 {0x62, 0x04, 0x11, 0xbb},
352 {0x03, 0x01, 0xe0, 0xbb},
353 {0x2c, 0x00, 0x2c, 0xbb},
354 {0x20, 0xd0, 0x00, 0xbb},
355 {0x01, 0x00, 0x08, 0xbb},
356 {0x06, 0x00, 0x10, 0xbb},
357 {0x05, 0x00, 0x20, 0xbb},
358 {0x20, 0x00, 0x00, 0xbb},
359 {0xb6, 0x00, 0x00, 0xcc},
360 {0xb6, 0x03, 0x01, 0xcc},
361 {0xb6, 0x02, 0x40, 0xcc},
362 {0xb6, 0x05, 0x00, 0xcc},
363 {0xb6, 0x04, 0xf0, 0xcc},
364 {0xb6, 0x12, 0x78, 0xcc},
365 {0xb6, 0x18, 0x00, 0xcc},
366 {0xb6, 0x17, 0x96, 0xcc},
367 {0xb6, 0x16, 0x00, 0xcc},
368 {0xb6, 0x22, 0x12, 0xcc},
369 {0xb6, 0x23, 0x0b, 0xcc},
370 {0xb3, 0x02, 0x02, 0xcc},
371 {0xbf, 0xc0, 0x39, 0xcc},
372 {0xbf, 0xc1, 0x04, 0xcc},
373 {0xbf, 0xcc, 0x10, 0xcc},
374 {0xb9, 0x12, 0x00, 0xcc},
375 {0xb9, 0x13, 0x0a, 0xcc},
376 {0xb9, 0x14, 0x0a, 0xcc},
377 {0xb9, 0x15, 0x0a, 0xcc},
378 {0xb9, 0x16, 0x0a, 0xcc},
379 {0xb9, 0x18, 0x00, 0xcc},
380 {0xb9, 0x19, 0x0f, 0xcc},
381 {0xb9, 0x1a, 0x0f, 0xcc},
382 {0xb9, 0x1b, 0x0f, 0xcc},
383 {0xb9, 0x1c, 0x0f, 0xcc},
384 {0xb8, 0x8e, 0x00, 0xcc},
385 {0xb8, 0x8f, 0xff, 0xcc},
386 {0xb6, 0x12, 0xf8, 0xcc},
387 {0xb6, 0x13, 0x13, 0xcc},
388 {0xbc, 0x02, 0x18, 0xcc},
389 {0xbc, 0x03, 0x50, 0xcc},
390 {0xbc, 0x04, 0x18, 0xcc},
391 {0xbc, 0x05, 0x00, 0xcc},
392 {0xbc, 0x06, 0x00, 0xcc},
393 {0xbc, 0x08, 0x30, 0xcc},
394 {0xbc, 0x09, 0x40, 0xcc},
395 {0xbc, 0x0a, 0x10, 0xcc},
396 {0xb8, 0x0c, 0x20, 0xcc},
397 {0xb8, 0x0d, 0x70, 0xcc},
398 {0xbc, 0x0b, 0x00, 0xcc},
399 {0xbc, 0x0c, 0x00, 0xcc},
400 {0x35, 0x00, 0xef, 0xbb},
401 {0xb3, 0x5c, 0x01, 0xcc},
402 {}
403};
404
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300405static const __u8 mi1310_socinitVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300406 {0xb0, 0x03, 0x19, 0xcc},
407 {0xb0, 0x04, 0x02, 0xcc},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300408 {0xb3, 0x00, 0x24, 0xcc},
409 {0xb3, 0x00, 0x25, 0xcc},
410 {0xb3, 0x05, 0x01, 0xcc},
411 {0xb3, 0x06, 0x03, 0xcc},
412 {0xb3, 0x5c, 0x01, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300413 {0xb3, 0x08, 0x01, 0xcc},
414 {0xb3, 0x09, 0x0c, 0xcc},
415 {0xb3, 0x34, 0x02, 0xcc},
416 {0xb3, 0x35, 0xdd, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300417 {0xb3, 0x03, 0x0a, 0xcc},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300418 {0xb3, 0x04, 0x0d, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300419 {0xb3, 0x20, 0x00, 0xcc},
420 {0xb3, 0x21, 0x00, 0xcc},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300421 {0xb3, 0x22, 0x01, 0xcc},
422 {0xb3, 0x23, 0xe0, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300423 {0xb3, 0x14, 0x00, 0xcc},
424 {0xb3, 0x15, 0x00, 0xcc},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300425 {0xb3, 0x16, 0x02, 0xcc},
426 {0xb3, 0x17, 0x7f, 0xcc},
427 {0xb8, 0x01, 0x7d, 0xcc},
428 {0xb8, 0x81, 0x09, 0xcc},
429 {0xb8, 0x27, 0x20, 0xcc},
430 {0xb8, 0x26, 0x80, 0xcc},
431 {0xb3, 0x00, 0x25, 0xcc},
432 {0xb8, 0x00, 0x13, 0xcc},
433 {0xbc, 0x00, 0x71, 0xcc},
434 {0xb8, 0x81, 0x01, 0xcc},
435 {0xb8, 0x2c, 0x5a, 0xcc},
436 {0xb8, 0x2d, 0xff, 0xcc},
437 {0xb8, 0x2e, 0xee, 0xcc},
438 {0xb8, 0x2f, 0xfb, 0xcc},
439 {0xb8, 0x30, 0x52, 0xcc},
440 {0xb8, 0x31, 0xf8, 0xcc},
441 {0xb8, 0x32, 0xf1, 0xcc},
442 {0xb8, 0x33, 0xff, 0xcc},
443 {0xb8, 0x34, 0x54, 0xcc},
444 {0xb8, 0x35, 0x00, 0xcc},
445 {0xb8, 0x36, 0x00, 0xcc},
446 {0xb8, 0x37, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300447 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300448 {0x00, 0x01, 0x00, 0xdd},
449 {0x0d, 0x00, 0x09, 0xbb},
450 {0x0d, 0x00, 0x08, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300451 {0xf0, 0x00, 0x01, 0xbb},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300452 {0x00, 0x01, 0x00, 0xdd},
453 {0x06, 0x00, 0x14, 0xbb},
454 {0x3a, 0x10, 0x00, 0xbb},
455 {0x00, 0x00, 0x10, 0xdd},
456 {0x9b, 0x10, 0x00, 0xbb},
457 {0x00, 0x00, 0x10, 0xdd},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300458 {0xf0, 0x00, 0x00, 0xbb},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300459 {0x00, 0x01, 0x00, 0xdd},
460 {0x2b, 0x00, 0x28, 0xbb},
461 {0x2c, 0x00, 0x30, 0xbb},
462 {0x2d, 0x00, 0x30, 0xbb},
463 {0x2e, 0x00, 0x28, 0xbb},
464 {0x41, 0x00, 0xd7, 0xbb},
465 {0x09, 0x02, 0x3a, 0xbb},
466 {0x0c, 0x00, 0x00, 0xbb},
467 {0x20, 0x00, 0x00, 0xbb},
468 {0x05, 0x00, 0x8c, 0xbb},
469 {0x06, 0x00, 0x32, 0xbb},
470 {0x07, 0x00, 0xc6, 0xbb},
471 {0x08, 0x00, 0x19, 0xbb},
472 {0x24, 0x80, 0x6f, 0xbb},
473 {0xc8, 0x00, 0x0f, 0xbb},
474 {0x20, 0x00, 0x0f, 0xbb},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300475 {0xb6, 0x00, 0x00, 0xcc},
476 {0xb6, 0x03, 0x02, 0xcc},
477 {0xb6, 0x02, 0x80, 0xcc},
478 {0xb6, 0x05, 0x01, 0xcc},
479 {0xb6, 0x04, 0xe0, 0xcc},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300480 {0xb6, 0x12, 0x78, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300481 {0xb6, 0x18, 0x02, 0xcc},
482 {0xb6, 0x17, 0x58, 0xcc},
483 {0xb6, 0x16, 0x00, 0xcc},
484 {0xb6, 0x22, 0x12, 0xcc},
485 {0xb6, 0x23, 0x0b, 0xcc},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300486 {0xb3, 0x02, 0x02, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300487 {0xbf, 0xc0, 0x39, 0xcc},
488 {0xbf, 0xc1, 0x04, 0xcc},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300489 {0xbf, 0xcc, 0x10, 0xcc},
490 {0xb9, 0x12, 0x00, 0xcc},
491 {0xb9, 0x13, 0x0a, 0xcc},
492 {0xb9, 0x14, 0x0a, 0xcc},
493 {0xb9, 0x15, 0x0a, 0xcc},
494 {0xb9, 0x16, 0x0a, 0xcc},
495 {0xb9, 0x18, 0x00, 0xcc},
496 {0xb9, 0x19, 0x0f, 0xcc},
497 {0xb9, 0x1a, 0x0f, 0xcc},
498 {0xb9, 0x1b, 0x0f, 0xcc},
499 {0xb9, 0x1c, 0x0f, 0xcc},
500 {0xb8, 0x8e, 0x00, 0xcc},
501 {0xb8, 0x8f, 0xff, 0xcc},
502 {0xb3, 0x01, 0x41, 0xcc},
503 {0x03, 0x03, 0xc0, 0xbb},
504 {0x06, 0x00, 0x10, 0xbb},
505 {0xb6, 0x12, 0xf8, 0xcc},
506 {0xb8, 0x0c, 0x20, 0xcc},
507 {0xb8, 0x0d, 0x70, 0xcc},
508 {0xb6, 0x13, 0x13, 0xcc},
509 {0x2f, 0x00, 0xC0, 0xbb},
510 {0xb8, 0xa0, 0x12, 0xcc},
511 {},
512};
513static const __u8 mi1310_socinitQVGA_JPG[][4] = {
514 {0xb0, 0x03, 0x19, 0xcc},
515 {0xb0, 0x04, 0x02, 0xcc},
516 {0xb3, 0x00, 0x24, 0xcc},
517 {0xb3, 0x00, 0x25, 0xcc},
518 {0xb3, 0x05, 0x01, 0xcc},
519 {0xb3, 0x06, 0x03, 0xcc},
520 {0xb3, 0x5c, 0x01, 0xcc},
521 {0xb3, 0x08, 0x01, 0xcc},
522 {0xb3, 0x09, 0x0c, 0xcc},
523 {0xb3, 0x34, 0x02, 0xcc},
524 {0xb3, 0x35, 0xdd, 0xcc},
525 {0xb3, 0x03, 0x0a, 0xcc},
526 {0xb3, 0x04, 0x0d, 0xcc},
527 {0xb3, 0x20, 0x00, 0xcc},
528 {0xb3, 0x21, 0x00, 0xcc},
529 {0xb3, 0x22, 0x01, 0xcc},
530 {0xb3, 0x23, 0xe0, 0xcc},
531 {0xb3, 0x14, 0x00, 0xcc},
532 {0xb3, 0x15, 0x00, 0xcc},
533 {0xb3, 0x16, 0x02, 0xcc},
534 {0xb3, 0x17, 0x7f, 0xcc},
535 {0xb8, 0x01, 0x7d, 0xcc},
536 {0xb8, 0x81, 0x09, 0xcc},
537 {0xb8, 0x27, 0x20, 0xcc},
538 {0xb8, 0x26, 0x80, 0xcc},
539 {0xb3, 0x00, 0x25, 0xcc},
540 {0xb8, 0x00, 0x13, 0xcc},
541 {0xbc, 0x00, 0xd1, 0xcc},
542 {0xb8, 0x81, 0x01, 0xcc},
543 {0xb8, 0x2c, 0x5a, 0xcc},
544 {0xb8, 0x2d, 0xff, 0xcc},
545 {0xb8, 0x2e, 0xee, 0xcc},
546 {0xb8, 0x2f, 0xfb, 0xcc},
547 {0xb8, 0x30, 0x52, 0xcc},
548 {0xb8, 0x31, 0xf8, 0xcc},
549 {0xb8, 0x32, 0xf1, 0xcc},
550 {0xb8, 0x33, 0xff, 0xcc},
551 {0xb8, 0x34, 0x54, 0xcc},
552 {0xb8, 0x35, 0x00, 0xcc},
553 {0xb8, 0x36, 0x00, 0xcc},
554 {0xb8, 0x37, 0x00, 0xcc},
555 {0xf0, 0x00, 0x00, 0xbb},
556 {0x00, 0x01, 0x00, 0xdd},
557 {0x0d, 0x00, 0x09, 0xbb},
558 {0x0d, 0x00, 0x08, 0xbb},
559 {0xf0, 0x00, 0x01, 0xbb},
560 {0x00, 0x01, 0x00, 0xdd},
561 {0x06, 0x00, 0x14, 0xbb},
562 {0x3a, 0x10, 0x00, 0xbb},
563 {0x00, 0x00, 0x10, 0xdd},
564 {0x9b, 0x10, 0x00, 0xbb},
565 {0x00, 0x00, 0x10, 0xdd},
566 {0xf0, 0x00, 0x00, 0xbb},
567 {0x00, 0x01, 0x00, 0xdd},
568 {0x2b, 0x00, 0x28, 0xbb},
569 {0x2c, 0x00, 0x30, 0xbb},
570 {0x2d, 0x00, 0x30, 0xbb},
571 {0x2e, 0x00, 0x28, 0xbb},
572 {0x41, 0x00, 0xd7, 0xbb},
573 {0x09, 0x02, 0x3a, 0xbb},
574 {0x0c, 0x00, 0x00, 0xbb},
575 {0x20, 0x00, 0x00, 0xbb},
576 {0x05, 0x00, 0x8c, 0xbb},
577 {0x06, 0x00, 0x32, 0xbb},
578 {0x07, 0x00, 0xc6, 0xbb},
579 {0x08, 0x00, 0x19, 0xbb},
580 {0x24, 0x80, 0x6f, 0xbb},
581 {0xc8, 0x00, 0x0f, 0xbb},
582 {0x20, 0x00, 0x0f, 0xbb},
583 {0xb6, 0x00, 0x00, 0xcc},
584 {0xb6, 0x03, 0x01, 0xcc},
585 {0xb6, 0x02, 0x40, 0xcc},
586 {0xb6, 0x05, 0x00, 0xcc},
587 {0xb6, 0x04, 0xf0, 0xcc},
588 {0xb6, 0x12, 0x78, 0xcc},
589 {0xb6, 0x18, 0x00, 0xcc},
590 {0xb6, 0x17, 0x96, 0xcc},
591 {0xb6, 0x16, 0x00, 0xcc},
592 {0xb6, 0x22, 0x12, 0xcc},
593 {0xb6, 0x23, 0x0b, 0xcc},
594 {0xb3, 0x02, 0x02, 0xcc},
595 {0xbf, 0xc0, 0x39, 0xcc},
596 {0xbf, 0xc1, 0x04, 0xcc},
597 {0xbf, 0xcc, 0x10, 0xcc},
598 {0xb9, 0x12, 0x00, 0xcc},
599 {0xb9, 0x13, 0x0a, 0xcc},
600 {0xb9, 0x14, 0x0a, 0xcc},
601 {0xb9, 0x15, 0x0a, 0xcc},
602 {0xb9, 0x16, 0x0a, 0xcc},
603 {0xb9, 0x18, 0x00, 0xcc},
604 {0xb9, 0x19, 0x0f, 0xcc},
605 {0xb9, 0x1a, 0x0f, 0xcc},
606 {0xb9, 0x1b, 0x0f, 0xcc},
607 {0xb9, 0x1c, 0x0f, 0xcc},
608 {0xb8, 0x8e, 0x00, 0xcc},
609 {0xb8, 0x8f, 0xff, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300610 {0xbc, 0x02, 0x18, 0xcc},
611 {0xbc, 0x03, 0x50, 0xcc},
612 {0xbc, 0x04, 0x18, 0xcc},
613 {0xbc, 0x05, 0x00, 0xcc},
614 {0xbc, 0x06, 0x00, 0xcc},
615 {0xbc, 0x08, 0x30, 0xcc},
616 {0xbc, 0x09, 0x40, 0xcc},
617 {0xbc, 0x0a, 0x10, 0xcc},
618 {0xbc, 0x0b, 0x00, 0xcc},
619 {0xbc, 0x0c, 0x00, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300620 {0xb3, 0x01, 0x41, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300621 {0x03, 0x03, 0xc0, 0xbb},
Jean-Francois Moinea92e9062009-01-29 05:32:23 -0300622 {0x06, 0x00, 0x10, 0xbb},
623 {0xb6, 0x12, 0xf8, 0xcc},
624 {0xb8, 0x0c, 0x20, 0xcc},
625 {0xb8, 0x0d, 0x70, 0xcc},
626 {0xb6, 0x13, 0x13, 0xcc},
627 {0x2f, 0x00, 0xC0, 0xbb},
628 {0xb8, 0xa0, 0x12, 0xcc},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300629 {},
630};
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -0300631static const u8 mi1310_soc_InitSXGA_JPG[][4] = {
632 {0xb0, 0x03, 0x19, 0xcc},
633 {0xb0, 0x04, 0x02, 0xcc},
634 {0xb3, 0x00, 0x24, 0xcc},
635 {0xb3, 0x00, 0x25, 0xcc},
636 {0xb3, 0x05, 0x00, 0xcc},
637 {0xb3, 0x06, 0x01, 0xcc},
638 {0xb3, 0x5c, 0x01, 0xcc},
639 {0xb3, 0x08, 0x01, 0xcc},
640 {0xb3, 0x09, 0x0c, 0xcc},
641 {0xb3, 0x34, 0x02, 0xcc},
642 {0xb3, 0x35, 0xdd, 0xcc},
643 {0xb3, 0x03, 0x0a, 0xcc},
644 {0xb3, 0x04, 0x0d, 0xcc},
645 {0xb3, 0x20, 0x00, 0xcc},
646 {0xb3, 0x21, 0x00, 0xcc},
647 {0xb3, 0x22, 0x04, 0xcc},
648 {0xb3, 0x23, 0x00, 0xcc},
649 {0xb3, 0x14, 0x00, 0xcc},
650 {0xb3, 0x15, 0x00, 0xcc},
651 {0xb3, 0x16, 0x04, 0xcc},
652 {0xb3, 0x17, 0xff, 0xcc},
653 {0xb8, 0x01, 0x7d, 0xcc},
654 {0xb8, 0x81, 0x09, 0xcc},
655 {0xb8, 0x27, 0x20, 0xcc},
656 {0xb8, 0x26, 0x80, 0xcc},
657 {0xb8, 0x06, 0x00, 0xcc},
658 {0xb8, 0x07, 0x05, 0xcc},
659 {0xb8, 0x08, 0x00, 0xcc},
660 {0xb8, 0x09, 0x04, 0xcc},
661 {0xb3, 0x00, 0x25, 0xcc},
662 {0xb8, 0x00, 0x11, 0xcc},
663 {0xbc, 0x00, 0x71, 0xcc},
664 {0xb8, 0x81, 0x01, 0xcc},
665 {0xb8, 0x2c, 0x5a, 0xcc},
666 {0xb8, 0x2d, 0xff, 0xcc},
667 {0xb8, 0x2e, 0xee, 0xcc},
668 {0xb8, 0x2f, 0xfb, 0xcc},
669 {0xb8, 0x30, 0x52, 0xcc},
670 {0xb8, 0x31, 0xf8, 0xcc},
671 {0xb8, 0x32, 0xf1, 0xcc},
672 {0xb8, 0x33, 0xff, 0xcc},
673 {0xb8, 0x34, 0x54, 0xcc},
674 {0xf0, 0x00, 0x00, 0xbb},
675 {0x00, 0x01, 0x00, 0xdd},
676 {0x0d, 0x00, 0x09, 0xbb},
677 {0x0d, 0x00, 0x08, 0xbb},
678 {0xf0, 0x00, 0x01, 0xbb},
679 {0x00, 0x01, 0x00, 0xdd},
680 {0x06, 0x00, 0x14, 0xbb},
681 {0x3a, 0x10, 0x00, 0xbb},
682 {0x00, 0x00, 0x10, 0xdd},
683 {0x9b, 0x10, 0x00, 0xbb},
684 {0x00, 0x00, 0x10, 0xdd},
685 {0xf0, 0x00, 0x00, 0xbb},
686 {0x00, 0x01, 0x00, 0xdd},
687 {0x2b, 0x00, 0x28, 0xbb},
688 {0x2c, 0x00, 0x30, 0xbb},
689 {0x2d, 0x00, 0x30, 0xbb},
690 {0x2e, 0x00, 0x28, 0xbb},
691 {0x41, 0x00, 0xd7, 0xbb},
692 {0x09, 0x02, 0x3a, 0xbb},
693 {0x0c, 0x00, 0x00, 0xbb},
694 {0x20, 0x00, 0x00, 0xbb},
695 {0x05, 0x00, 0x8c, 0xbb},
696 {0x06, 0x00, 0x32, 0xbb},
697 {0x07, 0x00, 0xc6, 0xbb},
698 {0x08, 0x00, 0x19, 0xbb},
699 {0x24, 0x80, 0x6f, 0xbb},
700 {0xc8, 0x00, 0x0f, 0xbb},
701 {0x20, 0x00, 0x03, 0xbb},
702 {0xb6, 0x00, 0x00, 0xcc},
703 {0xb6, 0x03, 0x05, 0xcc},
704 {0xb6, 0x02, 0x00, 0xcc},
705 {0xb6, 0x05, 0x04, 0xcc},
706 {0xb6, 0x04, 0x00, 0xcc},
707 {0xb6, 0x12, 0xf8, 0xcc},
708 {0xb6, 0x18, 0x0a, 0xcc},
709 {0xb6, 0x17, 0x00, 0xcc},
710 {0xb6, 0x16, 0x00, 0xcc},
711 {0xb6, 0x22, 0x12, 0xcc},
712 {0xb6, 0x23, 0x0b, 0xcc},
713 {0xb3, 0x02, 0x02, 0xcc},
714 {0xbf, 0xc0, 0x39, 0xcc},
715 {0xbf, 0xc1, 0x04, 0xcc},
716 {0xbf, 0xcc, 0x10, 0xcc},
717 {0xb9, 0x12, 0x00, 0xcc},
718 {0xb9, 0x13, 0x14, 0xcc},
719 {0xb9, 0x14, 0x14, 0xcc},
720 {0xb9, 0x15, 0x14, 0xcc},
721 {0xb9, 0x16, 0x14, 0xcc},
722 {0xb9, 0x18, 0x00, 0xcc},
723 {0xb9, 0x19, 0x1e, 0xcc},
724 {0xb9, 0x1a, 0x1e, 0xcc},
725 {0xb9, 0x1b, 0x1e, 0xcc},
726 {0xb9, 0x1c, 0x1e, 0xcc},
727 {0xb3, 0x01, 0x41, 0xcc},
728 {0xb8, 0x8e, 0x00, 0xcc},
729 {0xb8, 0x8f, 0xff, 0xcc},
730 {0xb6, 0x12, 0xf8, 0xcc},
731 {0xb8, 0x0c, 0x20, 0xcc},
732 {0xb8, 0x0d, 0x70, 0xcc},
733 {0xb6, 0x13, 0x13, 0xcc},
734 {0x2f, 0x00, 0xC0, 0xbb},
735 {0xb8, 0xa0, 0x12, 0xcc},
736 {}
737};
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300738
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300739static const __u8 mi1320_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300740 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
741 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
742};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300743static const __u8 mi1320_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300744 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52
745};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300746static const __u8 mi1320_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300747 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
748 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
749 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
750 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
751 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
752 {0xb3, 0x06, 0x00, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
753 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
754 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
755 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
756 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
757 {0xb3, 0x22, 0x03, 0xcc}, {0xb3, 0x23, 0xc0, 0xcc},
758 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
759 {0xb3, 0x16, 0x04, 0xcc}, {0xb3, 0x17, 0xff, 0xcc},
760 {0xb3, 0x00, 0x67, 0xcc}, {0xbc, 0x00, 0xd0, 0xcc},
761 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
762 {0x0d, 0x00, 0x09, 0xbb}, {0x00, 0x01, 0x00, 0xdd},
763 {0x0d, 0x00, 0x08, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
764 {0xa1, 0x05, 0x00, 0xbb}, {0xa4, 0x03, 0xc0, 0xbb},
765 {0xf0, 0x00, 0x02, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
766 {0xc8, 0x9f, 0x0b, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
767 {0xf0, 0x00, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
768 {0x20, 0x01, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
769 {0xf0, 0x00, 0x01, 0xbb}, {0x9d, 0x3c, 0xa0, 0xbb},
770 {0x47, 0x30, 0x30, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
771 {0x0a, 0x80, 0x11, 0xbb}, {0x35, 0x00, 0x22, 0xbb},
772 {0xf0, 0x00, 0x02, 0xbb}, {0x9d, 0xc5, 0x05, 0xbb},
773 {0xdc, 0x0f, 0xfc, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
774 {0x06, 0x74, 0x0e, 0xbb}, {0x80, 0x00, 0x06, 0xbb},
775 {0x81, 0x04, 0x00, 0xbb}, {0x82, 0x01, 0x02, 0xbb},
776 {0x83, 0x03, 0x02, 0xbb}, {0x84, 0x05, 0x00, 0xbb},
777 {0x85, 0x01, 0x00, 0xbb}, {0x86, 0x03, 0x02, 0xbb},
778 {0x87, 0x05, 0x00, 0xbb}, {0x88, 0x01, 0x00, 0xbb},
779 {0x89, 0x02, 0x02, 0xbb}, {0x8a, 0xfd, 0x04, 0xbb},
780 {0x8b, 0xfc, 0xfd, 0xbb}, {0x8c, 0xff, 0xfd, 0xbb},
781 {0x8d, 0x00, 0x00, 0xbb}, {0x8e, 0xfe, 0x05, 0xbb},
782 {0x8f, 0xfc, 0xfd, 0xbb}, {0x90, 0xfe, 0xfd, 0xbb},
783 {0x91, 0x00, 0x00, 0xbb}, {0x92, 0xfe, 0x03, 0xbb},
784 {0x93, 0xfd, 0xfe, 0xbb}, {0x94, 0xff, 0xfd, 0xbb},
785 {0x95, 0x00, 0x00, 0xbb}, {0xb6, 0x07, 0x05, 0xbb},
786 {0xb7, 0x13, 0x06, 0xbb}, {0xb8, 0x08, 0x06, 0xbb},
787 {0xb9, 0x14, 0x08, 0xbb}, {0xba, 0x06, 0x05, 0xbb},
788 {0xbb, 0x13, 0x06, 0xbb}, {0xbc, 0x03, 0x01, 0xbb},
789 {0xbd, 0x03, 0x04, 0xbb}, {0xbe, 0x00, 0x02, 0xbb},
790 {0xbf, 0x03, 0x01, 0xbb}, {0xc0, 0x02, 0x04, 0xbb},
791 {0xc1, 0x00, 0x04, 0xbb}, {0xc2, 0x02, 0x01, 0xbb},
792 {0xc3, 0x01, 0x03, 0xbb}, {0xc4, 0x00, 0x04, 0xbb},
793 {0xf0, 0x00, 0x00, 0xbb}, {0x05, 0x01, 0x13, 0xbb},
794 {0x06, 0x00, 0x11, 0xbb}, {0x07, 0x00, 0x85, 0xbb},
795 {0x08, 0x00, 0x27, 0xbb}, {0x20, 0x01, 0x03, 0xbb},
796 {0x21, 0x80, 0x00, 0xbb}, {0x22, 0x0d, 0x0f, 0xbb},
797 {0x24, 0x80, 0x00, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
798 {0xf0, 0x00, 0x02, 0xbb}, {0x39, 0x03, 0x0d, 0xbb},
799 {0x3a, 0x06, 0x1b, 0xbb}, {0x3b, 0x00, 0x95, 0xbb},
800 {0x3c, 0x04, 0xdb, 0xbb}, {0x57, 0x02, 0x00, 0xbb},
801 {0x58, 0x02, 0x66, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
802 {0x5a, 0x01, 0x33, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
803 {0x5d, 0x16, 0x11, 0xbb}, {0x64, 0x5e, 0x1c, 0xbb},
804 {0xf0, 0x00, 0x02, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
805 {0x5b, 0x00, 0x01, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
806 {0x36, 0x68, 0x10, 0xbb}, {0x00, 0x00, 0x30, 0xdd},
807 {0x37, 0x82, 0x00, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
808 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
809 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
810 {0xb6, 0x03, 0x05, 0xcc}, {0xb6, 0x02, 0x00, 0xcc},
811 {0xb6, 0x05, 0x04, 0xcc}, {0xb6, 0x04, 0x00, 0xcc},
812 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x29, 0xcc},
813 {0xb6, 0x18, 0x0a, 0xcc}, {0xb6, 0x17, 0x00, 0xcc},
814 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
815 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x26, 0xcc},
816 {0xbf, 0xc1, 0x02, 0xcc}, {0xbf, 0xcc, 0x04, 0xcc},
817 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
818 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
819 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
820 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
821 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
822 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
823 {}
824};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300825static const __u8 mi1320_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300826 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
827 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
828 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
829 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
830 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x01, 0xcc},
831 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
832 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
833 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
834 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
835 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
836 {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
837 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
838 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
839 {0xb3, 0x00, 0x65, 0xcc}, {0xb8, 0x00, 0x00, 0xcc},
840 {0xbc, 0x00, 0xd0, 0xcc}, {0xbc, 0x01, 0x01, 0xcc},
841 {0xf0, 0x00, 0x00, 0xbb}, {0x0d, 0x00, 0x09, 0xbb},
842 {0x00, 0x01, 0x00, 0xdd}, {0x0d, 0x00, 0x08, 0xbb},
843 {0xf0, 0x00, 0x00, 0xbb}, {0x02, 0x00, 0x64, 0xbb},
844 {0x05, 0x01, 0x78, 0xbb}, {0x06, 0x00, 0x11, 0xbb},
845 {0x07, 0x01, 0x42, 0xbb}, {0x08, 0x00, 0x11, 0xbb},
846 {0x20, 0x01, 0x00, 0xbb}, {0x21, 0x80, 0x00, 0xbb},
847 {0x22, 0x0d, 0x0f, 0xbb}, {0x24, 0x80, 0x00, 0xbb},
848 {0x59, 0x00, 0xff, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
849 {0x9d, 0x3c, 0xa0, 0xbb}, {0x47, 0x30, 0x30, 0xbb},
850 {0xf0, 0x00, 0x00, 0xbb}, {0x0a, 0x80, 0x11, 0xbb},
851 {0x35, 0x00, 0x22, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
852 {0x9d, 0xc5, 0x05, 0xbb}, {0xdc, 0x0f, 0xfc, 0xbb},
853 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0x74, 0x0e, 0xbb},
854 {0x80, 0x00, 0x06, 0xbb}, {0x81, 0x04, 0x00, 0xbb},
855 {0x82, 0x01, 0x02, 0xbb}, {0x83, 0x03, 0x02, 0xbb},
856 {0x84, 0x05, 0x00, 0xbb}, {0x85, 0x01, 0x00, 0xbb},
857 {0x86, 0x03, 0x02, 0xbb}, {0x87, 0x05, 0x00, 0xbb},
858 {0x88, 0x01, 0x00, 0xbb}, {0x89, 0x02, 0x02, 0xbb},
859 {0x8a, 0xfd, 0x04, 0xbb}, {0x8b, 0xfc, 0xfd, 0xbb},
860 {0x8c, 0xff, 0xfd, 0xbb}, {0x8d, 0x00, 0x00, 0xbb},
861 {0x8e, 0xfe, 0x05, 0xbb}, {0x8f, 0xfc, 0xfd, 0xbb},
862 {0x90, 0xfe, 0xfd, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
863 {0x92, 0xfe, 0x03, 0xbb}, {0x93, 0xfd, 0xfe, 0xbb},
864 {0x94, 0xff, 0xfd, 0xbb}, {0x95, 0x00, 0x00, 0xbb},
865 {0xb6, 0x07, 0x05, 0xbb}, {0xb7, 0x13, 0x06, 0xbb},
866 {0xb8, 0x08, 0x06, 0xbb}, {0xb9, 0x14, 0x08, 0xbb},
867 {0xba, 0x06, 0x05, 0xbb}, {0xbb, 0x13, 0x06, 0xbb},
868 {0xbc, 0x03, 0x01, 0xbb}, {0xbd, 0x03, 0x04, 0xbb},
869 {0xbe, 0x00, 0x02, 0xbb}, {0xbf, 0x03, 0x01, 0xbb},
870 {0xc0, 0x02, 0x04, 0xbb}, {0xc1, 0x00, 0x04, 0xbb},
871 {0xc2, 0x02, 0x01, 0xbb}, {0xc3, 0x01, 0x03, 0xbb},
872 {0xc4, 0x00, 0x04, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
873 {0xc8, 0x00, 0x00, 0xbb}, {0x2e, 0x00, 0x00, 0xbb},
874 {0x2e, 0x0c, 0x5b, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
875 {0x39, 0x03, 0xca, 0xbb}, {0x3a, 0x06, 0x80, 0xbb},
876 {0x3b, 0x01, 0x52, 0xbb}, {0x3c, 0x05, 0x40, 0xbb},
877 {0x57, 0x01, 0x9c, 0xbb}, {0x58, 0x01, 0xee, 0xbb},
878 {0x59, 0x00, 0xf0, 0xbb}, {0x5a, 0x01, 0x20, 0xbb},
879 {0x5c, 0x1d, 0x17, 0xbb}, {0x5d, 0x22, 0x1c, 0xbb},
880 {0x64, 0x1e, 0x1c, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
881 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x68, 0x10, 0xbb},
882 {0x00, 0x00, 0x30, 0xdd}, {0x37, 0x81, 0x00, 0xbb},
883 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
884 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
885 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
886 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
887 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
888 {0xbf, 0xc0, 0x26, 0xcc}, {0xbf, 0xc1, 0x02, 0xcc},
889 {0xbf, 0xcc, 0x04, 0xcc}, {0xb3, 0x5c, 0x01, 0xcc},
890 {0xb3, 0x01, 0x41, 0xcc},
891 {}
892};
893
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300894static const __u8 po3130_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300895 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
896 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
897};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300898static const __u8 po3130_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300899 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
900};
901
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300902static const __u8 po3130_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300903 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
904 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
905 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
906 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
907 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
908 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
909 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
910 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
911 {0xb3, 0x23, 0xe8, 0xcc}, {0xb8, 0x08, 0xe8, 0xcc},
912 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
913 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
914 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
915 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0x71, 0xcc},
916 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
917 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
918 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
919 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
920 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
921 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
922 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
923 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
924 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
925 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
926 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
927 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
928 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
929 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
930 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
931 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
932 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
933 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
934 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
935 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
936 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
937 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
938 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
939 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
940 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
941 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
942 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
943 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
944 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
945 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
946 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
947 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
948 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
949 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
950 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
951 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
952 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
953 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
954 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
955 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
956 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
957 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
958 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
959 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
960 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
961 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
962 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
963 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
964 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
965 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
966 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
967 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
968 {0x00, 0x7e, 0xea, 0xaa},
969 {0x00, 0x4c, 0x07, 0xaa},
970 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
971 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
972/* {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
973 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc}, */
974 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
975 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
976 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
977 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
978 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
979 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
980 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
981 {0xb9, 0x08, 0x3c, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
982 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
983 {}
984};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -0300985static const __u8 po3130_rundata[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -0300986 {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa},
987 {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa},
988 {0x00, 0x44, 0x40, 0xaa},
989/* {0x00, 0xd5, 0x7c, 0xaa}, */
990 {0x00, 0xad, 0x04, 0xaa}, {0x00, 0xae, 0x00, 0xaa},
991 {0x00, 0xb0, 0x78, 0xaa}, {0x00, 0x98, 0x02, 0xaa},
992 {0x00, 0x94, 0x25, 0xaa}, {0x00, 0x95, 0x25, 0xaa},
993 {0x00, 0x59, 0x68, 0xaa}, {0x00, 0x44, 0x20, 0xaa},
994 {0x00, 0x17, 0x50, 0xaa}, {0x00, 0x19, 0x50, 0xaa},
995 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0xd1, 0x3c, 0xaa},
996 {0x00, 0x1e, 0x06, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
997 {}
998};
999
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001000static const __u8 po3130_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001001 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1002 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc},
1003 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
1004 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1005 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1006 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
1007 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1008 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1009 {0xb3, 0x23, 0xe0, 0xcc}, {0xb8, 0x08, 0xe0, 0xcc},
1010 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1011 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1012 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
1013 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1014 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
1015 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1016 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1017 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1018 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
1019 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
1020 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1021 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1022 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
1023 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
1024 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
1025 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1026 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
1027 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
1028 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
1029 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
1030 {0x00, 0x59, 0x6f, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
1031 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
1032 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
1033 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
1034 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
1035 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
1036 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
1037 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
1038 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
1039 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
1040 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
1041 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
1042 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
1043 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
1044 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
1045 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
1046 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
1047 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1048 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1049 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1050 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1051 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1052 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1053 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
1054 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
1055 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
1056 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
1057 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
1058 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
1059 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
1060 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1061 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1062 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1063 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1064 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1065 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1066 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0x4c, 0x07, 0xaa},
1067 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
1068 {0x00, 0x59, 0x66, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
1069 {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1070 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1071 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1072 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1073 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1074 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1075 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1076 {0xb9, 0x08, 0x3c, 0xcc}, {0xbc, 0x02, 0x18, 0xcc},
1077 {0xbc, 0x03, 0x50, 0xcc}, {0xbc, 0x04, 0x18, 0xcc},
1078 {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
1079 {0xbc, 0x08, 0x30, 0xcc}, {0xbc, 0x09, 0x40, 0xcc},
1080 {0xbc, 0x0a, 0x10, 0xcc}, {0xbc, 0x0b, 0x00, 0xcc},
1081 {0xbc, 0x0c, 0x00, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
1082 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1083 {}
1084};
1085
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001086static const __u8 hv7131r_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001087/* 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1088 * 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff */
1089 0x04, 0x1a, 0x36, 0x55, 0x6f, 0x87, 0x9d, 0xb0, 0xc1,
1090 0xcf, 0xda, 0xe4, 0xec, 0xf3, 0xf8, 0xfd, 0xff
1091};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001092static const __u8 hv7131r_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001093 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1094};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001095static const __u8 hv7131r_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001096 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1097 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1098 {0xb3, 0x00, 0x24, 0xcc},
1099 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1100 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1101 {0xb3, 0x06, 0x01, 0xcc},
1102 {0xb3, 0x01, 0x45, 0xcc}, {0xb3, 0x03, 0x0b, 0xcc},
1103 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1104 {0xb3, 0x21, 0x00, 0xcc},
1105 {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
1106 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1107 {0xb3, 0x16, 0x02, 0xcc},
1108 {0xb3, 0x17, 0x7f, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1109 {0xb3, 0x35, 0x91, 0xcc}, {0xb3, 0x00, 0x27, 0xcc},
1110 {0xbc, 0x00, 0x73, 0xcc},
1111 {0xb8, 0x00, 0x23, 0xcc}, {0x00, 0x01, 0x0c, 0xaa},
1112 {0x00, 0x14, 0x01, 0xaa}, {0x00, 0x15, 0xe6, 0xaa},
1113 {0x00, 0x16, 0x02, 0xaa},
1114 {0x00, 0x17, 0x86, 0xaa}, {0x00, 0x23, 0x00, 0xaa},
1115 {0x00, 0x25, 0x09, 0xaa}, {0x00, 0x26, 0x27, 0xaa},
1116 {0x00, 0x27, 0xc0, 0xaa},
1117 {0xb8, 0x2c, 0x60, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1118 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1119 {0xb8, 0x30, 0x50, 0xcc},
1120 {0xb8, 0x31, 0xf8, 0xcc}, {0xb8, 0x32, 0xf8, 0xcc},
1121 {0xb8, 0x33, 0xf8, 0xcc}, {0xb8, 0x34, 0x65, 0xcc},
1122 {0xb8, 0x35, 0x00, 0xcc},
1123 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1124 {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x01, 0x7d, 0xcc},
1125 {0xb8, 0x81, 0x09, 0xcc},
1126 {0xb3, 0x01, 0x41, 0xcc}, {0xb8, 0xfe, 0x00, 0xcc},
1127 {0xb8, 0xff, 0x28, 0xcc}, {0xb9, 0x00, 0x28, 0xcc},
1128 {0xb9, 0x01, 0x28, 0xcc},
1129 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1130 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1131 {0xb9, 0x06, 0x3c, 0xcc},
1132 {0xb9, 0x07, 0x3c, 0xcc}, {0xb9, 0x08, 0x3c, 0xcc},
1133 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1134 {0x00, 0x30, 0x18, 0xaa},
1135 {}
1136};
1137
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001138static const __u8 hv7131r_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001139 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1140 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1141 {0xb3, 0x00, 0x24, 0xcc},
1142 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1143 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1144 {0xb3, 0x06, 0x01, 0xcc},
1145 {0xb3, 0x03, 0x0b, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1146 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
1147 {0xb3, 0x22, 0x01, 0xcc},
1148 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x14, 0x00, 0xcc},
1149 {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x02, 0xcc},
1150 {0xb3, 0x17, 0x7f, 0xcc},
1151 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0x91, 0xcc},
1152 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1153 {0xb8, 0x00, 0x21, 0xcc},
1154 {0x00, 0x01, 0x0c, 0xaa}, {0x00, 0x14, 0x01, 0xaa},
1155 {0x00, 0x15, 0xe6, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
1156 {0x00, 0x17, 0x86, 0xaa},
1157 {0x00, 0x23, 0x00, 0xaa}, {0x00, 0x25, 0x01, 0xaa},
1158 {0x00, 0x26, 0xd4, 0xaa}, {0x00, 0x27, 0xc0, 0xaa},
1159 {0xbc, 0x02, 0x08, 0xcc},
1160 {0xbc, 0x03, 0x70, 0xcc}, {0xbc, 0x04, 0x08, 0xcc},
1161 {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
1162 {0xbc, 0x08, 0x3c, 0xcc},
1163 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x04, 0xcc},
1164 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
1165 {0xb8, 0xfe, 0x02, 0xcc},
1166 {0xb8, 0xff, 0x07, 0xcc}, {0xb9, 0x00, 0x14, 0xcc},
1167 {0xb9, 0x01, 0x14, 0xcc}, {0xb9, 0x02, 0x14, 0xcc},
1168 {0xb9, 0x03, 0x00, 0xcc},
1169 {0xb9, 0x04, 0x02, 0xcc}, {0xb9, 0x05, 0x05, 0xcc},
1170 {0xb9, 0x06, 0x0f, 0xcc}, {0xb9, 0x07, 0x0f, 0xcc},
1171 {0xb9, 0x08, 0x0f, 0xcc},
1172 {0xb8, 0x2c, 0x60, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1173 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1174 {0xb8, 0x30, 0x50, 0xcc},
1175 {0xb8, 0x31, 0xf8, 0xcc}, {0xb8, 0x32, 0xf8, 0xcc},
1176 {0xb8, 0x33, 0xf8, 0xcc},
1177 {0xb8, 0x34, 0x65, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1178 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1179 {0xb8, 0x27, 0x20, 0xcc},
1180 {0xb8, 0x01, 0x7d, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1181 {0xb3, 0x01, 0x41, 0xcc}, {0xb8, 0xfe, 0x00, 0xcc},
1182 {0xb8, 0xff, 0x28, 0xcc},
1183 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1184 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1185 {0xb9, 0x04, 0x00, 0xcc},
1186 {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
1187 {0xb9, 0x07, 0x3c, 0xcc}, {0xb9, 0x08, 0x3c, 0xcc},
1188 {0xb8, 0x8e, 0x00, 0xcc},
1189 {0xb8, 0x8f, 0xff, 0xcc}, {0x00, 0x30, 0x18, 0xaa},
1190 {}
1191};
1192
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001193static const __u8 ov7660_gamma[17] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001194 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1195 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1196};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001197static const __u8 ov7660_matrix[9] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001198 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62
1199};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001200static const __u8 ov7660_initVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001201 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1202 {0x00, 0x00, 0x50, 0xdd},
1203 {0xb0, 0x03, 0x01, 0xcc},
1204 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1205 {0xb3, 0x05, 0x01, 0xcc},
1206 {0xb3, 0x06, 0x03, 0xcc},
1207 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1208 {0xb3, 0x05, 0x00, 0xcc},
1209 {0xb3, 0x06, 0x01, 0xcc},
1210 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1211 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1212 {0xb3, 0x21, 0x00, 0xcc},
1213 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1214 {0xb3, 0x1f, 0x02, 0xcc},
1215 {0xb3, 0x34, 0x01, 0xcc},
1216 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1217 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1218 {0xb8, 0x01, 0x7d, 0xcc},
1219 {0xbc, 0x00, 0x73, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1220 {0xb8, 0x27, 0x20, 0xcc},
1221 {0xb8, 0x8f, 0x50, 0xcc},
1222 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1223 {0x00, 0x12, 0x80, 0xaa},
1224 {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001225 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001226 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1227 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1228 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1229 {0x00, 0x13, 0xa7, 0xaa},
1230 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1231 {0x00, 0x36, 0x00, 0xaa},
1232 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1233 {0x00, 0x39, 0x43, 0xaa},
1234 {0x00, 0x8d, 0xcf, 0xaa},
1235 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1236 {0x00, 0x0f, 0x62, 0xaa},
1237 {0x00, 0x35, 0x84, 0xaa},
1238 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1239 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1240 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1241 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1242 {0x00, 0x01, 0x80, 0xaa},
1243 {0x00, 0x02, 0x80, 0xaa},
1244 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1245 {0xb9, 0x00, 0x28, 0xcc},
1246 {0xb9, 0x01, 0x28, 0xcc}, {0xb9, 0x02, 0x28, 0xcc},
1247 {0xb9, 0x03, 0x00, 0xcc},
1248 {0xb9, 0x04, 0x00, 0xcc},
1249 {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
1250 {0xb9, 0x07, 0x3c, 0xcc},
1251 {0xb9, 0x08, 0x3c, 0xcc},
1252
1253 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1254
1255 {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc},
1256 {}
1257};
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001258static const __u8 ov7660_initQVGA_data[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001259 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1260 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1261 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1262 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x03, 0xcc},
1263 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1264 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1265 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1266 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1267 {0xb3, 0x21, 0x00, 0xcc},
1268 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1269 {0xb3, 0x1f, 0x02, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1270 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1271 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1272 {0xb8, 0x01, 0x7d, 0xcc},
1273/* sizer */
1274 {0xbc, 0x00, 0xd3, 0xcc},
1275 {0xb8, 0x81, 0x09, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1276 {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x8f, 0x50, 0xcc},
1277 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1278 {0x00, 0x12, 0x80, 0xaa}, {0x00, 0x12, 0x05, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001279 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001280 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1281 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1282 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1283 {0x00, 0x13, 0xa7, 0xaa},
1284 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1285 {0x00, 0x36, 0x00, 0xaa},
1286 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1287 {0x00, 0x39, 0x43, 0xaa}, {0x00, 0x8d, 0xcf, 0xaa},
1288 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1289 {0x00, 0x0f, 0x62, 0xaa}, {0x00, 0x35, 0x84, 0xaa},
1290 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1291 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1292 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1293 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1294 {0x00, 0x01, 0x80, 0xaa},
1295 {0x00, 0x02, 0x80, 0xaa},
1296/* sizer filters */
1297 {0xbc, 0x02, 0x08, 0xcc},
1298 {0xbc, 0x03, 0x70, 0xcc},
1299 {0xb8, 0x35, 0x00, 0xcc},
1300 {0xb8, 0x36, 0x00, 0xcc},
1301 {0xb8, 0x37, 0x00, 0xcc},
1302 {0xbc, 0x04, 0x08, 0xcc},
1303 {0xbc, 0x05, 0x00, 0xcc},
1304 {0xbc, 0x06, 0x00, 0xcc},
1305 {0xbc, 0x08, 0x3c, 0xcc},
1306 {0xbc, 0x09, 0x40, 0xcc},
1307 {0xbc, 0x0a, 0x04, 0xcc},
1308 {0xbc, 0x0b, 0x00, 0xcc},
1309 {0xbc, 0x0c, 0x00, 0xcc},
1310/* */
1311 {0xb8, 0xfe, 0x00, 0xcc},
1312 {0xb8, 0xff, 0x28, 0xcc},
1313/* */
1314 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1315 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1316 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1317 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1318 {0xb9, 0x08, 0x3c, 0xcc},
1319/* */
1320 {0xb8, 0x8e, 0x00, 0xcc},
1321 {0xb8, 0x8f, 0xff, 0xcc}, /* ff */
1322 {0x00, 0x29, 0x3c, 0xaa},
1323 {0xb3, 0x01, 0x45, 0xcc}, /* 45 */
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001324 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001325};
1326
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001327static const __u8 ov7660_50HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001328 {0x00, 0x3b, 0x08, 0xaa},
1329 {0x00, 0x9d, 0x40, 0xaa},
1330 {0x00, 0x13, 0xa7, 0xaa},
Jean-Francois Moine1ff1e482008-07-17 09:37:57 -03001331 {}
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001332};
1333
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001334static const __u8 ov7660_60HZ[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001335 {0x00, 0x3b, 0x00, 0xaa},
1336 {0x00, 0x9e, 0x40, 0xaa},
1337 {0x00, 0x13, 0xa7, 0xaa},
1338 {}
1339};
1340
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001341static const __u8 ov7660_NoFliker[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001342 {0x00, 0x13, 0x87, 0xaa},
1343 {}
1344};
1345
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001346static const __u8 ov7670_initVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001347 {0xb3, 0x01, 0x05, 0xcc},
1348 {0x00, 0x00, 0x30, 0xdd}, {0xb0, 0x03, 0x19, 0xcc},
1349 {0x00, 0x00, 0x10, 0xdd},
1350 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1351 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
1352 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1353 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1354 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
1355 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
1356 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1357 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1358 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1359 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1360 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0x41, 0xcc},
1361 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
1362 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
1363 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
1364 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1365 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
1366 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
1367 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
1368 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
1369 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
1370 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
1371 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
1372 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
1373 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
1374 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
1375 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
1376 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
1377 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
1378 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
1379 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
1380 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
1381 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
1382 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
1383 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
1384 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001385 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
1386 {0x00, 0x21, 0x02, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001387 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
1388 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
1389 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
1390 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
1391 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
1392 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
1393 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
1394 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
1395 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
1396 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
1397 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
1398 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
1399 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
1400 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
1401 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
1402 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
1403 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
1404 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
1405 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
1406 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
1407 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
1408 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
1409 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
1410 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
1411 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
1412 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
1413 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
1414 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
1415 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1416 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
1417 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1418 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
1419 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1420 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
1421 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1422 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
1423 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
1424 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
1425 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
1426 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
1427 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
1428 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
1429 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
1430 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
1431 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
1432 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
1433 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
1434 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
1435 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
1436 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
1437 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
1438 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
1439 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
1440 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
1441 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
1442 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1443 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
1444 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
1445 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
1446 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
1447 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
1448 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
1449 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
1450 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001451 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
1452 {0x00, 0xaa, 0x14, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001453 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
1454 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
1455 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
1456 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1457 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
1458 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1459 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
1460 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1461 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
1462 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1463 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
1464 {0xb6, 0x03, 0x02, 0xcc}, {0xb6, 0x02, 0x80, 0xcc},
1465 {0xb6, 0x05, 0x01, 0xcc}, {0xb6, 0x04, 0xe0, 0xcc},
1466 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x13, 0xcc},
1467 {0xb6, 0x18, 0x02, 0xcc}, {0xb6, 0x17, 0x58, 0xcc},
1468 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
1469 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
1470 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
1471 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
1472 {0x00, 0x77, 0x05, 0xaa},
1473 {},
1474};
1475
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001476static const __u8 ov7670_initQVGA_JPG[][4] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001477 {0xb3, 0x01, 0x05, 0xcc}, {0x00, 0x00, 0x30, 0xdd},
1478 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1479 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1480 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
1481 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1482 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1483 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
1484 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
1485 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1486 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1487 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1488 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1489 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1490 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
1491 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
1492 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
1493 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1494 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
1495 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
1496 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
1497 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
1498 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
1499 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
1500 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
1501 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
1502 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
1503 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
1504 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
1505 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
1506 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
1507 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
1508 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
1509 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
1510 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
1511 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
1512 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
1513 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001514 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
1515 {0x00, 0x21, 0x02, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001516 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
1517 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
1518 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
1519 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
1520 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
1521 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
1522 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
1523 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
1524 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
1525 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
1526 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
1527 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
1528 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
1529 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
1530 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
1531 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
1532 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
1533 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
1534 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
1535 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
1536 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
1537 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
1538 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
1539 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
1540 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
1541 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
1542 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
1543 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
1544 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1545 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
1546 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1547 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
1548 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1549 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
1550 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1551 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
1552 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
1553 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
1554 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
1555 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
1556 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
1557 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
1558 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
1559 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
1560 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
1561 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
1562 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
1563 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
1564 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
1565 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
1566 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
1567 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
1568 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
1569 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
1570 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
1571 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1572 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
1573 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
1574 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
1575 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
1576 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
1577 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
1578 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
1579 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03001580 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
1581 {0x00, 0xaa, 0x14, 0xaa},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001582 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
1583 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
1584 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
1585 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
1586 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
1587 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
1588 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
1589 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
1590 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
1591 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
1592 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
1593 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
1594 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
1595 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x21, 0xcc},
1596 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
1597 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
1598 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
1599 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
1600 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
1601 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
1602 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
1603 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
1604 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
1605 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
1606 {0x00, 0x77, 0x05, 0xaa },
1607 {},
1608};
Jean-Francois Moine88521532008-12-10 05:06:13 -03001609
1610/* PO1200 - values from usbvm326.inf and ms-win trace */
1611static const __u8 po1200_gamma[17] = {
1612 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1613 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1614};
1615static const __u8 po1200_matrix[9] = {
1616 0x60, 0xf9, 0xe5, 0xe7, 0x50, 0x05, 0xf3, 0xe6, 0x5e
1617};
1618static const __u8 po1200_initVGA_data[][4] = {
1619 {0xb0, 0x03, 0x19, 0xcc}, /* reset? */
1620 {0xb0, 0x03, 0x19, 0xcc},
1621/* {0x00, 0x00, 0x33, 0xdd}, */
1622 {0xb0, 0x04, 0x02, 0xcc},
1623 {0xb0, 0x02, 0x02, 0xcc},
1624 {0xb3, 0x5d, 0x00, 0xcc},
1625 {0xb3, 0x01, 0x01, 0xcc},
1626 {0xb3, 0x00, 0x64, 0xcc},
1627 {0xb3, 0x00, 0x65, 0xcc},
1628 {0xb3, 0x05, 0x01, 0xcc},
1629 {0xb3, 0x06, 0x01, 0xcc},
1630 {0xb3, 0x5c, 0x01, 0xcc},
1631 {0xb3, 0x08, 0x01, 0xcc},
1632 {0xb3, 0x09, 0x0c, 0xcc},
1633 {0xb3, 0x00, 0x67, 0xcc},
1634 {0xb3, 0x02, 0xb2, 0xcc},
1635 {0xb3, 0x03, 0x18, 0xcc},
1636 {0xb3, 0x04, 0x15, 0xcc},
1637 {0xb3, 0x20, 0x00, 0xcc},
1638 {0xb3, 0x21, 0x00, 0xcc},
1639 {0xb3, 0x22, 0x02, 0xcc},
1640 {0xb3, 0x23, 0x58, 0xcc},
1641 {0xb3, 0x14, 0x00, 0xcc},
1642 {0xb3, 0x15, 0x00, 0xcc},
1643 {0xb3, 0x16, 0x03, 0xcc},
1644 {0xb3, 0x17, 0x1f, 0xcc},
1645 {0xbc, 0x00, 0x71, 0xcc},
1646 {0xbc, 0x01, 0x01, 0xcc},
1647 {0xb0, 0x54, 0x13, 0xcc},
1648 {0xb3, 0x00, 0x67, 0xcc},
1649 {0xb3, 0x34, 0x01, 0xcc},
1650 {0xb3, 0x35, 0xdc, 0xcc},
1651 {0x00, 0x03, 0x00, 0xaa},
1652 {0x00, 0x12, 0x05, 0xaa},
1653 {0x00, 0x13, 0x02, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001654 {0x00, 0x1e, 0xc6, 0xaa}, /* h/v flip */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001655 {0x00, 0x21, 0x00, 0xaa},
1656 {0x00, 0x25, 0x02, 0xaa},
1657 {0x00, 0x3c, 0x4f, 0xaa},
1658 {0x00, 0x3f, 0xe0, 0xaa},
1659 {0x00, 0x42, 0xff, 0xaa},
1660 {0x00, 0x45, 0x34, 0xaa},
1661 {0x00, 0x55, 0xfe, 0xaa},
1662 {0x00, 0x59, 0xd3, 0xaa},
1663 {0x00, 0x5e, 0x04, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001664 {0x00, 0x61, 0xb8, 0xaa}, /* sharpness */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001665 {0x00, 0x62, 0x02, 0xaa},
1666 {0x00, 0xa7, 0x31, 0xaa},
1667 {0x00, 0xa9, 0x66, 0xaa},
1668 {0x00, 0xb0, 0x00, 0xaa},
1669 {0x00, 0xb1, 0x00, 0xaa},
1670 {0x00, 0xb3, 0x11, 0xaa},
1671 {0x00, 0xb6, 0x26, 0xaa},
1672 {0x00, 0xb7, 0x20, 0xaa},
1673 {0x00, 0xba, 0x04, 0xaa},
1674 {0x00, 0x88, 0x42, 0xaa},
1675 {0x00, 0x89, 0x9a, 0xaa},
1676 {0x00, 0x8a, 0x88, 0xaa},
1677 {0x00, 0x8b, 0x8e, 0xaa},
1678 {0x00, 0x8c, 0x3e, 0xaa},
1679 {0x00, 0x8d, 0x90, 0xaa},
1680 {0x00, 0x8e, 0x87, 0xaa},
1681 {0x00, 0x8f, 0x96, 0xaa},
1682 {0x00, 0x90, 0x3d, 0xaa},
1683 {0x00, 0x64, 0x00, 0xaa},
1684 {0x00, 0x65, 0x10, 0xaa},
1685 {0x00, 0x66, 0x20, 0xaa},
1686 {0x00, 0x67, 0x2b, 0xaa},
1687 {0x00, 0x68, 0x36, 0xaa},
1688 {0x00, 0x69, 0x49, 0xaa},
1689 {0x00, 0x6a, 0x5a, 0xaa},
1690 {0x00, 0x6b, 0x7f, 0xaa},
1691 {0x00, 0x6c, 0x9b, 0xaa},
1692 {0x00, 0x6d, 0xba, 0xaa},
1693 {0x00, 0x6e, 0xd4, 0xaa},
1694 {0x00, 0x6f, 0xea, 0xaa},
1695 {0x00, 0x70, 0x00, 0xaa},
1696 {0x00, 0x71, 0x10, 0xaa},
1697 {0x00, 0x72, 0x20, 0xaa},
1698 {0x00, 0x73, 0x2b, 0xaa},
1699 {0x00, 0x74, 0x36, 0xaa},
1700 {0x00, 0x75, 0x49, 0xaa},
1701 {0x00, 0x76, 0x5a, 0xaa},
1702 {0x00, 0x77, 0x7f, 0xaa},
1703 {0x00, 0x78, 0x9b, 0xaa},
1704 {0x00, 0x79, 0xba, 0xaa},
1705 {0x00, 0x7a, 0xd4, 0xaa},
1706 {0x00, 0x7b, 0xea, 0xaa},
1707 {0x00, 0x7c, 0x00, 0xaa},
1708 {0x00, 0x7d, 0x10, 0xaa},
1709 {0x00, 0x7e, 0x20, 0xaa},
1710 {0x00, 0x7f, 0x2b, 0xaa},
1711 {0x00, 0x80, 0x36, 0xaa},
1712 {0x00, 0x81, 0x49, 0xaa},
1713 {0x00, 0x82, 0x5a, 0xaa},
1714 {0x00, 0x83, 0x7f, 0xaa},
1715 {0x00, 0x84, 0x9b, 0xaa},
1716 {0x00, 0x85, 0xba, 0xaa},
1717 {0x00, 0x86, 0xd4, 0xaa},
1718 {0x00, 0x87, 0xea, 0xaa},
1719 {0x00, 0x57, 0x2a, 0xaa},
1720 {0x00, 0x03, 0x01, 0xaa},
1721 {0x00, 0x04, 0x10, 0xaa},
1722 {0x00, 0x05, 0x10, 0xaa},
1723 {0x00, 0x06, 0x10, 0xaa},
1724 {0x00, 0x07, 0x10, 0xaa},
1725 {0x00, 0x08, 0x13, 0xaa},
1726 {0x00, 0x0a, 0x00, 0xaa},
1727 {0x00, 0x0b, 0x10, 0xaa},
1728 {0x00, 0x0c, 0x20, 0xaa},
1729 {0x00, 0x0d, 0x18, 0xaa},
1730 {0x00, 0x22, 0x01, 0xaa},
1731 {0x00, 0x23, 0x60, 0xaa},
1732 {0x00, 0x25, 0x08, 0xaa},
1733 {0x00, 0x26, 0x82, 0xaa},
1734 {0x00, 0x2e, 0x0f, 0xaa},
1735 {0x00, 0x2f, 0x1e, 0xaa},
1736 {0x00, 0x30, 0x2d, 0xaa},
1737 {0x00, 0x31, 0x3c, 0xaa},
1738 {0x00, 0x32, 0x4b, 0xaa},
1739 {0x00, 0x33, 0x5a, 0xaa},
1740 {0x00, 0x34, 0x69, 0xaa},
1741 {0x00, 0x35, 0x78, 0xaa},
1742 {0x00, 0x36, 0x87, 0xaa},
1743 {0x00, 0x37, 0x96, 0xaa},
1744 {0x00, 0x38, 0xa5, 0xaa},
1745 {0x00, 0x39, 0xb4, 0xaa},
1746 {0x00, 0x3a, 0xc3, 0xaa},
1747 {0x00, 0x3b, 0xd2, 0xaa},
1748 {0x00, 0x3c, 0xe1, 0xaa},
1749 {0x00, 0x3e, 0xff, 0xaa},
1750 {0x00, 0x3f, 0xff, 0xaa},
1751 {0x00, 0x40, 0xff, 0xaa},
1752 {0x00, 0x41, 0xff, 0xaa},
1753 {0x00, 0x42, 0xff, 0xaa},
1754 {0x00, 0x43, 0xff, 0xaa},
1755 {0x00, 0x03, 0x00, 0xaa},
1756 {0x00, 0x03, 0x00, 0xaa},
1757 {0x00, 0x20, 0xc4, 0xaa},
1758 {0x00, 0x13, 0x03, 0xaa},
1759 {0x00, 0x3c, 0x50, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001760 {0x00, 0x61, 0x6a, 0xaa}, /* sharpness? */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001761 {0x00, 0x51, 0x5b, 0xaa},
1762 {0x00, 0x52, 0x91, 0xaa},
1763 {0x00, 0x53, 0x4c, 0xaa},
1764 {0x00, 0x54, 0x50, 0xaa},
1765 {0x00, 0x56, 0x02, 0xaa},
1766 {0xb6, 0x00, 0x00, 0xcc},
1767 {0xb6, 0x03, 0x03, 0xcc},
1768 {0xb6, 0x02, 0x20, 0xcc},
1769 {0xb6, 0x05, 0x02, 0xcc},
1770 {0xb6, 0x04, 0x58, 0xcc},
1771 {0xb6, 0x12, 0xf8, 0xcc},
1772 {0xb6, 0x13, 0x21, 0xcc},
1773 {0xb6, 0x18, 0x03, 0xcc},
1774 {0xb6, 0x17, 0xa9, 0xcc},
1775 {0xb6, 0x16, 0x80, 0xcc},
1776 {0xb6, 0x22, 0x12, 0xcc},
1777 {0xb6, 0x23, 0x0b, 0xcc},
1778 {0xbf, 0xc0, 0x39, 0xcc},
1779 {0xbf, 0xc1, 0x04, 0xcc},
1780 {0xbf, 0xcc, 0x00, 0xcc},
1781 {0xb8, 0x06, 0x20, 0xcc},
1782 {0xb8, 0x07, 0x03, 0xcc},
1783 {0xb8, 0x08, 0x58, 0xcc},
1784 {0xb8, 0x09, 0x02, 0xcc},
1785 {0xb3, 0x01, 0x41, 0xcc},
1786 {0x00, 0x03, 0x00, 0xaa},
1787 {0x00, 0xd9, 0x0f, 0xaa},
1788 {0x00, 0xda, 0xaa, 0xaa},
1789 {0x00, 0xd9, 0x10, 0xaa},
1790 {0x00, 0xda, 0xaa, 0xaa},
1791 {0x00, 0xd9, 0x11, 0xaa},
1792 {0x00, 0xda, 0x00, 0xaa},
1793 {0x00, 0xd9, 0x12, 0xaa},
1794 {0x00, 0xda, 0xff, 0xaa},
1795 {0x00, 0xd9, 0x13, 0xaa},
1796 {0x00, 0xda, 0xff, 0xaa},
1797 {0x00, 0xe8, 0x11, 0xaa},
1798 {0x00, 0xe9, 0x12, 0xaa},
1799 {0x00, 0xea, 0x5c, 0xaa},
1800 {0x00, 0xeb, 0xff, 0xaa},
1801 {0x00, 0xd8, 0x80, 0xaa},
1802 {0x00, 0xe6, 0x02, 0xaa},
1803 {0x00, 0xd6, 0x40, 0xaa},
1804 {0x00, 0xe3, 0x05, 0xaa},
1805 {0x00, 0xe0, 0x40, 0xaa},
1806 {0x00, 0xde, 0x03, 0xaa},
1807 {0x00, 0xdf, 0x03, 0xaa},
1808 {0x00, 0xdb, 0x02, 0xaa},
1809 {0x00, 0xdc, 0x00, 0xaa},
1810 {0x00, 0xdd, 0x03, 0xaa},
1811 {0x00, 0xe1, 0x08, 0xaa},
1812 {0x00, 0xe2, 0x01, 0xaa},
1813 {0x00, 0xd6, 0x40, 0xaa},
1814 {0x00, 0xe4, 0x40, 0xaa},
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03001815 {0x00, 0xa8, 0x8f, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03001816 {0x00, 0xb4, 0x16, 0xaa},
1817 {0xb0, 0x02, 0x06, 0xcc},
1818 {0xb0, 0x18, 0x06, 0xcc},
1819 {0xb0, 0x19, 0x06, 0xcc},
1820 {0xb3, 0x5d, 0x18, 0xcc},
1821 {0xb3, 0x05, 0x00, 0xcc},
1822 {0xb3, 0x06, 0x00, 0xcc},
1823 {0x00, 0xb4, 0x0e, 0xaa},
1824 {0x00, 0xb5, 0x49, 0xaa},
1825 {0x00, 0xb6, 0x1c, 0xaa},
1826 {0x00, 0xb7, 0x96, 0xaa},
1827/* end of usbvm326.inf - start of ms-win trace */
1828 {0xb6, 0x12, 0xf8, 0xcc},
1829 {0xb6, 0x13, 0x3d, 0xcc},
1830/*read b306*/
1831 {0x00, 0x03, 0x00, 0xaa},
1832 {0x00, 0x1a, 0x09, 0xaa},
1833 {0x00, 0x1b, 0x8a, 0xaa},
1834/*read b827*/
1835 {0xb8, 0x27, 0x00, 0xcc},
1836 {0xb8, 0x26, 0x60, 0xcc},
1837 {0xb8, 0x26, 0x60, 0xcc},
1838/*gamma - to do?*/
1839 {0x00, 0x03, 0x00, 0xaa},
1840 {0x00, 0xae, 0x84, 0xaa},
1841/*gamma again*/
1842 {0x00, 0x03, 0x00, 0xaa},
1843 {0x00, 0x96, 0xa0, 0xaa},
1844/*matrix*/
1845 {0x00, 0x03, 0x00, 0xaa},
1846 {0x00, 0x91, 0x35, 0xaa},
1847 {0x00, 0x92, 0x22, 0xaa},
1848/*gamma*/
1849 {0x00, 0x03, 0x00, 0xaa},
1850 {0x00, 0x95, 0x85, 0xaa},
1851/*matrix*/
1852 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03001853 {0x00, 0x4d, 0x20, 0xaa},
1854 {0xb8, 0x22, 0x40, 0xcc},
1855 {0xb8, 0x23, 0x40, 0xcc},
1856 {0xb8, 0x24, 0x40, 0xcc},
1857 {0xb8, 0x81, 0x09, 0xcc},
1858 {0x00, 0x00, 0x64, 0xdd},
1859 {0x00, 0x03, 0x01, 0xaa},
1860/*read 46*/
1861 {0x00, 0x46, 0x3c, 0xaa},
1862 {0x00, 0x03, 0x00, 0xaa},
1863 {0x00, 0x16, 0x40, 0xaa},
1864 {0x00, 0x17, 0x40, 0xaa},
1865 {0x00, 0x18, 0x40, 0xaa},
1866 {0x00, 0x19, 0x41, 0xaa},
1867 {0x00, 0x03, 0x01, 0xaa},
1868 {0x00, 0x46, 0x3c, 0xaa},
1869 {0x00, 0x00, 0x18, 0xdd},
1870/*read bfff*/
1871 {0x00, 0x03, 0x00, 0xaa},
Jean-Francois Moine88521532008-12-10 05:06:13 -03001872 {0x00, 0xb4, 0x1c, 0xaa},
1873 {0x00, 0xb5, 0x92, 0xaa},
1874 {0x00, 0xb6, 0x39, 0xaa},
1875 {0x00, 0xb7, 0x24, 0xaa},
1876/*write 89 0400 1415*/
1877};
1878
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001879struct sensor_info {
1880 int sensorId;
1881 __u8 I2cAdd;
1882 __u8 IdAdd;
1883 __u16 VpId;
1884 __u8 m1;
1885 __u8 m2;
1886 __u8 op;
1887 };
1888
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001889static const struct sensor_info sensor_info_data[] = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001890/* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
1891 {SENSOR_HV7131R, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
1892 {SENSOR_OV7660, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
1893 {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01},
1894 {SENSOR_MI1320, 0x80 | 0xc8, 0x00, 0x148c, 0x64, 0x65, 0x01},
1895 {SENSOR_OV7670, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
1896 {SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001897/* (tested in vc032x_probe_sensor) */
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001898/* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
Jean-Francois Moine88521532008-12-10 05:06:13 -03001899 {SENSOR_PO1200, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001900};
1901
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001902/* read 'len' bytes in gspca_dev->usb_buf */
1903static void reg_r(struct gspca_dev *gspca_dev,
1904 __u16 req,
1905 __u16 index,
1906 __u16 len)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001907{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001908 usb_control_msg(gspca_dev->dev,
1909 usb_rcvctrlpipe(gspca_dev->dev, 0),
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001910 req,
1911 USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1912 1, /* value */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001913 index, gspca_dev->usb_buf, len,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001914 500);
1915}
1916
1917static void reg_w(struct usb_device *dev,
1918 __u16 req,
1919 __u16 value,
1920 __u16 index)
1921{
1922 usb_control_msg(dev,
1923 usb_sndctrlpipe(dev, 0),
1924 req,
1925 USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1926 value, index, NULL, 0,
1927 500);
1928}
1929
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001930static void read_sensor_register(struct gspca_dev *gspca_dev,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001931 __u16 address, __u16 *value)
1932{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001933 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001934 __u8 ldata, mdata, hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001935 int retry = 50;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001936
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001937 *value = 0;
1938
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001939 reg_r(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001940 /*PDEBUG(D_PROBE, " I2c Bus Busy Wait 0x%02X ", tmpvalue); */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001941 if (!(gspca_dev->usb_buf[0] & 0x02)) {
1942 PDEBUG(D_ERR, "I2c Bus Busy Wait %d",
1943 gspca_dev->usb_buf[0] & 0x02);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001944 return;
1945 }
1946 reg_w(dev, 0xa0, address, 0xb33a);
1947 reg_w(dev, 0xa0, 0x02, 0xb339);
1948
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001949 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
1950 while (retry-- && gspca_dev->usb_buf[0]) {
1951 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001952/* PDEBUG(D_PROBE, "Read again 0xb33b %d", tmpvalue); */
1953 msleep(1);
1954 }
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001955 reg_r(gspca_dev, 0xa1, 0xb33e, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001956 ldata = gspca_dev->usb_buf[0];
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001957 reg_r(gspca_dev, 0xa1, 0xb33d, 1);
1958 mdata = gspca_dev->usb_buf[0];
1959 reg_r(gspca_dev, 0xa1, 0xb33c, 1);
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001960 hdata = gspca_dev->usb_buf[0];
1961 PDEBUG(D_PROBE, "Read Sensor %02x%02x %02x",
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001962 hdata, mdata, ldata);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001963 reg_r(gspca_dev, 0xa1, 0xb334, 1);
1964 if (gspca_dev->usb_buf[0] == 0x02)
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001965 *value = (hdata << 8) + mdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001966 else
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001967 *value = hdata;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001968}
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001969
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001970static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
1971{
1972 struct usb_device *dev = gspca_dev->dev;
1973 int i;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001974 __u16 value;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03001975 const struct sensor_info *ptsensor_info;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001976
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001977 reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001978 PDEBUG(D_PROBE, "check sensor header %02x", gspca_dev->usb_buf[0]);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001979 for (i = 0; i < ARRAY_SIZE(sensor_info_data); i++) {
1980 ptsensor_info = &sensor_info_data[i];
1981 reg_w(dev, 0xa0, 0x02, 0xb334);
1982 reg_w(dev, 0xa0, ptsensor_info->m1, 0xb300);
1983 reg_w(dev, 0xa0, ptsensor_info->m2, 0xb300);
1984 reg_w(dev, 0xa0, 0x01, 0xb308);
1985 reg_w(dev, 0xa0, 0x0c, 0xb309);
1986 reg_w(dev, 0xa0, ptsensor_info->I2cAdd, 0xb335);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001987 reg_w(dev, 0xa0, ptsensor_info->op, 0xb301);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03001988 read_sensor_register(gspca_dev, ptsensor_info->IdAdd, &value);
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001989 if (value == ptsensor_info->VpId)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001990 return ptsensor_info->sensorId;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03001991
1992 /* special case for MI0360 */
1993 if (ptsensor_info->sensorId == SENSOR_MI1310_SOC
Jean-Francois Moinee18fd012008-12-08 04:48:21 -03001994 && value == 0x8243)
Jean-Francois Moine8d3f6e32008-12-10 05:13:05 -03001995 return SENSOR_MI0360;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03001996 }
1997 return -1;
1998}
1999
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002000static __u8 i2c_write(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002001 __u8 reg, const __u8 *val, __u8 size)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002002{
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002003 struct usb_device *dev = gspca_dev->dev;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002004
2005 if (size > 3 || size < 1)
2006 return -EINVAL;
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002007 reg_r(gspca_dev, 0xa1, 0xb33f, 1);
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03002008 reg_w(dev, 0xa0, size, 0xb334);
2009 reg_w(dev, 0xa0, reg, 0xb33a);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002010 switch (size) {
2011 case 1:
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03002012 reg_w(dev, 0xa0, val[0], 0xb336);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002013 break;
2014 case 2:
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03002015 reg_w(dev, 0xa0, val[0], 0xb336);
2016 reg_w(dev, 0xa0, val[1], 0xb337);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002017 break;
2018 case 3:
Jean-Francois Moinec41492c2008-07-07 08:31:16 -03002019 reg_w(dev, 0xa0, val[0], 0xb336);
2020 reg_w(dev, 0xa0, val[1], 0xb337);
2021 reg_w(dev, 0xa0, val[2], 0xb338);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002022 break;
2023 default:
2024 reg_w(dev, 0xa0, 0x01, 0xb334);
2025 return -EINVAL;
2026 }
2027 reg_w(dev, 0xa0, 0x01, 0xb339);
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002028 reg_r(gspca_dev, 0xa1, 0xb33b, 1);
2029 return gspca_dev->usb_buf[0] == 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002030}
2031
2032static void put_tab_to_reg(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002033 const __u8 *tab, __u8 tabsize, __u16 addr)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002034{
2035 int j;
2036 __u16 ad = addr;
2037
2038 for (j = 0; j < tabsize; j++)
2039 reg_w(gspca_dev->dev, 0xa0, tab[j], ad++);
2040}
2041
2042static void usb_exchange(struct gspca_dev *gspca_dev,
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002043 const __u8 data[][4])
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002044{
2045 struct usb_device *dev = gspca_dev->dev;
2046 int i = 0;
2047
2048 for (;;) {
2049 switch (data[i][3]) {
2050 default:
2051 return;
2052 case 0xcc: /* normal write */
2053 reg_w(dev, 0xa0, data[i][2],
2054 ((data[i][0])<<8) | data[i][1]);
2055 break;
2056 case 0xaa: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002057 i2c_write(gspca_dev, data[i][1], &data[i][2], 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002058 break;
2059 case 0xbb: /* i2c op */
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002060 i2c_write(gspca_dev, data[i][0], &data[i][1], 2);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002061 break;
2062 case 0xdd:
2063 msleep(data[i][2] + 10);
2064 break;
2065 }
2066 i++;
2067 }
2068 /*not reached*/
2069}
2070
2071/*
2072 "GammaT"=hex:04,17,31,4f,6a,83,99,ad,bf,ce,da,e5,ee,f5,fb,ff,ff
2073 "MatrixT"=hex:60,f9,e5,e7,50,05,f3,e6,66
2074 */
2075
2076static void vc0321_reset(struct gspca_dev *gspca_dev)
2077{
2078 reg_w(gspca_dev->dev, 0xa0, 0x00, 0xb04d);
2079 reg_w(gspca_dev->dev, 0xa0, 0x01, 0xb301);
2080 msleep(100);
2081 reg_w(gspca_dev->dev, 0xa0, 0x01, 0xb003);
2082 msleep(100);
2083}
2084
2085/* this function is called at probe time */
2086static int sd_config(struct gspca_dev *gspca_dev,
2087 const struct usb_device_id *id)
2088{
2089 struct sd *sd = (struct sd *) gspca_dev;
2090 struct usb_device *dev = gspca_dev->dev;
2091 struct cam *cam;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002092 int sensor;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002093
2094 cam = &gspca_dev->cam;
Jean-Francois Moine9d64fdb2008-07-25 08:53:03 -03002095 sd->bridge = id->driver_info;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002096
2097 vc0321_reset(gspca_dev);
2098 sensor = vc032x_probe_sensor(gspca_dev);
2099 switch (sensor) {
2100 case -1:
2101 PDEBUG(D_PROBE, "Unknown sensor...");
2102 return -EINVAL;
2103 case SENSOR_HV7131R:
2104 PDEBUG(D_PROBE, "Find Sensor HV7131R");
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002105 break;
2106 case SENSOR_MI0360:
2107 PDEBUG(D_PROBE, "Find Sensor MI0360");
2108 sd->bridge = BRIDGE_VC0323;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002109 break;
2110 case SENSOR_MI1310_SOC:
2111 PDEBUG(D_PROBE, "Find Sensor MI1310_SOC");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002112 break;
2113 case SENSOR_MI1320:
2114 PDEBUG(D_PROBE, "Find Sensor MI1320");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002115 break;
2116 case SENSOR_OV7660:
2117 PDEBUG(D_PROBE, "Find Sensor OV7660");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002118 break;
2119 case SENSOR_OV7670:
2120 PDEBUG(D_PROBE, "Find Sensor OV7670");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002121 break;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002122 case SENSOR_PO1200:
2123 PDEBUG(D_PROBE, "Find Sensor PO1200");
2124 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002125 case SENSOR_PO3130NC:
2126 PDEBUG(D_PROBE, "Find Sensor PO3130NC");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002127 break;
2128 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002129 sd->sensor = sensor;
2130
2131 if (sd->bridge == BRIDGE_VC0321) {
2132 cam->cam_mode = vc0321_mode;
2133 cam->nmodes = ARRAY_SIZE(vc0321_mode);
2134 } else {
Jean-Francois Moine88521532008-12-10 05:06:13 -03002135 if (sensor != SENSOR_PO1200) {
2136 cam->cam_mode = vc0323_mode;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002137 if (sd->sensor != SENSOR_MI1310_SOC)
2138 cam->nmodes = ARRAY_SIZE(vc0323_mode);
2139 else /* no SXGA */
2140 cam->nmodes = ARRAY_SIZE(vc0323_mode) - 1;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002141 } else {
2142 cam->cam_mode = svga_mode;
2143 cam->nmodes = ARRAY_SIZE(svga_mode);
2144 }
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002145 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002146
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002147 sd->hflip = HFLIP_DEF;
2148 sd->vflip = VFLIP_DEF;
2149 if (sd->sensor == SENSOR_OV7670) {
2150 sd->hflip = 1;
2151 sd->vflip = 1;
2152 }
Jean-Francois Moined0d0e392008-07-10 07:06:44 -03002153 sd->lightfreq = FREQ_DEF;
Jean-Francois Moinef50ba1b2008-09-03 17:12:14 -03002154 if (sd->sensor != SENSOR_OV7670)
2155 gspca_dev->ctrl_dis = (1 << LIGHTFREQ_IDX);
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002156 switch (sd->sensor) {
2157 case SENSOR_OV7660:
2158 case SENSOR_OV7670:
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002159 case SENSOR_PO1200:
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002160 break;
2161 default:
2162 gspca_dev->ctrl_dis = (1 << HFLIP_IDX)
2163 | (1 << VFLIP_IDX);
2164 break;
2165 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002166
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002167 sd->sharpness = SHARPNESS_DEF;
2168
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002169 if (sd->bridge == BRIDGE_VC0321) {
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002170 reg_r(gspca_dev, 0x8a, 0, 3);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002171 reg_w(dev, 0x87, 0x00, 0x0f0f);
2172
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002173 reg_r(gspca_dev, 0x8b, 0, 3);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002174 reg_w(dev, 0x88, 0x00, 0x0202);
2175 }
2176 return 0;
2177}
2178
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03002179/* this function is called at probe and time */
2180static int sd_init(struct gspca_dev *gspca_dev)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002181{
2182 return 0;
2183}
2184
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002185/* for OV7660 and OV7670 only */
2186static void sethvflip(struct gspca_dev *gspca_dev)
2187{
2188 struct sd *sd = (struct sd *) gspca_dev;
2189 __u8 data;
2190
2191 switch (sd->sensor) {
2192 case SENSOR_OV7660:
2193 data = 1;
2194 break;
2195 case SENSOR_OV7670:
2196 data = 7;
2197 break;
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002198 case SENSOR_PO1200:
2199 data = 0;
2200 i2c_write(gspca_dev, 0x03, &data, 1);
2201 data = 0x80 * sd->hflip
2202 | 0x40 * sd->vflip
2203 | 0x06;
2204 i2c_write(gspca_dev, 0x1e, &data, 1);
2205 return;
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002206 default:
2207 return;
2208 }
2209 data |= OV7660_MVFP_MIRROR * sd->hflip
2210 | OV7660_MVFP_VFLIP * sd->vflip;
2211 i2c_write(gspca_dev, OV7660_REG_MVFP, &data, 1);
2212}
2213
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002214static void setlightfreq(struct gspca_dev *gspca_dev)
2215{
2216 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002217 static const __u8 (*ov7660_freq_tb[3])[4] =
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002218 {ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ};
2219
2220 if (sd->sensor != SENSOR_OV7660)
2221 return;
2222 usb_exchange(gspca_dev, ov7660_freq_tb[sd->lightfreq]);
2223}
2224
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002225/* po1200 only */
2226static void setsharpness(struct gspca_dev *gspca_dev)
2227{
2228 struct sd *sd = (struct sd *) gspca_dev;
2229 __u8 data;
2230
2231 if (sd->sensor != SENSOR_PO1200)
2232 return;
2233 data = 0;
2234 i2c_write(gspca_dev, 0x03, &data, 1);
2235 data = 0xb5 + sd->sharpness * 3;
2236 i2c_write(gspca_dev, 0x61, &data, 1);
2237}
2238
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03002239static int sd_start(struct gspca_dev *gspca_dev)
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002240{
2241 struct sd *sd = (struct sd *) gspca_dev;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002242 const __u8 (*init)[4];
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002243 const __u8 *GammaT = NULL;
2244 const __u8 *MatrixT = NULL;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002245 int mode;
2246
2247 /* Assume start use the good resolution from gspca_dev->mode */
2248 if (sd->bridge == BRIDGE_VC0321) {
2249 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfec);
2250 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfed);
2251 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfee);
2252 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xbfef);
2253 }
2254
Jean-Francois Moinec2446b32008-07-05 11:49:20 -03002255 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002256 switch (sd->sensor) {
2257 case SENSOR_HV7131R:
2258 GammaT = hv7131r_gamma;
2259 MatrixT = hv7131r_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002260 if (mode)
2261 init = hv7131r_initQVGA_data; /* 320x240 */
2262 else
2263 init = hv7131r_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002264 break;
2265 case SENSOR_OV7660:
2266 GammaT = ov7660_gamma;
2267 MatrixT = ov7660_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002268 if (mode)
2269 init = ov7660_initQVGA_data; /* 320x240 */
2270 else
2271 init = ov7660_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002272 break;
2273 case SENSOR_OV7670:
2274 /*GammaT = ov7660_gamma; */
2275 /*MatrixT = ov7660_matrix; */
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002276 if (mode)
2277 init = ov7670_initQVGA_JPG; /* 320x240 */
2278 else
2279 init = ov7670_initVGA_JPG; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002280 break;
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002281 case SENSOR_MI0360:
2282 GammaT = mi1320_gamma;
2283 MatrixT = mi0360_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002284 if (mode)
2285 init = mi0360_initQVGA_JPG; /* 320x240 */
2286 else
2287 init = mi0360_initVGA_JPG; /* 640x480 */
Jean-Francois Moinecbb05542008-11-26 16:17:13 -03002288 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002289 case SENSOR_MI1310_SOC:
Jean-Francois Moinea92e9062009-01-29 05:32:23 -03002290 GammaT = mi1320_gamma;
2291 MatrixT = mi0360_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002292 switch (mode) {
2293 case 1:
2294 init = mi1310_socinitQVGA_JPG; /* 320x240 */
2295 break;
2296 case 0:
2297 init = mi1310_socinitVGA_JPG; /* 640x480 */
2298 break;
2299 default:
2300 init = mi1310_soc_InitSXGA_JPG; /* 1280xq024 */
2301 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002302 }
2303 break;
2304 case SENSOR_MI1320:
2305 GammaT = mi1320_gamma;
2306 MatrixT = mi1320_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002307 if (mode)
2308 init = mi1320_initQVGA_data; /* 320x240 */
2309 else
2310 init = mi1320_initVGA_data; /* 640x480 */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002311 break;
2312 case SENSOR_PO3130NC:
2313 GammaT = po3130_gamma;
2314 MatrixT = po3130_matrix;
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002315 if (mode)
2316 init = po3130_initQVGA_data; /* 320x240 */
2317 else
2318 init = po3130_initVGA_data; /* 640x480 */
2319 usb_exchange(gspca_dev, init);
2320 init = po3130_rundata;
Jean-Francois Moine88521532008-12-10 05:06:13 -03002321 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002322 default:
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002323/* case SENSOR_PO1200: */
2324 GammaT = po1200_gamma;
2325 MatrixT = po1200_matrix;
2326 init = po1200_initVGA_data;
2327 break;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002328 }
Jean-Francois Moine6af4e7a2009-01-29 16:34:25 -03002329 usb_exchange(gspca_dev, init);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002330 if (GammaT && MatrixT) {
2331 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb84a);
2332 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb85b);
2333 put_tab_to_reg(gspca_dev, GammaT, 17, 0xb86c);
2334 put_tab_to_reg(gspca_dev, MatrixT, 9, 0xb82c);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002335 /* Seem SHARPNESS */
2336 /*
2337 reg_w(gspca_dev->dev, 0xa0, 0x80, 0xb80a);
2338 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xb80b);
2339 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xb80e);
2340 */
2341 /* all 0x40 ??? do nothing
2342 reg_w(gspca_dev->dev, 0xa0, 0x40, 0xb822);
2343 reg_w(gspca_dev->dev, 0xa0, 0x40, 0xb823);
2344 reg_w(gspca_dev->dev, 0xa0, 0x40, 0xb824);
2345 */
2346 /* Only works for HV7131R ??
Jean-Francois Moine739570b2008-07-14 09:38:29 -03002347 reg_r (gspca_dev, 0xa1, 0xb881, 1);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002348 reg_w(gspca_dev->dev, 0xa0, 0xfe01, 0xb881);
2349 reg_w(gspca_dev->dev, 0xa0, 0x79, 0xb801);
2350 */
2351 /* only hv7131r et ov7660
2352 reg_w(gspca_dev->dev, 0xa0, 0x20, 0xb827);
2353 reg_w(gspca_dev->dev, 0xa0, 0xff, 0xb826); * ISP_GAIN 80
2354 reg_w(gspca_dev->dev, 0xa0, 0x23, 0xb800); * ISP CTRL_BAS
2355 */
2356 /* set the led on 0x0892 0x0896 */
Jean-Francois Moine88521532008-12-10 05:06:13 -03002357 if (sd->sensor != SENSOR_PO1200) {
2358 reg_w(gspca_dev->dev, 0x89, 0xffff, 0xfdff);
2359 msleep(100);
Jean-Francois Moine88521532008-12-10 05:06:13 -03002360 sethvflip(gspca_dev);
2361 setlightfreq(gspca_dev);
2362 } else {
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002363 setsharpness(gspca_dev);
2364 sethvflip(gspca_dev);
Jean-Francois Moine88521532008-12-10 05:06:13 -03002365 reg_w(gspca_dev->dev, 0x89, 0x0400, 0x1415);
2366 }
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002367 }
Jean-Francois Moine72ab97c2008-09-20 06:39:08 -03002368 return 0;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002369}
2370
2371static void sd_stopN(struct gspca_dev *gspca_dev)
2372{
2373 struct usb_device *dev = gspca_dev->dev;
2374
2375 reg_w(dev, 0x89, 0xffff, 0xffff);
2376 reg_w(dev, 0xa0, 0x01, 0xb301);
2377 reg_w(dev, 0xa0, 0x09, 0xb003);
2378}
2379
Jean-Francois Moine98522a72008-11-18 06:33:08 -03002380/* called on streamoff with alt 0 and on disconnect */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002381static void sd_stop0(struct gspca_dev *gspca_dev)
2382{
2383 struct usb_device *dev = gspca_dev->dev;
2384
Jean-Francois Moine98522a72008-11-18 06:33:08 -03002385 if (!gspca_dev->present)
2386 return;
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002387 reg_w(dev, 0x89, 0xffff, 0xffff);
2388}
2389
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002390static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2391 struct gspca_frame *frame, /* target */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002392 __u8 *data, /* isoc packet */
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002393 int len) /* iso pkt length */
2394{
2395 struct sd *sd = (struct sd *) gspca_dev;
2396
2397 if (data[0] == 0xff && data[1] == 0xd8) {
2398 PDEBUG(D_PACK,
2399 "vc032x header packet found len %d", len);
2400 frame = gspca_frame_add(gspca_dev, LAST_PACKET, frame,
2401 data, 0);
2402 if (sd->bridge == BRIDGE_VC0321) {
2403#define VCHDRSZ 46
2404 data += VCHDRSZ;
2405 len -= VCHDRSZ;
2406#undef VCHDRSZ
2407 }
2408 gspca_frame_add(gspca_dev, FIRST_PACKET, frame,
2409 data, len);
2410 return;
2411 }
Hans de Goeded473a002008-12-11 05:02:18 -03002412
2413 /* The vc0321 sends some additional data after sending the complete
2414 * frame, we ignore this. */
2415 if (sd->bridge == BRIDGE_VC0321
2416 && len > frame->v4l2_buf.length - (frame->data_end - frame->data))
2417 len = frame->v4l2_buf.length - (frame->data_end - frame->data);
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002418 gspca_frame_add(gspca_dev, INTER_PACKET, frame, data, len);
2419}
2420
Jean-Francois Moine7dc7ad32008-12-08 05:13:53 -03002421static int sd_sethflip(struct gspca_dev *gspca_dev, __s32 val)
2422{
2423 struct sd *sd = (struct sd *) gspca_dev;
2424
2425 sd->hflip = val;
2426 if (gspca_dev->streaming)
2427 sethvflip(gspca_dev);
2428 return 0;
2429}
2430
2431static int sd_gethflip(struct gspca_dev *gspca_dev, __s32 *val)
2432{
2433 struct sd *sd = (struct sd *) gspca_dev;
2434
2435 *val = sd->hflip;
2436 return 0;
2437}
2438
2439static int sd_setvflip(struct gspca_dev *gspca_dev, __s32 val)
2440{
2441 struct sd *sd = (struct sd *) gspca_dev;
2442
2443 sd->vflip = val;
2444 if (gspca_dev->streaming)
2445 sethvflip(gspca_dev);
2446 return 0;
2447}
2448
2449static int sd_getvflip(struct gspca_dev *gspca_dev, __s32 *val)
2450{
2451 struct sd *sd = (struct sd *) gspca_dev;
2452
2453 *val = sd->vflip;
2454 return 0;
2455}
2456
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002457static int sd_setfreq(struct gspca_dev *gspca_dev, __s32 val)
2458{
2459 struct sd *sd = (struct sd *) gspca_dev;
2460
2461 sd->lightfreq = val;
2462 if (gspca_dev->streaming)
2463 setlightfreq(gspca_dev);
2464 return 0;
2465}
2466
2467static int sd_getfreq(struct gspca_dev *gspca_dev, __s32 *val)
2468{
2469 struct sd *sd = (struct sd *) gspca_dev;
2470
2471 *val = sd->lightfreq;
2472 return 0;
2473}
2474
Jean-Francois Moine47a42b02008-12-13 07:45:34 -03002475static int sd_setsharpness(struct gspca_dev *gspca_dev, __s32 val)
2476{
2477 struct sd *sd = (struct sd *) gspca_dev;
2478
2479 sd->sharpness = val;
2480 if (gspca_dev->streaming)
2481 setsharpness(gspca_dev);
2482 return 0;
2483}
2484
2485static int sd_getsharpness(struct gspca_dev *gspca_dev, __s32 *val)
2486{
2487 struct sd *sd = (struct sd *) gspca_dev;
2488
2489 *val = sd->sharpness;
2490 return 0;
2491}
2492
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002493static int sd_querymenu(struct gspca_dev *gspca_dev,
2494 struct v4l2_querymenu *menu)
2495{
2496 switch (menu->id) {
2497 case V4L2_CID_POWER_LINE_FREQUENCY:
2498 switch (menu->index) {
2499 case 0: /* V4L2_CID_POWER_LINE_FREQUENCY_DISABLED */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002500 strcpy((char *) menu->name, "NoFliker");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002501 return 0;
2502 case 1: /* V4L2_CID_POWER_LINE_FREQUENCY_50HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002503 strcpy((char *) menu->name, "50 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002504 return 0;
2505 case 2: /* V4L2_CID_POWER_LINE_FREQUENCY_60HZ */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002506 strcpy((char *) menu->name, "60 Hz");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002507 return 0;
2508 }
2509 break;
2510 }
2511 return -EINVAL;
2512}
2513
2514/* sub-driver description */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002515static const struct sd_desc sd_desc = {
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002516 .name = MODULE_NAME,
2517 .ctrls = sd_ctrls,
2518 .nctrls = ARRAY_SIZE(sd_ctrls),
2519 .config = sd_config,
Jean-Francois Moine012d6b02008-09-03 17:12:16 -03002520 .init = sd_init,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002521 .start = sd_start,
2522 .stopN = sd_stopN,
2523 .stop0 = sd_stop0,
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002524 .pkt_scan = sd_pkt_scan,
2525 .querymenu = sd_querymenu,
2526};
2527
2528/* -- module initialisation -- */
Jean-Francois Moinea5ae2062008-07-04 11:16:16 -03002529static const __devinitdata struct usb_device_id device_table[] = {
Jean-Francois Moinea92e9062009-01-29 05:32:23 -03002530 {USB_DEVICE(0x041e, 0x405b), .driver_info = BRIDGE_VC0321},
Jean-Francois Moine87581aa2008-07-26 14:30:01 -03002531 {USB_DEVICE(0x046d, 0x0892), .driver_info = BRIDGE_VC0321},
2532 {USB_DEVICE(0x046d, 0x0896), .driver_info = BRIDGE_VC0321},
Jean-Francois Moineda3bcb52008-12-29 09:06:09 -03002533 {USB_DEVICE(0x046d, 0x0897), .driver_info = BRIDGE_VC0321},
Jean-Francois Moine87581aa2008-07-26 14:30:01 -03002534 {USB_DEVICE(0x0ac8, 0x0321), .driver_info = BRIDGE_VC0321},
2535 {USB_DEVICE(0x0ac8, 0x0323), .driver_info = BRIDGE_VC0323},
2536 {USB_DEVICE(0x0ac8, 0x0328), .driver_info = BRIDGE_VC0321},
2537 {USB_DEVICE(0x0ac8, 0xc001), .driver_info = BRIDGE_VC0321},
2538 {USB_DEVICE(0x0ac8, 0xc002), .driver_info = BRIDGE_VC0321},
Jean-Francois Moine88521532008-12-10 05:06:13 -03002539 {USB_DEVICE(0x15b8, 0x6002), .driver_info = BRIDGE_VC0323},
Jean-Francois Moine87581aa2008-07-26 14:30:01 -03002540 {USB_DEVICE(0x17ef, 0x4802), .driver_info = BRIDGE_VC0323},
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002541 {}
2542};
2543MODULE_DEVICE_TABLE(usb, device_table);
2544
2545/* -- device connect -- */
2546static int sd_probe(struct usb_interface *intf,
2547 const struct usb_device_id *id)
2548{
2549 return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
2550 THIS_MODULE);
2551}
2552
2553static struct usb_driver sd_driver = {
2554 .name = MODULE_NAME,
2555 .id_table = device_table,
2556 .probe = sd_probe,
2557 .disconnect = gspca_disconnect,
Jean-Francois Moine6a709742008-09-03 16:48:10 -03002558#ifdef CONFIG_PM
2559 .suspend = gspca_suspend,
2560 .resume = gspca_resume,
2561#endif
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002562};
2563
2564/* -- module insert / remove -- */
2565static int __init sd_mod_init(void)
2566{
Alexey Klimovf69e9522009-01-01 13:02:07 -03002567 int ret;
2568 ret = usb_register(&sd_driver);
2569 if (ret < 0)
Alexey Klimove6b14842009-01-01 13:04:58 -03002570 return ret;
Jean-Francois Moine10b0e962008-07-22 05:35:10 -03002571 PDEBUG(D_PROBE, "registered");
Jean-Francois Moine6a7eba22008-06-30 15:50:11 -03002572 return 0;
2573}
2574static void __exit sd_mod_exit(void)
2575{
2576 usb_deregister(&sd_driver);
2577 PDEBUG(D_PROBE, "deregistered");
2578}
2579
2580module_init(sd_mod_init);
2581module_exit(sd_mod_exit);