2 * Z-star vc0321 library
3 * Copyright (C) 2006 Koninski Artur takeshi87@o2.pl
4 * Copyright (C) 2006 Michel Xhaard
6 * V4L2 by Jean-Francois Moine <http://moinejf.free.fr>
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
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.
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
23 #define MODULE_NAME "vc032x"
27 MODULE_AUTHOR("Michel Xhaard <mxhaard@users.sourceforge.net>");
28 MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver");
29 MODULE_LICENSE("GPL");
31 /* specific webcam descriptor */
33 struct gspca_dev gspca_dev
; /* !! must be the first item */
46 #define BRIDGE_VC0321 0
47 #define BRIDGE_VC0323 1
49 #define SENSOR_HV7131R 0
50 #define SENSOR_MI0360 1
51 #define SENSOR_MI1310_SOC 2
52 #define SENSOR_MI1320 3
53 #define SENSOR_MI1320_SOC 4
54 #define SENSOR_OV7660 5
55 #define SENSOR_OV7670 6
56 #define SENSOR_PO1200 7
57 #define SENSOR_PO3130NC 8
58 #define SENSOR_POxxxx 9
60 #define FL_SAMSUNG 0x01 /* SamsungQ1 (2 sensors) */
61 #define FL_HFLIP 0x02 /* mirrored by default */
62 #define FL_VFLIP 0x04 /* vertical flipped by default */
65 /* V4L2 controls supported by the driver */
66 static int sd_setbrightness(struct gspca_dev
*gspca_dev
, __s32 val
);
67 static int sd_getbrightness(struct gspca_dev
*gspca_dev
, __s32
*val
);
68 static int sd_setcontrast(struct gspca_dev
*gspca_dev
, __s32 val
);
69 static int sd_getcontrast(struct gspca_dev
*gspca_dev
, __s32
*val
);
70 static int sd_setcolors(struct gspca_dev
*gspca_dev
, __s32 val
);
71 static int sd_getcolors(struct gspca_dev
*gspca_dev
, __s32
*val
);
72 static int sd_sethflip(struct gspca_dev
*gspca_dev
, __s32 val
);
73 static int sd_gethflip(struct gspca_dev
*gspca_dev
, __s32
*val
);
74 static int sd_setvflip(struct gspca_dev
*gspca_dev
, __s32 val
);
75 static int sd_getvflip(struct gspca_dev
*gspca_dev
, __s32
*val
);
76 static int sd_setfreq(struct gspca_dev
*gspca_dev
, __s32 val
);
77 static int sd_getfreq(struct gspca_dev
*gspca_dev
, __s32
*val
);
78 static int sd_setsharpness(struct gspca_dev
*gspca_dev
, __s32 val
);
79 static int sd_getsharpness(struct gspca_dev
*gspca_dev
, __s32
*val
);
81 static const struct ctrl sd_ctrls
[] = {
82 #define BRIGHTNESS_IDX 0
85 .id
= V4L2_CID_BRIGHTNESS
,
86 .type
= V4L2_CTRL_TYPE_INTEGER
,
91 #define BRIGHTNESS_DEF 128
92 .default_value
= BRIGHTNESS_DEF
,
94 .set
= sd_setbrightness
,
95 .get
= sd_getbrightness
,
97 #define CONTRAST_IDX 1
100 .id
= V4L2_CID_CONTRAST
,
101 .type
= V4L2_CTRL_TYPE_INTEGER
,
106 #define CONTRAST_DEF 127
107 .default_value
= CONTRAST_DEF
,
109 .set
= sd_setcontrast
,
110 .get
= sd_getcontrast
,
115 .id
= V4L2_CID_SATURATION
,
116 .type
= V4L2_CTRL_TYPE_INTEGER
,
117 .name
= "Saturation",
122 .default_value
= COLOR_DEF
,
127 /* next 2 controls work with some sensors only */
131 .id
= V4L2_CID_HFLIP
,
132 .type
= V4L2_CTRL_TYPE_BOOLEAN
,
138 .default_value
= HFLIP_DEF
,
146 .id
= V4L2_CID_VFLIP
,
147 .type
= V4L2_CTRL_TYPE_BOOLEAN
,
153 .default_value
= VFLIP_DEF
,
158 #define LIGHTFREQ_IDX 5
161 .id
= V4L2_CID_POWER_LINE_FREQUENCY
,
162 .type
= V4L2_CTRL_TYPE_MENU
,
163 .name
= "Light frequency filter",
165 .maximum
= 2, /* 0: No, 1: 50Hz, 2:60Hz */
168 .default_value
= FREQ_DEF
,
173 #define SHARPNESS_IDX 6
176 .id
= V4L2_CID_SHARPNESS
,
177 .type
= V4L2_CTRL_TYPE_INTEGER
,
182 #define SHARPNESS_DEF -1
183 .default_value
= SHARPNESS_DEF
,
185 .set
= sd_setsharpness
,
186 .get
= sd_getsharpness
,
190 /* table of the disabled controls */
191 static u32 ctrl_dis
[] = {
192 /* SENSOR_HV7131R 0 */
193 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
194 | (1 << HFLIP_IDX
) | (1 << VFLIP_IDX
) | (1 << LIGHTFREQ_IDX
)
195 | (1 << SHARPNESS_IDX
),
196 /* SENSOR_MI0360 1 */
197 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
198 | (1 << HFLIP_IDX
) | (1 << VFLIP_IDX
) | (1 << LIGHTFREQ_IDX
)
199 | (1 << SHARPNESS_IDX
),
200 /* SENSOR_MI1310_SOC 2 */
201 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
202 | (1 << LIGHTFREQ_IDX
) | (1 << SHARPNESS_IDX
),
203 /* SENSOR_MI1320 3 */
204 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
205 | (1 << LIGHTFREQ_IDX
) | (1 << SHARPNESS_IDX
),
206 /* SENSOR_MI1320_SOC 4 */
207 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
208 | (1 << LIGHTFREQ_IDX
) | (1 << SHARPNESS_IDX
),
209 /* SENSOR_OV7660 5 */
210 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
211 | (1 << LIGHTFREQ_IDX
) | (1 << SHARPNESS_IDX
),
212 /* SENSOR_OV7670 6 */
213 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
214 | (1 << SHARPNESS_IDX
),
215 /* SENSOR_PO1200 7 */
216 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
217 | (1 << LIGHTFREQ_IDX
),
218 /* SENSOR_PO3130NC 8 */
219 (1 << BRIGHTNESS_IDX
) | (1 << CONTRAST_IDX
) | (1 << COLORS_IDX
)
220 | (1 << HFLIP_IDX
) | (1 << VFLIP_IDX
) | (1 << LIGHTFREQ_IDX
)
221 | (1 << SHARPNESS_IDX
),
222 /* SENSOR_POxxxx 9 */
223 (1 << HFLIP_IDX
) | (1 << VFLIP_IDX
) | (1 << LIGHTFREQ_IDX
),
226 static const struct v4l2_pix_format vc0321_mode
[] = {
227 {320, 240, V4L2_PIX_FMT_YVYU
, V4L2_FIELD_NONE
,
229 .sizeimage
= 320 * 240 * 2,
230 .colorspace
= V4L2_COLORSPACE_SRGB
,
232 {640, 480, V4L2_PIX_FMT_YVYU
, V4L2_FIELD_NONE
,
234 .sizeimage
= 640 * 480 * 2,
235 .colorspace
= V4L2_COLORSPACE_SRGB
,
238 static const struct v4l2_pix_format vc0323_mode
[] = {
239 {320, 240, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
241 .sizeimage
= 320 * 240 * 3 / 8 + 590,
242 .colorspace
= V4L2_COLORSPACE_JPEG
,
244 {640, 480, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
246 .sizeimage
= 640 * 480 * 3 / 8 + 590,
247 .colorspace
= V4L2_COLORSPACE_JPEG
,
249 {1280, 960, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
, /* mi1310_soc only */
250 .bytesperline
= 1280,
251 .sizeimage
= 1280 * 960 * 3 / 8 + 590,
252 .colorspace
= V4L2_COLORSPACE_JPEG
,
255 static const struct v4l2_pix_format bi_mode
[] = {
256 {320, 240, V4L2_PIX_FMT_YUYV
, V4L2_FIELD_NONE
,
258 .sizeimage
= 320 * 240 * 2,
259 .colorspace
= V4L2_COLORSPACE_SRGB
,
261 {640, 480, V4L2_PIX_FMT_YUYV
, V4L2_FIELD_NONE
,
263 .sizeimage
= 640 * 480 * 2,
264 .colorspace
= V4L2_COLORSPACE_SRGB
,
266 {1280, 1024, V4L2_PIX_FMT_YUYV
, V4L2_FIELD_NONE
,
267 .bytesperline
= 1280,
268 .sizeimage
= 1280 * 1024 * 2,
269 .colorspace
= V4L2_COLORSPACE_SRGB
,
272 static const struct v4l2_pix_format svga_mode
[] = {
273 {800, 600, V4L2_PIX_FMT_JPEG
, V4L2_FIELD_NONE
,
275 .sizeimage
= 800 * 600 * 1 / 4 + 590,
276 .colorspace
= V4L2_COLORSPACE_JPEG
,
280 /* OV7660/7670 registers */
281 #define OV7660_REG_MVFP 0x1e
282 #define OV7660_MVFP_MIRROR 0x20
283 #define OV7660_MVFP_VFLIP 0x10
285 static const u8 mi0360_matrix
[9] = {
286 0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
289 static const u8 mi0360_initVGA_JPG
[][4] = {
290 {0xb0, 0x03, 0x19, 0xcc},
291 {0xb0, 0x04, 0x02, 0xcc},
292 {0xb3, 0x00, 0x24, 0xcc},
293 {0xb3, 0x00, 0x25, 0xcc},
294 {0xb3, 0x08, 0x01, 0xcc},
295 {0xb3, 0x09, 0x0c, 0xcc},
296 {0xb3, 0x05, 0x01, 0xcc},
297 {0xb3, 0x06, 0x03, 0xcc},
298 {0xb3, 0x03, 0x0a, 0xcc},
299 {0xb3, 0x20, 0x00, 0xcc},
300 {0xb3, 0x21, 0x00, 0xcc},
301 {0xb3, 0x22, 0x01, 0xcc},
302 {0xb3, 0x23, 0xe0, 0xcc},
303 {0xb3, 0x04, 0x05, 0xcc},
304 {0xb3, 0x14, 0x00, 0xcc},
305 {0xb3, 0x15, 0x00, 0xcc},
306 {0xb3, 0x16, 0x02, 0xcc},
307 {0xb3, 0x17, 0x7f, 0xcc},
308 {0xb3, 0x35, 0xdd, 0xcc}, /* i2c add: 5d */
309 {0xb3, 0x34, 0x02, 0xcc},
310 {0xb3, 0x00, 0x25, 0xcc},
311 {0xbc, 0x00, 0x71, 0xcc},
312 {0xb8, 0x00, 0x13, 0xcc},
313 {0xb8, 0x27, 0x20, 0xcc},
314 {0xb8, 0x2c, 0x50, 0xcc},
315 {0xb8, 0x2d, 0xf8, 0xcc},
316 {0xb8, 0x2e, 0xf8, 0xcc},
317 {0xb8, 0x2f, 0xf8, 0xcc},
318 {0xb8, 0x30, 0x50, 0xcc},
319 {0xb8, 0x31, 0xf8, 0xcc},
320 {0xb8, 0x32, 0xf8, 0xcc},
321 {0xb8, 0x33, 0xf8, 0xcc},
322 {0xb8, 0x34, 0x50, 0xcc},
323 {0xb8, 0x35, 0x00, 0xcc},
324 {0xb8, 0x36, 0x00, 0xcc},
325 {0xb8, 0x37, 0x00, 0xcc},
326 {0xb8, 0x01, 0x79, 0xcc},
327 {0xb8, 0x08, 0xe0, 0xcc},
328 {0xb3, 0x01, 0x41, 0xcc},
329 {0xb8, 0x01, 0x79, 0xcc},
330 {0xb8, 0x14, 0x18, 0xcc},
331 {0xb8, 0xb2, 0x0a, 0xcc},
332 {0xb8, 0xb4, 0x0a, 0xcc},
333 {0xb8, 0xb5, 0x0a, 0xcc},
334 {0xb8, 0xfe, 0x00, 0xcc},
335 {0xb8, 0xff, 0x28, 0xcc},
336 {0xb9, 0x00, 0x28, 0xcc},
337 {0xb9, 0x01, 0x28, 0xcc},
338 {0xb9, 0x02, 0x28, 0xcc},
339 {0xb9, 0x03, 0x00, 0xcc},
340 {0xb9, 0x04, 0x00, 0xcc},
341 {0xb9, 0x05, 0x3c, 0xcc},
342 {0xb9, 0x06, 0x3c, 0xcc},
343 {0xb9, 0x07, 0x3c, 0xcc},
344 {0xb9, 0x08, 0x3c, 0xcc},
345 {0xb8, 0x8e, 0x00, 0xcc},
346 {0xb8, 0x8f, 0xff, 0xcc},
347 {0xb8, 0x81, 0x09, 0xcc},
348 {0x31, 0x00, 0x00, 0xbb},
349 {0x09, 0x01, 0xc7, 0xbb},
350 {0x34, 0x01, 0x00, 0xbb},
351 {0x2b, 0x00, 0x28, 0xbb},
352 {0x2c, 0x00, 0x30, 0xbb},
353 {0x2d, 0x00, 0x30, 0xbb},
354 {0x2e, 0x00, 0x28, 0xbb},
355 {0x62, 0x04, 0x11, 0xbb},
356 {0x03, 0x01, 0xe0, 0xbb},
357 {0x2c, 0x00, 0x2c, 0xbb},
358 {0x20, 0xd0, 0x00, 0xbb},
359 {0x01, 0x00, 0x08, 0xbb},
360 {0x06, 0x00, 0x10, 0xbb},
361 {0x05, 0x00, 0x20, 0xbb},
362 {0x20, 0x00, 0x00, 0xbb},
363 {0xb6, 0x00, 0x00, 0xcc},
364 {0xb6, 0x03, 0x02, 0xcc},
365 {0xb6, 0x02, 0x80, 0xcc},
366 {0xb6, 0x05, 0x01, 0xcc},
367 {0xb6, 0x04, 0xe0, 0xcc},
368 {0xb6, 0x12, 0x78, 0xcc},
369 {0xb6, 0x18, 0x02, 0xcc},
370 {0xb6, 0x17, 0x58, 0xcc},
371 {0xb6, 0x16, 0x00, 0xcc},
372 {0xb6, 0x22, 0x12, 0xcc},
373 {0xb6, 0x23, 0x0b, 0xcc},
374 {0xb3, 0x02, 0x02, 0xcc},
375 {0xbf, 0xc0, 0x39, 0xcc},
376 {0xbf, 0xc1, 0x04, 0xcc},
377 {0xbf, 0xcc, 0x10, 0xcc},
378 {0xb9, 0x12, 0x00, 0xcc},
379 {0xb9, 0x13, 0x0a, 0xcc},
380 {0xb9, 0x14, 0x0a, 0xcc},
381 {0xb9, 0x15, 0x0a, 0xcc},
382 {0xb9, 0x16, 0x0a, 0xcc},
383 {0xb9, 0x18, 0x00, 0xcc},
384 {0xb9, 0x19, 0x0f, 0xcc},
385 {0xb9, 0x1a, 0x0f, 0xcc},
386 {0xb9, 0x1b, 0x0f, 0xcc},
387 {0xb9, 0x1c, 0x0f, 0xcc},
388 {0xb8, 0x8e, 0x00, 0xcc},
389 {0xb8, 0x8f, 0xff, 0xcc},
390 {0xb6, 0x12, 0xf8, 0xcc},
391 {0xb8, 0x0c, 0x20, 0xcc},
392 {0xb8, 0x0d, 0x70, 0xcc},
393 {0xb6, 0x13, 0x13, 0xcc},
394 {0x35, 0x00, 0x60, 0xbb},
395 {0xb3, 0x5c, 0x01, 0xcc},
398 static const u8 mi0360_initQVGA_JPG
[][4] = {
399 {0xb0, 0x03, 0x19, 0xcc},
400 {0xb0, 0x04, 0x02, 0xcc},
401 {0xb3, 0x00, 0x24, 0xcc},
402 {0xb3, 0x00, 0x25, 0xcc},
403 {0xb3, 0x08, 0x01, 0xcc},
404 {0xb3, 0x09, 0x0c, 0xcc},
405 {0xb3, 0x05, 0x01, 0xcc},
406 {0xb3, 0x06, 0x03, 0xcc},
407 {0xb3, 0x03, 0x0a, 0xcc},
408 {0xb3, 0x20, 0x00, 0xcc},
409 {0xb3, 0x21, 0x00, 0xcc},
410 {0xb3, 0x22, 0x01, 0xcc},
411 {0xb3, 0x23, 0xe0, 0xcc},
412 {0xb3, 0x04, 0x05, 0xcc},
413 {0xb3, 0x14, 0x00, 0xcc},
414 {0xb3, 0x15, 0x00, 0xcc},
415 {0xb3, 0x16, 0x02, 0xcc},
416 {0xb3, 0x17, 0x7f, 0xcc},
417 {0xb3, 0x35, 0xdd, 0xcc},
418 {0xb3, 0x34, 0x02, 0xcc},
419 {0xb3, 0x00, 0x25, 0xcc},
420 {0xbc, 0x00, 0xd1, 0xcc},
421 {0xb8, 0x00, 0x13, 0xcc},
422 {0xb8, 0x27, 0x20, 0xcc},
423 {0xb8, 0x2c, 0x50, 0xcc},
424 {0xb8, 0x2d, 0xf8, 0xcc},
425 {0xb8, 0x2e, 0xf8, 0xcc},
426 {0xb8, 0x2f, 0xf8, 0xcc},
427 {0xb8, 0x30, 0x50, 0xcc},
428 {0xb8, 0x31, 0xf8, 0xcc},
429 {0xb8, 0x32, 0xf8, 0xcc},
430 {0xb8, 0x33, 0xf8, 0xcc},
431 {0xb8, 0x34, 0x50, 0xcc},
432 {0xb8, 0x35, 0x00, 0xcc},
433 {0xb8, 0x36, 0x00, 0xcc},
434 {0xb8, 0x37, 0x00, 0xcc},
435 {0xb8, 0x01, 0x79, 0xcc},
436 {0xb8, 0x08, 0xe0, 0xcc},
437 {0xb3, 0x01, 0x41, 0xcc},
438 {0xb8, 0x01, 0x79, 0xcc},
439 {0xb8, 0x14, 0x18, 0xcc},
440 {0xb8, 0xb2, 0x0a, 0xcc},
441 {0xb8, 0xb4, 0x0a, 0xcc},
442 {0xb8, 0xb5, 0x0a, 0xcc},
443 {0xb8, 0xfe, 0x00, 0xcc},
444 {0xb8, 0xff, 0x28, 0xcc},
445 {0xb9, 0x00, 0x28, 0xcc},
446 {0xb9, 0x01, 0x28, 0xcc},
447 {0xb9, 0x02, 0x28, 0xcc},
448 {0xb9, 0x03, 0x00, 0xcc},
449 {0xb9, 0x04, 0x00, 0xcc},
450 {0xb9, 0x05, 0x3c, 0xcc},
451 {0xb9, 0x06, 0x3c, 0xcc},
452 {0xb9, 0x07, 0x3c, 0xcc},
453 {0xb9, 0x08, 0x3c, 0xcc},
454 {0xb8, 0x8e, 0x00, 0xcc},
455 {0xb8, 0x8f, 0xff, 0xcc},
456 {0xb8, 0x81, 0x09, 0xcc},
457 {0x31, 0x00, 0x00, 0xbb},
458 {0x09, 0x01, 0xc7, 0xbb},
459 {0x34, 0x01, 0x00, 0xbb},
460 {0x2b, 0x00, 0x28, 0xbb},
461 {0x2c, 0x00, 0x30, 0xbb},
462 {0x2d, 0x00, 0x30, 0xbb},
463 {0x2e, 0x00, 0x28, 0xbb},
464 {0x62, 0x04, 0x11, 0xbb},
465 {0x03, 0x01, 0xe0, 0xbb},
466 {0x2c, 0x00, 0x2c, 0xbb},
467 {0x20, 0xd0, 0x00, 0xbb},
468 {0x01, 0x00, 0x08, 0xbb},
469 {0x06, 0x00, 0x10, 0xbb},
470 {0x05, 0x00, 0x20, 0xbb},
471 {0x20, 0x00, 0x00, 0xbb},
472 {0xb6, 0x00, 0x00, 0xcc},
473 {0xb6, 0x03, 0x01, 0xcc},
474 {0xb6, 0x02, 0x40, 0xcc},
475 {0xb6, 0x05, 0x00, 0xcc},
476 {0xb6, 0x04, 0xf0, 0xcc},
477 {0xb6, 0x12, 0x78, 0xcc},
478 {0xb6, 0x18, 0x00, 0xcc},
479 {0xb6, 0x17, 0x96, 0xcc},
480 {0xb6, 0x16, 0x00, 0xcc},
481 {0xb6, 0x22, 0x12, 0xcc},
482 {0xb6, 0x23, 0x0b, 0xcc},
483 {0xb3, 0x02, 0x02, 0xcc},
484 {0xbf, 0xc0, 0x39, 0xcc},
485 {0xbf, 0xc1, 0x04, 0xcc},
486 {0xbf, 0xcc, 0x10, 0xcc},
487 {0xb9, 0x12, 0x00, 0xcc},
488 {0xb9, 0x13, 0x0a, 0xcc},
489 {0xb9, 0x14, 0x0a, 0xcc},
490 {0xb9, 0x15, 0x0a, 0xcc},
491 {0xb9, 0x16, 0x0a, 0xcc},
492 {0xb9, 0x18, 0x00, 0xcc},
493 {0xb9, 0x19, 0x0f, 0xcc},
494 {0xb9, 0x1a, 0x0f, 0xcc},
495 {0xb9, 0x1b, 0x0f, 0xcc},
496 {0xb9, 0x1c, 0x0f, 0xcc},
497 {0xb8, 0x8e, 0x00, 0xcc},
498 {0xb8, 0x8f, 0xff, 0xcc},
499 {0xb6, 0x12, 0xf8, 0xcc},
500 {0xb6, 0x13, 0x13, 0xcc},
501 {0xbc, 0x02, 0x18, 0xcc},
502 {0xbc, 0x03, 0x50, 0xcc},
503 {0xbc, 0x04, 0x18, 0xcc},
504 {0xbc, 0x05, 0x00, 0xcc},
505 {0xbc, 0x06, 0x00, 0xcc},
506 {0xbc, 0x08, 0x30, 0xcc},
507 {0xbc, 0x09, 0x40, 0xcc},
508 {0xbc, 0x0a, 0x10, 0xcc},
509 {0xb8, 0x0c, 0x20, 0xcc},
510 {0xb8, 0x0d, 0x70, 0xcc},
511 {0xbc, 0x0b, 0x00, 0xcc},
512 {0xbc, 0x0c, 0x00, 0xcc},
513 {0x35, 0x00, 0xef, 0xbb},
514 {0xb3, 0x5c, 0x01, 0xcc},
518 static const u8 mi1310_socinitVGA_JPG
[][4] = {
519 {0xb0, 0x03, 0x19, 0xcc},
520 {0xb0, 0x04, 0x02, 0xcc},
521 {0xb3, 0x00, 0x64, 0xcc},
522 {0xb3, 0x00, 0x65, 0xcc},
523 {0xb3, 0x05, 0x00, 0xcc},
524 {0xb3, 0x06, 0x00, 0xcc},
525 {0xb3, 0x08, 0x01, 0xcc},
526 {0xb3, 0x09, 0x0c, 0xcc},
527 {0xb3, 0x34, 0x02, 0xcc},
528 {0xb3, 0x35, 0xdd, 0xcc}, /* i2c add: 5d */
529 {0xb3, 0x02, 0x00, 0xcc},
530 {0xb3, 0x03, 0x0a, 0xcc},
531 {0xb3, 0x04, 0x05, 0xcc},
532 {0xb3, 0x20, 0x00, 0xcc},
533 {0xb3, 0x21, 0x00, 0xcc},
534 {0xb3, 0x22, 0x03, 0xcc},
535 {0xb3, 0x23, 0xc0, 0xcc},
536 {0xb3, 0x14, 0x00, 0xcc},
537 {0xb3, 0x15, 0x00, 0xcc},
538 {0xb3, 0x16, 0x04, 0xcc},
539 {0xb3, 0x17, 0xff, 0xcc},
540 {0xb3, 0x00, 0x65, 0xcc},
541 {0xb8, 0x00, 0x00, 0xcc},
542 {0xbc, 0x00, 0xd0, 0xcc},
543 {0xbc, 0x01, 0x01, 0xcc},
544 {0xf0, 0x00, 0x02, 0xbb},
545 {0xc8, 0x9f, 0x0b, 0xbb},
546 {0x5b, 0x00, 0x01, 0xbb},
547 {0x2f, 0xde, 0x20, 0xbb},
548 {0xf0, 0x00, 0x00, 0xbb},
549 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
550 {0xf0, 0x00, 0x01, 0xbb},
551 {0x05, 0x00, 0x07, 0xbb},
552 {0x34, 0x00, 0x00, 0xbb},
553 {0x35, 0xff, 0x00, 0xbb},
554 {0xdc, 0x07, 0x02, 0xbb},
555 {0xdd, 0x3c, 0x18, 0xbb},
556 {0xde, 0x92, 0x6d, 0xbb},
557 {0xdf, 0xcd, 0xb1, 0xbb},
558 {0xe0, 0xff, 0xe7, 0xbb},
559 {0x06, 0xf0, 0x0d, 0xbb},
560 {0x06, 0x70, 0x0e, 0xbb},
561 {0x4c, 0x00, 0x01, 0xbb},
562 {0x4d, 0x00, 0x01, 0xbb},
563 {0xf0, 0x00, 0x02, 0xbb},
564 {0x2e, 0x0c, 0x55, 0xbb},
565 {0x21, 0xb6, 0x6e, 0xbb},
566 {0x36, 0x30, 0x10, 0xbb},
567 {0x37, 0x00, 0xc1, 0xbb},
568 {0xf0, 0x00, 0x00, 0xbb},
569 {0x07, 0x00, 0x84, 0xbb},
570 {0x08, 0x02, 0x4a, 0xbb},
571 {0x05, 0x01, 0x10, 0xbb},
572 {0x06, 0x00, 0x39, 0xbb},
573 {0xf0, 0x00, 0x02, 0xbb},
574 {0x58, 0x02, 0x67, 0xbb},
575 {0x57, 0x02, 0x00, 0xbb},
576 {0x5a, 0x02, 0x67, 0xbb},
577 {0x59, 0x02, 0x00, 0xbb},
578 {0x5c, 0x12, 0x0d, 0xbb},
579 {0x5d, 0x16, 0x11, 0xbb},
580 {0x39, 0x06, 0x18, 0xbb},
581 {0x3a, 0x06, 0x18, 0xbb},
582 {0x3b, 0x06, 0x18, 0xbb},
583 {0x3c, 0x06, 0x18, 0xbb},
584 {0x64, 0x7b, 0x5b, 0xbb},
585 {0xf0, 0x00, 0x02, 0xbb},
586 {0x36, 0x30, 0x10, 0xbb},
587 {0x37, 0x00, 0xc0, 0xbb},
588 {0xbc, 0x0e, 0x00, 0xcc},
589 {0xbc, 0x0f, 0x05, 0xcc},
590 {0xbc, 0x10, 0xc0, 0xcc},
591 {0xbc, 0x11, 0x03, 0xcc},
592 {0xb6, 0x00, 0x00, 0xcc},
593 {0xb6, 0x03, 0x02, 0xcc},
594 {0xb6, 0x02, 0x80, 0xcc},
595 {0xb6, 0x05, 0x01, 0xcc},
596 {0xb6, 0x04, 0xe0, 0xcc},
597 {0xb6, 0x12, 0xf8, 0xcc},
598 {0xb6, 0x13, 0x25, 0xcc},
599 {0xb6, 0x18, 0x02, 0xcc},
600 {0xb6, 0x17, 0x58, 0xcc},
601 {0xb6, 0x16, 0x00, 0xcc},
602 {0xb6, 0x22, 0x12, 0xcc},
603 {0xb6, 0x23, 0x0b, 0xcc},
604 {0xbf, 0xc0, 0x39, 0xcc},
605 {0xbf, 0xc1, 0x04, 0xcc},
606 {0xbf, 0xcc, 0x00, 0xcc},
607 {0xbc, 0x02, 0x18, 0xcc},
608 {0xbc, 0x03, 0x50, 0xcc},
609 {0xbc, 0x04, 0x18, 0xcc},
610 {0xbc, 0x05, 0x00, 0xcc},
611 {0xbc, 0x06, 0x00, 0xcc},
612 {0xbc, 0x08, 0x30, 0xcc},
613 {0xbc, 0x09, 0x40, 0xcc},
614 {0xbc, 0x0a, 0x10, 0xcc},
615 {0xbc, 0x0b, 0x00, 0xcc},
616 {0xbc, 0x0c, 0x00, 0xcc},
617 {0xb3, 0x5c, 0x01, 0xcc},
618 {0xf0, 0x00, 0x01, 0xbb},
619 {0x80, 0x00, 0x03, 0xbb},
620 {0x81, 0xc7, 0x14, 0xbb},
621 {0x82, 0xeb, 0xe8, 0xbb},
622 {0x83, 0xfe, 0xf4, 0xbb},
623 {0x84, 0xcd, 0x10, 0xbb},
624 {0x85, 0xf3, 0xee, 0xbb},
625 {0x86, 0xff, 0xf1, 0xbb},
626 {0x87, 0xcd, 0x10, 0xbb},
627 {0x88, 0xf3, 0xee, 0xbb},
628 {0x89, 0x01, 0xf1, 0xbb},
629 {0x8a, 0xe5, 0x17, 0xbb},
630 {0x8b, 0xe8, 0xe2, 0xbb},
631 {0x8c, 0xf7, 0xed, 0xbb},
632 {0x8d, 0x00, 0xff, 0xbb},
633 {0x8e, 0xec, 0x10, 0xbb},
634 {0x8f, 0xf0, 0xed, 0xbb},
635 {0x90, 0xf9, 0xf2, 0xbb},
636 {0x91, 0x00, 0x00, 0xbb},
637 {0x92, 0xe9, 0x0d, 0xbb},
638 {0x93, 0xf4, 0xf2, 0xbb},
639 {0x94, 0xfb, 0xf5, 0xbb},
640 {0x95, 0x00, 0xff, 0xbb},
641 {0xb6, 0x0f, 0x08, 0xbb},
642 {0xb7, 0x3d, 0x16, 0xbb},
643 {0xb8, 0x0c, 0x04, 0xbb},
644 {0xb9, 0x1c, 0x07, 0xbb},
645 {0xba, 0x0a, 0x03, 0xbb},
646 {0xbb, 0x1b, 0x09, 0xbb},
647 {0xbc, 0x17, 0x0d, 0xbb},
648 {0xbd, 0x23, 0x1d, 0xbb},
649 {0xbe, 0x00, 0x28, 0xbb},
650 {0xbf, 0x11, 0x09, 0xbb},
651 {0xc0, 0x16, 0x15, 0xbb},
652 {0xc1, 0x00, 0x1b, 0xbb},
653 {0xc2, 0x0e, 0x07, 0xbb},
654 {0xc3, 0x14, 0x10, 0xbb},
655 {0xc4, 0x00, 0x17, 0xbb},
656 {0x06, 0x74, 0x8e, 0xbb},
657 {0xf0, 0x00, 0x01, 0xbb},
658 {0x06, 0xf4, 0x8e, 0xbb},
659 {0x00, 0x00, 0x50, 0xdd},
660 {0x06, 0x74, 0x8e, 0xbb},
661 {0xf0, 0x00, 0x02, 0xbb},
662 {0x24, 0x50, 0x20, 0xbb},
663 {0xf0, 0x00, 0x02, 0xbb},
664 {0x34, 0x0c, 0x50, 0xbb},
665 {0xb3, 0x01, 0x41, 0xcc},
666 {0xf0, 0x00, 0x00, 0xbb},
667 {0x03, 0x03, 0xc0, 0xbb},
670 static const u8 mi1310_socinitQVGA_JPG
[][4] = {
671 {0xb0, 0x03, 0x19, 0xcc}, {0xb0, 0x04, 0x02, 0xcc},
672 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
673 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x00, 0xcc},
674 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
675 {0xb3, 0x34, 0x02, 0xcc}, {0xb3, 0x35, 0xdd, 0xcc},
676 {0xb3, 0x02, 0x00, 0xcc}, {0xb3, 0x03, 0x0a, 0xcc},
677 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
678 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x03, 0xcc},
679 {0xb3, 0x23, 0xc0, 0xcc}, {0xb3, 0x14, 0x00, 0xcc},
680 {0xb3, 0x15, 0x00, 0xcc}, {0xb3, 0x16, 0x04, 0xcc},
681 {0xb3, 0x17, 0xff, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
682 {0xb8, 0x00, 0x00, 0xcc}, {0xbc, 0x00, 0xf0, 0xcc},
683 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x02, 0xbb},
684 {0xc8, 0x9f, 0x0b, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
685 {0x2f, 0xde, 0x20, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
686 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
687 {0xf0, 0x00, 0x01, 0xbb},
688 {0x05, 0x00, 0x07, 0xbb}, {0x34, 0x00, 0x00, 0xbb},
689 {0x35, 0xff, 0x00, 0xbb}, {0xdc, 0x07, 0x02, 0xbb},
690 {0xdd, 0x3c, 0x18, 0xbb}, {0xde, 0x92, 0x6d, 0xbb},
691 {0xdf, 0xcd, 0xb1, 0xbb}, {0xe0, 0xff, 0xe7, 0xbb},
692 {0x06, 0xf0, 0x0d, 0xbb}, {0x06, 0x70, 0x0e, 0xbb},
693 {0x4c, 0x00, 0x01, 0xbb}, {0x4d, 0x00, 0x01, 0xbb},
694 {0xf0, 0x00, 0x02, 0xbb}, {0x2e, 0x0c, 0x55, 0xbb},
695 {0x21, 0xb6, 0x6e, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
696 {0x37, 0x00, 0xc1, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
697 {0x07, 0x00, 0x84, 0xbb}, {0x08, 0x02, 0x4a, 0xbb},
698 {0x05, 0x01, 0x10, 0xbb}, {0x06, 0x00, 0x39, 0xbb},
699 {0xf0, 0x00, 0x02, 0xbb}, {0x58, 0x02, 0x67, 0xbb},
700 {0x57, 0x02, 0x00, 0xbb}, {0x5a, 0x02, 0x67, 0xbb},
701 {0x59, 0x02, 0x00, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
702 {0x5d, 0x16, 0x11, 0xbb}, {0x39, 0x06, 0x18, 0xbb},
703 {0x3a, 0x06, 0x18, 0xbb}, {0x3b, 0x06, 0x18, 0xbb},
704 {0x3c, 0x06, 0x18, 0xbb}, {0x64, 0x7b, 0x5b, 0xbb},
705 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x30, 0x10, 0xbb},
706 {0x37, 0x00, 0xc0, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
707 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
708 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
709 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
710 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
711 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x25, 0xcc},
712 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
713 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
714 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
715 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
716 {0xb3, 0x5c, 0x01, 0xcc}, {0xf0, 0x00, 0x01, 0xbb},
717 {0x80, 0x00, 0x03, 0xbb}, {0x81, 0xc7, 0x14, 0xbb},
718 {0x82, 0xeb, 0xe8, 0xbb}, {0x83, 0xfe, 0xf4, 0xbb},
719 {0x84, 0xcd, 0x10, 0xbb}, {0x85, 0xf3, 0xee, 0xbb},
720 {0x86, 0xff, 0xf1, 0xbb}, {0x87, 0xcd, 0x10, 0xbb},
721 {0x88, 0xf3, 0xee, 0xbb}, {0x89, 0x01, 0xf1, 0xbb},
722 {0x8a, 0xe5, 0x17, 0xbb}, {0x8b, 0xe8, 0xe2, 0xbb},
723 {0x8c, 0xf7, 0xed, 0xbb}, {0x8d, 0x00, 0xff, 0xbb},
724 {0x8e, 0xec, 0x10, 0xbb}, {0x8f, 0xf0, 0xed, 0xbb},
725 {0x90, 0xf9, 0xf2, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
726 {0x92, 0xe9, 0x0d, 0xbb}, {0x93, 0xf4, 0xf2, 0xbb},
727 {0x94, 0xfb, 0xf5, 0xbb}, {0x95, 0x00, 0xff, 0xbb},
728 {0xb6, 0x0f, 0x08, 0xbb}, {0xb7, 0x3d, 0x16, 0xbb},
729 {0xb8, 0x0c, 0x04, 0xbb}, {0xb9, 0x1c, 0x07, 0xbb},
730 {0xba, 0x0a, 0x03, 0xbb}, {0xbb, 0x1b, 0x09, 0xbb},
731 {0xbc, 0x17, 0x0d, 0xbb}, {0xbd, 0x23, 0x1d, 0xbb},
732 {0xbe, 0x00, 0x28, 0xbb}, {0xbf, 0x11, 0x09, 0xbb},
733 {0xc0, 0x16, 0x15, 0xbb}, {0xc1, 0x00, 0x1b, 0xbb},
734 {0xc2, 0x0e, 0x07, 0xbb}, {0xc3, 0x14, 0x10, 0xbb},
735 {0xc4, 0x00, 0x17, 0xbb}, {0x06, 0x74, 0x8e, 0xbb},
736 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0xf4, 0x8e, 0xbb},
737 {0x00, 0x00, 0x50, 0xdd}, {0x06, 0x74, 0x8e, 0xbb},
738 {0xf0, 0x00, 0x02, 0xbb}, {0x24, 0x50, 0x20, 0xbb},
739 {0xf0, 0x00, 0x02, 0xbb}, {0x34, 0x0c, 0x50, 0xbb},
740 {0xb3, 0x01, 0x41, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
741 {0x03, 0x03, 0xc0, 0xbb},
744 static const u8 mi1310_soc_InitSXGA_JPG
[][4] = {
745 {0xb0, 0x03, 0x19, 0xcc},
746 {0xb0, 0x04, 0x02, 0xcc},
747 {0xb3, 0x00, 0x64, 0xcc},
748 {0xb3, 0x00, 0x65, 0xcc},
749 {0xb3, 0x05, 0x00, 0xcc},
750 {0xb3, 0x06, 0x00, 0xcc},
751 {0xb3, 0x08, 0x01, 0xcc},
752 {0xb3, 0x09, 0x0c, 0xcc},
753 {0xb3, 0x34, 0x02, 0xcc},
754 {0xb3, 0x35, 0xdd, 0xcc},
755 {0xb3, 0x02, 0x00, 0xcc},
756 {0xb3, 0x03, 0x0a, 0xcc},
757 {0xb3, 0x04, 0x0d, 0xcc},
758 {0xb3, 0x20, 0x00, 0xcc},
759 {0xb3, 0x21, 0x00, 0xcc},
760 {0xb3, 0x22, 0x03, 0xcc},
761 {0xb3, 0x23, 0xc0, 0xcc},
762 {0xb3, 0x14, 0x00, 0xcc},
763 {0xb3, 0x15, 0x00, 0xcc},
764 {0xb3, 0x16, 0x04, 0xcc},
765 {0xb3, 0x17, 0xff, 0xcc},
766 {0xb3, 0x00, 0x65, 0xcc},
767 {0xb8, 0x00, 0x00, 0xcc},
768 {0xbc, 0x00, 0x70, 0xcc},
769 {0xbc, 0x01, 0x01, 0xcc},
770 {0xf0, 0x00, 0x02, 0xbb},
771 {0xc8, 0x9f, 0x0b, 0xbb},
772 {0x5b, 0x00, 0x01, 0xbb},
773 {0xf0, 0x00, 0x00, 0xbb},
774 {0x20, 0x03, 0x02, 0xbb}, /* h/v flip */
775 {0xf0, 0x00, 0x01, 0xbb},
776 {0x05, 0x00, 0x07, 0xbb},
777 {0x34, 0x00, 0x00, 0xbb},
778 {0x35, 0xff, 0x00, 0xbb},
779 {0xdc, 0x07, 0x02, 0xbb},
780 {0xdd, 0x3c, 0x18, 0xbb},
781 {0xde, 0x92, 0x6d, 0xbb},
782 {0xdf, 0xcd, 0xb1, 0xbb},
783 {0xe0, 0xff, 0xe7, 0xbb},
784 {0x06, 0xf0, 0x0d, 0xbb},
785 {0x06, 0x70, 0x0e, 0xbb},
786 {0x4c, 0x00, 0x01, 0xbb},
787 {0x4d, 0x00, 0x01, 0xbb},
788 {0xf0, 0x00, 0x02, 0xbb},
789 {0x2e, 0x0c, 0x60, 0xbb},
790 {0x21, 0xb6, 0x6e, 0xbb},
791 {0x37, 0x01, 0x40, 0xbb},
792 {0xf0, 0x00, 0x00, 0xbb},
793 {0x07, 0x00, 0x84, 0xbb},
794 {0x08, 0x02, 0x4a, 0xbb},
795 {0x05, 0x01, 0x10, 0xbb},
796 {0x06, 0x00, 0x39, 0xbb},
797 {0xf0, 0x00, 0x02, 0xbb},
798 {0x58, 0x02, 0x67, 0xbb},
799 {0x57, 0x02, 0x00, 0xbb},
800 {0x5a, 0x02, 0x67, 0xbb},
801 {0x59, 0x02, 0x00, 0xbb},
802 {0x5c, 0x12, 0x0d, 0xbb},
803 {0x5d, 0x16, 0x11, 0xbb},
804 {0x39, 0x06, 0x18, 0xbb},
805 {0x3a, 0x06, 0x18, 0xbb},
806 {0x3b, 0x06, 0x18, 0xbb},
807 {0x3c, 0x06, 0x18, 0xbb},
808 {0x64, 0x7b, 0x5b, 0xbb},
809 {0xb6, 0x00, 0x00, 0xcc},
810 {0xb6, 0x03, 0x05, 0xcc},
811 {0xb6, 0x02, 0x00, 0xcc},
812 {0xb6, 0x05, 0x03, 0xcc},
813 {0xb6, 0x04, 0xc0, 0xcc},
814 {0xb6, 0x12, 0xf8, 0xcc},
815 {0xb6, 0x13, 0x29, 0xcc},
816 {0xb6, 0x18, 0x09, 0xcc},
817 {0xb6, 0x17, 0x60, 0xcc},
818 {0xb6, 0x16, 0x00, 0xcc},
819 {0xb6, 0x22, 0x12, 0xcc},
820 {0xb6, 0x23, 0x0b, 0xcc},
821 {0xbf, 0xc0, 0x39, 0xcc},
822 {0xbf, 0xc1, 0x04, 0xcc},
823 {0xbf, 0xcc, 0x00, 0xcc},
824 {0xb3, 0x01, 0x41, 0xcc},
825 {0x00, 0x00, 0x80, 0xdd},
826 {0xf0, 0x00, 0x02, 0xbb},
827 {0x00, 0x00, 0x10, 0xdd},
828 {0x22, 0xa0, 0x78, 0xbb},
829 {0x23, 0xa0, 0x78, 0xbb},
830 {0x24, 0x7f, 0x00, 0xbb},
831 {0x28, 0xea, 0x02, 0xbb},
832 {0x29, 0x86, 0x7a, 0xbb},
833 {0x5e, 0x52, 0x4c, 0xbb},
834 {0x5f, 0x20, 0x24, 0xbb},
835 {0x60, 0x00, 0x02, 0xbb},
836 {0x02, 0x00, 0xee, 0xbb},
837 {0x03, 0x39, 0x23, 0xbb},
838 {0x04, 0x07, 0x24, 0xbb},
839 {0x09, 0x00, 0xc0, 0xbb},
840 {0x0a, 0x00, 0x79, 0xbb},
841 {0x0b, 0x00, 0x04, 0xbb},
842 {0x0c, 0x00, 0x5c, 0xbb},
843 {0x0d, 0x00, 0xd9, 0xbb},
844 {0x0e, 0x00, 0x53, 0xbb},
845 {0x0f, 0x00, 0x21, 0xbb},
846 {0x10, 0x00, 0xa4, 0xbb},
847 {0x11, 0x00, 0xe5, 0xbb},
848 {0x15, 0x00, 0x00, 0xbb},
849 {0x16, 0x00, 0x00, 0xbb},
850 {0x17, 0x00, 0x00, 0xbb},
851 {0x18, 0x00, 0x00, 0xbb},
852 {0x19, 0x00, 0x00, 0xbb},
853 {0x1a, 0x00, 0x00, 0xbb},
854 {0x1b, 0x00, 0x00, 0xbb},
855 {0x1c, 0x00, 0x00, 0xbb},
856 {0x1d, 0x00, 0x00, 0xbb},
857 {0x1e, 0x00, 0x00, 0xbb},
858 {0xf0, 0x00, 0x01, 0xbb},
859 {0x00, 0x00, 0x20, 0xdd},
860 {0x06, 0xf0, 0x8e, 0xbb},
861 {0x00, 0x00, 0x80, 0xdd},
862 {0x06, 0x70, 0x8e, 0xbb},
863 {0xf0, 0x00, 0x02, 0xbb},
864 {0x00, 0x00, 0x20, 0xdd},
865 {0x5e, 0x6a, 0x53, 0xbb},
866 {0x5f, 0x40, 0x2c, 0xbb},
867 {0xf0, 0x00, 0x01, 0xbb},
868 {0x00, 0x00, 0x20, 0xdd},
869 {0x58, 0x00, 0x00, 0xbb},
870 {0x53, 0x09, 0x03, 0xbb},
871 {0x54, 0x31, 0x18, 0xbb},
872 {0x55, 0x8b, 0x5f, 0xbb},
873 {0x56, 0xc0, 0xa9, 0xbb},
874 {0x57, 0xe0, 0xd2, 0xbb},
875 {0xe1, 0x00, 0x00, 0xbb},
876 {0xdc, 0x09, 0x03, 0xbb},
877 {0xdd, 0x31, 0x18, 0xbb},
878 {0xde, 0x8b, 0x5f, 0xbb},
879 {0xdf, 0xc0, 0xa9, 0xbb},
880 {0xe0, 0xe0, 0xd2, 0xbb},
881 {0xb3, 0x5c, 0x01, 0xcc},
882 {0xf0, 0x00, 0x01, 0xbb},
883 {0x06, 0xf0, 0x8e, 0xbb},
884 {0xf0, 0x00, 0x02, 0xbb},
885 {0x2f, 0xde, 0x20, 0xbb},
886 {0xf0, 0x00, 0x02, 0xbb},
887 {0x24, 0x50, 0x20, 0xbb},
888 {0xbc, 0x0e, 0x00, 0xcc},
889 {0xbc, 0x0f, 0x05, 0xcc},
890 {0xbc, 0x10, 0xc0, 0xcc},
891 {0xf0, 0x00, 0x02, 0xbb},
892 {0x34, 0x0c, 0x50, 0xbb},
893 {0xbc, 0x11, 0x03, 0xcc},
894 {0xf0, 0x00, 0x01, 0xbb},
895 {0x80, 0x00, 0x03, 0xbb},
896 {0x81, 0xc7, 0x14, 0xbb},
897 {0x82, 0xeb, 0xe8, 0xbb},
898 {0x83, 0xfe, 0xf4, 0xbb},
899 {0x84, 0xcd, 0x10, 0xbb},
900 {0x85, 0xf3, 0xee, 0xbb},
901 {0x86, 0xff, 0xf1, 0xbb},
902 {0x87, 0xcd, 0x10, 0xbb},
903 {0x88, 0xf3, 0xee, 0xbb},
904 {0x89, 0x01, 0xf1, 0xbb},
905 {0x8a, 0xe5, 0x17, 0xbb},
906 {0x8b, 0xe8, 0xe2, 0xbb},
907 {0x8c, 0xf7, 0xed, 0xbb},
908 {0x8d, 0x00, 0xff, 0xbb},
909 {0x8e, 0xec, 0x10, 0xbb},
910 {0x8f, 0xf0, 0xed, 0xbb},
911 {0x90, 0xf9, 0xf2, 0xbb},
912 {0x91, 0x00, 0x00, 0xbb},
913 {0x92, 0xe9, 0x0d, 0xbb},
914 {0x93, 0xf4, 0xf2, 0xbb},
915 {0x94, 0xfb, 0xf5, 0xbb},
916 {0x95, 0x00, 0xff, 0xbb},
917 {0xb6, 0x0f, 0x08, 0xbb},
918 {0xb7, 0x3d, 0x16, 0xbb},
919 {0xb8, 0x0c, 0x04, 0xbb},
920 {0xb9, 0x1c, 0x07, 0xbb},
921 {0xba, 0x0a, 0x03, 0xbb},
922 {0xbb, 0x1b, 0x09, 0xbb},
923 {0xbc, 0x17, 0x0d, 0xbb},
924 {0xbd, 0x23, 0x1d, 0xbb},
925 {0xbe, 0x00, 0x28, 0xbb},
926 {0xbf, 0x11, 0x09, 0xbb},
927 {0xc0, 0x16, 0x15, 0xbb},
928 {0xc1, 0x00, 0x1b, 0xbb},
929 {0xc2, 0x0e, 0x07, 0xbb},
930 {0xc3, 0x14, 0x10, 0xbb},
931 {0xc4, 0x00, 0x17, 0xbb},
932 {0x06, 0x74, 0x8e, 0xbb},
933 {0xf0, 0x00, 0x00, 0xbb},
934 {0x03, 0x03, 0xc0, 0xbb},
938 static const u8 mi1320_gamma
[17] = {
939 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
940 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
942 static const u8 mi1320_matrix
[9] = {
943 0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52
945 static const u8 mi1320_initVGA_data
[][4] = {
946 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
947 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
948 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
949 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
950 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
951 {0xb3, 0x06, 0x00, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
952 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
953 {0xb3, 0x35, 0xc8, 0xcc}, /* i2c add: 48 */
954 {0xb3, 0x02, 0x00, 0xcc},
955 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
956 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
957 {0xb3, 0x22, 0x03, 0xcc}, {0xb3, 0x23, 0xc0, 0xcc},
958 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
959 {0xb3, 0x16, 0x04, 0xcc}, {0xb3, 0x17, 0xff, 0xcc},
960 {0xb3, 0x00, 0x67, 0xcc}, {0xbc, 0x00, 0xd0, 0xcc},
961 {0xbc, 0x01, 0x01, 0xcc}, {0xf0, 0x00, 0x00, 0xbb},
962 {0x0d, 0x00, 0x09, 0xbb}, {0x00, 0x01, 0x00, 0xdd},
963 {0x0d, 0x00, 0x08, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
964 {0xa1, 0x05, 0x00, 0xbb}, {0xa4, 0x03, 0xc0, 0xbb},
965 {0xf0, 0x00, 0x02, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
966 {0xc8, 0x9f, 0x0b, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
967 {0xf0, 0x00, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
968 {0x20, 0x01, 0x00, 0xbb}, {0x00, 0x00, 0x10, 0xdd},
969 {0xf0, 0x00, 0x01, 0xbb}, {0x9d, 0x3c, 0xa0, 0xbb},
970 {0x47, 0x30, 0x30, 0xbb}, {0xf0, 0x00, 0x00, 0xbb},
971 {0x0a, 0x80, 0x11, 0xbb}, {0x35, 0x00, 0x22, 0xbb},
972 {0xf0, 0x00, 0x02, 0xbb}, {0x9d, 0xc5, 0x05, 0xbb},
973 {0xdc, 0x0f, 0xfc, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
974 {0x06, 0x74, 0x0e, 0xbb}, {0x80, 0x00, 0x06, 0xbb},
975 {0x81, 0x04, 0x00, 0xbb}, {0x82, 0x01, 0x02, 0xbb},
976 {0x83, 0x03, 0x02, 0xbb}, {0x84, 0x05, 0x00, 0xbb},
977 {0x85, 0x01, 0x00, 0xbb}, {0x86, 0x03, 0x02, 0xbb},
978 {0x87, 0x05, 0x00, 0xbb}, {0x88, 0x01, 0x00, 0xbb},
979 {0x89, 0x02, 0x02, 0xbb}, {0x8a, 0xfd, 0x04, 0xbb},
980 {0x8b, 0xfc, 0xfd, 0xbb}, {0x8c, 0xff, 0xfd, 0xbb},
981 {0x8d, 0x00, 0x00, 0xbb}, {0x8e, 0xfe, 0x05, 0xbb},
982 {0x8f, 0xfc, 0xfd, 0xbb}, {0x90, 0xfe, 0xfd, 0xbb},
983 {0x91, 0x00, 0x00, 0xbb}, {0x92, 0xfe, 0x03, 0xbb},
984 {0x93, 0xfd, 0xfe, 0xbb}, {0x94, 0xff, 0xfd, 0xbb},
985 {0x95, 0x00, 0x00, 0xbb}, {0xb6, 0x07, 0x05, 0xbb},
986 {0xb7, 0x13, 0x06, 0xbb}, {0xb8, 0x08, 0x06, 0xbb},
987 {0xb9, 0x14, 0x08, 0xbb}, {0xba, 0x06, 0x05, 0xbb},
988 {0xbb, 0x13, 0x06, 0xbb}, {0xbc, 0x03, 0x01, 0xbb},
989 {0xbd, 0x03, 0x04, 0xbb}, {0xbe, 0x00, 0x02, 0xbb},
990 {0xbf, 0x03, 0x01, 0xbb}, {0xc0, 0x02, 0x04, 0xbb},
991 {0xc1, 0x00, 0x04, 0xbb}, {0xc2, 0x02, 0x01, 0xbb},
992 {0xc3, 0x01, 0x03, 0xbb}, {0xc4, 0x00, 0x04, 0xbb},
993 {0xf0, 0x00, 0x00, 0xbb}, {0x05, 0x01, 0x13, 0xbb},
994 {0x06, 0x00, 0x11, 0xbb}, {0x07, 0x00, 0x85, 0xbb},
995 {0x08, 0x00, 0x27, 0xbb},
996 {0x20, 0x01, 0x00, 0xbb}, /* h/v flips - was 03 */
997 {0x21, 0x80, 0x00, 0xbb}, {0x22, 0x0d, 0x0f, 0xbb},
998 {0x24, 0x80, 0x00, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
999 {0xf0, 0x00, 0x02, 0xbb}, {0x39, 0x03, 0x0d, 0xbb},
1000 {0x3a, 0x06, 0x1b, 0xbb}, {0x3b, 0x00, 0x95, 0xbb},
1001 {0x3c, 0x04, 0xdb, 0xbb}, {0x57, 0x02, 0x00, 0xbb},
1002 {0x58, 0x02, 0x66, 0xbb}, {0x59, 0x00, 0xff, 0xbb},
1003 {0x5a, 0x01, 0x33, 0xbb}, {0x5c, 0x12, 0x0d, 0xbb},
1004 {0x5d, 0x16, 0x11, 0xbb}, {0x64, 0x5e, 0x1c, 0xbb},
1005 {0xf0, 0x00, 0x02, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
1006 {0x5b, 0x00, 0x01, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
1007 {0x36, 0x68, 0x10, 0xbb}, {0x00, 0x00, 0x30, 0xdd},
1008 {0x37, 0x82, 0x00, 0xbb}, {0xbc, 0x0e, 0x00, 0xcc},
1009 {0xbc, 0x0f, 0x05, 0xcc}, {0xbc, 0x10, 0xc0, 0xcc},
1010 {0xbc, 0x11, 0x03, 0xcc}, {0xb6, 0x00, 0x00, 0xcc},
1011 {0xb6, 0x03, 0x05, 0xcc}, {0xb6, 0x02, 0x00, 0xcc},
1012 {0xb6, 0x05, 0x04, 0xcc}, {0xb6, 0x04, 0x00, 0xcc},
1013 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x29, 0xcc},
1014 {0xb6, 0x18, 0x0a, 0xcc}, {0xb6, 0x17, 0x00, 0xcc},
1015 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
1016 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x26, 0xcc},
1017 {0xbf, 0xc1, 0x02, 0xcc}, {0xbf, 0xcc, 0x04, 0xcc},
1018 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
1019 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
1020 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
1021 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
1022 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
1023 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1026 static const u8 mi1320_initQVGA_data
[][4] = {
1027 {0xb3, 0x01, 0x01, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
1028 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
1029 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x33, 0xdd},
1030 {0xb3, 0x00, 0x64, 0xcc}, {0xb3, 0x00, 0x65, 0xcc},
1031 {0xb0, 0x16, 0x03, 0xcc}, {0xb3, 0x05, 0x01, 0xcc},
1032 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1033 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x34, 0x02, 0xcc},
1034 {0xb3, 0x35, 0xc8, 0xcc}, {0xb3, 0x02, 0x00, 0xcc},
1035 {0xb3, 0x03, 0x0a, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1036 {0xb3, 0x20, 0x00, 0xcc}, {0xb3, 0x21, 0x00, 0xcc},
1037 {0xb3, 0x22, 0x01, 0xcc}, {0xb3, 0x23, 0xe0, 0xcc},
1038 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1039 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1040 {0xb3, 0x00, 0x65, 0xcc}, {0xb8, 0x00, 0x00, 0xcc},
1041 {0xbc, 0x00, 0xd0, 0xcc}, {0xbc, 0x01, 0x01, 0xcc},
1042 {0xf0, 0x00, 0x00, 0xbb}, {0x0d, 0x00, 0x09, 0xbb},
1043 {0x00, 0x01, 0x00, 0xdd}, {0x0d, 0x00, 0x08, 0xbb},
1044 {0xf0, 0x00, 0x00, 0xbb}, {0x02, 0x00, 0x64, 0xbb},
1045 {0x05, 0x01, 0x78, 0xbb}, {0x06, 0x00, 0x11, 0xbb},
1046 {0x07, 0x01, 0x42, 0xbb}, {0x08, 0x00, 0x11, 0xbb},
1047 {0x20, 0x01, 0x00, 0xbb}, {0x21, 0x80, 0x00, 0xbb},
1048 {0x22, 0x0d, 0x0f, 0xbb}, {0x24, 0x80, 0x00, 0xbb},
1049 {0x59, 0x00, 0xff, 0xbb}, {0xf0, 0x00, 0x01, 0xbb},
1050 {0x9d, 0x3c, 0xa0, 0xbb}, {0x47, 0x30, 0x30, 0xbb},
1051 {0xf0, 0x00, 0x00, 0xbb}, {0x0a, 0x80, 0x11, 0xbb},
1052 {0x35, 0x00, 0x22, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
1053 {0x9d, 0xc5, 0x05, 0xbb}, {0xdc, 0x0f, 0xfc, 0xbb},
1054 {0xf0, 0x00, 0x01, 0xbb}, {0x06, 0x74, 0x0e, 0xbb},
1055 {0x80, 0x00, 0x06, 0xbb}, {0x81, 0x04, 0x00, 0xbb},
1056 {0x82, 0x01, 0x02, 0xbb}, {0x83, 0x03, 0x02, 0xbb},
1057 {0x84, 0x05, 0x00, 0xbb}, {0x85, 0x01, 0x00, 0xbb},
1058 {0x86, 0x03, 0x02, 0xbb}, {0x87, 0x05, 0x00, 0xbb},
1059 {0x88, 0x01, 0x00, 0xbb}, {0x89, 0x02, 0x02, 0xbb},
1060 {0x8a, 0xfd, 0x04, 0xbb}, {0x8b, 0xfc, 0xfd, 0xbb},
1061 {0x8c, 0xff, 0xfd, 0xbb}, {0x8d, 0x00, 0x00, 0xbb},
1062 {0x8e, 0xfe, 0x05, 0xbb}, {0x8f, 0xfc, 0xfd, 0xbb},
1063 {0x90, 0xfe, 0xfd, 0xbb}, {0x91, 0x00, 0x00, 0xbb},
1064 {0x92, 0xfe, 0x03, 0xbb}, {0x93, 0xfd, 0xfe, 0xbb},
1065 {0x94, 0xff, 0xfd, 0xbb}, {0x95, 0x00, 0x00, 0xbb},
1066 {0xb6, 0x07, 0x05, 0xbb}, {0xb7, 0x13, 0x06, 0xbb},
1067 {0xb8, 0x08, 0x06, 0xbb}, {0xb9, 0x14, 0x08, 0xbb},
1068 {0xba, 0x06, 0x05, 0xbb}, {0xbb, 0x13, 0x06, 0xbb},
1069 {0xbc, 0x03, 0x01, 0xbb}, {0xbd, 0x03, 0x04, 0xbb},
1070 {0xbe, 0x00, 0x02, 0xbb}, {0xbf, 0x03, 0x01, 0xbb},
1071 {0xc0, 0x02, 0x04, 0xbb}, {0xc1, 0x00, 0x04, 0xbb},
1072 {0xc2, 0x02, 0x01, 0xbb}, {0xc3, 0x01, 0x03, 0xbb},
1073 {0xc4, 0x00, 0x04, 0xbb}, {0xf0, 0x00, 0x02, 0xbb},
1074 {0xc8, 0x00, 0x00, 0xbb}, {0x2e, 0x00, 0x00, 0xbb},
1075 {0x2e, 0x0c, 0x5b, 0xbb}, {0x2f, 0xd1, 0x00, 0xbb},
1076 {0x39, 0x03, 0xca, 0xbb}, {0x3a, 0x06, 0x80, 0xbb},
1077 {0x3b, 0x01, 0x52, 0xbb}, {0x3c, 0x05, 0x40, 0xbb},
1078 {0x57, 0x01, 0x9c, 0xbb}, {0x58, 0x01, 0xee, 0xbb},
1079 {0x59, 0x00, 0xf0, 0xbb}, {0x5a, 0x01, 0x20, 0xbb},
1080 {0x5c, 0x1d, 0x17, 0xbb}, {0x5d, 0x22, 0x1c, 0xbb},
1081 {0x64, 0x1e, 0x1c, 0xbb}, {0x5b, 0x00, 0x01, 0xbb},
1082 {0xf0, 0x00, 0x02, 0xbb}, {0x36, 0x68, 0x10, 0xbb},
1083 {0x00, 0x00, 0x30, 0xdd}, {0x37, 0x81, 0x00, 0xbb},
1084 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
1085 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
1086 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
1087 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
1088 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
1089 {0xbf, 0xc0, 0x26, 0xcc}, {0xbf, 0xc1, 0x02, 0xcc},
1090 {0xbf, 0xcc, 0x04, 0xcc}, {0xb3, 0x5c, 0x01, 0xcc},
1091 {0xb3, 0x01, 0x41, 0xcc},
1095 static const u8 mi1320_soc_InitVGA
[][4] = {
1096 {0xb3, 0x01, 0x01, 0xcc},
1097 {0xb0, 0x03, 0x19, 0xcc},
1098 {0xb0, 0x04, 0x02, 0xcc},
1099 {0x00, 0x00, 0x30, 0xdd},
1100 {0xb3, 0x00, 0x64, 0xcc},
1101 {0xb3, 0x00, 0x67, 0xcc},
1102 {0xb3, 0x05, 0x01, 0xcc},
1103 {0xb3, 0x06, 0x01, 0xcc},
1104 {0xb3, 0x08, 0x01, 0xcc},
1105 {0xb3, 0x09, 0x0c, 0xcc},
1106 {0xb3, 0x34, 0x02, 0xcc},
1107 {0xb3, 0x35, 0xc8, 0xcc}, /* i2c add: 48 */
1108 {0xb3, 0x02, 0x00, 0xcc},
1109 {0xb3, 0x03, 0x0a, 0xcc},
1110 {0xb3, 0x04, 0x05, 0xcc},
1111 {0xb3, 0x20, 0x00, 0xcc},
1112 {0xb3, 0x21, 0x00, 0xcc},
1113 {0xb3, 0x22, 0x01, 0xcc},
1114 {0xb3, 0x23, 0xe0, 0xcc},
1115 {0xb3, 0x14, 0x00, 0xcc},
1116 {0xb3, 0x15, 0x00, 0xcc},
1117 {0xb3, 0x16, 0x02, 0xcc},
1118 {0xb3, 0x17, 0x7f, 0xcc},
1119 {0xb3, 0x00, 0x67, 0xcc},
1120 {0xb8, 0x00, 0x00, 0xcc},
1121 {0xbc, 0x00, 0x71, 0xcc},
1122 {0xbc, 0x01, 0x01, 0xcc},
1123 {0xb3, 0x5c, 0x01, 0xcc},
1124 {0xf0, 0x00, 0x02, 0xbb},
1125 {0x00, 0x00, 0x10, 0xdd},
1126 {0xc8, 0x00, 0x00, 0xbb},
1127 {0x00, 0x00, 0x30, 0xdd},
1128 {0xf0, 0x00, 0x00, 0xbb},
1129 {0x00, 0x00, 0x10, 0xdd},
1130 {0x07, 0x00, 0xe0, 0xbb},
1131 {0x08, 0x00, 0x0b, 0xbb},
1132 {0x21, 0x00, 0x0c, 0xbb},
1133 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
1134 {0xbf, 0xc0, 0x26, 0xcc},
1135 {0xbf, 0xc1, 0x02, 0xcc},
1136 {0xbf, 0xcc, 0x04, 0xcc},
1137 {0xb3, 0x01, 0x41, 0xcc},
1138 {0xf0, 0x00, 0x00, 0xbb},
1139 {0x05, 0x01, 0x78, 0xbb},
1140 {0x06, 0x00, 0x11, 0xbb},
1141 {0x07, 0x01, 0x42, 0xbb},
1142 {0x08, 0x00, 0x11, 0xbb},
1143 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
1144 {0x21, 0x80, 0x00, 0xbb},
1145 {0x22, 0x0d, 0x0f, 0xbb},
1146 {0x24, 0x80, 0x00, 0xbb},
1147 {0x59, 0x00, 0xff, 0xbb},
1148 {0xf0, 0x00, 0x02, 0xbb},
1149 {0x39, 0x03, 0xca, 0xbb},
1150 {0x3a, 0x06, 0x80, 0xbb},
1151 {0x3b, 0x01, 0x52, 0xbb},
1152 {0x3c, 0x05, 0x40, 0xbb},
1153 {0x57, 0x01, 0x9c, 0xbb},
1154 {0x58, 0x01, 0xee, 0xbb},
1155 {0x59, 0x00, 0xf0, 0xbb},
1156 {0x5a, 0x01, 0x20, 0xbb},
1157 {0x5c, 0x1d, 0x17, 0xbb},
1158 {0x5d, 0x22, 0x1c, 0xbb},
1159 {0x64, 0x1e, 0x1c, 0xbb},
1160 {0x5b, 0x00, 0x00, 0xbb},
1161 {0xf0, 0x00, 0x02, 0xbb},
1162 {0x22, 0xa0, 0x78, 0xbb},
1163 {0x23, 0xa0, 0x78, 0xbb},
1164 {0x24, 0x7f, 0x00, 0xbb},
1165 {0x28, 0xea, 0x02, 0xbb},
1166 {0x29, 0x86, 0x7a, 0xbb},
1167 {0x5e, 0x52, 0x4c, 0xbb},
1168 {0x5f, 0x20, 0x24, 0xbb},
1169 {0x60, 0x00, 0x02, 0xbb},
1170 {0x02, 0x00, 0xee, 0xbb},
1171 {0x03, 0x39, 0x23, 0xbb},
1172 {0x04, 0x07, 0x24, 0xbb},
1173 {0x09, 0x00, 0xc0, 0xbb},
1174 {0x0a, 0x00, 0x79, 0xbb},
1175 {0x0b, 0x00, 0x04, 0xbb},
1176 {0x0c, 0x00, 0x5c, 0xbb},
1177 {0x0d, 0x00, 0xd9, 0xbb},
1178 {0x0e, 0x00, 0x53, 0xbb},
1179 {0x0f, 0x00, 0x21, 0xbb},
1180 {0x10, 0x00, 0xa4, 0xbb},
1181 {0x11, 0x00, 0xe5, 0xbb},
1182 {0x15, 0x00, 0x00, 0xbb},
1183 {0x16, 0x00, 0x00, 0xbb},
1184 {0x17, 0x00, 0x00, 0xbb},
1185 {0x18, 0x00, 0x00, 0xbb},
1186 {0x19, 0x00, 0x00, 0xbb},
1187 {0x1a, 0x00, 0x00, 0xbb},
1188 {0x1b, 0x00, 0x00, 0xbb},
1189 {0x1c, 0x00, 0x00, 0xbb},
1190 {0x1d, 0x00, 0x00, 0xbb},
1191 {0x1e, 0x00, 0x00, 0xbb},
1192 {0xf0, 0x00, 0x01, 0xbb},
1193 {0x06, 0xe0, 0x0e, 0xbb},
1194 {0x06, 0x60, 0x0e, 0xbb},
1195 {0xb3, 0x5c, 0x01, 0xcc},
1198 static const u8 mi1320_soc_InitQVGA
[][4] = {
1199 {0xb3, 0x01, 0x01, 0xcc},
1200 {0xb0, 0x03, 0x19, 0xcc},
1201 {0xb0, 0x04, 0x02, 0xcc},
1202 {0x00, 0x00, 0x30, 0xdd},
1203 {0xb3, 0x00, 0x64, 0xcc},
1204 {0xb3, 0x00, 0x67, 0xcc},
1205 {0xb3, 0x05, 0x01, 0xcc},
1206 {0xb3, 0x06, 0x01, 0xcc},
1207 {0xb3, 0x08, 0x01, 0xcc},
1208 {0xb3, 0x09, 0x0c, 0xcc},
1209 {0xb3, 0x34, 0x02, 0xcc},
1210 {0xb3, 0x35, 0xc8, 0xcc},
1211 {0xb3, 0x02, 0x00, 0xcc},
1212 {0xb3, 0x03, 0x0a, 0xcc},
1213 {0xb3, 0x04, 0x05, 0xcc},
1214 {0xb3, 0x20, 0x00, 0xcc},
1215 {0xb3, 0x21, 0x00, 0xcc},
1216 {0xb3, 0x22, 0x01, 0xcc},
1217 {0xb3, 0x23, 0xe0, 0xcc},
1218 {0xb3, 0x14, 0x00, 0xcc},
1219 {0xb3, 0x15, 0x00, 0xcc},
1220 {0xb3, 0x16, 0x02, 0xcc},
1221 {0xb3, 0x17, 0x7f, 0xcc},
1222 {0xb3, 0x00, 0x67, 0xcc},
1223 {0xb8, 0x00, 0x00, 0xcc},
1224 {0xbc, 0x00, 0xd1, 0xcc},
1225 {0xbc, 0x01, 0x01, 0xcc},
1226 {0xb3, 0x5c, 0x01, 0xcc},
1227 {0xf0, 0x00, 0x02, 0xbb},
1228 {0x00, 0x00, 0x10, 0xdd},
1229 {0xc8, 0x00, 0x00, 0xbb},
1230 {0x00, 0x00, 0x30, 0xdd},
1231 {0xf0, 0x00, 0x00, 0xbb},
1232 {0x00, 0x00, 0x10, 0xdd},
1233 {0x07, 0x00, 0xe0, 0xbb},
1234 {0x08, 0x00, 0x0b, 0xbb},
1235 {0x21, 0x00, 0x0c, 0xbb},
1236 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
1237 {0xbf, 0xc0, 0x26, 0xcc},
1238 {0xbf, 0xc1, 0x02, 0xcc},
1239 {0xbf, 0xcc, 0x04, 0xcc},
1240 {0xbc, 0x02, 0x18, 0xcc},
1241 {0xbc, 0x03, 0x50, 0xcc},
1242 {0xbc, 0x04, 0x18, 0xcc},
1243 {0xbc, 0x05, 0x00, 0xcc},
1244 {0xbc, 0x06, 0x00, 0xcc},
1245 {0xbc, 0x08, 0x30, 0xcc},
1246 {0xbc, 0x09, 0x40, 0xcc},
1247 {0xbc, 0x0a, 0x10, 0xcc},
1248 {0xbc, 0x0b, 0x00, 0xcc},
1249 {0xbc, 0x0c, 0x00, 0xcc},
1250 {0xb3, 0x01, 0x41, 0xcc},
1251 {0xf0, 0x00, 0x00, 0xbb},
1252 {0x05, 0x01, 0x78, 0xbb},
1253 {0x06, 0x00, 0x11, 0xbb},
1254 {0x07, 0x01, 0x42, 0xbb},
1255 {0x08, 0x00, 0x11, 0xbb},
1256 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
1257 {0x21, 0x80, 0x00, 0xbb},
1258 {0x22, 0x0d, 0x0f, 0xbb},
1259 {0x24, 0x80, 0x00, 0xbb},
1260 {0x59, 0x00, 0xff, 0xbb},
1261 {0xf0, 0x00, 0x02, 0xbb},
1262 {0x39, 0x03, 0xca, 0xbb},
1263 {0x3a, 0x06, 0x80, 0xbb},
1264 {0x3b, 0x01, 0x52, 0xbb},
1265 {0x3c, 0x05, 0x40, 0xbb},
1266 {0x57, 0x01, 0x9c, 0xbb},
1267 {0x58, 0x01, 0xee, 0xbb},
1268 {0x59, 0x00, 0xf0, 0xbb},
1269 {0x5a, 0x01, 0x20, 0xbb},
1270 {0x5c, 0x1d, 0x17, 0xbb},
1271 {0x5d, 0x22, 0x1c, 0xbb},
1272 {0x64, 0x1e, 0x1c, 0xbb},
1273 {0x5b, 0x00, 0x00, 0xbb},
1274 {0xf0, 0x00, 0x02, 0xbb},
1275 {0x22, 0xa0, 0x78, 0xbb},
1276 {0x23, 0xa0, 0x78, 0xbb},
1277 {0x24, 0x7f, 0x00, 0xbb},
1278 {0x28, 0xea, 0x02, 0xbb},
1279 {0x29, 0x86, 0x7a, 0xbb},
1280 {0x5e, 0x52, 0x4c, 0xbb},
1281 {0x5f, 0x20, 0x24, 0xbb},
1282 {0x60, 0x00, 0x02, 0xbb},
1283 {0x02, 0x00, 0xee, 0xbb},
1284 {0x03, 0x39, 0x23, 0xbb},
1285 {0x04, 0x07, 0x24, 0xbb},
1286 {0x09, 0x00, 0xc0, 0xbb},
1287 {0x0a, 0x00, 0x79, 0xbb},
1288 {0x0b, 0x00, 0x04, 0xbb},
1289 {0x0c, 0x00, 0x5c, 0xbb},
1290 {0x0d, 0x00, 0xd9, 0xbb},
1291 {0x0e, 0x00, 0x53, 0xbb},
1292 {0x0f, 0x00, 0x21, 0xbb},
1293 {0x10, 0x00, 0xa4, 0xbb},
1294 {0x11, 0x00, 0xe5, 0xbb},
1295 {0x15, 0x00, 0x00, 0xbb},
1296 {0x16, 0x00, 0x00, 0xbb},
1297 {0x17, 0x00, 0x00, 0xbb},
1298 {0x18, 0x00, 0x00, 0xbb},
1299 {0x19, 0x00, 0x00, 0xbb},
1300 {0x1a, 0x00, 0x00, 0xbb},
1301 {0x1b, 0x00, 0x00, 0xbb},
1302 {0x1c, 0x00, 0x00, 0xbb},
1303 {0x1d, 0x00, 0x00, 0xbb},
1304 {0x1e, 0x00, 0x00, 0xbb},
1305 {0xf0, 0x00, 0x01, 0xbb},
1306 {0x06, 0xe0, 0x0e, 0xbb},
1307 {0x06, 0x60, 0x0e, 0xbb},
1308 {0xb3, 0x5c, 0x01, 0xcc},
1311 static const u8 mi1320_soc_InitSXGA
[][4] = {
1312 {0xb3, 0x01, 0x01, 0xcc},
1313 {0xb0, 0x03, 0x19, 0xcc},
1314 {0x00, 0x00, 0x30, 0xdd},
1315 {0xb3, 0x00, 0x64, 0xcc},
1316 {0xb3, 0x00, 0x67, 0xcc},
1317 {0xb3, 0x05, 0x01, 0xcc},
1318 {0xb3, 0x06, 0x01, 0xcc},
1319 {0xb3, 0x08, 0x01, 0xcc},
1320 {0xb3, 0x09, 0x0c, 0xcc},
1321 {0xb3, 0x34, 0x02, 0xcc},
1322 {0xb3, 0x35, 0xc8, 0xcc},
1323 {0xb3, 0x02, 0x00, 0xcc},
1324 {0xb3, 0x03, 0x0a, 0xcc},
1325 {0xb3, 0x04, 0x05, 0xcc},
1326 {0xb3, 0x20, 0x00, 0xcc},
1327 {0xb3, 0x21, 0x00, 0xcc},
1328 {0xb3, 0x22, 0x04, 0xcc},
1329 {0xb3, 0x23, 0x00, 0xcc},
1330 {0xb3, 0x14, 0x00, 0xcc},
1331 {0xb3, 0x15, 0x00, 0xcc},
1332 {0xb3, 0x16, 0x04, 0xcc},
1333 {0xb3, 0x17, 0xff, 0xcc},
1334 {0xb3, 0x00, 0x67, 0xcc},
1335 {0xbc, 0x00, 0x71, 0xcc},
1336 {0xbc, 0x01, 0x01, 0xcc},
1337 {0xb3, 0x5c, 0x01, 0xcc},
1338 {0xf0, 0x00, 0x02, 0xbb},
1339 {0x00, 0x00, 0x30, 0xdd},
1340 {0xc8, 0x9f, 0x0b, 0xbb},
1341 {0x00, 0x00, 0x20, 0xdd},
1342 {0x5b, 0x00, 0x01, 0xbb},
1343 {0x00, 0x00, 0x20, 0xdd},
1344 {0xf0, 0x00, 0x00, 0xbb},
1345 {0x00, 0x00, 0x30, 0xdd},
1346 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
1347 {0x00, 0x00, 0x20, 0xdd},
1348 {0xbf, 0xc0, 0x26, 0xcc},
1349 {0xbf, 0xc1, 0x02, 0xcc},
1350 {0xbf, 0xcc, 0x04, 0xcc},
1351 {0xb3, 0x01, 0x41, 0xcc},
1352 {0xf0, 0x00, 0x00, 0xbb},
1353 {0x05, 0x01, 0x78, 0xbb},
1354 {0x06, 0x00, 0x11, 0xbb},
1355 {0x07, 0x01, 0x42, 0xbb},
1356 {0x08, 0x00, 0x11, 0xbb},
1357 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
1358 {0x21, 0x80, 0x00, 0xbb},
1359 {0x22, 0x0d, 0x0f, 0xbb},
1360 {0x24, 0x80, 0x00, 0xbb},
1361 {0x59, 0x00, 0xff, 0xbb},
1362 {0xf0, 0x00, 0x02, 0xbb},
1363 {0x39, 0x03, 0xca, 0xbb},
1364 {0x3a, 0x06, 0x80, 0xbb},
1365 {0x3b, 0x01, 0x52, 0xbb},
1366 {0x3c, 0x05, 0x40, 0xbb},
1367 {0x57, 0x01, 0x9c, 0xbb},
1368 {0x58, 0x01, 0xee, 0xbb},
1369 {0x59, 0x00, 0xf0, 0xbb},
1370 {0x5a, 0x01, 0x20, 0xbb},
1371 {0x5c, 0x1d, 0x17, 0xbb},
1372 {0x5d, 0x22, 0x1c, 0xbb},
1373 {0x64, 0x1e, 0x1c, 0xbb},
1374 {0x5b, 0x00, 0x00, 0xbb},
1375 {0xf0, 0x00, 0x02, 0xbb},
1376 {0x22, 0xa0, 0x78, 0xbb},
1377 {0x23, 0xa0, 0x78, 0xbb},
1378 {0x24, 0x7f, 0x00, 0xbb},
1379 {0x28, 0xea, 0x02, 0xbb},
1380 {0x29, 0x86, 0x7a, 0xbb},
1381 {0x5e, 0x52, 0x4c, 0xbb},
1382 {0x5f, 0x20, 0x24, 0xbb},
1383 {0x60, 0x00, 0x02, 0xbb},
1384 {0x02, 0x00, 0xee, 0xbb},
1385 {0x03, 0x39, 0x23, 0xbb},
1386 {0x04, 0x07, 0x24, 0xbb},
1387 {0x09, 0x00, 0xc0, 0xbb},
1388 {0x0a, 0x00, 0x79, 0xbb},
1389 {0x0b, 0x00, 0x04, 0xbb},
1390 {0x0c, 0x00, 0x5c, 0xbb},
1391 {0x0d, 0x00, 0xd9, 0xbb},
1392 {0x0e, 0x00, 0x53, 0xbb},
1393 {0x0f, 0x00, 0x21, 0xbb},
1394 {0x10, 0x00, 0xa4, 0xbb},
1395 {0x11, 0x00, 0xe5, 0xbb},
1396 {0x15, 0x00, 0x00, 0xbb},
1397 {0x16, 0x00, 0x00, 0xbb},
1398 {0x17, 0x00, 0x00, 0xbb},
1399 {0x18, 0x00, 0x00, 0xbb},
1400 {0x19, 0x00, 0x00, 0xbb},
1401 {0x1a, 0x00, 0x00, 0xbb},
1402 {0x1b, 0x00, 0x00, 0xbb},
1403 {0x1c, 0x00, 0x00, 0xbb},
1404 {0x1d, 0x00, 0x00, 0xbb},
1405 {0x1e, 0x00, 0x00, 0xbb},
1406 {0xf0, 0x00, 0x01, 0xbb},
1407 {0x06, 0xe0, 0x0e, 0xbb},
1408 {0x06, 0x60, 0x0e, 0xbb},
1409 {0xb3, 0x5c, 0x01, 0xcc},
1410 {0xf0, 0x00, 0x00, 0xbb},
1411 {0x05, 0x01, 0x13, 0xbb},
1412 {0x06, 0x00, 0x11, 0xbb},
1413 {0x07, 0x00, 0x85, 0xbb},
1414 {0x08, 0x00, 0x27, 0xbb},
1415 {0x20, 0x01, 0x03, 0xbb}, /* h/v flip */
1416 {0x21, 0x80, 0x00, 0xbb},
1417 {0x22, 0x0d, 0x0f, 0xbb},
1418 {0x24, 0x80, 0x00, 0xbb},
1419 {0x59, 0x00, 0xff, 0xbb},
1420 {0xf0, 0x00, 0x02, 0xbb},
1421 {0x39, 0x03, 0x0d, 0xbb},
1422 {0x3a, 0x06, 0x1b, 0xbb},
1423 {0x3b, 0x00, 0x95, 0xbb},
1424 {0x3c, 0x04, 0xdb, 0xbb},
1425 {0x57, 0x02, 0x00, 0xbb},
1426 {0x58, 0x02, 0x66, 0xbb},
1427 {0x59, 0x00, 0xff, 0xbb},
1428 {0x5a, 0x01, 0x33, 0xbb},
1429 {0x5c, 0x12, 0x0d, 0xbb},
1430 {0x5d, 0x16, 0x11, 0xbb},
1431 {0x64, 0x5e, 0x1c, 0xbb},
1434 static const u8 po3130_gamma
[17] = {
1435 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1436 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1438 static const u8 po3130_matrix
[9] = {
1439 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1442 static const u8 po3130_initVGA_data
[][4] = {
1443 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1444 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1445 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
1446 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1447 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1448 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
1449 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1450 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1451 {0xb3, 0x23, 0xe8, 0xcc}, {0xb8, 0x08, 0xe8, 0xcc},
1452 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1453 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1454 {0xb3, 0x34, 0x01, 0xcc},
1455 {0xb3, 0x35, 0xf6, 0xcc}, /* i2c add: 76 */
1456 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0x71, 0xcc},
1457 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
1458 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1459 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1460 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1461 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
1462 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
1463 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1464 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1465 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
1466 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
1467 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
1468 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1469 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
1470 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
1471 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
1472 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
1473 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
1474 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
1475 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
1476 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
1477 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
1478 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
1479 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
1480 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
1481 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
1482 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
1483 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
1484 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
1485 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
1486 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
1487 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
1488 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
1489 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
1490 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1491 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1492 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1493 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1494 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1495 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1496 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
1497 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
1498 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
1499 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
1500 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
1501 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
1502 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
1503 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1504 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1505 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1506 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1507 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1508 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1509 {0x00, 0x7e, 0xea, 0xaa},
1510 {0x00, 0x4c, 0x07, 0xaa},
1511 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
1512 {0x00, 0x59, 0x02, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
1513 /* {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1514 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc}, */
1515 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1516 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1517 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1518 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1519 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1520 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1521 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1522 {0xb9, 0x08, 0x3c, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
1523 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1526 static const u8 po3130_rundata
[][4] = {
1527 {0x00, 0x47, 0x45, 0xaa}, {0x00, 0x48, 0x9b, 0xaa},
1528 {0x00, 0x49, 0x3a, 0xaa}, {0x00, 0x4a, 0x01, 0xaa},
1529 {0x00, 0x44, 0x40, 0xaa},
1530 /* {0x00, 0xd5, 0x7c, 0xaa}, */
1531 {0x00, 0xad, 0x04, 0xaa}, {0x00, 0xae, 0x00, 0xaa},
1532 {0x00, 0xb0, 0x78, 0xaa}, {0x00, 0x98, 0x02, 0xaa},
1533 {0x00, 0x94, 0x25, 0xaa}, {0x00, 0x95, 0x25, 0xaa},
1534 {0x00, 0x59, 0x68, 0xaa}, {0x00, 0x44, 0x20, 0xaa},
1535 {0x00, 0x17, 0x50, 0xaa}, {0x00, 0x19, 0x50, 0xaa},
1536 {0x00, 0xd1, 0x3c, 0xaa}, {0x00, 0xd1, 0x3c, 0xaa},
1537 {0x00, 0x1e, 0x06, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1541 static const u8 po3130_initQVGA_data
[][4] = {
1542 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1543 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x09, 0xcc},
1544 {0xb3, 0x00, 0x04, 0xcc}, {0xb3, 0x00, 0x24, 0xcc},
1545 {0xb3, 0x00, 0x25, 0xcc}, {0xb3, 0x08, 0x01, 0xcc},
1546 {0xb3, 0x09, 0x0c, 0xcc}, {0xb3, 0x05, 0x00, 0xcc},
1547 {0xb3, 0x06, 0x01, 0xcc}, {0xb3, 0x03, 0x1a, 0xcc},
1548 {0xb3, 0x04, 0x15, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1549 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1550 {0xb3, 0x23, 0xe0, 0xcc}, {0xb8, 0x08, 0xe0, 0xcc},
1551 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1552 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1553 {0xb3, 0x34, 0x01, 0xcc}, {0xb3, 0x35, 0xf6, 0xcc},
1554 {0xb3, 0x00, 0x27, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
1555 {0xb8, 0x00, 0x21, 0xcc}, {0xb8, 0x27, 0x20, 0xcc},
1556 {0xb8, 0x01, 0x79, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1557 {0xb8, 0x2c, 0x50, 0xcc}, {0xb8, 0x2d, 0xf8, 0xcc},
1558 {0xb8, 0x2e, 0xf8, 0xcc}, {0xb8, 0x2f, 0xf8, 0xcc},
1559 {0xb8, 0x30, 0x50, 0xcc}, {0xb8, 0x31, 0xf8, 0xcc},
1560 {0xb8, 0x32, 0xf8, 0xcc}, {0xb8, 0x33, 0xf8, 0xcc},
1561 {0xb8, 0x34, 0x50, 0xcc}, {0xb8, 0x35, 0x00, 0xcc},
1562 {0xb8, 0x36, 0x00, 0xcc}, {0xb8, 0x37, 0x00, 0xcc},
1563 {0x00, 0x1e, 0xc6, 0xaa}, {0x00, 0x20, 0x44, 0xaa},
1564 {0x00, 0xad, 0x02, 0xaa}, {0x00, 0xae, 0x2c, 0xaa},
1565 {0x00, 0x12, 0x08, 0xaa}, {0x00, 0x17, 0x41, 0xaa},
1566 {0x00, 0x19, 0x41, 0xaa}, {0x00, 0x1e, 0x06, 0xaa},
1567 {0x00, 0x21, 0x00, 0xaa}, {0x00, 0x36, 0xc0, 0xaa},
1568 {0x00, 0x37, 0xc8, 0xaa}, {0x00, 0x3b, 0x36, 0xaa},
1569 {0x00, 0x4b, 0xfe, 0xaa}, {0x00, 0x51, 0x1c, 0xaa},
1570 {0x00, 0x52, 0x01, 0xaa}, {0x00, 0x55, 0x0a, 0xaa},
1571 {0x00, 0x59, 0x6f, 0xaa}, {0x00, 0x5a, 0x04, 0xaa},
1572 {0x00, 0x5c, 0x10, 0xaa}, {0x00, 0x5d, 0x10, 0xaa},
1573 {0x00, 0x5e, 0x10, 0xaa}, {0x00, 0x5f, 0x10, 0xaa},
1574 {0x00, 0x61, 0x00, 0xaa}, {0x00, 0x62, 0x18, 0xaa},
1575 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x70, 0x68, 0xaa},
1576 {0x00, 0x80, 0x71, 0xaa}, {0x00, 0x81, 0x08, 0xaa},
1577 {0x00, 0x82, 0x00, 0xaa}, {0x00, 0x83, 0x55, 0xaa},
1578 {0x00, 0x84, 0x06, 0xaa}, {0x00, 0x85, 0x06, 0xaa},
1579 {0x00, 0x86, 0x13, 0xaa}, {0x00, 0x87, 0x18, 0xaa},
1580 {0x00, 0xaa, 0x3f, 0xaa}, {0x00, 0xab, 0x44, 0xaa},
1581 {0x00, 0xb0, 0x68, 0xaa}, {0x00, 0xb5, 0x10, 0xaa},
1582 {0x00, 0xb8, 0x20, 0xaa}, {0x00, 0xb9, 0xa0, 0xaa},
1583 {0x00, 0xbc, 0x04, 0xaa}, {0x00, 0x8b, 0x40, 0xaa},
1584 {0x00, 0x8c, 0x91, 0xaa}, {0x00, 0x8d, 0x8f, 0xaa},
1585 {0x00, 0x8e, 0x91, 0xaa}, {0x00, 0x8f, 0x43, 0xaa},
1586 {0x00, 0x90, 0x92, 0xaa}, {0x00, 0x91, 0x89, 0xaa},
1587 {0x00, 0x92, 0x9d, 0xaa}, {0x00, 0x93, 0x46, 0xaa},
1588 {0x00, 0xd6, 0x22, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1589 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1590 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1591 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1592 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1593 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1594 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0xd6, 0x62, 0xaa},
1595 {0x00, 0x73, 0x00, 0xaa}, {0x00, 0x74, 0x10, 0xaa},
1596 {0x00, 0x75, 0x20, 0xaa}, {0x00, 0x76, 0x2b, 0xaa},
1597 {0x00, 0x77, 0x36, 0xaa}, {0x00, 0x78, 0x49, 0xaa},
1598 {0x00, 0x79, 0x5a, 0xaa}, {0x00, 0x7a, 0x7f, 0xaa},
1599 {0x00, 0x7b, 0x9b, 0xaa}, {0x00, 0x7c, 0xba, 0xaa},
1600 {0x00, 0x7d, 0xd4, 0xaa}, {0x00, 0x7e, 0xea, 0xaa},
1601 {0x00, 0xd6, 0xa2, 0xaa}, {0x00, 0x73, 0x00, 0xaa},
1602 {0x00, 0x74, 0x10, 0xaa}, {0x00, 0x75, 0x20, 0xaa},
1603 {0x00, 0x76, 0x2b, 0xaa}, {0x00, 0x77, 0x36, 0xaa},
1604 {0x00, 0x78, 0x49, 0xaa}, {0x00, 0x79, 0x5a, 0xaa},
1605 {0x00, 0x7a, 0x7f, 0xaa}, {0x00, 0x7b, 0x9b, 0xaa},
1606 {0x00, 0x7c, 0xba, 0xaa}, {0x00, 0x7d, 0xd4, 0xaa},
1607 {0x00, 0x7e, 0xea, 0xaa}, {0x00, 0x4c, 0x07, 0xaa},
1608 {0x00, 0x4b, 0xe0, 0xaa}, {0x00, 0x4e, 0x77, 0xaa},
1609 {0x00, 0x59, 0x66, 0xaa}, {0x00, 0x4d, 0x0a, 0xaa},
1610 {0x00, 0xd1, 0x00, 0xaa}, {0x00, 0x20, 0xc4, 0xaa},
1611 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1612 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1613 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1614 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1615 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1616 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1617 {0xb9, 0x08, 0x3c, 0xcc}, {0xbc, 0x02, 0x18, 0xcc},
1618 {0xbc, 0x03, 0x50, 0xcc}, {0xbc, 0x04, 0x18, 0xcc},
1619 {0xbc, 0x05, 0x00, 0xcc}, {0xbc, 0x06, 0x00, 0xcc},
1620 {0xbc, 0x08, 0x30, 0xcc}, {0xbc, 0x09, 0x40, 0xcc},
1621 {0xbc, 0x0a, 0x10, 0xcc}, {0xbc, 0x0b, 0x00, 0xcc},
1622 {0xbc, 0x0c, 0x00, 0xcc}, {0x00, 0x05, 0x00, 0xaa},
1623 {0xb3, 0x5c, 0x00, 0xcc}, {0xb3, 0x01, 0x41, 0xcc},
1627 static const u8 hv7131r_gamma
[17] = {
1628 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1629 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1631 static const u8 hv7131r_matrix
[9] = {
1632 0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1634 static const u8 hv7131r_initVGA_data
[][4] = {
1635 {0xb3, 0x01, 0x01, 0xcc},
1636 {0xb0, 0x03, 0x19, 0xcc},
1637 {0xb0, 0x04, 0x02, 0xcc},
1638 {0x00, 0x00, 0x20, 0xdd},
1639 {0xb3, 0x00, 0x24, 0xcc},
1640 {0xb3, 0x00, 0x25, 0xcc},
1641 {0xb3, 0x08, 0x01, 0xcc},
1642 {0xb3, 0x09, 0x0c, 0xcc},
1643 {0xb3, 0x05, 0x01, 0xcc},
1644 {0xb3, 0x06, 0x03, 0xcc},
1645 {0xb3, 0x01, 0x45, 0xcc},
1646 {0xb3, 0x03, 0x0b, 0xcc},
1647 {0xb3, 0x04, 0x05, 0xcc},
1648 {0xb3, 0x20, 0x00, 0xcc},
1649 {0xb3, 0x21, 0x00, 0xcc},
1650 {0xb3, 0x22, 0x01, 0xcc},
1651 {0xb3, 0x23, 0xe0, 0xcc},
1652 {0xb3, 0x14, 0x00, 0xcc},
1653 {0xb3, 0x15, 0x02, 0xcc},
1654 {0xb3, 0x16, 0x02, 0xcc},
1655 {0xb3, 0x17, 0x7f, 0xcc},
1656 {0xb3, 0x34, 0x01, 0xcc},
1657 {0xb3, 0x35, 0x91, 0xcc}, /* i2c add: 11 */
1658 {0xb3, 0x00, 0x27, 0xcc},
1659 {0xbc, 0x00, 0x73, 0xcc},
1660 {0xb8, 0x00, 0x23, 0xcc},
1661 {0xb8, 0x2c, 0x50, 0xcc},
1662 {0xb8, 0x2d, 0xf8, 0xcc},
1663 {0xb8, 0x2e, 0xf8, 0xcc},
1664 {0xb8, 0x2f, 0xf8, 0xcc},
1665 {0xb8, 0x30, 0x50, 0xcc},
1666 {0xb8, 0x31, 0xf8, 0xcc},
1667 {0xb8, 0x32, 0xf8, 0xcc},
1668 {0xb8, 0x33, 0xf8, 0xcc},
1669 {0xb8, 0x34, 0x58, 0xcc},
1670 {0xb8, 0x35, 0x00, 0xcc},
1671 {0xb8, 0x36, 0x00, 0xcc},
1672 {0xb8, 0x37, 0x00, 0xcc},
1673 {0xb8, 0x27, 0x20, 0xcc},
1674 {0xb8, 0x01, 0x7d, 0xcc},
1675 {0xb8, 0x81, 0x09, 0xcc},
1676 {0xb3, 0x01, 0x41, 0xcc},
1677 {0xb8, 0x8e, 0x00, 0xcc},
1678 {0xb8, 0x8f, 0xff, 0xcc},
1679 {0x00, 0x01, 0x0c, 0xaa},
1680 {0x00, 0x14, 0x01, 0xaa},
1681 {0x00, 0x15, 0xe6, 0xaa},
1682 {0x00, 0x16, 0x02, 0xaa},
1683 {0x00, 0x17, 0x86, 0xaa},
1684 {0x00, 0x23, 0x00, 0xaa},
1685 {0x00, 0x25, 0x03, 0xaa},
1686 {0x00, 0x26, 0xa9, 0xaa},
1687 {0x00, 0x27, 0x80, 0xaa},
1688 {0x00, 0x30, 0x18, 0xaa},
1689 {0xb6, 0x00, 0x00, 0xcc},
1690 {0xb6, 0x03, 0x02, 0xcc},
1691 {0xb6, 0x02, 0x80, 0xcc},
1692 {0xb6, 0x05, 0x01, 0xcc},
1693 {0xb6, 0x04, 0xe0, 0xcc},
1694 {0xb6, 0x12, 0x78, 0xcc},
1695 {0xb6, 0x18, 0x02, 0xcc},
1696 {0xb6, 0x17, 0x58, 0xcc},
1697 {0xb6, 0x16, 0x00, 0xcc},
1698 {0xb6, 0x22, 0x12, 0xcc},
1699 {0xb6, 0x23, 0x0b, 0xcc},
1700 {0xb3, 0x02, 0x02, 0xcc},
1701 {0xbf, 0xc0, 0x39, 0xcc},
1702 {0xbf, 0xc1, 0x04, 0xcc},
1703 {0xbf, 0xcc, 0x10, 0xcc},
1704 {0xb6, 0x12, 0xf8, 0xcc},
1705 {0xb6, 0x13, 0x13, 0xcc},
1706 {0xb9, 0x12, 0x00, 0xcc},
1707 {0xb9, 0x13, 0x0a, 0xcc},
1708 {0xb9, 0x14, 0x0a, 0xcc},
1709 {0xb9, 0x15, 0x0a, 0xcc},
1710 {0xb9, 0x16, 0x0a, 0xcc},
1711 {0xb8, 0x0c, 0x20, 0xcc},
1712 {0xb8, 0x0d, 0x70, 0xcc},
1713 {0xb9, 0x18, 0x00, 0xcc},
1714 {0xb9, 0x19, 0x0f, 0xcc},
1715 {0xb9, 0x1a, 0x0f, 0xcc},
1716 {0xb9, 0x1b, 0x0f, 0xcc},
1717 {0xb9, 0x1c, 0x0f, 0xcc},
1718 {0xb3, 0x5c, 0x01, 0xcc},
1722 static const u8 hv7131r_initQVGA_data
[][4] = {
1723 {0xb3, 0x01, 0x01, 0xcc},
1724 {0xb0, 0x03, 0x19, 0xcc},
1725 {0xb0, 0x04, 0x02, 0xcc},
1726 {0x00, 0x00, 0x20, 0xdd},
1727 {0xb3, 0x00, 0x24, 0xcc},
1728 {0xb3, 0x00, 0x25, 0xcc},
1729 {0xb3, 0x08, 0x01, 0xcc},
1730 {0xb3, 0x09, 0x0c, 0xcc},
1731 {0xb3, 0x05, 0x01, 0xcc},
1732 {0xb3, 0x06, 0x03, 0xcc},
1733 {0xb3, 0x01, 0x45, 0xcc},
1734 {0xb3, 0x03, 0x0b, 0xcc},
1735 {0xb3, 0x04, 0x05, 0xcc},
1736 {0xb3, 0x20, 0x00, 0xcc},
1737 {0xb3, 0x21, 0x00, 0xcc},
1738 {0xb3, 0x22, 0x01, 0xcc},
1739 {0xb3, 0x23, 0xe0, 0xcc},
1740 {0xb3, 0x14, 0x00, 0xcc},
1741 {0xb3, 0x15, 0x02, 0xcc},
1742 {0xb3, 0x16, 0x02, 0xcc},
1743 {0xb3, 0x17, 0x7f, 0xcc},
1744 {0xb3, 0x34, 0x01, 0xcc},
1745 {0xb3, 0x35, 0x91, 0xcc},
1746 {0xb3, 0x00, 0x27, 0xcc},
1747 {0xbc, 0x00, 0xd3, 0xcc},
1748 {0xb8, 0x00, 0x23, 0xcc},
1749 {0xb8, 0x2c, 0x50, 0xcc},
1750 {0xb8, 0x2d, 0xf8, 0xcc},
1751 {0xb8, 0x2e, 0xf8, 0xcc},
1752 {0xb8, 0x2f, 0xf8, 0xcc},
1753 {0xb8, 0x30, 0x50, 0xcc},
1754 {0xb8, 0x31, 0xf8, 0xcc},
1755 {0xb8, 0x32, 0xf8, 0xcc},
1756 {0xb8, 0x33, 0xf8, 0xcc},
1757 {0xb8, 0x34, 0x58, 0xcc},
1758 {0xb8, 0x35, 0x00, 0xcc},
1759 {0xb8, 0x36, 0x00, 0xcc},
1760 {0xb8, 0x37, 0x00, 0xcc},
1761 {0xb8, 0x27, 0x20, 0xcc},
1762 {0xb8, 0x01, 0x7d, 0xcc},
1763 {0xb8, 0x81, 0x09, 0xcc},
1764 {0xb3, 0x01, 0x41, 0xcc},
1765 {0xb8, 0x8e, 0x00, 0xcc},
1766 {0xb8, 0x8f, 0xff, 0xcc},
1767 {0x00, 0x01, 0x0c, 0xaa},
1768 {0x00, 0x14, 0x01, 0xaa},
1769 {0x00, 0x15, 0xe6, 0xaa},
1770 {0x00, 0x16, 0x02, 0xaa},
1771 {0x00, 0x17, 0x86, 0xaa},
1772 {0x00, 0x23, 0x00, 0xaa},
1773 {0x00, 0x25, 0x03, 0xaa},
1774 {0x00, 0x26, 0xa9, 0xaa},
1775 {0x00, 0x27, 0x80, 0xaa},
1776 {0x00, 0x30, 0x18, 0xaa},
1777 {0xb6, 0x00, 0x00, 0xcc},
1778 {0xb6, 0x03, 0x01, 0xcc},
1779 {0xb6, 0x02, 0x40, 0xcc},
1780 {0xb6, 0x05, 0x00, 0xcc},
1781 {0xb6, 0x04, 0xf0, 0xcc},
1782 {0xb6, 0x12, 0x78, 0xcc},
1783 {0xb6, 0x18, 0x00, 0xcc},
1784 {0xb6, 0x17, 0x96, 0xcc},
1785 {0xb6, 0x16, 0x00, 0xcc},
1786 {0xb6, 0x22, 0x12, 0xcc},
1787 {0xb6, 0x23, 0x0b, 0xcc},
1788 {0xb3, 0x02, 0x02, 0xcc},
1789 {0xbf, 0xc0, 0x39, 0xcc},
1790 {0xbf, 0xc1, 0x04, 0xcc},
1791 {0xbf, 0xcc, 0x10, 0xcc},
1792 {0xbc, 0x02, 0x18, 0xcc},
1793 {0xbc, 0x03, 0x50, 0xcc},
1794 {0xbc, 0x04, 0x18, 0xcc},
1795 {0xbc, 0x05, 0x00, 0xcc},
1796 {0xbc, 0x06, 0x00, 0xcc},
1797 {0xbc, 0x08, 0x30, 0xcc},
1798 {0xbc, 0x09, 0x40, 0xcc},
1799 {0xbc, 0x0a, 0x10, 0xcc},
1800 {0xbc, 0x0b, 0x00, 0xcc},
1801 {0xbc, 0x0c, 0x00, 0xcc},
1802 {0xb9, 0x12, 0x00, 0xcc},
1803 {0xb9, 0x13, 0x0a, 0xcc},
1804 {0xb9, 0x14, 0x0a, 0xcc},
1805 {0xb9, 0x15, 0x0a, 0xcc},
1806 {0xb9, 0x16, 0x0a, 0xcc},
1807 {0xb9, 0x18, 0x00, 0xcc},
1808 {0xb9, 0x19, 0x0f, 0xcc},
1809 {0xb8, 0x0c, 0x20, 0xcc},
1810 {0xb8, 0x0d, 0x70, 0xcc},
1811 {0xb9, 0x1a, 0x0f, 0xcc},
1812 {0xb9, 0x1b, 0x0f, 0xcc},
1813 {0xb9, 0x1c, 0x0f, 0xcc},
1814 {0xb6, 0x12, 0xf8, 0xcc},
1815 {0xb6, 0x13, 0x13, 0xcc},
1816 {0xb3, 0x5c, 0x01, 0xcc},
1820 static const u8 ov7660_gamma
[17] = {
1821 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1822 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1824 static const u8 ov7660_matrix
[9] = {
1825 0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62
1827 static const u8 ov7660_initVGA_data
[][4] = {
1828 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1829 {0x00, 0x00, 0x50, 0xdd},
1830 {0xb0, 0x03, 0x01, 0xcc},
1831 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1832 {0xb3, 0x05, 0x01, 0xcc},
1833 {0xb3, 0x06, 0x03, 0xcc},
1834 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1835 {0xb3, 0x05, 0x00, 0xcc},
1836 {0xb3, 0x06, 0x01, 0xcc},
1837 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1838 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1839 {0xb3, 0x21, 0x00, 0xcc},
1840 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1841 {0xb3, 0x1f, 0x02, 0xcc},
1842 {0xb3, 0x34, 0x01, 0xcc},
1843 {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
1844 {0xb3, 0x00, 0x26, 0xcc},
1845 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1846 {0xb8, 0x01, 0x7d, 0xcc},
1847 {0xbc, 0x00, 0x73, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1848 {0xb8, 0x27, 0x20, 0xcc},
1849 {0xb8, 0x8f, 0x50, 0xcc},
1850 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1851 {0x00, 0x12, 0x80, 0xaa},
1852 {0x00, 0x12, 0x05, 0xaa},
1853 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
1854 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1855 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1856 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1857 {0x00, 0x13, 0xa7, 0xaa},
1858 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1859 {0x00, 0x36, 0x00, 0xaa},
1860 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1861 {0x00, 0x39, 0x43, 0xaa},
1862 {0x00, 0x8d, 0xcf, 0xaa},
1863 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1864 {0x00, 0x0f, 0x62, 0xaa},
1865 {0x00, 0x35, 0x84, 0xaa},
1866 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1867 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1868 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1869 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1870 {0x00, 0x01, 0x80, 0xaa},
1871 {0x00, 0x02, 0x80, 0xaa},
1872 {0xb8, 0xfe, 0x00, 0xcc}, {0xb8, 0xff, 0x28, 0xcc},
1873 {0xb9, 0x00, 0x28, 0xcc},
1874 {0xb9, 0x01, 0x28, 0xcc}, {0xb9, 0x02, 0x28, 0xcc},
1875 {0xb9, 0x03, 0x00, 0xcc},
1876 {0xb9, 0x04, 0x00, 0xcc},
1877 {0xb9, 0x05, 0x3c, 0xcc}, {0xb9, 0x06, 0x3c, 0xcc},
1878 {0xb9, 0x07, 0x3c, 0xcc},
1879 {0xb9, 0x08, 0x3c, 0xcc},
1881 {0xb8, 0x8e, 0x00, 0xcc}, {0xb8, 0x8f, 0xff, 0xcc},
1883 {0x00, 0x29, 0x3c, 0xaa}, {0xb3, 0x01, 0x45, 0xcc},
1886 static const u8 ov7660_initQVGA_data
[][4] = {
1887 {0xb0, 0x4d, 0x00, 0xcc}, {0xb3, 0x01, 0x01, 0xcc},
1888 {0x00, 0x00, 0x50, 0xdd}, {0xb0, 0x03, 0x01, 0xcc},
1889 {0xb3, 0x00, 0x21, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1890 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x03, 0xcc},
1891 {0xb3, 0x03, 0x1f, 0xcc}, {0xb3, 0x04, 0x05, 0xcc},
1892 {0xb3, 0x05, 0x00, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1893 {0xb3, 0x15, 0x00, 0xcc},/* 0xb315 <-0 href startl */
1894 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1895 {0xb3, 0x21, 0x00, 0xcc},
1896 {0xb3, 0x23, 0xe0, 0xcc}, {0xb3, 0x1d, 0x01, 0xcc},
1897 {0xb3, 0x1f, 0x02, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
1898 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x00, 0x26, 0xcc},
1899 {0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1900 {0xb8, 0x01, 0x7d, 0xcc},
1902 {0xbc, 0x00, 0xd3, 0xcc},
1903 {0xb8, 0x81, 0x09, 0xcc}, {0xb8, 0x81, 0x09, 0xcc},
1904 {0xb8, 0x27, 0x20, 0xcc}, {0xb8, 0x8f, 0x50, 0xcc},
1905 {0x00, 0x01, 0x80, 0xaa}, {0x00, 0x02, 0x80, 0xaa},
1906 {0x00, 0x12, 0x80, 0xaa}, {0x00, 0x12, 0x05, 0xaa},
1907 {0x00, 0x1e, 0x01, 0xaa}, /* MVFP */
1908 {0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1909 {0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1910 {0x00, 0x0d, 0x48, 0xaa}, {0x00, 0x0e, 0x04, 0xaa},
1911 {0x00, 0x13, 0xa7, 0xaa},
1912 {0x00, 0x40, 0xc1, 0xaa}, {0x00, 0x35, 0x00, 0xaa},
1913 {0x00, 0x36, 0x00, 0xaa},
1914 {0x00, 0x3c, 0x68, 0xaa}, {0x00, 0x1b, 0x05, 0xaa},
1915 {0x00, 0x39, 0x43, 0xaa}, {0x00, 0x8d, 0xcf, 0xaa},
1916 {0x00, 0x8b, 0xcc, 0xaa}, {0x00, 0x8c, 0xcc, 0xaa},
1917 {0x00, 0x0f, 0x62, 0xaa}, {0x00, 0x35, 0x84, 0xaa},
1918 {0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1919 {0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1920 {0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1921 {0x00, 0x9e, 0x40, 0xaa}, {0xb8, 0x8f, 0x50, 0xcc},
1922 {0x00, 0x01, 0x80, 0xaa},
1923 {0x00, 0x02, 0x80, 0xaa},
1925 {0xbc, 0x02, 0x08, 0xcc},
1926 {0xbc, 0x03, 0x70, 0xcc},
1927 {0xb8, 0x35, 0x00, 0xcc},
1928 {0xb8, 0x36, 0x00, 0xcc},
1929 {0xb8, 0x37, 0x00, 0xcc},
1930 {0xbc, 0x04, 0x08, 0xcc},
1931 {0xbc, 0x05, 0x00, 0xcc},
1932 {0xbc, 0x06, 0x00, 0xcc},
1933 {0xbc, 0x08, 0x3c, 0xcc},
1934 {0xbc, 0x09, 0x40, 0xcc},
1935 {0xbc, 0x0a, 0x04, 0xcc},
1936 {0xbc, 0x0b, 0x00, 0xcc},
1937 {0xbc, 0x0c, 0x00, 0xcc},
1939 {0xb8, 0xfe, 0x00, 0xcc},
1940 {0xb8, 0xff, 0x28, 0xcc},
1942 {0xb9, 0x00, 0x28, 0xcc}, {0xb9, 0x01, 0x28, 0xcc},
1943 {0xb9, 0x02, 0x28, 0xcc}, {0xb9, 0x03, 0x00, 0xcc},
1944 {0xb9, 0x04, 0x00, 0xcc}, {0xb9, 0x05, 0x3c, 0xcc},
1945 {0xb9, 0x06, 0x3c, 0xcc}, {0xb9, 0x07, 0x3c, 0xcc},
1946 {0xb9, 0x08, 0x3c, 0xcc},
1948 {0xb8, 0x8e, 0x00, 0xcc},
1949 {0xb8, 0x8f, 0xff, 0xcc}, /* ff */
1950 {0x00, 0x29, 0x3c, 0xaa},
1951 {0xb3, 0x01, 0x45, 0xcc}, /* 45 */
1955 static const u8 ov7660_50HZ
[][4] = {
1956 {0x00, 0x3b, 0x08, 0xaa},
1957 {0x00, 0x9d, 0x40, 0xaa},
1958 {0x00, 0x13, 0xa7, 0xaa},
1962 static const u8 ov7660_60HZ
[][4] = {
1963 {0x00, 0x3b, 0x00, 0xaa},
1964 {0x00, 0x9e, 0x40, 0xaa},
1965 {0x00, 0x13, 0xa7, 0xaa},
1969 static const u8 ov7660_NoFliker
[][4] = {
1970 {0x00, 0x13, 0x87, 0xaa},
1974 static const u8 ov7670_initVGA_JPG
[][4] = {
1975 {0xb3, 0x01, 0x05, 0xcc},
1976 {0x00, 0x00, 0x30, 0xdd}, {0xb0, 0x03, 0x19, 0xcc},
1977 {0x00, 0x00, 0x10, 0xdd},
1978 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
1979 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
1980 {0xb3, 0x35, 0xa1, 0xcc}, /* i2c add: 21 */
1981 {0xb3, 0x34, 0x01, 0xcc},
1982 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
1983 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
1984 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
1985 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
1986 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
1987 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
1988 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
1989 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0x41, 0xcc},
1990 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
1991 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
1992 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
1993 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
1994 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
1995 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
1996 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
1997 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
1998 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
1999 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
2000 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
2001 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
2002 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
2003 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
2004 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
2005 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
2006 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
2007 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
2008 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
2009 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
2010 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
2011 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
2012 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
2013 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
2014 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
2015 {0x00, 0x21, 0x02, 0xaa},
2016 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
2017 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
2018 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
2019 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
2020 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
2021 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
2022 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
2023 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
2024 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
2025 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
2026 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
2027 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
2028 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
2029 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
2030 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
2031 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
2032 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
2033 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
2034 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
2035 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
2036 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
2037 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
2038 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
2039 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
2040 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
2041 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
2042 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
2043 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
2044 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
2045 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
2046 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
2047 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
2048 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
2049 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
2050 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
2051 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
2052 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
2053 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
2054 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
2055 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
2056 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
2057 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
2058 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
2059 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
2060 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
2061 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
2062 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
2063 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
2064 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
2065 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
2066 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
2067 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
2068 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
2069 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
2070 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
2071 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
2072 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
2073 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
2074 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
2075 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
2076 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
2077 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
2078 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
2079 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
2080 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
2081 {0x00, 0xaa, 0x14, 0xaa},
2082 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
2083 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
2084 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
2085 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
2086 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
2087 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
2088 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
2089 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
2090 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
2091 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
2092 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
2093 {0xb6, 0x03, 0x02, 0xcc}, {0xb6, 0x02, 0x80, 0xcc},
2094 {0xb6, 0x05, 0x01, 0xcc}, {0xb6, 0x04, 0xe0, 0xcc},
2095 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x13, 0xcc},
2096 {0xb6, 0x18, 0x02, 0xcc}, {0xb6, 0x17, 0x58, 0xcc},
2097 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
2098 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
2099 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
2100 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
2101 {0x00, 0x77, 0x05, 0xaa},
2105 static const u8 ov7670_initQVGA_JPG
[][4] = {
2106 {0xb3, 0x01, 0x05, 0xcc}, {0x00, 0x00, 0x30, 0xdd},
2107 {0xb0, 0x03, 0x19, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
2108 {0xb0, 0x04, 0x02, 0xcc}, {0x00, 0x00, 0x10, 0xdd},
2109 {0xb3, 0x00, 0x66, 0xcc}, {0xb3, 0x00, 0x67, 0xcc},
2110 {0xb3, 0x35, 0xa1, 0xcc}, {0xb3, 0x34, 0x01, 0xcc},
2111 {0xb3, 0x05, 0x01, 0xcc}, {0xb3, 0x06, 0x01, 0xcc},
2112 {0xb3, 0x08, 0x01, 0xcc}, {0xb3, 0x09, 0x0c, 0xcc},
2113 {0xb3, 0x02, 0x02, 0xcc}, {0xb3, 0x03, 0x1f, 0xcc},
2114 {0xb3, 0x14, 0x00, 0xcc}, {0xb3, 0x15, 0x00, 0xcc},
2115 {0xb3, 0x16, 0x02, 0xcc}, {0xb3, 0x17, 0x7f, 0xcc},
2116 {0xb3, 0x04, 0x05, 0xcc}, {0xb3, 0x20, 0x00, 0xcc},
2117 {0xb3, 0x21, 0x00, 0xcc}, {0xb3, 0x22, 0x01, 0xcc},
2118 {0xb3, 0x23, 0xe0, 0xcc}, {0xbc, 0x00, 0xd1, 0xcc},
2119 {0xbc, 0x01, 0x01, 0xcc}, {0x00, 0x12, 0x80, 0xaa},
2120 {0x00, 0x00, 0x20, 0xdd}, {0x00, 0x12, 0x00, 0xaa},
2121 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x6b, 0x0a, 0xaa},
2122 {0x00, 0x3a, 0x04, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
2123 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x7a, 0x29, 0xaa},
2124 {0x00, 0x7b, 0x0e, 0xaa}, {0x00, 0x7c, 0x1a, 0xaa},
2125 {0x00, 0x7d, 0x31, 0xaa}, {0x00, 0x7e, 0x53, 0xaa},
2126 {0x00, 0x7f, 0x60, 0xaa}, {0x00, 0x80, 0x6b, 0xaa},
2127 {0x00, 0x81, 0x73, 0xaa}, {0x00, 0x82, 0x7b, 0xaa},
2128 {0x00, 0x83, 0x82, 0xaa}, {0x00, 0x84, 0x89, 0xaa},
2129 {0x00, 0x85, 0x96, 0xaa}, {0x00, 0x86, 0xa1, 0xaa},
2130 {0x00, 0x87, 0xb7, 0xaa}, {0x00, 0x88, 0xcc, 0xaa},
2131 {0x00, 0x89, 0xe1, 0xaa}, {0x00, 0x13, 0xe0, 0xaa},
2132 {0x00, 0x00, 0x00, 0xaa}, {0x00, 0x10, 0x00, 0xaa},
2133 {0x00, 0x0d, 0x40, 0xaa}, {0x00, 0x14, 0x28, 0xaa},
2134 {0x00, 0xa5, 0x05, 0xaa}, {0x00, 0xab, 0x07, 0xaa},
2135 {0x00, 0x24, 0x95, 0xaa}, {0x00, 0x25, 0x33, 0xaa},
2136 {0x00, 0x26, 0xe3, 0xaa}, {0x00, 0x9f, 0x88, 0xaa},
2137 {0x00, 0xa0, 0x78, 0xaa}, {0x00, 0x55, 0x90, 0xaa},
2138 {0x00, 0xa1, 0x03, 0xaa}, {0x00, 0xa6, 0xe0, 0xaa},
2139 {0x00, 0xa7, 0xd8, 0xaa}, {0x00, 0xa8, 0xf0, 0xaa},
2140 {0x00, 0xa9, 0x90, 0xaa}, {0x00, 0xaa, 0x14, 0xaa},
2141 {0x00, 0x13, 0xe5, 0xaa}, {0x00, 0x0e, 0x61, 0xaa},
2142 {0x00, 0x0f, 0x4b, 0xaa}, {0x00, 0x16, 0x02, 0xaa},
2143 {0x00, 0x1e, 0x07, 0xaa}, /* MVFP */
2144 {0x00, 0x21, 0x02, 0xaa},
2145 {0x00, 0x22, 0x91, 0xaa}, {0x00, 0x29, 0x07, 0xaa},
2146 {0x00, 0x33, 0x0b, 0xaa}, {0x00, 0x35, 0x0b, 0xaa},
2147 {0x00, 0x37, 0x1d, 0xaa}, {0x00, 0x38, 0x71, 0xaa},
2148 {0x00, 0x39, 0x2a, 0xaa}, {0x00, 0x3c, 0x78, 0xaa},
2149 {0x00, 0x4d, 0x40, 0xaa}, {0x00, 0x4e, 0x20, 0xaa},
2150 {0x00, 0x74, 0x19, 0xaa}, {0x00, 0x8d, 0x4f, 0xaa},
2151 {0x00, 0x8e, 0x00, 0xaa}, {0x00, 0x8f, 0x00, 0xaa},
2152 {0x00, 0x90, 0x00, 0xaa}, {0x00, 0x91, 0x00, 0xaa},
2153 {0x00, 0x96, 0x00, 0xaa}, {0x00, 0x9a, 0x80, 0xaa},
2154 {0x00, 0xb0, 0x84, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
2155 {0x00, 0xb2, 0x0e, 0xaa}, {0x00, 0xb3, 0x82, 0xaa},
2156 {0x00, 0xb8, 0x0a, 0xaa}, {0x00, 0x43, 0x14, 0xaa},
2157 {0x00, 0x44, 0xf0, 0xaa}, {0x00, 0x45, 0x45, 0xaa},
2158 {0x00, 0x46, 0x63, 0xaa}, {0x00, 0x47, 0x2d, 0xaa},
2159 {0x00, 0x48, 0x46, 0xaa}, {0x00, 0x59, 0x88, 0xaa},
2160 {0x00, 0x5a, 0xa0, 0xaa}, {0x00, 0x5b, 0xc6, 0xaa},
2161 {0x00, 0x5c, 0x7d, 0xaa}, {0x00, 0x5d, 0x5f, 0xaa},
2162 {0x00, 0x5e, 0x19, 0xaa}, {0x00, 0x6c, 0x0a, 0xaa},
2163 {0x00, 0x6d, 0x55, 0xaa}, {0x00, 0x6e, 0x11, 0xaa},
2164 {0x00, 0x6f, 0x9e, 0xaa}, {0x00, 0x69, 0x00, 0xaa},
2165 {0x00, 0x6a, 0x40, 0xaa}, {0x00, 0x01, 0x40, 0xaa},
2166 {0x00, 0x02, 0x40, 0xaa}, {0x00, 0x13, 0xe7, 0xaa},
2167 {0x00, 0x5f, 0xf0, 0xaa}, {0x00, 0x60, 0xf0, 0xaa},
2168 {0x00, 0x61, 0xf0, 0xaa}, {0x00, 0x27, 0xa0, 0xaa},
2169 {0x00, 0x28, 0x80, 0xaa}, {0x00, 0x2c, 0x90, 0xaa},
2170 {0x00, 0x4f, 0x66, 0xaa}, {0x00, 0x50, 0x66, 0xaa},
2171 {0x00, 0x51, 0x00, 0xaa}, {0x00, 0x52, 0x22, 0xaa},
2172 {0x00, 0x53, 0x5e, 0xaa}, {0x00, 0x54, 0x80, 0xaa},
2173 {0x00, 0x58, 0x9e, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
2174 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x85, 0xaa},
2175 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
2176 {0x00, 0x77, 0x0a, 0xaa}, {0x00, 0x3d, 0x88, 0xaa},
2177 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
2178 {0x00, 0x41, 0x38, 0xaa}, {0x00, 0x62, 0x30, 0xaa},
2179 {0x00, 0x63, 0x30, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
2180 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x0b, 0xaa},
2181 {0x00, 0x65, 0x00, 0xaa}, {0x00, 0x66, 0x05, 0xaa},
2182 {0x00, 0x56, 0x50, 0xaa}, {0x00, 0x34, 0x11, 0xaa},
2183 {0x00, 0xa4, 0x88, 0xaa}, {0x00, 0x96, 0x00, 0xaa},
2184 {0x00, 0x97, 0x30, 0xaa}, {0x00, 0x98, 0x20, 0xaa},
2185 {0x00, 0x99, 0x30, 0xaa}, {0x00, 0x9a, 0x84, 0xaa},
2186 {0x00, 0x9b, 0x29, 0xaa}, {0x00, 0x9c, 0x03, 0xaa},
2187 {0x00, 0x78, 0x04, 0xaa}, {0x00, 0x79, 0x01, 0xaa},
2188 {0x00, 0xc8, 0xf0, 0xaa}, {0x00, 0x79, 0x0f, 0xaa},
2189 {0x00, 0xc8, 0x00, 0xaa}, {0x00, 0x79, 0x10, 0xaa},
2190 {0x00, 0xc8, 0x7e, 0xaa}, {0x00, 0x79, 0x0a, 0xaa},
2191 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x0b, 0xaa},
2192 {0x00, 0xc8, 0x01, 0xaa}, {0x00, 0x79, 0x0c, 0xaa},
2193 {0x00, 0xc8, 0x0f, 0xaa}, {0x00, 0x79, 0x0d, 0xaa},
2194 {0x00, 0xc8, 0x20, 0xaa}, {0x00, 0x79, 0x09, 0xaa},
2195 {0x00, 0xc8, 0x80, 0xaa}, {0x00, 0x79, 0x02, 0xaa},
2196 {0x00, 0xc8, 0xc0, 0xaa}, {0x00, 0x79, 0x03, 0xaa},
2197 {0x00, 0xc8, 0x40, 0xaa}, {0x00, 0x79, 0x05, 0xaa},
2198 {0x00, 0xc8, 0x30, 0xaa}, {0x00, 0x79, 0x26, 0xaa},
2199 {0x00, 0x11, 0x40, 0xaa}, {0x00, 0x3a, 0x04, 0xaa},
2200 {0x00, 0x12, 0x00, 0xaa}, {0x00, 0x40, 0xc0, 0xaa},
2201 {0x00, 0x8c, 0x00, 0xaa}, {0x00, 0x17, 0x14, 0xaa},
2202 {0x00, 0x18, 0x02, 0xaa}, {0x00, 0x32, 0x92, 0xaa},
2203 {0x00, 0x19, 0x02, 0xaa}, {0x00, 0x1a, 0x7a, 0xaa},
2204 {0x00, 0x03, 0x0a, 0xaa}, {0x00, 0x0c, 0x00, 0xaa},
2205 {0x00, 0x3e, 0x00, 0xaa}, {0x00, 0x70, 0x3a, 0xaa},
2206 {0x00, 0x71, 0x35, 0xaa}, {0x00, 0x72, 0x11, 0xaa},
2207 {0x00, 0x73, 0xf0, 0xaa}, {0x00, 0xa2, 0x02, 0xaa},
2208 {0x00, 0xb1, 0x00, 0xaa}, {0x00, 0xb1, 0x0c, 0xaa},
2209 {0x00, 0x1e, 0x37, 0xaa}, /* MVFP */
2210 {0x00, 0xaa, 0x14, 0xaa},
2211 {0x00, 0x24, 0x80, 0xaa}, {0x00, 0x25, 0x74, 0xaa},
2212 {0x00, 0x26, 0xd3, 0xaa}, {0x00, 0x0d, 0x00, 0xaa},
2213 {0x00, 0x14, 0x18, 0xaa}, {0x00, 0x9d, 0x99, 0xaa},
2214 {0x00, 0x9e, 0x7f, 0xaa}, {0x00, 0x64, 0x08, 0xaa},
2215 {0x00, 0x94, 0x07, 0xaa}, {0x00, 0x95, 0x06, 0xaa},
2216 {0x00, 0x66, 0x05, 0xaa}, {0x00, 0x41, 0x08, 0xaa},
2217 {0x00, 0x3f, 0x00, 0xaa}, {0x00, 0x75, 0x07, 0xaa},
2218 {0x00, 0x76, 0xe1, 0xaa}, {0x00, 0x4c, 0x00, 0xaa},
2219 {0x00, 0x77, 0x00, 0xaa}, {0x00, 0x3d, 0xc2, 0xaa},
2220 {0x00, 0x4b, 0x09, 0xaa}, {0x00, 0xc9, 0x60, 0xaa},
2221 {0x00, 0x41, 0x38, 0xaa}, {0xb6, 0x00, 0x00, 0xcc},
2222 {0xb6, 0x03, 0x01, 0xcc}, {0xb6, 0x02, 0x40, 0xcc},
2223 {0xb6, 0x05, 0x00, 0xcc}, {0xb6, 0x04, 0xf0, 0xcc},
2224 {0xb6, 0x12, 0xf8, 0xcc}, {0xb6, 0x13, 0x21, 0xcc},
2225 {0xb6, 0x18, 0x00, 0xcc}, {0xb6, 0x17, 0x96, 0xcc},
2226 {0xb6, 0x16, 0x00, 0xcc}, {0xb6, 0x22, 0x12, 0xcc},
2227 {0xb6, 0x23, 0x0b, 0xcc}, {0xbf, 0xc0, 0x39, 0xcc},
2228 {0xbf, 0xc1, 0x04, 0xcc}, {0xbf, 0xcc, 0x00, 0xcc},
2229 {0xbc, 0x02, 0x18, 0xcc}, {0xbc, 0x03, 0x50, 0xcc},
2230 {0xbc, 0x04, 0x18, 0xcc}, {0xbc, 0x05, 0x00, 0xcc},
2231 {0xbc, 0x06, 0x00, 0xcc}, {0xbc, 0x08, 0x30, 0xcc},
2232 {0xbc, 0x09, 0x40, 0xcc}, {0xbc, 0x0a, 0x10, 0xcc},
2233 {0xbc, 0x0b, 0x00, 0xcc}, {0xbc, 0x0c, 0x00, 0xcc},
2234 {0xb3, 0x5c, 0x01, 0xcc}, {0xb3, 0x01, 0x45, 0xcc},
2235 {0x00, 0x77, 0x05, 0xaa },
2239 /* PO1200 - values from usbvm326.inf and ms-win trace */
2240 static const u8 po1200_gamma
[17] = {
2241 0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
2242 0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
2244 static const u8 po1200_matrix
[9] = {
2245 0x60, 0xf9, 0xe5, 0xe7, 0x50, 0x05, 0xf3, 0xe6, 0x5e
2247 static const u8 po1200_initVGA_data
[][4] = {
2248 {0xb0, 0x03, 0x19, 0xcc}, /* reset? */
2249 {0xb0, 0x03, 0x19, 0xcc},
2250 /* {0x00, 0x00, 0x33, 0xdd}, */
2251 {0xb0, 0x04, 0x02, 0xcc},
2252 {0xb0, 0x02, 0x02, 0xcc},
2253 {0xb3, 0x5d, 0x00, 0xcc},
2254 {0xb3, 0x01, 0x01, 0xcc},
2255 {0xb3, 0x00, 0x64, 0xcc},
2256 {0xb3, 0x00, 0x65, 0xcc},
2257 {0xb3, 0x05, 0x01, 0xcc},
2258 {0xb3, 0x06, 0x01, 0xcc},
2259 {0xb3, 0x5c, 0x01, 0xcc},
2260 {0xb3, 0x08, 0x01, 0xcc},
2261 {0xb3, 0x09, 0x0c, 0xcc},
2262 {0xb3, 0x00, 0x67, 0xcc},
2263 {0xb3, 0x02, 0xb2, 0xcc},
2264 {0xb3, 0x03, 0x18, 0xcc},
2265 {0xb3, 0x04, 0x15, 0xcc},
2266 {0xb3, 0x20, 0x00, 0xcc},
2267 {0xb3, 0x21, 0x00, 0xcc},
2268 {0xb3, 0x22, 0x02, 0xcc},
2269 {0xb3, 0x23, 0x58, 0xcc},
2270 {0xb3, 0x14, 0x00, 0xcc},
2271 {0xb3, 0x15, 0x00, 0xcc},
2272 {0xb3, 0x16, 0x03, 0xcc},
2273 {0xb3, 0x17, 0x1f, 0xcc},
2274 {0xbc, 0x00, 0x71, 0xcc},
2275 {0xbc, 0x01, 0x01, 0xcc},
2276 {0xb0, 0x54, 0x13, 0xcc},
2277 {0xb3, 0x00, 0x67, 0xcc},
2278 {0xb3, 0x34, 0x01, 0xcc},
2279 {0xb3, 0x35, 0xdc, 0xcc}, /* i2c add: 5c */
2280 {0x00, 0x03, 0x00, 0xaa},
2281 {0x00, 0x12, 0x05, 0xaa},
2282 {0x00, 0x13, 0x02, 0xaa},
2283 {0x00, 0x1e, 0xc6, 0xaa}, /* h/v flip */
2284 {0x00, 0x21, 0x00, 0xaa},
2285 {0x00, 0x25, 0x02, 0xaa},
2286 {0x00, 0x3c, 0x4f, 0xaa},
2287 {0x00, 0x3f, 0xe0, 0xaa},
2288 {0x00, 0x42, 0xff, 0xaa},
2289 {0x00, 0x45, 0x34, 0xaa},
2290 {0x00, 0x55, 0xfe, 0xaa},
2291 {0x00, 0x59, 0xd3, 0xaa},
2292 {0x00, 0x5e, 0x04, 0xaa},
2293 {0x00, 0x61, 0xb8, 0xaa}, /* sharpness */
2294 {0x00, 0x62, 0x02, 0xaa},
2295 {0x00, 0xa7, 0x31, 0xaa},
2296 {0x00, 0xa9, 0x66, 0xaa},
2297 {0x00, 0xb0, 0x00, 0xaa},
2298 {0x00, 0xb1, 0x00, 0xaa},
2299 {0x00, 0xb3, 0x11, 0xaa},
2300 {0x00, 0xb6, 0x26, 0xaa},
2301 {0x00, 0xb7, 0x20, 0xaa},
2302 {0x00, 0xba, 0x04, 0xaa},
2303 {0x00, 0x88, 0x42, 0xaa},
2304 {0x00, 0x89, 0x9a, 0xaa},
2305 {0x00, 0x8a, 0x88, 0xaa},
2306 {0x00, 0x8b, 0x8e, 0xaa},
2307 {0x00, 0x8c, 0x3e, 0xaa},
2308 {0x00, 0x8d, 0x90, 0xaa},
2309 {0x00, 0x8e, 0x87, 0xaa},
2310 {0x00, 0x8f, 0x96, 0xaa},
2311 {0x00, 0x90, 0x3d, 0xaa},
2312 {0x00, 0x64, 0x00, 0xaa},
2313 {0x00, 0x65, 0x10, 0xaa},
2314 {0x00, 0x66, 0x20, 0xaa},
2315 {0x00, 0x67, 0x2b, 0xaa},
2316 {0x00, 0x68, 0x36, 0xaa},
2317 {0x00, 0x69, 0x49, 0xaa},
2318 {0x00, 0x6a, 0x5a, 0xaa},
2319 {0x00, 0x6b, 0x7f, 0xaa},
2320 {0x00, 0x6c, 0x9b, 0xaa},
2321 {0x00, 0x6d, 0xba, 0xaa},
2322 {0x00, 0x6e, 0xd4, 0xaa},
2323 {0x00, 0x6f, 0xea, 0xaa},
2324 {0x00, 0x70, 0x00, 0xaa},
2325 {0x00, 0x71, 0x10, 0xaa},
2326 {0x00, 0x72, 0x20, 0xaa},
2327 {0x00, 0x73, 0x2b, 0xaa},
2328 {0x00, 0x74, 0x36, 0xaa},
2329 {0x00, 0x75, 0x49, 0xaa},
2330 {0x00, 0x76, 0x5a, 0xaa},
2331 {0x00, 0x77, 0x7f, 0xaa},
2332 {0x00, 0x78, 0x9b, 0xaa},
2333 {0x00, 0x79, 0xba, 0xaa},
2334 {0x00, 0x7a, 0xd4, 0xaa},
2335 {0x00, 0x7b, 0xea, 0xaa},
2336 {0x00, 0x7c, 0x00, 0xaa},
2337 {0x00, 0x7d, 0x10, 0xaa},
2338 {0x00, 0x7e, 0x20, 0xaa},
2339 {0x00, 0x7f, 0x2b, 0xaa},
2340 {0x00, 0x80, 0x36, 0xaa},
2341 {0x00, 0x81, 0x49, 0xaa},
2342 {0x00, 0x82, 0x5a, 0xaa},
2343 {0x00, 0x83, 0x7f, 0xaa},
2344 {0x00, 0x84, 0x9b, 0xaa},
2345 {0x00, 0x85, 0xba, 0xaa},
2346 {0x00, 0x86, 0xd4, 0xaa},
2347 {0x00, 0x87, 0xea, 0xaa},
2348 {0x00, 0x57, 0x2a, 0xaa},
2349 {0x00, 0x03, 0x01, 0xaa},
2350 {0x00, 0x04, 0x10, 0xaa},
2351 {0x00, 0x05, 0x10, 0xaa},
2352 {0x00, 0x06, 0x10, 0xaa},
2353 {0x00, 0x07, 0x10, 0xaa},
2354 {0x00, 0x08, 0x13, 0xaa},
2355 {0x00, 0x0a, 0x00, 0xaa},
2356 {0x00, 0x0b, 0x10, 0xaa},
2357 {0x00, 0x0c, 0x20, 0xaa},
2358 {0x00, 0x0d, 0x18, 0xaa},
2359 {0x00, 0x22, 0x01, 0xaa},
2360 {0x00, 0x23, 0x60, 0xaa},
2361 {0x00, 0x25, 0x08, 0xaa},
2362 {0x00, 0x26, 0x82, 0xaa},
2363 {0x00, 0x2e, 0x0f, 0xaa},
2364 {0x00, 0x2f, 0x1e, 0xaa},
2365 {0x00, 0x30, 0x2d, 0xaa},
2366 {0x00, 0x31, 0x3c, 0xaa},
2367 {0x00, 0x32, 0x4b, 0xaa},
2368 {0x00, 0x33, 0x5a, 0xaa},
2369 {0x00, 0x34, 0x69, 0xaa},
2370 {0x00, 0x35, 0x78, 0xaa},
2371 {0x00, 0x36, 0x87, 0xaa},
2372 {0x00, 0x37, 0x96, 0xaa},
2373 {0x00, 0x38, 0xa5, 0xaa},
2374 {0x00, 0x39, 0xb4, 0xaa},
2375 {0x00, 0x3a, 0xc3, 0xaa},
2376 {0x00, 0x3b, 0xd2, 0xaa},
2377 {0x00, 0x3c, 0xe1, 0xaa},
2378 {0x00, 0x3e, 0xff, 0xaa},
2379 {0x00, 0x3f, 0xff, 0xaa},
2380 {0x00, 0x40, 0xff, 0xaa},
2381 {0x00, 0x41, 0xff, 0xaa},
2382 {0x00, 0x42, 0xff, 0xaa},
2383 {0x00, 0x43, 0xff, 0xaa},
2384 {0x00, 0x03, 0x00, 0xaa},
2385 {0x00, 0x03, 0x00, 0xaa},
2386 {0x00, 0x20, 0xc4, 0xaa},
2387 {0x00, 0x13, 0x03, 0xaa},
2388 {0x00, 0x3c, 0x50, 0xaa},
2389 {0x00, 0x61, 0x6a, 0xaa}, /* sharpness? */
2390 {0x00, 0x51, 0x5b, 0xaa},
2391 {0x00, 0x52, 0x91, 0xaa},
2392 {0x00, 0x53, 0x4c, 0xaa},
2393 {0x00, 0x54, 0x50, 0xaa},
2394 {0x00, 0x56, 0x02, 0xaa},
2395 {0xb6, 0x00, 0x00, 0xcc},
2396 {0xb6, 0x03, 0x03, 0xcc},
2397 {0xb6, 0x02, 0x20, 0xcc},
2398 {0xb6, 0x05, 0x02, 0xcc},
2399 {0xb6, 0x04, 0x58, 0xcc},
2400 {0xb6, 0x12, 0xf8, 0xcc},
2401 {0xb6, 0x13, 0x21, 0xcc},
2402 {0xb6, 0x18, 0x03, 0xcc},
2403 {0xb6, 0x17, 0xa9, 0xcc},
2404 {0xb6, 0x16, 0x80, 0xcc},
2405 {0xb6, 0x22, 0x12, 0xcc},
2406 {0xb6, 0x23, 0x0b, 0xcc},
2407 {0xbf, 0xc0, 0x39, 0xcc},
2408 {0xbf, 0xc1, 0x04, 0xcc},
2409 {0xbf, 0xcc, 0x00, 0xcc},
2410 {0xb8, 0x06, 0x20, 0xcc},
2411 {0xb8, 0x07, 0x03, 0xcc},
2412 {0xb8, 0x08, 0x58, 0xcc},
2413 {0xb8, 0x09, 0x02, 0xcc},
2414 {0xb3, 0x01, 0x41, 0xcc},
2415 {0x00, 0x03, 0x00, 0xaa},
2416 {0x00, 0xd9, 0x0f, 0xaa},
2417 {0x00, 0xda, 0xaa, 0xaa},
2418 {0x00, 0xd9, 0x10, 0xaa},
2419 {0x00, 0xda, 0xaa, 0xaa},
2420 {0x00, 0xd9, 0x11, 0xaa},
2421 {0x00, 0xda, 0x00, 0xaa},
2422 {0x00, 0xd9, 0x12, 0xaa},
2423 {0x00, 0xda, 0xff, 0xaa},
2424 {0x00, 0xd9, 0x13, 0xaa},
2425 {0x00, 0xda, 0xff, 0xaa},
2426 {0x00, 0xe8, 0x11, 0xaa},
2427 {0x00, 0xe9, 0x12, 0xaa},
2428 {0x00, 0xea, 0x5c, 0xaa},
2429 {0x00, 0xeb, 0xff, 0xaa},
2430 {0x00, 0xd8, 0x80, 0xaa},
2431 {0x00, 0xe6, 0x02, 0xaa},
2432 {0x00, 0xd6, 0x40, 0xaa},
2433 {0x00, 0xe3, 0x05, 0xaa},
2434 {0x00, 0xe0, 0x40, 0xaa},
2435 {0x00, 0xde, 0x03, 0xaa},
2436 {0x00, 0xdf, 0x03, 0xaa},
2437 {0x00, 0xdb, 0x02, 0xaa},
2438 {0x00, 0xdc, 0x00, 0xaa},
2439 {0x00, 0xdd, 0x03, 0xaa},
2440 {0x00, 0xe1, 0x08, 0xaa},
2441 {0x00, 0xe2, 0x01, 0xaa},
2442 {0x00, 0xd6, 0x40, 0xaa},
2443 {0x00, 0xe4, 0x40, 0xaa},
2444 {0x00, 0xa8, 0x8f, 0xaa},
2445 {0x00, 0xb4, 0x16, 0xaa},
2446 {0xb0, 0x02, 0x06, 0xcc},
2447 {0xb0, 0x18, 0x06, 0xcc},
2448 {0xb0, 0x19, 0x06, 0xcc},
2449 {0xb3, 0x5d, 0x18, 0xcc},
2450 {0xb3, 0x05, 0x00, 0xcc},
2451 {0xb3, 0x06, 0x00, 0xcc},
2452 {0x00, 0xb4, 0x0e, 0xaa},
2453 {0x00, 0xb5, 0x49, 0xaa},
2454 {0x00, 0xb6, 0x1c, 0xaa},
2455 {0x00, 0xb7, 0x96, 0xaa},
2456 /* end of usbvm326.inf - start of ms-win trace */
2457 {0xb6, 0x12, 0xf8, 0xcc},
2458 {0xb6, 0x13, 0x3d, 0xcc},
2460 {0x00, 0x03, 0x00, 0xaa},
2461 {0x00, 0x1a, 0x09, 0xaa},
2462 {0x00, 0x1b, 0x8a, 0xaa},
2464 {0xb8, 0x27, 0x00, 0xcc},
2465 {0xb8, 0x26, 0x60, 0xcc},
2466 {0xb8, 0x26, 0x60, 0xcc},
2468 {0x00, 0x03, 0x00, 0xaa},
2469 {0x00, 0xae, 0x84, 0xaa},
2471 {0x00, 0x03, 0x00, 0xaa},
2472 {0x00, 0x96, 0xa0, 0xaa},
2474 {0x00, 0x03, 0x00, 0xaa},
2475 {0x00, 0x91, 0x35, 0xaa},
2476 {0x00, 0x92, 0x22, 0xaa},
2478 {0x00, 0x03, 0x00, 0xaa},
2479 {0x00, 0x95, 0x85, 0xaa},
2481 {0x00, 0x03, 0x00, 0xaa},
2482 {0x00, 0x4d, 0x20, 0xaa},
2483 {0xb8, 0x22, 0x40, 0xcc},
2484 {0xb8, 0x23, 0x40, 0xcc},
2485 {0xb8, 0x24, 0x40, 0xcc},
2486 {0xb8, 0x81, 0x09, 0xcc},
2487 {0x00, 0x00, 0x64, 0xdd},
2488 {0x00, 0x03, 0x01, 0xaa},
2490 {0x00, 0x46, 0x3c, 0xaa},
2491 {0x00, 0x03, 0x00, 0xaa},
2492 {0x00, 0x16, 0x40, 0xaa},
2493 {0x00, 0x17, 0x40, 0xaa},
2494 {0x00, 0x18, 0x40, 0xaa},
2495 {0x00, 0x19, 0x41, 0xaa},
2496 {0x00, 0x03, 0x01, 0xaa},
2497 {0x00, 0x46, 0x3c, 0xaa},
2498 {0x00, 0x00, 0x18, 0xdd},
2500 {0x00, 0x03, 0x00, 0xaa},
2501 {0x00, 0xb4, 0x1c, 0xaa},
2502 {0x00, 0xb5, 0x92, 0xaa},
2503 {0x00, 0xb6, 0x39, 0xaa},
2504 {0x00, 0xb7, 0x24, 0xaa},
2505 /*write 89 0400 1415*/
2509 static const u8 poxxxx_init_common
[][4] = {
2510 {0xb3, 0x00, 0x04, 0xcc},
2511 {0x00, 0x00, 0x10, 0xdd},
2512 {0xb3, 0x00, 0x64, 0xcc},
2513 {0x00, 0x00, 0x10, 0xdd},
2514 {0xb3, 0x00, 0x65, 0xcc},
2515 {0x00, 0x00, 0x10, 0xdd},
2516 {0xb3, 0x00, 0x67, 0xcc},
2517 {0xb0, 0x03, 0x09, 0xcc},
2518 {0xb3, 0x05, 0x00, 0xcc},
2519 {0xb3, 0x06, 0x00, 0xcc},
2520 {0xb3, 0x5c, 0x01, 0xcc},
2521 {0xb3, 0x08, 0x01, 0xcc},
2522 {0xb3, 0x09, 0x0c, 0xcc},
2523 {0xb3, 0x34, 0x01, 0xcc},
2524 {0xb3, 0x35, 0xf6, 0xcc}, /* i2c add: 76 */
2525 {0xb3, 0x02, 0xb0, 0xcc},
2526 {0xb3, 0x03, 0x18, 0xcc},
2527 {0xb3, 0x04, 0x15, 0xcc},
2528 {0xb3, 0x20, 0x00, 0xcc},
2529 {0xb3, 0x21, 0x00, 0xcc},
2530 {0xb3, 0x22, 0x04, 0xcc},
2531 {0xb3, 0x23, 0x00, 0xcc},
2532 {0xb3, 0x14, 0x00, 0xcc},
2533 {0xb3, 0x15, 0x00, 0xcc},
2534 {0xb3, 0x16, 0x04, 0xcc},
2535 {0xb3, 0x17, 0xff, 0xcc},
2536 {0xb3, 0x2c, 0x03, 0xcc},
2537 {0xb3, 0x2d, 0x56, 0xcc},
2538 {0xb3, 0x2e, 0x02, 0xcc},
2539 {0xb3, 0x2f, 0x0a, 0xcc},
2540 {0xb3, 0x40, 0x00, 0xcc},
2541 {0xb3, 0x41, 0x34, 0xcc},
2542 {0xb3, 0x42, 0x01, 0xcc},
2543 {0xb3, 0x43, 0xe0, 0xcc},
2544 {0xbc, 0x00, 0x71, 0xcc},
2545 {0xbc, 0x01, 0x01, 0xcc},
2546 {0xb3, 0x01, 0x41, 0xcc},
2547 {0xb3, 0x4d, 0x00, 0xcc},
2548 {0x00, 0x0b, 0x2a, 0xaa},
2549 {0x00, 0x0e, 0x03, 0xaa},
2550 {0x00, 0x0f, 0xea, 0xaa},
2551 {0x00, 0x12, 0x08, 0xaa},
2552 {0x00, 0x1e, 0x06, 0xaa},
2553 {0x00, 0x21, 0x00, 0xaa},
2554 {0x00, 0x31, 0x1f, 0xaa},
2555 {0x00, 0x33, 0x38, 0xaa},
2556 {0x00, 0x36, 0xc0, 0xaa},
2557 {0x00, 0x37, 0xc8, 0xaa},
2558 {0x00, 0x3b, 0x36, 0xaa},
2559 {0x00, 0x4b, 0xfe, 0xaa},
2560 {0x00, 0x4d, 0x2e, 0xaa},
2561 {0x00, 0x51, 0x1c, 0xaa},
2562 {0x00, 0x52, 0x01, 0xaa},
2563 {0x00, 0x55, 0x0a, 0xaa},
2564 {0x00, 0x56, 0x0a, 0xaa},
2565 {0x00, 0x57, 0x07, 0xaa},
2566 {0x00, 0x58, 0x07, 0xaa},
2567 {0x00, 0x59, 0x04, 0xaa},
2568 {0x00, 0x70, 0x68, 0xaa},
2569 {0x00, 0x71, 0x04, 0xaa},
2570 {0x00, 0x72, 0x10, 0xaa},
2571 {0x00, 0x80, 0x71, 0xaa},
2572 {0x00, 0x81, 0x08, 0xaa},
2573 {0x00, 0x82, 0x00, 0xaa},
2574 {0x00, 0x83, 0x55, 0xaa},
2575 {0x00, 0x84, 0x06, 0xaa},
2576 {0x00, 0x85, 0x06, 0xaa},
2577 {0x00, 0x8b, 0x25, 0xaa},
2578 {0x00, 0x8c, 0x00, 0xaa},
2579 {0x00, 0x8d, 0x86, 0xaa},
2580 {0x00, 0x8e, 0x82, 0xaa},
2581 {0x00, 0x8f, 0x2d, 0xaa},
2582 {0x00, 0x90, 0x8b, 0xaa},
2583 {0x00, 0x91, 0x81, 0xaa},
2584 {0x00, 0x92, 0x81, 0xaa},
2585 {0x00, 0x93, 0x23, 0xaa},
2586 {0x00, 0xa3, 0x2a, 0xaa},
2587 {0x00, 0xa4, 0x03, 0xaa},
2588 {0x00, 0xa5, 0xea, 0xaa},
2589 {0x00, 0xb0, 0x68, 0xaa},
2590 {0x00, 0xbc, 0x04, 0xaa},
2591 {0x00, 0xbe, 0x3b, 0xaa},
2592 {0x00, 0x4e, 0x40, 0xaa},
2593 {0x00, 0x06, 0x04, 0xaa},
2594 {0x00, 0x07, 0x03, 0xaa},
2595 {0x00, 0xcd, 0x18, 0xaa},
2596 {0x00, 0x28, 0x03, 0xaa},
2597 {0x00, 0x29, 0xef, 0xaa},
2598 /* reinit on alt 2 (qvga) or alt7 (vga) */
2599 {0xb3, 0x05, 0x00, 0xcc},
2600 {0xb3, 0x06, 0x00, 0xcc},
2601 {0xb8, 0x00, 0x01, 0xcc},
2603 {0x00, 0x1d, 0x85, 0xaa},
2604 {0x00, 0x1e, 0xc6, 0xaa},
2605 {0x00, 0x00, 0x40, 0xdd},
2606 {0x00, 0x1d, 0x05, 0xaa},
2608 {0x00, 0xd6, 0x22, 0xaa}, /* gamma 0 */
2609 {0x00, 0x73, 0x00, 0xaa},
2610 {0x00, 0x74, 0x0a, 0xaa},
2611 {0x00, 0x75, 0x16, 0xaa},
2612 {0x00, 0x76, 0x25, 0xaa},
2613 {0x00, 0x77, 0x34, 0xaa},
2614 {0x00, 0x78, 0x49, 0xaa},
2615 {0x00, 0x79, 0x5a, 0xaa},
2616 {0x00, 0x7a, 0x7f, 0xaa},
2617 {0x00, 0x7b, 0x9b, 0xaa},
2618 {0x00, 0x7c, 0xba, 0xaa},
2619 {0x00, 0x7d, 0xd4, 0xaa},
2620 {0x00, 0x7e, 0xea, 0xaa},
2622 {0x00, 0xd6, 0x62, 0xaa}, /* gamma 1 */
2623 {0x00, 0x73, 0x00, 0xaa},
2624 {0x00, 0x74, 0x0a, 0xaa},
2625 {0x00, 0x75, 0x16, 0xaa},
2626 {0x00, 0x76, 0x25, 0xaa},
2627 {0x00, 0x77, 0x34, 0xaa},
2628 {0x00, 0x78, 0x49, 0xaa},
2629 {0x00, 0x79, 0x5a, 0xaa},
2630 {0x00, 0x7a, 0x7f, 0xaa},
2631 {0x00, 0x7b, 0x9b, 0xaa},
2632 {0x00, 0x7c, 0xba, 0xaa},
2633 {0x00, 0x7d, 0xd4, 0xaa},
2634 {0x00, 0x7e, 0xea, 0xaa},
2636 {0x00, 0xd6, 0xa2, 0xaa}, /* gamma 2 */
2637 {0x00, 0x73, 0x00, 0xaa},
2638 {0x00, 0x74, 0x0a, 0xaa},
2639 {0x00, 0x75, 0x16, 0xaa},
2640 {0x00, 0x76, 0x25, 0xaa},
2641 {0x00, 0x77, 0x34, 0xaa},
2642 {0x00, 0x78, 0x49, 0xaa},
2643 {0x00, 0x79, 0x5a, 0xaa},
2644 {0x00, 0x7a, 0x7f, 0xaa},
2645 {0x00, 0x7b, 0x9b, 0xaa},
2646 {0x00, 0x7c, 0xba, 0xaa},
2647 {0x00, 0x7d, 0xd4, 0xaa},
2648 {0x00, 0x7e, 0xea, 0xaa},
2650 {0x00, 0xaa, 0xff, 0xaa}, /* back light comp */
2651 {0x00, 0xc4, 0x03, 0xaa},
2652 {0x00, 0xc5, 0x19, 0xaa},
2653 {0x00, 0xc6, 0x03, 0xaa},
2654 {0x00, 0xc7, 0x91, 0xaa},
2655 {0x00, 0xc8, 0x01, 0xaa},
2656 {0x00, 0xc9, 0xdd, 0xaa},
2657 {0x00, 0xca, 0x02, 0xaa},
2658 {0x00, 0xcb, 0x37, 0xaa},
2661 {0x00, 0xd1, 0x3c, 0xaa},
2662 {0x00, 0xb8, 0x28, 0xaa},
2663 {0x00, 0xb9, 0x1e, 0xaa},
2664 {0x00, 0xb6, 0x14, 0xaa},
2665 {0x00, 0xb7, 0x0f, 0xaa},
2666 {0x00, 0x5c, 0x10, 0xaa},
2667 {0x00, 0x5d, 0x18, 0xaa},
2668 {0x00, 0x5e, 0x24, 0xaa},
2669 {0x00, 0x5f, 0x24, 0xaa},
2670 {0x00, 0x86, 0x1a, 0xaa},
2671 {0x00, 0x60, 0x00, 0xaa},
2672 {0x00, 0x61, 0x1b, 0xaa},
2673 {0x00, 0x62, 0x30, 0xaa},
2674 {0x00, 0x63, 0x40, 0xaa},
2675 {0x00, 0x87, 0x1a, 0xaa},
2676 {0x00, 0x64, 0x00, 0xaa},
2677 {0x00, 0x65, 0x08, 0xaa},
2678 {0x00, 0x66, 0x10, 0xaa},
2679 {0x00, 0x67, 0x20, 0xaa},
2680 {0x00, 0x88, 0x10, 0xaa},
2681 {0x00, 0x68, 0x00, 0xaa},
2682 {0x00, 0x69, 0x08, 0xaa},
2683 {0x00, 0x6a, 0x0f, 0xaa},
2684 {0x00, 0x6b, 0x0f, 0xaa},
2685 {0x00, 0x89, 0x07, 0xaa},
2686 {0x00, 0xd5, 0x4c, 0xaa},
2687 {0x00, 0x0a, 0x00, 0xaa},
2688 {0x00, 0x0b, 0x2a, 0xaa},
2689 {0x00, 0x0e, 0x03, 0xaa},
2690 {0x00, 0x0f, 0xea, 0xaa},
2691 {0x00, 0xa2, 0x00, 0xaa},
2692 {0x00, 0xa3, 0x2a, 0xaa},
2693 {0x00, 0xa4, 0x03, 0xaa},
2694 {0x00, 0xa5, 0xea, 0xaa},
2697 static const u8 poxxxx_initVGA
[][4] = {
2698 {0x00, 0x20, 0x11, 0xaa},
2699 {0x00, 0x33, 0x38, 0xaa},
2700 {0x00, 0xbb, 0x0d, 0xaa},
2701 {0xb3, 0x22, 0x01, 0xcc},
2702 {0xb3, 0x23, 0xe0, 0xcc},
2703 {0xb3, 0x16, 0x02, 0xcc},
2704 {0xb3, 0x17, 0x7f, 0xcc},
2705 {0xb3, 0x02, 0xb0, 0xcc},
2706 {0xb3, 0x06, 0x00, 0xcc},
2707 {0xb3, 0x5c, 0x01, 0xcc},
2708 {0x00, 0x04, 0x06, 0xaa},
2709 {0x00, 0x05, 0x3f, 0xaa},
2710 {0x00, 0x04, 0x00, 0xdd}, /* delay 1s */
2713 static const u8 poxxxx_initQVGA
[][4] = {
2714 {0x00, 0x20, 0x33, 0xaa},
2715 {0x00, 0x33, 0x38, 0xaa},
2716 {0x00, 0xbb, 0x0d, 0xaa},
2717 {0xb3, 0x22, 0x00, 0xcc},
2718 {0xb3, 0x23, 0xf0, 0xcc},
2719 {0xb3, 0x16, 0x01, 0xcc},
2720 {0xb3, 0x17, 0x3f, 0xcc},
2721 {0xb3, 0x02, 0xb0, 0xcc},
2722 {0xb3, 0x06, 0x01, 0xcc},
2723 {0xb3, 0x5c, 0x00, 0xcc},
2724 {0x00, 0x04, 0x06, 0xaa},
2725 {0x00, 0x05, 0x3f, 0xaa},
2726 {0x00, 0x04, 0x00, 0xdd}, /* delay 1s */
2729 static const u8 poxxxx_init_end_1
[][4] = {
2730 {0x00, 0x47, 0x25, 0xaa},
2731 {0x00, 0x48, 0x80, 0xaa},
2732 {0x00, 0x49, 0x1f, 0xaa},
2733 {0x00, 0x4a, 0x40, 0xaa},
2734 {0x00, 0x44, 0x40, 0xaa},
2735 {0x00, 0xab, 0x4a, 0xaa},
2736 {0x00, 0xb1, 0x00, 0xaa},
2737 {0x00, 0xb2, 0x04, 0xaa},
2738 {0x00, 0xb3, 0x08, 0xaa},
2739 {0x00, 0xb4, 0x0b, 0xaa},
2740 {0x00, 0xb5, 0x0d, 0xaa},
2741 {0x00, 0x59, 0x7e, 0xaa}, /* sharpness */
2742 {0x00, 0x16, 0x00, 0xaa}, /* white balance */
2743 {0x00, 0x18, 0x00, 0xaa},
2746 static const u8 poxxxx_init_end_2
[][4] = {
2747 {0x00, 0x1d, 0x85, 0xaa},
2748 {0x00, 0x1e, 0x06, 0xaa},
2749 {0x00, 0x1d, 0x05, 0xaa},
2753 struct sensor_info
{
2764 static const struct sensor_info vc0321_probe_data
[] = {
2765 /* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
2767 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2768 /* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
2769 {-1, 0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
2770 /* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
2771 {-1, 0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
2773 {-1, 0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
2774 /* 4 MI360 - tested in vc032x_probe_sensor */
2775 /* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
2777 {SENSOR_HV7131R
, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
2779 {-1, 0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
2781 {-1, 0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
2783 {SENSOR_OV7660
, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
2784 /* 9 PO3130NC - (tested in vc032x_probe_sensor) */
2785 /* {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
2787 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2789 {SENSOR_MI1310_SOC
, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
2791 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2793 {-1, 0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
2794 /* 14 MI360_SOC - ??? */
2796 {SENSOR_PO1200
, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
2798 {-1, 0x80 | 0x18, 0x00, 0x0000, 0x24, 0x25, 0x01},
2800 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2802 {-1, 0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
2803 {SENSOR_MI1320
, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x65, 0x01},
2805 static const struct sensor_info vc0323_probe_data
[] = {
2806 /* sensorId, I2cAdd, IdAdd, VpId, m1, m2, op */
2808 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2809 /* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
2810 {-1, 0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
2811 /* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
2812 {-1, 0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
2814 {-1, 0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
2815 /* 4 MI360 - tested in vc032x_probe_sensor */
2816 /* {SENSOR_MI0360, 0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
2818 {SENSOR_HV7131R
, 0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
2820 {-1, 0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
2822 {-1, 0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
2824 {SENSOR_OV7660
, 0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
2825 /* 9 PO3130NC - (tested in vc032x_probe_sensor) */
2826 /* {SENSOR_PO3130NC, 0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
2828 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2830 {SENSOR_MI1310_SOC
, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
2832 {-1, 0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2834 {-1, 0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
2835 /* 14 MI360_SOC - ??? */
2837 {SENSOR_PO1200
, 0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
2839 {-1, 0x80 | 0x2d, 0x00, 0x0000, 0x65, 0x67, 0x01},
2841 {-1, 0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2843 {-1, 0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
2844 {SENSOR_MI1320_SOC
, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x67, 0x01},
2845 /*fixme: not in the ms-win probe - may be found before? */
2846 {SENSOR_OV7670
, 0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
2849 /* read 'len' bytes in gspca_dev->usb_buf */
2850 static void reg_r(struct gspca_dev
*gspca_dev
,
2855 usb_control_msg(gspca_dev
->dev
,
2856 usb_rcvctrlpipe(gspca_dev
->dev
, 0),
2858 USB_DIR_IN
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
2860 index
, gspca_dev
->usb_buf
, len
,
2864 static void reg_w(struct usb_device
*dev
,
2869 usb_control_msg(dev
,
2870 usb_sndctrlpipe(dev
, 0),
2872 USB_DIR_OUT
| USB_TYPE_VENDOR
| USB_RECIP_DEVICE
,
2873 value
, index
, NULL
, 0,
2877 static u16
read_sensor_register(struct gspca_dev
*gspca_dev
,
2880 struct usb_device
*dev
= gspca_dev
->dev
;
2881 u8 ldata
, mdata
, hdata
;
2884 reg_r(gspca_dev
, 0xa1, 0xb33f, 1);
2885 if (!(gspca_dev
->usb_buf
[0] & 0x02)) {
2886 PDEBUG(D_ERR
, "I2c Bus Busy Wait %02x",
2887 gspca_dev
->usb_buf
[0]);
2890 reg_w(dev
, 0xa0, address
, 0xb33a);
2891 reg_w(dev
, 0xa0, 0x02, 0xb339);
2894 reg_r(gspca_dev
, 0xa1, 0xb33b, 1);
2895 if (gspca_dev
->usb_buf
[0] == 0x00)
2898 } while (--retry
>= 0);
2900 reg_r(gspca_dev
, 0xa1, 0xb33e, 1);
2901 ldata
= gspca_dev
->usb_buf
[0];
2902 reg_r(gspca_dev
, 0xa1, 0xb33d, 1);
2903 mdata
= gspca_dev
->usb_buf
[0];
2904 reg_r(gspca_dev
, 0xa1, 0xb33c, 1);
2905 hdata
= gspca_dev
->usb_buf
[0];
2906 if (hdata
!= 0 && mdata
!= 0 && ldata
!= 0)
2907 PDEBUG(D_PROBE
, "Read Sensor %02x%02x %02x",
2908 hdata
, mdata
, ldata
);
2909 reg_r(gspca_dev
, 0xa1, 0xb334, 1);
2910 if (gspca_dev
->usb_buf
[0] == 0x02)
2911 return (hdata
<< 8) + mdata
;
2915 static int vc032x_probe_sensor(struct gspca_dev
*gspca_dev
)
2917 struct sd
*sd
= (struct sd
*) gspca_dev
;
2918 struct usb_device
*dev
= gspca_dev
->dev
;
2921 const struct sensor_info
*ptsensor_info
;
2923 /*fixme: should also check the other sensor (back mi1320_soc, front mc501cb)*/
2924 if (sd
->flags
& FL_SAMSUNG
) {
2925 reg_w(dev
, 0xa0, 0x01, 0xb301);
2926 reg_w(dev
, 0x89, 0xf0ff, 0xffff); /* select the back sensor */
2929 reg_r(gspca_dev
, 0xa1, 0xbfcf, 1);
2930 PDEBUG(D_PROBE
, "vc032%d check sensor header %02x",
2931 sd
->bridge
== BRIDGE_VC0321
? 1 : 3, gspca_dev
->usb_buf
[0]);
2932 if (sd
->bridge
== BRIDGE_VC0321
) {
2933 ptsensor_info
= vc0321_probe_data
;
2934 n
= ARRAY_SIZE(vc0321_probe_data
);
2936 ptsensor_info
= vc0323_probe_data
;
2937 n
= ARRAY_SIZE(vc0323_probe_data
);
2939 for (i
= 0; i
< n
; i
++) {
2940 reg_w(dev
, 0xa0, 0x02, 0xb334);
2941 reg_w(dev
, 0xa0, ptsensor_info
->m1
, 0xb300);
2942 reg_w(dev
, 0xa0, ptsensor_info
->m2
, 0xb300);
2943 reg_w(dev
, 0xa0, 0x01, 0xb308);
2944 reg_w(dev
, 0xa0, 0x0c, 0xb309);
2945 reg_w(dev
, 0xa0, ptsensor_info
->I2cAdd
, 0xb335);
2946 reg_w(dev
, 0xa0, ptsensor_info
->op
, 0xb301);
2947 value
= read_sensor_register(gspca_dev
, ptsensor_info
->IdAdd
);
2948 if (value
== 0 && ptsensor_info
->IdAdd
== 0x82)
2949 value
= read_sensor_register(gspca_dev
, 0x83);
2951 PDEBUG(D_ERR
|D_PROBE
, "Sensor ID %04x (%d)",
2953 if (value
== ptsensor_info
->VpId
)
2954 return ptsensor_info
->sensorId
;
2958 return SENSOR_PO3130NC
;
2960 return SENSOR_OV7670
;
2962 return SENSOR_MI0360
;
2970 static void i2c_write(struct gspca_dev
*gspca_dev
,
2971 u8 reg
, const u8
*val
,
2972 u8 size
) /* 1 or 2 */
2974 struct usb_device
*dev
= gspca_dev
->dev
;
2977 reg_r(gspca_dev
, 0xa1, 0xb33f, 1);
2978 /*fixme:should check if (!(gspca_dev->usb_buf[0] & 0x02)) error*/
2979 reg_w(dev
, 0xa0, size
, 0xb334);
2980 reg_w(dev
, 0xa0, reg
, 0xb33a);
2981 reg_w(dev
, 0xa0, val
[0], 0xb336);
2983 reg_w(dev
, 0xa0, val
[1], 0xb337);
2984 reg_w(dev
, 0xa0, 0x01, 0xb339);
2987 reg_r(gspca_dev
, 0xa1, 0xb33b, 1);
2988 if (gspca_dev
->usb_buf
[0] == 0)
2991 } while (--retry
> 0);
2993 PDEBUG(D_ERR
, "i2c_write failed");
2996 static void put_tab_to_reg(struct gspca_dev
*gspca_dev
,
2997 const u8
*tab
, u8 tabsize
, u16 addr
)
3002 for (j
= 0; j
< tabsize
; j
++)
3003 reg_w(gspca_dev
->dev
, 0xa0, tab
[j
], ad
++);
3006 static void usb_exchange(struct gspca_dev
*gspca_dev
,
3009 struct usb_device
*dev
= gspca_dev
->dev
;
3013 switch (data
[i
][3]) {
3016 case 0xcc: /* normal write */
3017 reg_w(dev
, 0xa0, data
[i
][2],
3018 (data
[i
][0]) << 8 | data
[i
][1]);
3020 case 0xaa: /* i2c op */
3021 i2c_write(gspca_dev
, data
[i
][1], &data
[i
][2], 1);
3023 case 0xbb: /* i2c op */
3024 i2c_write(gspca_dev
, data
[i
][0], &data
[i
][1], 2);
3027 msleep(data
[i
][1] * 256 + data
[i
][2] + 10);
3036 /* this function is called at probe time */
3037 static int sd_config(struct gspca_dev
*gspca_dev
,
3038 const struct usb_device_id
*id
)
3040 struct sd
*sd
= (struct sd
*) gspca_dev
;
3041 struct usb_device
*dev
= gspca_dev
->dev
;
3044 static u8 npkt
[] = { /* number of packets per ISOC message */
3047 32, /* MI1310_SOC 2 */
3049 128, /* MI1320_SOC 4 */
3053 128, /* PO3130NC 8 */
3057 cam
= &gspca_dev
->cam
;
3058 sd
->bridge
= id
->driver_info
>> 8;
3059 sd
->flags
= id
->driver_info
& 0xff;
3060 if (id
->idVendor
== 0x046d &&
3061 (id
->idProduct
== 0x0892 || id
->idProduct
== 0x0896))
3062 sensor
= SENSOR_POxxxx
;
3064 sensor
= vc032x_probe_sensor(gspca_dev
);
3067 PDEBUG(D_PROBE
, "Unknown sensor...");
3069 case SENSOR_HV7131R
:
3070 PDEBUG(D_PROBE
, "Find Sensor HV7131R");
3073 PDEBUG(D_PROBE
, "Find Sensor MI0360");
3074 sd
->bridge
= BRIDGE_VC0323
;
3076 case SENSOR_MI1310_SOC
:
3077 PDEBUG(D_PROBE
, "Find Sensor MI1310_SOC");
3080 PDEBUG(D_PROBE
, "Find Sensor MI1320");
3082 case SENSOR_MI1320_SOC
:
3083 PDEBUG(D_PROBE
, "Find Sensor MI1320_SOC");
3086 PDEBUG(D_PROBE
, "Find Sensor OV7660");
3089 PDEBUG(D_PROBE
, "Find Sensor OV7670");
3092 PDEBUG(D_PROBE
, "Find Sensor PO1200");
3094 case SENSOR_PO3130NC
:
3095 PDEBUG(D_PROBE
, "Find Sensor PO3130NC");
3098 PDEBUG(D_PROBE
, "Sensor POxxxx");
3101 sd
->sensor
= sensor
;
3103 if (sd
->bridge
== BRIDGE_VC0321
) {
3104 cam
->cam_mode
= vc0321_mode
;
3105 cam
->nmodes
= ARRAY_SIZE(vc0321_mode
);
3109 cam
->cam_mode
= svga_mode
;
3110 cam
->nmodes
= ARRAY_SIZE(svga_mode
);
3112 case SENSOR_MI1310_SOC
:
3113 cam
->cam_mode
= vc0323_mode
;
3114 cam
->nmodes
= ARRAY_SIZE(vc0323_mode
);
3116 case SENSOR_MI1320_SOC
:
3117 cam
->cam_mode
= bi_mode
;
3118 cam
->nmodes
= ARRAY_SIZE(bi_mode
);
3121 cam
->cam_mode
= vc0323_mode
;
3122 cam
->nmodes
= ARRAY_SIZE(vc0323_mode
) - 1;
3126 cam
->npkt
= npkt
[sd
->sensor
];
3128 sd
->brightness
= BRIGHTNESS_DEF
;
3129 sd
->contrast
= CONTRAST_DEF
;
3130 sd
->colors
= COLOR_DEF
;
3131 sd
->hflip
= HFLIP_DEF
;
3132 sd
->vflip
= VFLIP_DEF
;
3133 sd
->lightfreq
= FREQ_DEF
;
3134 sd
->sharpness
= SHARPNESS_DEF
;
3136 gspca_dev
->ctrl_dis
= ctrl_dis
[sd
->sensor
];
3138 if (sd
->sensor
== SENSOR_OV7670
)
3139 sd
->flags
|= FL_HFLIP
| FL_VFLIP
;
3141 if (sd
->bridge
== BRIDGE_VC0321
) {
3142 reg_r(gspca_dev
, 0x8a, 0, 3);
3143 reg_w(dev
, 0x87, 0x00, 0x0f0f);
3145 reg_r(gspca_dev
, 0x8b, 0, 3);
3146 reg_w(dev
, 0x88, 0x00, 0x0202);
3151 /* this function is called at probe and resume time */
3152 static int sd_init(struct gspca_dev
*gspca_dev
)
3154 struct sd
*sd
= (struct sd
*) gspca_dev
;
3156 if (sd
->sensor
== SENSOR_POxxxx
) {
3157 reg_r(gspca_dev
, 0xa1, 0xb300, 1);
3158 if (gspca_dev
->usb_buf
[0] != 0) {
3159 reg_w(gspca_dev
->dev
, 0xa0, 0x26, 0xb300);
3160 reg_w(gspca_dev
->dev
, 0xa0, 0x04, 0xb300);
3161 reg_w(gspca_dev
->dev
, 0xa0, 0x00, 0xb300);
3167 static void setbrightness(struct gspca_dev
*gspca_dev
)
3169 struct sd
*sd
= (struct sd
*) gspca_dev
;
3172 if (gspca_dev
->ctrl_dis
& (1 << BRIGHTNESS_IDX
))
3174 data
= sd
->brightness
;
3179 i2c_write(gspca_dev
, 0x98, &data
, 1);
3182 static void setcontrast(struct gspca_dev
*gspca_dev
)
3184 struct sd
*sd
= (struct sd
*) gspca_dev
;
3186 if (gspca_dev
->ctrl_dis
& (1 << CONTRAST_IDX
))
3188 i2c_write(gspca_dev
, 0x99, &sd
->contrast
, 1);
3191 static void setcolors(struct gspca_dev
*gspca_dev
)
3193 struct sd
*sd
= (struct sd
*) gspca_dev
;
3196 if (gspca_dev
->ctrl_dis
& (1 << COLORS_IDX
))
3198 data
= sd
->colors
- (sd
->colors
>> 3) - 1;
3199 i2c_write(gspca_dev
, 0x94, &data
, 1);
3200 i2c_write(gspca_dev
, 0x95, &sd
->colors
, 1);
3203 static void sethvflip(struct gspca_dev
*gspca_dev
)
3205 struct sd
*sd
= (struct sd
*) gspca_dev
;
3206 u8 data
[2], hflip
, vflip
;
3209 if (sd
->flags
& FL_HFLIP
)
3212 if (sd
->flags
& FL_VFLIP
)
3214 switch (sd
->sensor
) {
3215 case SENSOR_MI1310_SOC
:
3217 case SENSOR_MI1320_SOC
:
3218 data
[0] = data
[1] = 0; /* select page 0 */
3219 i2c_write(gspca_dev
, 0xf0, data
, 2);
3220 data
[0] = sd
->sensor
== SENSOR_MI1310_SOC
? 0x03 : 0x01;
3221 data
[1] = 0x02 * hflip
3223 i2c_write(gspca_dev
, 0x20, data
, 2);
3227 data
[0] = sd
->sensor
== SENSOR_OV7660
? 0x01 : 0x07;
3228 data
[0] |= OV7660_MVFP_MIRROR
* hflip
3229 | OV7660_MVFP_VFLIP
* vflip
;
3230 i2c_write(gspca_dev
, OV7660_REG_MVFP
, data
, 1);
3234 i2c_write(gspca_dev
, 0x03, data
, 1);
3235 data
[0] = 0x80 * hflip
3238 i2c_write(gspca_dev
, 0x1e, data
, 1);
3243 static void setlightfreq(struct gspca_dev
*gspca_dev
)
3245 struct sd
*sd
= (struct sd
*) gspca_dev
;
3246 static const u8 (*ov7660_freq_tb
[3])[4] =
3247 {ov7660_NoFliker
, ov7660_50HZ
, ov7660_60HZ
};
3249 if (sd
->sensor
!= SENSOR_OV7660
)
3251 usb_exchange(gspca_dev
, ov7660_freq_tb
[sd
->lightfreq
]);
3254 static void setsharpness(struct gspca_dev
*gspca_dev
)
3256 struct sd
*sd
= (struct sd
*) gspca_dev
;
3259 switch (sd
->sensor
) {
3262 i2c_write(gspca_dev
, 0x03, &data
, 1);
3263 if (sd
->sharpness
< 0)
3266 data
= 0xb5 + sd
->sharpness
* 3;
3267 i2c_write(gspca_dev
, 0x61, &data
, 1);
3270 if (sd
->sharpness
< 0)
3271 data
= 0x7e; /* def = max */
3273 data
= 0x60 + sd
->sharpness
* 0x0f;
3274 i2c_write(gspca_dev
, 0x59, &data
, 1);
3279 static int sd_start(struct gspca_dev
*gspca_dev
)
3281 struct sd
*sd
= (struct sd
*) gspca_dev
;
3282 const u8 (*init
)[4];
3283 const u8
*GammaT
= NULL
;
3284 const u8
*MatrixT
= NULL
;
3286 static const u8 (*mi1320_soc_init
[])[4] = {
3287 mi1320_soc_InitSXGA
,
3289 mi1320_soc_InitQVGA
,
3292 /*fixme: back sensor only*/
3293 if (sd
->flags
& FL_SAMSUNG
) {
3294 reg_w(gspca_dev
->dev
, 0x89, 0xf0ff, 0xffff);
3295 reg_w(gspca_dev
->dev
, 0xa9, 0x8348, 0x000e);
3296 reg_w(gspca_dev
->dev
, 0xa9, 0x0000, 0x001a);
3299 /* Assume start use the good resolution from gspca_dev->mode */
3300 if (sd
->bridge
== BRIDGE_VC0321
) {
3301 reg_w(gspca_dev
->dev
, 0xa0, 0xff, 0xbfec);
3302 reg_w(gspca_dev
->dev
, 0xa0, 0xff, 0xbfed);
3303 reg_w(gspca_dev
->dev
, 0xa0, 0xff, 0xbfee);
3304 reg_w(gspca_dev
->dev
, 0xa0, 0xff, 0xbfef);
3305 sd
->image_offset
= 46;
3307 if (gspca_dev
->cam
.cam_mode
[gspca_dev
->curr_mode
].pixelformat
3308 == V4L2_PIX_FMT_JPEG
)
3309 sd
->image_offset
= 0;
3311 sd
->image_offset
= 32;
3314 mode
= gspca_dev
->cam
.cam_mode
[(int) gspca_dev
->curr_mode
].priv
;
3315 switch (sd
->sensor
) {
3316 case SENSOR_HV7131R
:
3317 GammaT
= hv7131r_gamma
;
3318 MatrixT
= hv7131r_matrix
;
3320 init
= hv7131r_initQVGA_data
; /* 320x240 */
3322 init
= hv7131r_initVGA_data
; /* 640x480 */
3325 GammaT
= ov7660_gamma
;
3326 MatrixT
= ov7660_matrix
;
3328 init
= ov7660_initQVGA_data
; /* 320x240 */
3330 init
= ov7660_initVGA_data
; /* 640x480 */
3333 /*GammaT = ov7660_gamma; */
3334 /*MatrixT = ov7660_matrix; */
3336 init
= ov7670_initQVGA_JPG
; /* 320x240 */
3338 init
= ov7670_initVGA_JPG
; /* 640x480 */
3341 GammaT
= mi1320_gamma
;
3342 MatrixT
= mi0360_matrix
;
3344 init
= mi0360_initQVGA_JPG
; /* 320x240 */
3346 init
= mi0360_initVGA_JPG
; /* 640x480 */
3348 case SENSOR_MI1310_SOC
:
3349 GammaT
= mi1320_gamma
;
3350 MatrixT
= mi1320_matrix
;
3353 init
= mi1310_socinitQVGA_JPG
; /* 320x240 */
3356 init
= mi1310_socinitVGA_JPG
; /* 640x480 */
3359 init
= mi1310_soc_InitSXGA_JPG
; /* 1280x1024 */
3364 GammaT
= mi1320_gamma
;
3365 MatrixT
= mi1320_matrix
;
3367 init
= mi1320_initQVGA_data
; /* 320x240 */
3369 init
= mi1320_initVGA_data
; /* 640x480 */
3371 case SENSOR_MI1320_SOC
:
3372 GammaT
= mi1320_gamma
;
3373 MatrixT
= mi1320_matrix
;
3374 init
= mi1320_soc_init
[mode
];
3376 case SENSOR_PO3130NC
:
3377 GammaT
= po3130_gamma
;
3378 MatrixT
= po3130_matrix
;
3380 init
= po3130_initQVGA_data
; /* 320x240 */
3382 init
= po3130_initVGA_data
; /* 640x480 */
3383 usb_exchange(gspca_dev
, init
);
3384 init
= po3130_rundata
;
3387 GammaT
= po1200_gamma
;
3388 MatrixT
= po1200_matrix
;
3389 init
= po1200_initVGA_data
;
3392 /* case SENSOR_POxxxx: */
3393 usb_exchange(gspca_dev
, poxxxx_init_common
);
3395 init
= poxxxx_initQVGA
;
3397 init
= poxxxx_initVGA
;
3398 usb_exchange(gspca_dev
, init
);
3399 reg_r(gspca_dev
, 0x8c, 0x0000, 3);
3400 reg_w(gspca_dev
->dev
, 0xa0,
3401 gspca_dev
->usb_buf
[2] & 1 ? 0 : 1,
3404 /*fixme: i2c read 04 and 05*/
3405 init
= poxxxx_init_end_1
;
3408 usb_exchange(gspca_dev
, init
);
3409 if (GammaT
&& MatrixT
) {
3410 put_tab_to_reg(gspca_dev
, GammaT
, 17, 0xb84a);
3411 put_tab_to_reg(gspca_dev
, GammaT
, 17, 0xb85b);
3412 put_tab_to_reg(gspca_dev
, GammaT
, 17, 0xb86c);
3413 put_tab_to_reg(gspca_dev
, MatrixT
, 9, 0xb82c);
3415 switch (sd
->sensor
) {
3417 case SENSOR_HV7131R
:
3418 reg_w(gspca_dev
->dev
, 0x89, 0x0400, 0x1415);
3420 case SENSOR_MI1310_SOC
:
3421 reg_w(gspca_dev
->dev
, 0x89, 0x058c, 0x0000);
3425 setsharpness(gspca_dev
);
3426 sethvflip(gspca_dev
);
3427 setlightfreq(gspca_dev
);
3429 if (sd
->sensor
== SENSOR_POxxxx
) {
3430 setcolors(gspca_dev
);
3431 setbrightness(gspca_dev
);
3432 setcontrast(gspca_dev
);
3436 reg_w(gspca_dev
->dev
, 0x89, 0xffff, 0xfdff);
3437 usb_exchange(gspca_dev
, poxxxx_init_end_2
);
3442 static void sd_stopN(struct gspca_dev
*gspca_dev
)
3444 struct usb_device
*dev
= gspca_dev
->dev
;
3445 struct sd
*sd
= (struct sd
*) gspca_dev
;
3447 switch (sd
->sensor
) {
3448 case SENSOR_MI1310_SOC
:
3449 reg_w(dev
, 0x89, 0x058c, 0x00ff);
3454 if (!(sd
->flags
& FL_SAMSUNG
))
3455 reg_w(dev
, 0x89, 0xffff, 0xffff);
3458 reg_w(dev
, 0xa0, 0x01, 0xb301);
3459 reg_w(dev
, 0xa0, 0x09, 0xb003);
3462 /* called on streamoff with alt 0 and on disconnect */
3463 static void sd_stop0(struct gspca_dev
*gspca_dev
)
3465 struct usb_device
*dev
= gspca_dev
->dev
;
3466 struct sd
*sd
= (struct sd
*) gspca_dev
;
3468 if (!gspca_dev
->present
)
3470 /*fixme: is this useful?*/
3471 if (sd
->sensor
== SENSOR_MI1310_SOC
)
3472 reg_w(dev
, 0x89, 0x058c, 0x00ff);
3473 else if (!(sd
->flags
& FL_SAMSUNG
))
3474 reg_w(dev
, 0x89, 0xffff, 0xffff);
3476 if (sd
->sensor
== SENSOR_POxxxx
) {
3477 reg_w(dev
, 0xa0, 0x26, 0xb300);
3478 reg_w(dev
, 0xa0, 0x04, 0xb300);
3479 reg_w(dev
, 0xa0, 0x00, 0xb300);
3483 static void sd_pkt_scan(struct gspca_dev
*gspca_dev
,
3484 u8
*data
, /* isoc packet */
3485 int len
) /* iso pkt length */
3487 struct sd
*sd
= (struct sd
*) gspca_dev
;
3489 if (data
[0] == 0xff && data
[1] == 0xd8) {
3491 "vc032x header packet found len %d", len
);
3492 gspca_frame_add(gspca_dev
, LAST_PACKET
, NULL
, 0);
3493 data
+= sd
->image_offset
;
3494 len
-= sd
->image_offset
;
3495 gspca_frame_add(gspca_dev
, FIRST_PACKET
, data
, len
);
3499 /* The vc0321 sends some additional data after sending the complete
3500 * frame, we ignore this. */
3501 if (sd
->bridge
== BRIDGE_VC0321
) {
3502 struct gspca_frame
*frame
;
3505 frame
= gspca_get_i_frame(gspca_dev
);
3506 if (frame
== NULL
) {
3507 gspca_dev
->last_packet_type
= DISCARD_PACKET
;
3510 l
= frame
->data_end
- frame
->data
;
3511 if (len
> frame
->v4l2_buf
.length
- l
)
3512 len
= frame
->v4l2_buf
.length
- l
;
3514 gspca_frame_add(gspca_dev
, INTER_PACKET
, data
, len
);
3517 static int sd_setbrightness(struct gspca_dev
*gspca_dev
, __s32 val
)
3519 struct sd
*sd
= (struct sd
*) gspca_dev
;
3521 sd
->brightness
= val
;
3522 if (gspca_dev
->streaming
)
3523 setbrightness(gspca_dev
);
3527 static int sd_getbrightness(struct gspca_dev
*gspca_dev
, __s32
*val
)
3529 struct sd
*sd
= (struct sd
*) gspca_dev
;
3531 *val
= sd
->brightness
;
3535 static int sd_setcontrast(struct gspca_dev
*gspca_dev
, __s32 val
)
3537 struct sd
*sd
= (struct sd
*) gspca_dev
;
3540 if (gspca_dev
->streaming
)
3541 setcontrast(gspca_dev
);
3545 static int sd_getcontrast(struct gspca_dev
*gspca_dev
, __s32
*val
)
3547 struct sd
*sd
= (struct sd
*) gspca_dev
;
3549 *val
= sd
->contrast
;
3553 static int sd_setcolors(struct gspca_dev
*gspca_dev
, __s32 val
)
3555 struct sd
*sd
= (struct sd
*) gspca_dev
;
3558 if (gspca_dev
->streaming
)
3559 setcolors(gspca_dev
);
3563 static int sd_getcolors(struct gspca_dev
*gspca_dev
, __s32
*val
)
3565 struct sd
*sd
= (struct sd
*) gspca_dev
;
3571 static int sd_sethflip(struct gspca_dev
*gspca_dev
, __s32 val
)
3573 struct sd
*sd
= (struct sd
*) gspca_dev
;
3576 if (gspca_dev
->streaming
)
3577 sethvflip(gspca_dev
);
3581 static int sd_gethflip(struct gspca_dev
*gspca_dev
, __s32
*val
)
3583 struct sd
*sd
= (struct sd
*) gspca_dev
;
3589 static int sd_setvflip(struct gspca_dev
*gspca_dev
, __s32 val
)
3591 struct sd
*sd
= (struct sd
*) gspca_dev
;
3594 if (gspca_dev
->streaming
)
3595 sethvflip(gspca_dev
);
3599 static int sd_getvflip(struct gspca_dev
*gspca_dev
, __s32
*val
)
3601 struct sd
*sd
= (struct sd
*) gspca_dev
;
3607 static int sd_setfreq(struct gspca_dev
*gspca_dev
, __s32 val
)
3609 struct sd
*sd
= (struct sd
*) gspca_dev
;
3611 sd
->lightfreq
= val
;
3612 if (gspca_dev
->streaming
)
3613 setlightfreq(gspca_dev
);
3617 static int sd_getfreq(struct gspca_dev
*gspca_dev
, __s32
*val
)
3619 struct sd
*sd
= (struct sd
*) gspca_dev
;
3621 *val
= sd
->lightfreq
;
3625 static int sd_setsharpness(struct gspca_dev
*gspca_dev
, __s32 val
)
3627 struct sd
*sd
= (struct sd
*) gspca_dev
;
3629 sd
->sharpness
= val
;
3630 if (gspca_dev
->streaming
)
3631 setsharpness(gspca_dev
);
3635 static int sd_getsharpness(struct gspca_dev
*gspca_dev
, __s32
*val
)
3637 struct sd
*sd
= (struct sd
*) gspca_dev
;
3639 *val
= sd
->sharpness
;
3643 static int sd_querymenu(struct gspca_dev
*gspca_dev
,
3644 struct v4l2_querymenu
*menu
)
3646 static const char *freq_nm
[3] = {"NoFliker", "50 Hz", "60 Hz"};
3649 case V4L2_CID_POWER_LINE_FREQUENCY
:
3650 if (menu
->index
>= ARRAY_SIZE(freq_nm
))
3652 strcpy((char *) menu
->name
, freq_nm
[menu
->index
]);
3658 /* sub-driver description */
3659 static const struct sd_desc sd_desc
= {
3660 .name
= MODULE_NAME
,
3662 .nctrls
= ARRAY_SIZE(sd_ctrls
),
3663 .config
= sd_config
,
3668 .pkt_scan
= sd_pkt_scan
,
3669 .querymenu
= sd_querymenu
,
3672 /* -- module initialisation -- */
3673 #define BF(bridge, flags) \
3674 .driver_info = (BRIDGE_ ## bridge << 8) \
3676 static const __devinitdata
struct usb_device_id device_table
[] = {
3677 {USB_DEVICE(0x041e, 0x405b), BF(VC0323
, FL_VFLIP
)},
3678 {USB_DEVICE(0x046d, 0x0892), BF(VC0321
, 0)},
3679 {USB_DEVICE(0x046d, 0x0896), BF(VC0321
, 0)},
3680 {USB_DEVICE(0x046d, 0x0897), BF(VC0321
, 0)},
3681 {USB_DEVICE(0x0ac8, 0x0321), BF(VC0321
, 0)},
3682 {USB_DEVICE(0x0ac8, 0x0323), BF(VC0323
, 0)},
3683 {USB_DEVICE(0x0ac8, 0x0328), BF(VC0321
, 0)},
3684 {USB_DEVICE(0x0ac8, 0xc001), BF(VC0321
, 0)},
3685 {USB_DEVICE(0x0ac8, 0xc002), BF(VC0321
, 0)},
3686 {USB_DEVICE(0x0ac8, 0xc301), BF(VC0323
, FL_SAMSUNG
)},
3687 {USB_DEVICE(0x15b8, 0x6001), BF(VC0323
, 0)},
3688 {USB_DEVICE(0x15b8, 0x6002), BF(VC0323
, 0)},
3689 {USB_DEVICE(0x17ef, 0x4802), BF(VC0323
, 0)},
3692 MODULE_DEVICE_TABLE(usb
, device_table
);
3694 /* -- device connect -- */
3695 static int sd_probe(struct usb_interface
*intf
,
3696 const struct usb_device_id
*id
)
3698 return gspca_dev_probe(intf
, id
, &sd_desc
, sizeof(struct sd
),
3702 static struct usb_driver sd_driver
= {
3703 .name
= MODULE_NAME
,
3704 .id_table
= device_table
,
3706 .disconnect
= gspca_disconnect
,
3708 .suspend
= gspca_suspend
,
3709 .resume
= gspca_resume
,
3713 /* -- module insert / remove -- */
3714 static int __init
sd_mod_init(void)
3718 ret
= usb_register(&sd_driver
);
3721 PDEBUG(D_PROBE
, "registered");
3724 static void __exit
sd_mod_exit(void)
3726 usb_deregister(&sd_driver
);
3727 PDEBUG(D_PROBE
, "deregistered");
3730 module_init(sd_mod_init
);
3731 module_exit(sd_mod_exit
);