xref: /openbmc/linux/drivers/media/usb/gspca/vc032x.c (revision d2574c33)
1 /*
2  * Z-star vc0321 library
3  *
4  * Copyright (C) 2009-2010 Jean-François Moine <http://moinejf.free.fr>
5  * Copyright (C) 2006 Koninski Artur takeshi87@o2.pl
6  * Copyright (C) 2006 Michel Xhaard
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */
18 
19 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20 
21 #define MODULE_NAME "vc032x"
22 
23 #include "gspca.h"
24 
25 MODULE_AUTHOR("Jean-François Moine <http://moinejf.free.fr>");
26 MODULE_DESCRIPTION("GSPCA/VC032X USB Camera Driver");
27 MODULE_LICENSE("GPL");
28 
29 /* specific webcam descriptor */
30 struct sd {
31 	struct gspca_dev gspca_dev;	/* !! must be the first item */
32 	struct { /* hvflip cluster */
33 		struct v4l2_ctrl *hflip;
34 		struct v4l2_ctrl *vflip;
35 	};
36 
37 	u8 image_offset;
38 
39 	u8 bridge;
40 	u8 sensor;
41 	u8 flags;
42 #define FL_SAMSUNG 0x01		/* SamsungQ1 (2 sensors) */
43 #define FL_HFLIP 0x02		/* mirrored by default */
44 #define FL_VFLIP 0x04		/* vertical flipped by default */
45 };
46 enum bridges {
47 	BRIDGE_VC0321,
48 	BRIDGE_VC0323,
49 };
50 enum sensors {
51 	SENSOR_HV7131R,
52 	SENSOR_MI0360,
53 	SENSOR_MI1310_SOC,
54 	SENSOR_MI1320,
55 	SENSOR_MI1320_SOC,
56 	SENSOR_OV7660,
57 	SENSOR_OV7670,
58 	SENSOR_PO1200,
59 	SENSOR_PO3130NC,
60 	SENSOR_POxxxx,
61 	NSENSORS
62 };
63 
64 
65 static const struct v4l2_pix_format vc0321_mode[] = {
66 	{320, 240, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
67 		.bytesperline = 320 * 2,
68 		.sizeimage = 320 * 240 * 2,
69 		.colorspace = V4L2_COLORSPACE_SRGB,
70 		.priv = 1},
71 	{640, 480, V4L2_PIX_FMT_YVYU, V4L2_FIELD_NONE,
72 		.bytesperline = 640 * 2,
73 		.sizeimage = 640 * 480 * 2,
74 		.colorspace = V4L2_COLORSPACE_SRGB,
75 		.priv = 0},
76 };
77 static const struct v4l2_pix_format vc0323_mode[] = {
78 	{320, 240, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
79 		.bytesperline = 320,
80 		.sizeimage = 320 * 240 * 3 / 8 + 590,
81 		.colorspace = V4L2_COLORSPACE_JPEG,
82 		.priv = 1},
83 	{640, 480, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
84 		.bytesperline = 640,
85 		.sizeimage = 640 * 480 * 3 / 8 + 590,
86 		.colorspace = V4L2_COLORSPACE_JPEG,
87 		.priv = 0},
88 	{1280, 960, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE, /* mi1310_soc only */
89 		.bytesperline = 1280,
90 		.sizeimage = 1280 * 960 * 3 / 8 + 590,
91 		.colorspace = V4L2_COLORSPACE_JPEG,
92 		.priv = 2},
93 };
94 static const struct v4l2_pix_format bi_mode[] = {
95 	{320, 240, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
96 		.bytesperline = 320 * 2,
97 		.sizeimage = 320 * 240 * 2,
98 		.colorspace = V4L2_COLORSPACE_SRGB,
99 		.priv = 2},
100 	{640, 480, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
101 		.bytesperline = 640 * 2,
102 		.sizeimage = 640 * 480 * 2,
103 		.colorspace = V4L2_COLORSPACE_SRGB,
104 		.priv = 1},
105 	{1280, 1024, V4L2_PIX_FMT_YUYV, V4L2_FIELD_NONE,
106 		.bytesperline = 1280 * 2,
107 		.sizeimage = 1280 * 1024 * 2,
108 		.colorspace = V4L2_COLORSPACE_SRGB,
109 		.priv = 0},
110 };
111 static const struct v4l2_pix_format svga_mode[] = {
112 	{800, 600, V4L2_PIX_FMT_JPEG, V4L2_FIELD_NONE,
113 		.bytesperline = 800,
114 		.sizeimage = 800 * 600 * 1 / 4 + 590,
115 		.colorspace = V4L2_COLORSPACE_JPEG,
116 		.priv = 0},
117 };
118 
119 /* OV7660/7670 registers */
120 #define OV7660_REG_MVFP 0x1e
121 #define OV7660_MVFP_MIRROR	0x20
122 #define OV7660_MVFP_VFLIP	0x10
123 
124 static const u8 mi0360_matrix[9] = {
125 	0x50, 0xf8, 0xf8, 0xf5, 0x50, 0xfb, 0xff, 0xf1, 0x50
126 };
127 
128 static const u8 mi0360_initVGA_JPG[][4] = {
129 	{0xb0, 0x03, 0x19, 0xcc},
130 	{0xb0, 0x04, 0x02, 0xcc},
131 	{0xb3, 0x00, 0x24, 0xcc},
132 	{0xb3, 0x00, 0x25, 0xcc},
133 	{0xb3, 0x08, 0x01, 0xcc},
134 	{0xb3, 0x09, 0x0c, 0xcc},
135 	{0xb3, 0x05, 0x01, 0xcc},
136 	{0xb3, 0x06, 0x03, 0xcc},
137 	{0xb3, 0x03, 0x0a, 0xcc},
138 	{0xb3, 0x20, 0x00, 0xcc},
139 	{0xb3, 0x21, 0x00, 0xcc},
140 	{0xb3, 0x22, 0x01, 0xcc},
141 	{0xb3, 0x23, 0xe0, 0xcc},
142 	{0xb3, 0x04, 0x05, 0xcc},
143 	{0xb3, 0x14, 0x00, 0xcc},
144 	{0xb3, 0x15, 0x00, 0xcc},
145 	{0xb3, 0x16, 0x02, 0xcc},
146 	{0xb3, 0x17, 0x7f, 0xcc},
147 	{0xb3, 0x35, 0xdd, 0xcc},	/* i2c add: 5d */
148 	{0xb3, 0x34, 0x02, 0xcc},
149 	{0xb3, 0x00, 0x25, 0xcc},
150 	{0xbc, 0x00, 0x71, 0xcc},
151 	{0xb8, 0x00, 0x13, 0xcc},
152 	{0xb8, 0x27, 0x20, 0xcc},
153 	{0xb8, 0x2c, 0x50, 0xcc},
154 	{0xb8, 0x2d, 0xf8, 0xcc},
155 	{0xb8, 0x2e, 0xf8, 0xcc},
156 	{0xb8, 0x2f, 0xf8, 0xcc},
157 	{0xb8, 0x30, 0x50, 0xcc},
158 	{0xb8, 0x31, 0xf8, 0xcc},
159 	{0xb8, 0x32, 0xf8, 0xcc},
160 	{0xb8, 0x33, 0xf8, 0xcc},
161 	{0xb8, 0x34, 0x50, 0xcc},
162 	{0xb8, 0x35, 0x00, 0xcc},
163 	{0xb8, 0x36, 0x00, 0xcc},
164 	{0xb8, 0x37, 0x00, 0xcc},
165 	{0xb8, 0x01, 0x79, 0xcc},
166 	{0xb8, 0x08, 0xe0, 0xcc},
167 	{0xb3, 0x01, 0x41, 0xcc},
168 	{0xb8, 0x01, 0x79, 0xcc},
169 	{0xb8, 0x14, 0x18, 0xcc},
170 	{0xb8, 0xb2, 0x0a, 0xcc},
171 	{0xb8, 0xb4, 0x0a, 0xcc},
172 	{0xb8, 0xb5, 0x0a, 0xcc},
173 	{0xb8, 0xfe, 0x00, 0xcc},
174 	{0xb8, 0xff, 0x28, 0xcc},
175 	{0xb9, 0x00, 0x28, 0xcc},
176 	{0xb9, 0x01, 0x28, 0xcc},
177 	{0xb9, 0x02, 0x28, 0xcc},
178 	{0xb9, 0x03, 0x00, 0xcc},
179 	{0xb9, 0x04, 0x00, 0xcc},
180 	{0xb9, 0x05, 0x3c, 0xcc},
181 	{0xb9, 0x06, 0x3c, 0xcc},
182 	{0xb9, 0x07, 0x3c, 0xcc},
183 	{0xb9, 0x08, 0x3c, 0xcc},
184 	{0xb8, 0x8e, 0x00, 0xcc},
185 	{0xb8, 0x8f, 0xff, 0xcc},
186 	{0xb8, 0x81, 0x09, 0xcc},
187 	{0x31, 0x00, 0x00, 0xbb},
188 	{0x09, 0x01, 0xc7, 0xbb},
189 	{0x34, 0x01, 0x00, 0xbb},
190 	{0x2b, 0x00, 0x28, 0xbb},
191 	{0x2c, 0x00, 0x30, 0xbb},
192 	{0x2d, 0x00, 0x30, 0xbb},
193 	{0x2e, 0x00, 0x28, 0xbb},
194 	{0x62, 0x04, 0x11, 0xbb},
195 	{0x03, 0x01, 0xe0, 0xbb},
196 	{0x2c, 0x00, 0x2c, 0xbb},
197 	{0x20, 0xd0, 0x00, 0xbb},
198 	{0x01, 0x00, 0x08, 0xbb},
199 	{0x06, 0x00, 0x10, 0xbb},
200 	{0x05, 0x00, 0x20, 0xbb},
201 	{0x20, 0x00, 0x00, 0xbb},
202 	{0xb6, 0x00, 0x00, 0xcc},
203 	{0xb6, 0x03, 0x02, 0xcc},
204 	{0xb6, 0x02, 0x80, 0xcc},
205 	{0xb6, 0x05, 0x01, 0xcc},
206 	{0xb6, 0x04, 0xe0, 0xcc},
207 	{0xb6, 0x12, 0x78, 0xcc},
208 	{0xb6, 0x18, 0x02, 0xcc},
209 	{0xb6, 0x17, 0x58, 0xcc},
210 	{0xb6, 0x16, 0x00, 0xcc},
211 	{0xb6, 0x22, 0x12, 0xcc},
212 	{0xb6, 0x23, 0x0b, 0xcc},
213 	{0xb3, 0x02, 0x02, 0xcc},
214 	{0xbf, 0xc0, 0x39, 0xcc},
215 	{0xbf, 0xc1, 0x04, 0xcc},
216 	{0xbf, 0xcc, 0x10, 0xcc},
217 	{0xb9, 0x12, 0x00, 0xcc},
218 	{0xb9, 0x13, 0x0a, 0xcc},
219 	{0xb9, 0x14, 0x0a, 0xcc},
220 	{0xb9, 0x15, 0x0a, 0xcc},
221 	{0xb9, 0x16, 0x0a, 0xcc},
222 	{0xb9, 0x18, 0x00, 0xcc},
223 	{0xb9, 0x19, 0x0f, 0xcc},
224 	{0xb9, 0x1a, 0x0f, 0xcc},
225 	{0xb9, 0x1b, 0x0f, 0xcc},
226 	{0xb9, 0x1c, 0x0f, 0xcc},
227 	{0xb8, 0x8e, 0x00, 0xcc},
228 	{0xb8, 0x8f, 0xff, 0xcc},
229 	{0xb6, 0x12, 0xf8, 0xcc},
230 	{0xb8, 0x0c, 0x20, 0xcc},
231 	{0xb8, 0x0d, 0x70, 0xcc},
232 	{0xb6, 0x13, 0x13, 0xcc},
233 	{0x35, 0x00, 0x60, 0xbb},
234 	{0xb3, 0x5c, 0x01, 0xcc},
235 	{}
236 };
237 static const u8 mi0360_initQVGA_JPG[][4] = {
238 	{0xb0, 0x03, 0x19, 0xcc},
239 	{0xb0, 0x04, 0x02, 0xcc},
240 	{0xb3, 0x00, 0x24, 0xcc},
241 	{0xb3, 0x00, 0x25, 0xcc},
242 	{0xb3, 0x08, 0x01, 0xcc},
243 	{0xb3, 0x09, 0x0c, 0xcc},
244 	{0xb3, 0x05, 0x01, 0xcc},
245 	{0xb3, 0x06, 0x03, 0xcc},
246 	{0xb3, 0x03, 0x0a, 0xcc},
247 	{0xb3, 0x20, 0x00, 0xcc},
248 	{0xb3, 0x21, 0x00, 0xcc},
249 	{0xb3, 0x22, 0x01, 0xcc},
250 	{0xb3, 0x23, 0xe0, 0xcc},
251 	{0xb3, 0x04, 0x05, 0xcc},
252 	{0xb3, 0x14, 0x00, 0xcc},
253 	{0xb3, 0x15, 0x00, 0xcc},
254 	{0xb3, 0x16, 0x02, 0xcc},
255 	{0xb3, 0x17, 0x7f, 0xcc},
256 	{0xb3, 0x35, 0xdd, 0xcc},
257 	{0xb3, 0x34, 0x02, 0xcc},
258 	{0xb3, 0x00, 0x25, 0xcc},
259 	{0xbc, 0x00, 0xd1, 0xcc},
260 	{0xb8, 0x00, 0x13, 0xcc},
261 	{0xb8, 0x27, 0x20, 0xcc},
262 	{0xb8, 0x2c, 0x50, 0xcc},
263 	{0xb8, 0x2d, 0xf8, 0xcc},
264 	{0xb8, 0x2e, 0xf8, 0xcc},
265 	{0xb8, 0x2f, 0xf8, 0xcc},
266 	{0xb8, 0x30, 0x50, 0xcc},
267 	{0xb8, 0x31, 0xf8, 0xcc},
268 	{0xb8, 0x32, 0xf8, 0xcc},
269 	{0xb8, 0x33, 0xf8, 0xcc},
270 	{0xb8, 0x34, 0x50, 0xcc},
271 	{0xb8, 0x35, 0x00, 0xcc},
272 	{0xb8, 0x36, 0x00, 0xcc},
273 	{0xb8, 0x37, 0x00, 0xcc},
274 	{0xb8, 0x01, 0x79, 0xcc},
275 	{0xb8, 0x08, 0xe0, 0xcc},
276 	{0xb3, 0x01, 0x41, 0xcc},
277 	{0xb8, 0x01, 0x79, 0xcc},
278 	{0xb8, 0x14, 0x18, 0xcc},
279 	{0xb8, 0xb2, 0x0a, 0xcc},
280 	{0xb8, 0xb4, 0x0a, 0xcc},
281 	{0xb8, 0xb5, 0x0a, 0xcc},
282 	{0xb8, 0xfe, 0x00, 0xcc},
283 	{0xb8, 0xff, 0x28, 0xcc},
284 	{0xb9, 0x00, 0x28, 0xcc},
285 	{0xb9, 0x01, 0x28, 0xcc},
286 	{0xb9, 0x02, 0x28, 0xcc},
287 	{0xb9, 0x03, 0x00, 0xcc},
288 	{0xb9, 0x04, 0x00, 0xcc},
289 	{0xb9, 0x05, 0x3c, 0xcc},
290 	{0xb9, 0x06, 0x3c, 0xcc},
291 	{0xb9, 0x07, 0x3c, 0xcc},
292 	{0xb9, 0x08, 0x3c, 0xcc},
293 	{0xb8, 0x8e, 0x00, 0xcc},
294 	{0xb8, 0x8f, 0xff, 0xcc},
295 	{0xb8, 0x81, 0x09, 0xcc},
296 	{0x31, 0x00, 0x00, 0xbb},
297 	{0x09, 0x01, 0xc7, 0xbb},
298 	{0x34, 0x01, 0x00, 0xbb},
299 	{0x2b, 0x00, 0x28, 0xbb},
300 	{0x2c, 0x00, 0x30, 0xbb},
301 	{0x2d, 0x00, 0x30, 0xbb},
302 	{0x2e, 0x00, 0x28, 0xbb},
303 	{0x62, 0x04, 0x11, 0xbb},
304 	{0x03, 0x01, 0xe0, 0xbb},
305 	{0x2c, 0x00, 0x2c, 0xbb},
306 	{0x20, 0xd0, 0x00, 0xbb},
307 	{0x01, 0x00, 0x08, 0xbb},
308 	{0x06, 0x00, 0x10, 0xbb},
309 	{0x05, 0x00, 0x20, 0xbb},
310 	{0x20, 0x00, 0x00, 0xbb},
311 	{0xb6, 0x00, 0x00, 0xcc},
312 	{0xb6, 0x03, 0x01, 0xcc},
313 	{0xb6, 0x02, 0x40, 0xcc},
314 	{0xb6, 0x05, 0x00, 0xcc},
315 	{0xb6, 0x04, 0xf0, 0xcc},
316 	{0xb6, 0x12, 0x78, 0xcc},
317 	{0xb6, 0x18, 0x00, 0xcc},
318 	{0xb6, 0x17, 0x96, 0xcc},
319 	{0xb6, 0x16, 0x00, 0xcc},
320 	{0xb6, 0x22, 0x12, 0xcc},
321 	{0xb6, 0x23, 0x0b, 0xcc},
322 	{0xb3, 0x02, 0x02, 0xcc},
323 	{0xbf, 0xc0, 0x39, 0xcc},
324 	{0xbf, 0xc1, 0x04, 0xcc},
325 	{0xbf, 0xcc, 0x10, 0xcc},
326 	{0xb9, 0x12, 0x00, 0xcc},
327 	{0xb9, 0x13, 0x0a, 0xcc},
328 	{0xb9, 0x14, 0x0a, 0xcc},
329 	{0xb9, 0x15, 0x0a, 0xcc},
330 	{0xb9, 0x16, 0x0a, 0xcc},
331 	{0xb9, 0x18, 0x00, 0xcc},
332 	{0xb9, 0x19, 0x0f, 0xcc},
333 	{0xb9, 0x1a, 0x0f, 0xcc},
334 	{0xb9, 0x1b, 0x0f, 0xcc},
335 	{0xb9, 0x1c, 0x0f, 0xcc},
336 	{0xb8, 0x8e, 0x00, 0xcc},
337 	{0xb8, 0x8f, 0xff, 0xcc},
338 	{0xb6, 0x12, 0xf8, 0xcc},
339 	{0xb6, 0x13, 0x13, 0xcc},
340 	{0xbc, 0x02, 0x18, 0xcc},
341 	{0xbc, 0x03, 0x50, 0xcc},
342 	{0xbc, 0x04, 0x18, 0xcc},
343 	{0xbc, 0x05, 0x00, 0xcc},
344 	{0xbc, 0x06, 0x00, 0xcc},
345 	{0xbc, 0x08, 0x30, 0xcc},
346 	{0xbc, 0x09, 0x40, 0xcc},
347 	{0xbc, 0x0a, 0x10, 0xcc},
348 	{0xb8, 0x0c, 0x20, 0xcc},
349 	{0xb8, 0x0d, 0x70, 0xcc},
350 	{0xbc, 0x0b, 0x00, 0xcc},
351 	{0xbc, 0x0c, 0x00, 0xcc},
352 	{0x35, 0x00, 0xef, 0xbb},
353 	{0xb3, 0x5c, 0x01, 0xcc},
354 	{}
355 };
356 
357 static const u8 mi1310_socinitVGA_JPG[][4] = {
358 	{0xb0, 0x03, 0x19, 0xcc},
359 	{0xb0, 0x04, 0x02, 0xcc},
360 	{0xb3, 0x00, 0x64, 0xcc},
361 	{0xb3, 0x00, 0x65, 0xcc},
362 	{0xb3, 0x05, 0x00, 0xcc},
363 	{0xb3, 0x06, 0x00, 0xcc},
364 	{0xb3, 0x08, 0x01, 0xcc},
365 	{0xb3, 0x09, 0x0c, 0xcc},
366 	{0xb3, 0x34, 0x02, 0xcc},
367 	{0xb3, 0x35, 0xdd, 0xcc},	/* i2c add: 5d */
368 	{0xb3, 0x02, 0x00, 0xcc},
369 	{0xb3, 0x03, 0x0a, 0xcc},
370 	{0xb3, 0x04, 0x05, 0xcc},
371 	{0xb3, 0x20, 0x00, 0xcc},
372 	{0xb3, 0x21, 0x00, 0xcc},
373 	{0xb3, 0x22, 0x03, 0xcc},
374 	{0xb3, 0x23, 0xc0, 0xcc},
375 	{0xb3, 0x14, 0x00, 0xcc},
376 	{0xb3, 0x15, 0x00, 0xcc},
377 	{0xb3, 0x16, 0x04, 0xcc},
378 	{0xb3, 0x17, 0xff, 0xcc},
379 	{0xb3, 0x00, 0x65, 0xcc},
380 	{0xb8, 0x00, 0x00, 0xcc},
381 	{0xbc, 0x00, 0xd0, 0xcc},
382 	{0xbc, 0x01, 0x01, 0xcc},
383 	{0xf0, 0x00, 0x02, 0xbb},
384 	{0xc8, 0x9f, 0x0b, 0xbb},
385 	{0x5b, 0x00, 0x01, 0xbb},
386 	{0x2f, 0xde, 0x20, 0xbb},
387 	{0xf0, 0x00, 0x00, 0xbb},
388 	{0x20, 0x03, 0x02, 0xbb},	/* h/v flip */
389 	{0xf0, 0x00, 0x01, 0xbb},
390 	{0x05, 0x00, 0x07, 0xbb},
391 	{0x34, 0x00, 0x00, 0xbb},
392 	{0x35, 0xff, 0x00, 0xbb},
393 	{0xdc, 0x07, 0x02, 0xbb},
394 	{0xdd, 0x3c, 0x18, 0xbb},
395 	{0xde, 0x92, 0x6d, 0xbb},
396 	{0xdf, 0xcd, 0xb1, 0xbb},
397 	{0xe0, 0xff, 0xe7, 0xbb},
398 	{0x06, 0xf0, 0x0d, 0xbb},
399 	{0x06, 0x70, 0x0e, 0xbb},
400 	{0x4c, 0x00, 0x01, 0xbb},
401 	{0x4d, 0x00, 0x01, 0xbb},
402 	{0xf0, 0x00, 0x02, 0xbb},
403 	{0x2e, 0x0c, 0x55, 0xbb},
404 	{0x21, 0xb6, 0x6e, 0xbb},
405 	{0x36, 0x30, 0x10, 0xbb},
406 	{0x37, 0x00, 0xc1, 0xbb},
407 	{0xf0, 0x00, 0x00, 0xbb},
408 	{0x07, 0x00, 0x84, 0xbb},
409 	{0x08, 0x02, 0x4a, 0xbb},
410 	{0x05, 0x01, 0x10, 0xbb},
411 	{0x06, 0x00, 0x39, 0xbb},
412 	{0xf0, 0x00, 0x02, 0xbb},
413 	{0x58, 0x02, 0x67, 0xbb},
414 	{0x57, 0x02, 0x00, 0xbb},
415 	{0x5a, 0x02, 0x67, 0xbb},
416 	{0x59, 0x02, 0x00, 0xbb},
417 	{0x5c, 0x12, 0x0d, 0xbb},
418 	{0x5d, 0x16, 0x11, 0xbb},
419 	{0x39, 0x06, 0x18, 0xbb},
420 	{0x3a, 0x06, 0x18, 0xbb},
421 	{0x3b, 0x06, 0x18, 0xbb},
422 	{0x3c, 0x06, 0x18, 0xbb},
423 	{0x64, 0x7b, 0x5b, 0xbb},
424 	{0xf0, 0x00, 0x02, 0xbb},
425 	{0x36, 0x30, 0x10, 0xbb},
426 	{0x37, 0x00, 0xc0, 0xbb},
427 	{0xbc, 0x0e, 0x00, 0xcc},
428 	{0xbc, 0x0f, 0x05, 0xcc},
429 	{0xbc, 0x10, 0xc0, 0xcc},
430 	{0xbc, 0x11, 0x03, 0xcc},
431 	{0xb6, 0x00, 0x00, 0xcc},
432 	{0xb6, 0x03, 0x02, 0xcc},
433 	{0xb6, 0x02, 0x80, 0xcc},
434 	{0xb6, 0x05, 0x01, 0xcc},
435 	{0xb6, 0x04, 0xe0, 0xcc},
436 	{0xb6, 0x12, 0xf8, 0xcc},
437 	{0xb6, 0x13, 0x25, 0xcc},
438 	{0xb6, 0x18, 0x02, 0xcc},
439 	{0xb6, 0x17, 0x58, 0xcc},
440 	{0xb6, 0x16, 0x00, 0xcc},
441 	{0xb6, 0x22, 0x12, 0xcc},
442 	{0xb6, 0x23, 0x0b, 0xcc},
443 	{0xbf, 0xc0, 0x39, 0xcc},
444 	{0xbf, 0xc1, 0x04, 0xcc},
445 	{0xbf, 0xcc, 0x00, 0xcc},
446 	{0xbc, 0x02, 0x18, 0xcc},
447 	{0xbc, 0x03, 0x50, 0xcc},
448 	{0xbc, 0x04, 0x18, 0xcc},
449 	{0xbc, 0x05, 0x00, 0xcc},
450 	{0xbc, 0x06, 0x00, 0xcc},
451 	{0xbc, 0x08, 0x30, 0xcc},
452 	{0xbc, 0x09, 0x40, 0xcc},
453 	{0xbc, 0x0a, 0x10, 0xcc},
454 	{0xbc, 0x0b, 0x00, 0xcc},
455 	{0xbc, 0x0c, 0x00, 0xcc},
456 	{0xb3, 0x5c, 0x01, 0xcc},
457 	{0xf0, 0x00, 0x01, 0xbb},
458 	{0x80, 0x00, 0x03, 0xbb},
459 	{0x81, 0xc7, 0x14, 0xbb},
460 	{0x82, 0xeb, 0xe8, 0xbb},
461 	{0x83, 0xfe, 0xf4, 0xbb},
462 	{0x84, 0xcd, 0x10, 0xbb},
463 	{0x85, 0xf3, 0xee, 0xbb},
464 	{0x86, 0xff, 0xf1, 0xbb},
465 	{0x87, 0xcd, 0x10, 0xbb},
466 	{0x88, 0xf3, 0xee, 0xbb},
467 	{0x89, 0x01, 0xf1, 0xbb},
468 	{0x8a, 0xe5, 0x17, 0xbb},
469 	{0x8b, 0xe8, 0xe2, 0xbb},
470 	{0x8c, 0xf7, 0xed, 0xbb},
471 	{0x8d, 0x00, 0xff, 0xbb},
472 	{0x8e, 0xec, 0x10, 0xbb},
473 	{0x8f, 0xf0, 0xed, 0xbb},
474 	{0x90, 0xf9, 0xf2, 0xbb},
475 	{0x91, 0x00, 0x00, 0xbb},
476 	{0x92, 0xe9, 0x0d, 0xbb},
477 	{0x93, 0xf4, 0xf2, 0xbb},
478 	{0x94, 0xfb, 0xf5, 0xbb},
479 	{0x95, 0x00, 0xff, 0xbb},
480 	{0xb6, 0x0f, 0x08, 0xbb},
481 	{0xb7, 0x3d, 0x16, 0xbb},
482 	{0xb8, 0x0c, 0x04, 0xbb},
483 	{0xb9, 0x1c, 0x07, 0xbb},
484 	{0xba, 0x0a, 0x03, 0xbb},
485 	{0xbb, 0x1b, 0x09, 0xbb},
486 	{0xbc, 0x17, 0x0d, 0xbb},
487 	{0xbd, 0x23, 0x1d, 0xbb},
488 	{0xbe, 0x00, 0x28, 0xbb},
489 	{0xbf, 0x11, 0x09, 0xbb},
490 	{0xc0, 0x16, 0x15, 0xbb},
491 	{0xc1, 0x00, 0x1b, 0xbb},
492 	{0xc2, 0x0e, 0x07, 0xbb},
493 	{0xc3, 0x14, 0x10, 0xbb},
494 	{0xc4, 0x00, 0x17, 0xbb},
495 	{0x06, 0x74, 0x8e, 0xbb},
496 	{0xf0, 0x00, 0x01, 0xbb},
497 	{0x06, 0xf4, 0x8e, 0xbb},
498 	{0x00, 0x00, 0x50, 0xdd},
499 	{0x06, 0x74, 0x8e, 0xbb},
500 	{0xf0, 0x00, 0x02, 0xbb},
501 	{0x24, 0x50, 0x20, 0xbb},
502 	{0xf0, 0x00, 0x02, 0xbb},
503 	{0x34, 0x0c, 0x50, 0xbb},
504 	{0xb3, 0x01, 0x41, 0xcc},
505 	{0xf0, 0x00, 0x00, 0xbb},
506 	{0x03, 0x03, 0xc0, 0xbb},
507 	{},
508 };
509 static const u8 mi1310_socinitQVGA_JPG[][4] = {
510 	{0xb0, 0x03, 0x19, 0xcc},	{0xb0, 0x04, 0x02, 0xcc},
511 	{0xb3, 0x00, 0x64, 0xcc},	{0xb3, 0x00, 0x65, 0xcc},
512 	{0xb3, 0x05, 0x00, 0xcc},	{0xb3, 0x06, 0x00, 0xcc},
513 	{0xb3, 0x08, 0x01, 0xcc},	{0xb3, 0x09, 0x0c, 0xcc},
514 	{0xb3, 0x34, 0x02, 0xcc},	{0xb3, 0x35, 0xdd, 0xcc},
515 	{0xb3, 0x02, 0x00, 0xcc},	{0xb3, 0x03, 0x0a, 0xcc},
516 	{0xb3, 0x04, 0x05, 0xcc},	{0xb3, 0x20, 0x00, 0xcc},
517 	{0xb3, 0x21, 0x00, 0xcc},	{0xb3, 0x22, 0x03, 0xcc},
518 	{0xb3, 0x23, 0xc0, 0xcc},	{0xb3, 0x14, 0x00, 0xcc},
519 	{0xb3, 0x15, 0x00, 0xcc},	{0xb3, 0x16, 0x04, 0xcc},
520 	{0xb3, 0x17, 0xff, 0xcc},	{0xb3, 0x00, 0x65, 0xcc},
521 	{0xb8, 0x00, 0x00, 0xcc},	{0xbc, 0x00, 0xf0, 0xcc},
522 	{0xbc, 0x01, 0x01, 0xcc},	{0xf0, 0x00, 0x02, 0xbb},
523 	{0xc8, 0x9f, 0x0b, 0xbb},	{0x5b, 0x00, 0x01, 0xbb},
524 	{0x2f, 0xde, 0x20, 0xbb},	{0xf0, 0x00, 0x00, 0xbb},
525 	{0x20, 0x03, 0x02, 0xbb},	/* h/v flip */
526 	{0xf0, 0x00, 0x01, 0xbb},
527 	{0x05, 0x00, 0x07, 0xbb},	{0x34, 0x00, 0x00, 0xbb},
528 	{0x35, 0xff, 0x00, 0xbb},	{0xdc, 0x07, 0x02, 0xbb},
529 	{0xdd, 0x3c, 0x18, 0xbb},	{0xde, 0x92, 0x6d, 0xbb},
530 	{0xdf, 0xcd, 0xb1, 0xbb},	{0xe0, 0xff, 0xe7, 0xbb},
531 	{0x06, 0xf0, 0x0d, 0xbb},	{0x06, 0x70, 0x0e, 0xbb},
532 	{0x4c, 0x00, 0x01, 0xbb},	{0x4d, 0x00, 0x01, 0xbb},
533 	{0xf0, 0x00, 0x02, 0xbb},	{0x2e, 0x0c, 0x55, 0xbb},
534 	{0x21, 0xb6, 0x6e, 0xbb},	{0x36, 0x30, 0x10, 0xbb},
535 	{0x37, 0x00, 0xc1, 0xbb},	{0xf0, 0x00, 0x00, 0xbb},
536 	{0x07, 0x00, 0x84, 0xbb},	{0x08, 0x02, 0x4a, 0xbb},
537 	{0x05, 0x01, 0x10, 0xbb},	{0x06, 0x00, 0x39, 0xbb},
538 	{0xf0, 0x00, 0x02, 0xbb},	{0x58, 0x02, 0x67, 0xbb},
539 	{0x57, 0x02, 0x00, 0xbb},	{0x5a, 0x02, 0x67, 0xbb},
540 	{0x59, 0x02, 0x00, 0xbb},	{0x5c, 0x12, 0x0d, 0xbb},
541 	{0x5d, 0x16, 0x11, 0xbb},	{0x39, 0x06, 0x18, 0xbb},
542 	{0x3a, 0x06, 0x18, 0xbb},	{0x3b, 0x06, 0x18, 0xbb},
543 	{0x3c, 0x06, 0x18, 0xbb},	{0x64, 0x7b, 0x5b, 0xbb},
544 	{0xf0, 0x00, 0x02, 0xbb},	{0x36, 0x30, 0x10, 0xbb},
545 	{0x37, 0x00, 0xc0, 0xbb},	{0xbc, 0x0e, 0x00, 0xcc},
546 	{0xbc, 0x0f, 0x05, 0xcc},	{0xbc, 0x10, 0xc0, 0xcc},
547 	{0xbc, 0x11, 0x03, 0xcc},	{0xb6, 0x00, 0x00, 0xcc},
548 	{0xb6, 0x03, 0x01, 0xcc},	{0xb6, 0x02, 0x40, 0xcc},
549 	{0xb6, 0x05, 0x00, 0xcc},	{0xb6, 0x04, 0xf0, 0xcc},
550 	{0xb6, 0x12, 0xf8, 0xcc},	{0xb6, 0x13, 0x25, 0xcc},
551 	{0xb6, 0x18, 0x00, 0xcc},	{0xb6, 0x17, 0x96, 0xcc},
552 	{0xb6, 0x16, 0x00, 0xcc},	{0xb6, 0x22, 0x12, 0xcc},
553 	{0xb6, 0x23, 0x0b, 0xcc},	{0xbf, 0xc0, 0x39, 0xcc},
554 	{0xbf, 0xc1, 0x04, 0xcc},	{0xbf, 0xcc, 0x00, 0xcc},
555 	{0xb3, 0x5c, 0x01, 0xcc},	{0xf0, 0x00, 0x01, 0xbb},
556 	{0x80, 0x00, 0x03, 0xbb},	{0x81, 0xc7, 0x14, 0xbb},
557 	{0x82, 0xeb, 0xe8, 0xbb},	{0x83, 0xfe, 0xf4, 0xbb},
558 	{0x84, 0xcd, 0x10, 0xbb},	{0x85, 0xf3, 0xee, 0xbb},
559 	{0x86, 0xff, 0xf1, 0xbb},	{0x87, 0xcd, 0x10, 0xbb},
560 	{0x88, 0xf3, 0xee, 0xbb},	{0x89, 0x01, 0xf1, 0xbb},
561 	{0x8a, 0xe5, 0x17, 0xbb},	{0x8b, 0xe8, 0xe2, 0xbb},
562 	{0x8c, 0xf7, 0xed, 0xbb},	{0x8d, 0x00, 0xff, 0xbb},
563 	{0x8e, 0xec, 0x10, 0xbb},	{0x8f, 0xf0, 0xed, 0xbb},
564 	{0x90, 0xf9, 0xf2, 0xbb},	{0x91, 0x00, 0x00, 0xbb},
565 	{0x92, 0xe9, 0x0d, 0xbb},	{0x93, 0xf4, 0xf2, 0xbb},
566 	{0x94, 0xfb, 0xf5, 0xbb},	{0x95, 0x00, 0xff, 0xbb},
567 	{0xb6, 0x0f, 0x08, 0xbb},	{0xb7, 0x3d, 0x16, 0xbb},
568 	{0xb8, 0x0c, 0x04, 0xbb},	{0xb9, 0x1c, 0x07, 0xbb},
569 	{0xba, 0x0a, 0x03, 0xbb},	{0xbb, 0x1b, 0x09, 0xbb},
570 	{0xbc, 0x17, 0x0d, 0xbb},	{0xbd, 0x23, 0x1d, 0xbb},
571 	{0xbe, 0x00, 0x28, 0xbb},	{0xbf, 0x11, 0x09, 0xbb},
572 	{0xc0, 0x16, 0x15, 0xbb},	{0xc1, 0x00, 0x1b, 0xbb},
573 	{0xc2, 0x0e, 0x07, 0xbb},	{0xc3, 0x14, 0x10, 0xbb},
574 	{0xc4, 0x00, 0x17, 0xbb},	{0x06, 0x74, 0x8e, 0xbb},
575 	{0xf0, 0x00, 0x01, 0xbb},	{0x06, 0xf4, 0x8e, 0xbb},
576 	{0x00, 0x00, 0x50, 0xdd},	{0x06, 0x74, 0x8e, 0xbb},
577 	{0xf0, 0x00, 0x02, 0xbb},	{0x24, 0x50, 0x20, 0xbb},
578 	{0xf0, 0x00, 0x02, 0xbb},	{0x34, 0x0c, 0x50, 0xbb},
579 	{0xb3, 0x01, 0x41, 0xcc},	{0xf0, 0x00, 0x00, 0xbb},
580 	{0x03, 0x03, 0xc0, 0xbb},
581 	{},
582 };
583 static const u8 mi1310_soc_InitSXGA_JPG[][4] = {
584 	{0xb0, 0x03, 0x19, 0xcc},
585 	{0xb0, 0x04, 0x02, 0xcc},
586 	{0xb3, 0x00, 0x64, 0xcc},
587 	{0xb3, 0x00, 0x65, 0xcc},
588 	{0xb3, 0x05, 0x00, 0xcc},
589 	{0xb3, 0x06, 0x00, 0xcc},
590 	{0xb3, 0x08, 0x01, 0xcc},
591 	{0xb3, 0x09, 0x0c, 0xcc},
592 	{0xb3, 0x34, 0x02, 0xcc},
593 	{0xb3, 0x35, 0xdd, 0xcc},
594 	{0xb3, 0x02, 0x00, 0xcc},
595 	{0xb3, 0x03, 0x0a, 0xcc},
596 	{0xb3, 0x04, 0x0d, 0xcc},
597 	{0xb3, 0x20, 0x00, 0xcc},
598 	{0xb3, 0x21, 0x00, 0xcc},
599 	{0xb3, 0x22, 0x03, 0xcc},
600 	{0xb3, 0x23, 0xc0, 0xcc},
601 	{0xb3, 0x14, 0x00, 0xcc},
602 	{0xb3, 0x15, 0x00, 0xcc},
603 	{0xb3, 0x16, 0x04, 0xcc},
604 	{0xb3, 0x17, 0xff, 0xcc},
605 	{0xb3, 0x00, 0x65, 0xcc},
606 	{0xb8, 0x00, 0x00, 0xcc},
607 	{0xbc, 0x00, 0x70, 0xcc},
608 	{0xbc, 0x01, 0x01, 0xcc},
609 	{0xf0, 0x00, 0x02, 0xbb},
610 	{0xc8, 0x9f, 0x0b, 0xbb},
611 	{0x5b, 0x00, 0x01, 0xbb},
612 	{0xf0, 0x00, 0x00, 0xbb},
613 	{0x20, 0x03, 0x02, 0xbb},	/* h/v flip */
614 	{0xf0, 0x00, 0x01, 0xbb},
615 	{0x05, 0x00, 0x07, 0xbb},
616 	{0x34, 0x00, 0x00, 0xbb},
617 	{0x35, 0xff, 0x00, 0xbb},
618 	{0xdc, 0x07, 0x02, 0xbb},
619 	{0xdd, 0x3c, 0x18, 0xbb},
620 	{0xde, 0x92, 0x6d, 0xbb},
621 	{0xdf, 0xcd, 0xb1, 0xbb},
622 	{0xe0, 0xff, 0xe7, 0xbb},
623 	{0x06, 0xf0, 0x0d, 0xbb},
624 	{0x06, 0x70, 0x0e, 0xbb},
625 	{0x4c, 0x00, 0x01, 0xbb},
626 	{0x4d, 0x00, 0x01, 0xbb},
627 	{0xf0, 0x00, 0x02, 0xbb},
628 	{0x2e, 0x0c, 0x60, 0xbb},
629 	{0x21, 0xb6, 0x6e, 0xbb},
630 	{0x37, 0x01, 0x40, 0xbb},
631 	{0xf0, 0x00, 0x00, 0xbb},
632 	{0x07, 0x00, 0x84, 0xbb},
633 	{0x08, 0x02, 0x4a, 0xbb},
634 	{0x05, 0x01, 0x10, 0xbb},
635 	{0x06, 0x00, 0x39, 0xbb},
636 	{0xf0, 0x00, 0x02, 0xbb},
637 	{0x58, 0x02, 0x67, 0xbb},
638 	{0x57, 0x02, 0x00, 0xbb},
639 	{0x5a, 0x02, 0x67, 0xbb},
640 	{0x59, 0x02, 0x00, 0xbb},
641 	{0x5c, 0x12, 0x0d, 0xbb},
642 	{0x5d, 0x16, 0x11, 0xbb},
643 	{0x39, 0x06, 0x18, 0xbb},
644 	{0x3a, 0x06, 0x18, 0xbb},
645 	{0x3b, 0x06, 0x18, 0xbb},
646 	{0x3c, 0x06, 0x18, 0xbb},
647 	{0x64, 0x7b, 0x5b, 0xbb},
648 	{0xb6, 0x00, 0x00, 0xcc},
649 	{0xb6, 0x03, 0x05, 0xcc},
650 	{0xb6, 0x02, 0x00, 0xcc},
651 	{0xb6, 0x05, 0x03, 0xcc},
652 	{0xb6, 0x04, 0xc0, 0xcc},
653 	{0xb6, 0x12, 0xf8, 0xcc},
654 	{0xb6, 0x13, 0x29, 0xcc},
655 	{0xb6, 0x18, 0x09, 0xcc},
656 	{0xb6, 0x17, 0x60, 0xcc},
657 	{0xb6, 0x16, 0x00, 0xcc},
658 	{0xb6, 0x22, 0x12, 0xcc},
659 	{0xb6, 0x23, 0x0b, 0xcc},
660 	{0xbf, 0xc0, 0x39, 0xcc},
661 	{0xbf, 0xc1, 0x04, 0xcc},
662 	{0xbf, 0xcc, 0x00, 0xcc},
663 	{0xb3, 0x01, 0x41, 0xcc},
664 	{0x00, 0x00, 0x80, 0xdd},
665 	{0xf0, 0x00, 0x02, 0xbb},
666 	{0x00, 0x00, 0x10, 0xdd},
667 	{0x22, 0xa0, 0x78, 0xbb},
668 	{0x23, 0xa0, 0x78, 0xbb},
669 	{0x24, 0x7f, 0x00, 0xbb},
670 	{0x28, 0xea, 0x02, 0xbb},
671 	{0x29, 0x86, 0x7a, 0xbb},
672 	{0x5e, 0x52, 0x4c, 0xbb},
673 	{0x5f, 0x20, 0x24, 0xbb},
674 	{0x60, 0x00, 0x02, 0xbb},
675 	{0x02, 0x00, 0xee, 0xbb},
676 	{0x03, 0x39, 0x23, 0xbb},
677 	{0x04, 0x07, 0x24, 0xbb},
678 	{0x09, 0x00, 0xc0, 0xbb},
679 	{0x0a, 0x00, 0x79, 0xbb},
680 	{0x0b, 0x00, 0x04, 0xbb},
681 	{0x0c, 0x00, 0x5c, 0xbb},
682 	{0x0d, 0x00, 0xd9, 0xbb},
683 	{0x0e, 0x00, 0x53, 0xbb},
684 	{0x0f, 0x00, 0x21, 0xbb},
685 	{0x10, 0x00, 0xa4, 0xbb},
686 	{0x11, 0x00, 0xe5, 0xbb},
687 	{0x15, 0x00, 0x00, 0xbb},
688 	{0x16, 0x00, 0x00, 0xbb},
689 	{0x17, 0x00, 0x00, 0xbb},
690 	{0x18, 0x00, 0x00, 0xbb},
691 	{0x19, 0x00, 0x00, 0xbb},
692 	{0x1a, 0x00, 0x00, 0xbb},
693 	{0x1b, 0x00, 0x00, 0xbb},
694 	{0x1c, 0x00, 0x00, 0xbb},
695 	{0x1d, 0x00, 0x00, 0xbb},
696 	{0x1e, 0x00, 0x00, 0xbb},
697 	{0xf0, 0x00, 0x01, 0xbb},
698 	{0x00, 0x00, 0x20, 0xdd},
699 	{0x06, 0xf0, 0x8e, 0xbb},
700 	{0x00, 0x00, 0x80, 0xdd},
701 	{0x06, 0x70, 0x8e, 0xbb},
702 	{0xf0, 0x00, 0x02, 0xbb},
703 	{0x00, 0x00, 0x20, 0xdd},
704 	{0x5e, 0x6a, 0x53, 0xbb},
705 	{0x5f, 0x40, 0x2c, 0xbb},
706 	{0xf0, 0x00, 0x01, 0xbb},
707 	{0x00, 0x00, 0x20, 0xdd},
708 	{0x58, 0x00, 0x00, 0xbb},
709 	{0x53, 0x09, 0x03, 0xbb},
710 	{0x54, 0x31, 0x18, 0xbb},
711 	{0x55, 0x8b, 0x5f, 0xbb},
712 	{0x56, 0xc0, 0xa9, 0xbb},
713 	{0x57, 0xe0, 0xd2, 0xbb},
714 	{0xe1, 0x00, 0x00, 0xbb},
715 	{0xdc, 0x09, 0x03, 0xbb},
716 	{0xdd, 0x31, 0x18, 0xbb},
717 	{0xde, 0x8b, 0x5f, 0xbb},
718 	{0xdf, 0xc0, 0xa9, 0xbb},
719 	{0xe0, 0xe0, 0xd2, 0xbb},
720 	{0xb3, 0x5c, 0x01, 0xcc},
721 	{0xf0, 0x00, 0x01, 0xbb},
722 	{0x06, 0xf0, 0x8e, 0xbb},
723 	{0xf0, 0x00, 0x02, 0xbb},
724 	{0x2f, 0xde, 0x20, 0xbb},
725 	{0xf0, 0x00, 0x02, 0xbb},
726 	{0x24, 0x50, 0x20, 0xbb},
727 	{0xbc, 0x0e, 0x00, 0xcc},
728 	{0xbc, 0x0f, 0x05, 0xcc},
729 	{0xbc, 0x10, 0xc0, 0xcc},
730 	{0xf0, 0x00, 0x02, 0xbb},
731 	{0x34, 0x0c, 0x50, 0xbb},
732 	{0xbc, 0x11, 0x03, 0xcc},
733 	{0xf0, 0x00, 0x01, 0xbb},
734 	{0x80, 0x00, 0x03, 0xbb},
735 	{0x81, 0xc7, 0x14, 0xbb},
736 	{0x82, 0xeb, 0xe8, 0xbb},
737 	{0x83, 0xfe, 0xf4, 0xbb},
738 	{0x84, 0xcd, 0x10, 0xbb},
739 	{0x85, 0xf3, 0xee, 0xbb},
740 	{0x86, 0xff, 0xf1, 0xbb},
741 	{0x87, 0xcd, 0x10, 0xbb},
742 	{0x88, 0xf3, 0xee, 0xbb},
743 	{0x89, 0x01, 0xf1, 0xbb},
744 	{0x8a, 0xe5, 0x17, 0xbb},
745 	{0x8b, 0xe8, 0xe2, 0xbb},
746 	{0x8c, 0xf7, 0xed, 0xbb},
747 	{0x8d, 0x00, 0xff, 0xbb},
748 	{0x8e, 0xec, 0x10, 0xbb},
749 	{0x8f, 0xf0, 0xed, 0xbb},
750 	{0x90, 0xf9, 0xf2, 0xbb},
751 	{0x91, 0x00, 0x00, 0xbb},
752 	{0x92, 0xe9, 0x0d, 0xbb},
753 	{0x93, 0xf4, 0xf2, 0xbb},
754 	{0x94, 0xfb, 0xf5, 0xbb},
755 	{0x95, 0x00, 0xff, 0xbb},
756 	{0xb6, 0x0f, 0x08, 0xbb},
757 	{0xb7, 0x3d, 0x16, 0xbb},
758 	{0xb8, 0x0c, 0x04, 0xbb},
759 	{0xb9, 0x1c, 0x07, 0xbb},
760 	{0xba, 0x0a, 0x03, 0xbb},
761 	{0xbb, 0x1b, 0x09, 0xbb},
762 	{0xbc, 0x17, 0x0d, 0xbb},
763 	{0xbd, 0x23, 0x1d, 0xbb},
764 	{0xbe, 0x00, 0x28, 0xbb},
765 	{0xbf, 0x11, 0x09, 0xbb},
766 	{0xc0, 0x16, 0x15, 0xbb},
767 	{0xc1, 0x00, 0x1b, 0xbb},
768 	{0xc2, 0x0e, 0x07, 0xbb},
769 	{0xc3, 0x14, 0x10, 0xbb},
770 	{0xc4, 0x00, 0x17, 0xbb},
771 	{0x06, 0x74, 0x8e, 0xbb},
772 	{0xf0, 0x00, 0x00, 0xbb},
773 	{0x03, 0x03, 0xc0, 0xbb},
774 	{}
775 };
776 
777 static const u8 mi1320_gamma[17] = {
778 	0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
779 	0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
780 };
781 static const u8 mi1320_matrix[9] = {
782 	0x54, 0xda, 0x06, 0xf1, 0x50, 0xf4, 0xf7, 0xea, 0x52
783 };
784 static const u8 mi1320_initVGA_data[][4] = {
785 	{0xb3, 0x01, 0x01, 0xcc},	{0x00, 0x00, 0x33, 0xdd},
786 	{0xb0, 0x03, 0x19, 0xcc},	{0x00, 0x00, 0x33, 0xdd},
787 	{0xb0, 0x04, 0x02, 0xcc},	{0x00, 0x00, 0x33, 0xdd},
788 	{0xb3, 0x00, 0x64, 0xcc},	{0xb3, 0x00, 0x65, 0xcc},
789 	{0xb0, 0x16, 0x03, 0xcc},	{0xb3, 0x05, 0x00, 0xcc},
790 	{0xb3, 0x06, 0x00, 0xcc},	{0xb3, 0x08, 0x01, 0xcc},
791 	{0xb3, 0x09, 0x0c, 0xcc},	{0xb3, 0x34, 0x02, 0xcc},
792 	{0xb3, 0x35, 0xc8, 0xcc},	/* i2c add: 48 */
793 	{0xb3, 0x02, 0x00, 0xcc},
794 	{0xb3, 0x03, 0x0a, 0xcc},	{0xb3, 0x04, 0x05, 0xcc},
795 	{0xb3, 0x20, 0x00, 0xcc},	{0xb3, 0x21, 0x00, 0xcc},
796 	{0xb3, 0x22, 0x03, 0xcc},	{0xb3, 0x23, 0xc0, 0xcc},
797 	{0xb3, 0x14, 0x00, 0xcc},	{0xb3, 0x15, 0x00, 0xcc},
798 	{0xb3, 0x16, 0x04, 0xcc},	{0xb3, 0x17, 0xff, 0xcc},
799 	{0xb3, 0x00, 0x67, 0xcc},	{0xbc, 0x00, 0xd0, 0xcc},
800 	{0xbc, 0x01, 0x01, 0xcc},	{0xf0, 0x00, 0x00, 0xbb},
801 	{0x0d, 0x00, 0x09, 0xbb},	{0x00, 0x01, 0x00, 0xdd},
802 	{0x0d, 0x00, 0x08, 0xbb},	{0xf0, 0x00, 0x01, 0xbb},
803 	{0xa1, 0x05, 0x00, 0xbb},	{0xa4, 0x03, 0xc0, 0xbb},
804 	{0xf0, 0x00, 0x02, 0xbb},	{0x00, 0x00, 0x10, 0xdd},
805 	{0xc8, 0x9f, 0x0b, 0xbb},	{0x00, 0x00, 0x10, 0xdd},
806 	{0xf0, 0x00, 0x00, 0xbb},	{0x00, 0x00, 0x10, 0xdd},
807 	{0x20, 0x01, 0x00, 0xbb},	{0x00, 0x00, 0x10, 0xdd},
808 	{0xf0, 0x00, 0x01, 0xbb},	{0x9d, 0x3c, 0xa0, 0xbb},
809 	{0x47, 0x30, 0x30, 0xbb},	{0xf0, 0x00, 0x00, 0xbb},
810 	{0x0a, 0x80, 0x11, 0xbb},	{0x35, 0x00, 0x22, 0xbb},
811 	{0xf0, 0x00, 0x02, 0xbb},	{0x9d, 0xc5, 0x05, 0xbb},
812 	{0xdc, 0x0f, 0xfc, 0xbb},	{0xf0, 0x00, 0x01, 0xbb},
813 	{0x06, 0x74, 0x0e, 0xbb},	{0x80, 0x00, 0x06, 0xbb},
814 	{0x81, 0x04, 0x00, 0xbb},	{0x82, 0x01, 0x02, 0xbb},
815 	{0x83, 0x03, 0x02, 0xbb},	{0x84, 0x05, 0x00, 0xbb},
816 	{0x85, 0x01, 0x00, 0xbb},	{0x86, 0x03, 0x02, 0xbb},
817 	{0x87, 0x05, 0x00, 0xbb},	{0x88, 0x01, 0x00, 0xbb},
818 	{0x89, 0x02, 0x02, 0xbb},	{0x8a, 0xfd, 0x04, 0xbb},
819 	{0x8b, 0xfc, 0xfd, 0xbb},	{0x8c, 0xff, 0xfd, 0xbb},
820 	{0x8d, 0x00, 0x00, 0xbb},	{0x8e, 0xfe, 0x05, 0xbb},
821 	{0x8f, 0xfc, 0xfd, 0xbb},	{0x90, 0xfe, 0xfd, 0xbb},
822 	{0x91, 0x00, 0x00, 0xbb},	{0x92, 0xfe, 0x03, 0xbb},
823 	{0x93, 0xfd, 0xfe, 0xbb},	{0x94, 0xff, 0xfd, 0xbb},
824 	{0x95, 0x00, 0x00, 0xbb},	{0xb6, 0x07, 0x05, 0xbb},
825 	{0xb7, 0x13, 0x06, 0xbb},	{0xb8, 0x08, 0x06, 0xbb},
826 	{0xb9, 0x14, 0x08, 0xbb},	{0xba, 0x06, 0x05, 0xbb},
827 	{0xbb, 0x13, 0x06, 0xbb},	{0xbc, 0x03, 0x01, 0xbb},
828 	{0xbd, 0x03, 0x04, 0xbb},	{0xbe, 0x00, 0x02, 0xbb},
829 	{0xbf, 0x03, 0x01, 0xbb},	{0xc0, 0x02, 0x04, 0xbb},
830 	{0xc1, 0x00, 0x04, 0xbb},	{0xc2, 0x02, 0x01, 0xbb},
831 	{0xc3, 0x01, 0x03, 0xbb},	{0xc4, 0x00, 0x04, 0xbb},
832 	{0xf0, 0x00, 0x00, 0xbb},	{0x05, 0x01, 0x13, 0xbb},
833 	{0x06, 0x00, 0x11, 0xbb},	{0x07, 0x00, 0x85, 0xbb},
834 	{0x08, 0x00, 0x27, 0xbb},
835 	{0x20, 0x01, 0x00, 0xbb},	/* h/v flips - was 03 */
836 	{0x21, 0x80, 0x00, 0xbb},	{0x22, 0x0d, 0x0f, 0xbb},
837 	{0x24, 0x80, 0x00, 0xbb},	{0x59, 0x00, 0xff, 0xbb},
838 	{0xf0, 0x00, 0x02, 0xbb},	{0x39, 0x03, 0x0d, 0xbb},
839 	{0x3a, 0x06, 0x1b, 0xbb},	{0x3b, 0x00, 0x95, 0xbb},
840 	{0x3c, 0x04, 0xdb, 0xbb},	{0x57, 0x02, 0x00, 0xbb},
841 	{0x58, 0x02, 0x66, 0xbb},	{0x59, 0x00, 0xff, 0xbb},
842 	{0x5a, 0x01, 0x33, 0xbb},	{0x5c, 0x12, 0x0d, 0xbb},
843 	{0x5d, 0x16, 0x11, 0xbb},	{0x64, 0x5e, 0x1c, 0xbb},
844 	{0xf0, 0x00, 0x02, 0xbb},	{0x2f, 0xd1, 0x00, 0xbb},
845 	{0x5b, 0x00, 0x01, 0xbb},	{0xf0, 0x00, 0x02, 0xbb},
846 	{0x36, 0x68, 0x10, 0xbb},	{0x00, 0x00, 0x30, 0xdd},
847 	{0x37, 0x82, 0x00, 0xbb},	{0xbc, 0x0e, 0x00, 0xcc},
848 	{0xbc, 0x0f, 0x05, 0xcc},	{0xbc, 0x10, 0xc0, 0xcc},
849 	{0xbc, 0x11, 0x03, 0xcc},	{0xb6, 0x00, 0x00, 0xcc},
850 	{0xb6, 0x03, 0x05, 0xcc},	{0xb6, 0x02, 0x00, 0xcc},
851 	{0xb6, 0x05, 0x04, 0xcc},	{0xb6, 0x04, 0x00, 0xcc},
852 	{0xb6, 0x12, 0xf8, 0xcc},	{0xb6, 0x13, 0x29, 0xcc},
853 	{0xb6, 0x18, 0x0a, 0xcc},	{0xb6, 0x17, 0x00, 0xcc},
854 	{0xb6, 0x16, 0x00, 0xcc},	{0xb6, 0x22, 0x12, 0xcc},
855 	{0xb6, 0x23, 0x0b, 0xcc},	{0xbf, 0xc0, 0x26, 0xcc},
856 	{0xbf, 0xc1, 0x02, 0xcc},	{0xbf, 0xcc, 0x04, 0xcc},
857 	{0xbc, 0x02, 0x18, 0xcc},	{0xbc, 0x03, 0x50, 0xcc},
858 	{0xbc, 0x04, 0x18, 0xcc},	{0xbc, 0x05, 0x00, 0xcc},
859 	{0xbc, 0x06, 0x00, 0xcc},	{0xbc, 0x08, 0x30, 0xcc},
860 	{0xbc, 0x09, 0x40, 0xcc},	{0xbc, 0x0a, 0x10, 0xcc},
861 	{0xbc, 0x0b, 0x00, 0xcc},	{0xbc, 0x0c, 0x00, 0xcc},
862 	{0xb3, 0x5c, 0x01, 0xcc},	{0xb3, 0x01, 0x41, 0xcc},
863 	{}
864 };
865 static const u8 mi1320_initQVGA_data[][4] = {
866 	{0xb3, 0x01, 0x01, 0xcc},	{0x00, 0x00, 0x33, 0xdd},
867 	{0xb0, 0x03, 0x19, 0xcc},	{0x00, 0x00, 0x33, 0xdd},
868 	{0xb0, 0x04, 0x02, 0xcc},	{0x00, 0x00, 0x33, 0xdd},
869 	{0xb3, 0x00, 0x64, 0xcc},	{0xb3, 0x00, 0x65, 0xcc},
870 	{0xb0, 0x16, 0x03, 0xcc},	{0xb3, 0x05, 0x01, 0xcc},
871 	{0xb3, 0x06, 0x01, 0xcc},	{0xb3, 0x08, 0x01, 0xcc},
872 	{0xb3, 0x09, 0x0c, 0xcc},	{0xb3, 0x34, 0x02, 0xcc},
873 	{0xb3, 0x35, 0xc8, 0xcc},	{0xb3, 0x02, 0x00, 0xcc},
874 	{0xb3, 0x03, 0x0a, 0xcc},	{0xb3, 0x04, 0x05, 0xcc},
875 	{0xb3, 0x20, 0x00, 0xcc},	{0xb3, 0x21, 0x00, 0xcc},
876 	{0xb3, 0x22, 0x01, 0xcc},	{0xb3, 0x23, 0xe0, 0xcc},
877 	{0xb3, 0x14, 0x00, 0xcc},	{0xb3, 0x15, 0x00, 0xcc},
878 	{0xb3, 0x16, 0x02, 0xcc},	{0xb3, 0x17, 0x7f, 0xcc},
879 	{0xb3, 0x00, 0x65, 0xcc},	{0xb8, 0x00, 0x00, 0xcc},
880 	{0xbc, 0x00, 0xd0, 0xcc},	{0xbc, 0x01, 0x01, 0xcc},
881 	{0xf0, 0x00, 0x00, 0xbb},	{0x0d, 0x00, 0x09, 0xbb},
882 	{0x00, 0x01, 0x00, 0xdd},	{0x0d, 0x00, 0x08, 0xbb},
883 	{0xf0, 0x00, 0x00, 0xbb},	{0x02, 0x00, 0x64, 0xbb},
884 	{0x05, 0x01, 0x78, 0xbb},	{0x06, 0x00, 0x11, 0xbb},
885 	{0x07, 0x01, 0x42, 0xbb},	{0x08, 0x00, 0x11, 0xbb},
886 	{0x20, 0x01, 0x00, 0xbb},	{0x21, 0x80, 0x00, 0xbb},
887 	{0x22, 0x0d, 0x0f, 0xbb},	{0x24, 0x80, 0x00, 0xbb},
888 	{0x59, 0x00, 0xff, 0xbb},	{0xf0, 0x00, 0x01, 0xbb},
889 	{0x9d, 0x3c, 0xa0, 0xbb},	{0x47, 0x30, 0x30, 0xbb},
890 	{0xf0, 0x00, 0x00, 0xbb},	{0x0a, 0x80, 0x11, 0xbb},
891 	{0x35, 0x00, 0x22, 0xbb},	{0xf0, 0x00, 0x02, 0xbb},
892 	{0x9d, 0xc5, 0x05, 0xbb},	{0xdc, 0x0f, 0xfc, 0xbb},
893 	{0xf0, 0x00, 0x01, 0xbb},	{0x06, 0x74, 0x0e, 0xbb},
894 	{0x80, 0x00, 0x06, 0xbb},	{0x81, 0x04, 0x00, 0xbb},
895 	{0x82, 0x01, 0x02, 0xbb},	{0x83, 0x03, 0x02, 0xbb},
896 	{0x84, 0x05, 0x00, 0xbb},	{0x85, 0x01, 0x00, 0xbb},
897 	{0x86, 0x03, 0x02, 0xbb},	{0x87, 0x05, 0x00, 0xbb},
898 	{0x88, 0x01, 0x00, 0xbb},	{0x89, 0x02, 0x02, 0xbb},
899 	{0x8a, 0xfd, 0x04, 0xbb},	{0x8b, 0xfc, 0xfd, 0xbb},
900 	{0x8c, 0xff, 0xfd, 0xbb},	{0x8d, 0x00, 0x00, 0xbb},
901 	{0x8e, 0xfe, 0x05, 0xbb},	{0x8f, 0xfc, 0xfd, 0xbb},
902 	{0x90, 0xfe, 0xfd, 0xbb},	{0x91, 0x00, 0x00, 0xbb},
903 	{0x92, 0xfe, 0x03, 0xbb},	{0x93, 0xfd, 0xfe, 0xbb},
904 	{0x94, 0xff, 0xfd, 0xbb},	{0x95, 0x00, 0x00, 0xbb},
905 	{0xb6, 0x07, 0x05, 0xbb},	{0xb7, 0x13, 0x06, 0xbb},
906 	{0xb8, 0x08, 0x06, 0xbb},	{0xb9, 0x14, 0x08, 0xbb},
907 	{0xba, 0x06, 0x05, 0xbb},	{0xbb, 0x13, 0x06, 0xbb},
908 	{0xbc, 0x03, 0x01, 0xbb},	{0xbd, 0x03, 0x04, 0xbb},
909 	{0xbe, 0x00, 0x02, 0xbb},	{0xbf, 0x03, 0x01, 0xbb},
910 	{0xc0, 0x02, 0x04, 0xbb},	{0xc1, 0x00, 0x04, 0xbb},
911 	{0xc2, 0x02, 0x01, 0xbb},	{0xc3, 0x01, 0x03, 0xbb},
912 	{0xc4, 0x00, 0x04, 0xbb},	{0xf0, 0x00, 0x02, 0xbb},
913 	{0xc8, 0x00, 0x00, 0xbb},	{0x2e, 0x00, 0x00, 0xbb},
914 	{0x2e, 0x0c, 0x5b, 0xbb},	{0x2f, 0xd1, 0x00, 0xbb},
915 	{0x39, 0x03, 0xca, 0xbb},	{0x3a, 0x06, 0x80, 0xbb},
916 	{0x3b, 0x01, 0x52, 0xbb},	{0x3c, 0x05, 0x40, 0xbb},
917 	{0x57, 0x01, 0x9c, 0xbb},	{0x58, 0x01, 0xee, 0xbb},
918 	{0x59, 0x00, 0xf0, 0xbb},	{0x5a, 0x01, 0x20, 0xbb},
919 	{0x5c, 0x1d, 0x17, 0xbb},	{0x5d, 0x22, 0x1c, 0xbb},
920 	{0x64, 0x1e, 0x1c, 0xbb},	{0x5b, 0x00, 0x01, 0xbb},
921 	{0xf0, 0x00, 0x02, 0xbb},	{0x36, 0x68, 0x10, 0xbb},
922 	{0x00, 0x00, 0x30, 0xdd},	{0x37, 0x81, 0x00, 0xbb},
923 	{0xbc, 0x02, 0x18, 0xcc},	{0xbc, 0x03, 0x50, 0xcc},
924 	{0xbc, 0x04, 0x18, 0xcc},	{0xbc, 0x05, 0x00, 0xcc},
925 	{0xbc, 0x06, 0x00, 0xcc},	{0xbc, 0x08, 0x30, 0xcc},
926 	{0xbc, 0x09, 0x40, 0xcc},	{0xbc, 0x0a, 0x10, 0xcc},
927 	{0xbc, 0x0b, 0x00, 0xcc},	{0xbc, 0x0c, 0x00, 0xcc},
928 	{0xbf, 0xc0, 0x26, 0xcc},	{0xbf, 0xc1, 0x02, 0xcc},
929 	{0xbf, 0xcc, 0x04, 0xcc},	{0xb3, 0x5c, 0x01, 0xcc},
930 	{0xb3, 0x01, 0x41, 0xcc},
931 	{}
932 };
933 
934 static const u8 mi1320_soc_InitVGA[][4] = {
935 	{0xb3, 0x01, 0x01, 0xcc},
936 	{0xb0, 0x03, 0x19, 0xcc},
937 	{0xb0, 0x04, 0x02, 0xcc},
938 	{0x00, 0x00, 0x30, 0xdd},
939 	{0xb3, 0x00, 0x64, 0xcc},
940 	{0xb3, 0x00, 0x67, 0xcc},
941 	{0xb3, 0x05, 0x01, 0xcc},
942 	{0xb3, 0x06, 0x01, 0xcc},
943 	{0xb3, 0x08, 0x01, 0xcc},
944 	{0xb3, 0x09, 0x0c, 0xcc},
945 	{0xb3, 0x34, 0x02, 0xcc},
946 	{0xb3, 0x35, 0xc8, 0xcc},	/* i2c add: 48 */
947 	{0xb3, 0x02, 0x00, 0xcc},
948 	{0xb3, 0x03, 0x0a, 0xcc},
949 	{0xb3, 0x04, 0x05, 0xcc},
950 	{0xb3, 0x20, 0x00, 0xcc},
951 	{0xb3, 0x21, 0x00, 0xcc},
952 	{0xb3, 0x22, 0x01, 0xcc},
953 	{0xb3, 0x23, 0xe0, 0xcc},
954 	{0xb3, 0x14, 0x00, 0xcc},
955 	{0xb3, 0x15, 0x00, 0xcc},
956 	{0xb3, 0x16, 0x02, 0xcc},
957 	{0xb3, 0x17, 0x7f, 0xcc},
958 	{0xb3, 0x00, 0x67, 0xcc},
959 	{0xb8, 0x00, 0x00, 0xcc},
960 	{0xbc, 0x00, 0x71, 0xcc},
961 	{0xbc, 0x01, 0x01, 0xcc},
962 	{0xb3, 0x5c, 0x01, 0xcc},
963 	{0xf0, 0x00, 0x02, 0xbb},
964 	{0x00, 0x00, 0x10, 0xdd},
965 	{0xc8, 0x00, 0x00, 0xbb},
966 	{0x00, 0x00, 0x30, 0xdd},
967 	{0xf0, 0x00, 0x00, 0xbb},
968 	{0x00, 0x00, 0x10, 0xdd},
969 	{0x07, 0x00, 0xe0, 0xbb},
970 	{0x08, 0x00, 0x0b, 0xbb},
971 	{0x21, 0x00, 0x0c, 0xbb},
972 	{0x20, 0x01, 0x03, 0xbb},	/* h/v flip */
973 	{0xbf, 0xc0, 0x26, 0xcc},
974 	{0xbf, 0xc1, 0x02, 0xcc},
975 	{0xbf, 0xcc, 0x04, 0xcc},
976 	{0xb3, 0x01, 0x41, 0xcc},
977 	{0xf0, 0x00, 0x00, 0xbb},
978 	{0x05, 0x01, 0x78, 0xbb},
979 	{0x06, 0x00, 0x11, 0xbb},
980 	{0x07, 0x01, 0x42, 0xbb},
981 	{0x08, 0x00, 0x11, 0xbb},
982 	{0x20, 0x01, 0x03, 0xbb},	/* h/v flip */
983 	{0x21, 0x80, 0x00, 0xbb},
984 	{0x22, 0x0d, 0x0f, 0xbb},
985 	{0x24, 0x80, 0x00, 0xbb},
986 	{0x59, 0x00, 0xff, 0xbb},
987 	{0xf0, 0x00, 0x02, 0xbb},
988 	{0x39, 0x03, 0xca, 0xbb},
989 	{0x3a, 0x06, 0x80, 0xbb},
990 	{0x3b, 0x01, 0x52, 0xbb},
991 	{0x3c, 0x05, 0x40, 0xbb},
992 	{0x57, 0x01, 0x9c, 0xbb},
993 	{0x58, 0x01, 0xee, 0xbb},
994 	{0x59, 0x00, 0xf0, 0xbb},
995 	{0x5a, 0x01, 0x20, 0xbb},
996 	{0x5c, 0x1d, 0x17, 0xbb},
997 	{0x5d, 0x22, 0x1c, 0xbb},
998 	{0x64, 0x1e, 0x1c, 0xbb},
999 	{0x5b, 0x00, 0x00, 0xbb},
1000 	{0xf0, 0x00, 0x02, 0xbb},
1001 	{0x22, 0xa0, 0x78, 0xbb},
1002 	{0x23, 0xa0, 0x78, 0xbb},
1003 	{0x24, 0x7f, 0x00, 0xbb},
1004 	{0x28, 0xea, 0x02, 0xbb},
1005 	{0x29, 0x86, 0x7a, 0xbb},
1006 	{0x5e, 0x52, 0x4c, 0xbb},
1007 	{0x5f, 0x20, 0x24, 0xbb},
1008 	{0x60, 0x00, 0x02, 0xbb},
1009 	{0x02, 0x00, 0xee, 0xbb},
1010 	{0x03, 0x39, 0x23, 0xbb},
1011 	{0x04, 0x07, 0x24, 0xbb},
1012 	{0x09, 0x00, 0xc0, 0xbb},
1013 	{0x0a, 0x00, 0x79, 0xbb},
1014 	{0x0b, 0x00, 0x04, 0xbb},
1015 	{0x0c, 0x00, 0x5c, 0xbb},
1016 	{0x0d, 0x00, 0xd9, 0xbb},
1017 	{0x0e, 0x00, 0x53, 0xbb},
1018 	{0x0f, 0x00, 0x21, 0xbb},
1019 	{0x10, 0x00, 0xa4, 0xbb},
1020 	{0x11, 0x00, 0xe5, 0xbb},
1021 	{0x15, 0x00, 0x00, 0xbb},
1022 	{0x16, 0x00, 0x00, 0xbb},
1023 	{0x17, 0x00, 0x00, 0xbb},
1024 	{0x18, 0x00, 0x00, 0xbb},
1025 	{0x19, 0x00, 0x00, 0xbb},
1026 	{0x1a, 0x00, 0x00, 0xbb},
1027 	{0x1b, 0x00, 0x00, 0xbb},
1028 	{0x1c, 0x00, 0x00, 0xbb},
1029 	{0x1d, 0x00, 0x00, 0xbb},
1030 	{0x1e, 0x00, 0x00, 0xbb},
1031 	{0xf0, 0x00, 0x01, 0xbb},
1032 	{0x06, 0xe0, 0x0e, 0xbb},
1033 	{0x06, 0x60, 0x0e, 0xbb},
1034 	{0xb3, 0x5c, 0x01, 0xcc},
1035 	{}
1036 };
1037 static const u8 mi1320_soc_InitQVGA[][4] = {
1038 	{0xb3, 0x01, 0x01, 0xcc},
1039 	{0xb0, 0x03, 0x19, 0xcc},
1040 	{0xb0, 0x04, 0x02, 0xcc},
1041 	{0x00, 0x00, 0x30, 0xdd},
1042 	{0xb3, 0x00, 0x64, 0xcc},
1043 	{0xb3, 0x00, 0x67, 0xcc},
1044 	{0xb3, 0x05, 0x01, 0xcc},
1045 	{0xb3, 0x06, 0x01, 0xcc},
1046 	{0xb3, 0x08, 0x01, 0xcc},
1047 	{0xb3, 0x09, 0x0c, 0xcc},
1048 	{0xb3, 0x34, 0x02, 0xcc},
1049 	{0xb3, 0x35, 0xc8, 0xcc},
1050 	{0xb3, 0x02, 0x00, 0xcc},
1051 	{0xb3, 0x03, 0x0a, 0xcc},
1052 	{0xb3, 0x04, 0x05, 0xcc},
1053 	{0xb3, 0x20, 0x00, 0xcc},
1054 	{0xb3, 0x21, 0x00, 0xcc},
1055 	{0xb3, 0x22, 0x01, 0xcc},
1056 	{0xb3, 0x23, 0xe0, 0xcc},
1057 	{0xb3, 0x14, 0x00, 0xcc},
1058 	{0xb3, 0x15, 0x00, 0xcc},
1059 	{0xb3, 0x16, 0x02, 0xcc},
1060 	{0xb3, 0x17, 0x7f, 0xcc},
1061 	{0xb3, 0x00, 0x67, 0xcc},
1062 	{0xb8, 0x00, 0x00, 0xcc},
1063 	{0xbc, 0x00, 0xd1, 0xcc},
1064 	{0xbc, 0x01, 0x01, 0xcc},
1065 	{0xb3, 0x5c, 0x01, 0xcc},
1066 	{0xf0, 0x00, 0x02, 0xbb},
1067 	{0x00, 0x00, 0x10, 0xdd},
1068 	{0xc8, 0x00, 0x00, 0xbb},
1069 	{0x00, 0x00, 0x30, 0xdd},
1070 	{0xf0, 0x00, 0x00, 0xbb},
1071 	{0x00, 0x00, 0x10, 0xdd},
1072 	{0x07, 0x00, 0xe0, 0xbb},
1073 	{0x08, 0x00, 0x0b, 0xbb},
1074 	{0x21, 0x00, 0x0c, 0xbb},
1075 	{0x20, 0x01, 0x03, 0xbb},	/* h/v flip */
1076 	{0xbf, 0xc0, 0x26, 0xcc},
1077 	{0xbf, 0xc1, 0x02, 0xcc},
1078 	{0xbf, 0xcc, 0x04, 0xcc},
1079 	{0xbc, 0x02, 0x18, 0xcc},
1080 	{0xbc, 0x03, 0x50, 0xcc},
1081 	{0xbc, 0x04, 0x18, 0xcc},
1082 	{0xbc, 0x05, 0x00, 0xcc},
1083 	{0xbc, 0x06, 0x00, 0xcc},
1084 	{0xbc, 0x08, 0x30, 0xcc},
1085 	{0xbc, 0x09, 0x40, 0xcc},
1086 	{0xbc, 0x0a, 0x10, 0xcc},
1087 	{0xbc, 0x0b, 0x00, 0xcc},
1088 	{0xbc, 0x0c, 0x00, 0xcc},
1089 	{0xb3, 0x01, 0x41, 0xcc},
1090 	{0xf0, 0x00, 0x00, 0xbb},
1091 	{0x05, 0x01, 0x78, 0xbb},
1092 	{0x06, 0x00, 0x11, 0xbb},
1093 	{0x07, 0x01, 0x42, 0xbb},
1094 	{0x08, 0x00, 0x11, 0xbb},
1095 	{0x20, 0x01, 0x03, 0xbb},	/* h/v flip */
1096 	{0x21, 0x80, 0x00, 0xbb},
1097 	{0x22, 0x0d, 0x0f, 0xbb},
1098 	{0x24, 0x80, 0x00, 0xbb},
1099 	{0x59, 0x00, 0xff, 0xbb},
1100 	{0xf0, 0x00, 0x02, 0xbb},
1101 	{0x39, 0x03, 0xca, 0xbb},
1102 	{0x3a, 0x06, 0x80, 0xbb},
1103 	{0x3b, 0x01, 0x52, 0xbb},
1104 	{0x3c, 0x05, 0x40, 0xbb},
1105 	{0x57, 0x01, 0x9c, 0xbb},
1106 	{0x58, 0x01, 0xee, 0xbb},
1107 	{0x59, 0x00, 0xf0, 0xbb},
1108 	{0x5a, 0x01, 0x20, 0xbb},
1109 	{0x5c, 0x1d, 0x17, 0xbb},
1110 	{0x5d, 0x22, 0x1c, 0xbb},
1111 	{0x64, 0x1e, 0x1c, 0xbb},
1112 	{0x5b, 0x00, 0x00, 0xbb},
1113 	{0xf0, 0x00, 0x02, 0xbb},
1114 	{0x22, 0xa0, 0x78, 0xbb},
1115 	{0x23, 0xa0, 0x78, 0xbb},
1116 	{0x24, 0x7f, 0x00, 0xbb},
1117 	{0x28, 0xea, 0x02, 0xbb},
1118 	{0x29, 0x86, 0x7a, 0xbb},
1119 	{0x5e, 0x52, 0x4c, 0xbb},
1120 	{0x5f, 0x20, 0x24, 0xbb},
1121 	{0x60, 0x00, 0x02, 0xbb},
1122 	{0x02, 0x00, 0xee, 0xbb},
1123 	{0x03, 0x39, 0x23, 0xbb},
1124 	{0x04, 0x07, 0x24, 0xbb},
1125 	{0x09, 0x00, 0xc0, 0xbb},
1126 	{0x0a, 0x00, 0x79, 0xbb},
1127 	{0x0b, 0x00, 0x04, 0xbb},
1128 	{0x0c, 0x00, 0x5c, 0xbb},
1129 	{0x0d, 0x00, 0xd9, 0xbb},
1130 	{0x0e, 0x00, 0x53, 0xbb},
1131 	{0x0f, 0x00, 0x21, 0xbb},
1132 	{0x10, 0x00, 0xa4, 0xbb},
1133 	{0x11, 0x00, 0xe5, 0xbb},
1134 	{0x15, 0x00, 0x00, 0xbb},
1135 	{0x16, 0x00, 0x00, 0xbb},
1136 	{0x17, 0x00, 0x00, 0xbb},
1137 	{0x18, 0x00, 0x00, 0xbb},
1138 	{0x19, 0x00, 0x00, 0xbb},
1139 	{0x1a, 0x00, 0x00, 0xbb},
1140 	{0x1b, 0x00, 0x00, 0xbb},
1141 	{0x1c, 0x00, 0x00, 0xbb},
1142 	{0x1d, 0x00, 0x00, 0xbb},
1143 	{0x1e, 0x00, 0x00, 0xbb},
1144 	{0xf0, 0x00, 0x01, 0xbb},
1145 	{0x06, 0xe0, 0x0e, 0xbb},
1146 	{0x06, 0x60, 0x0e, 0xbb},
1147 	{0xb3, 0x5c, 0x01, 0xcc},
1148 	{}
1149 };
1150 static const u8 mi1320_soc_InitSXGA[][4] = {
1151 	{0xb3, 0x01, 0x01, 0xcc},
1152 	{0xb0, 0x03, 0x19, 0xcc},
1153 	{0x00, 0x00, 0x30, 0xdd},
1154 	{0xb3, 0x00, 0x64, 0xcc},
1155 	{0xb3, 0x00, 0x67, 0xcc},
1156 	{0xb3, 0x05, 0x01, 0xcc},
1157 	{0xb3, 0x06, 0x01, 0xcc},
1158 	{0xb3, 0x08, 0x01, 0xcc},
1159 	{0xb3, 0x09, 0x0c, 0xcc},
1160 	{0xb3, 0x34, 0x02, 0xcc},
1161 	{0xb3, 0x35, 0xc8, 0xcc},
1162 	{0xb3, 0x02, 0x00, 0xcc},
1163 	{0xb3, 0x03, 0x0a, 0xcc},
1164 	{0xb3, 0x04, 0x05, 0xcc},
1165 	{0xb3, 0x20, 0x00, 0xcc},
1166 	{0xb3, 0x21, 0x00, 0xcc},
1167 	{0xb3, 0x22, 0x04, 0xcc},
1168 	{0xb3, 0x23, 0x00, 0xcc},
1169 	{0xb3, 0x14, 0x00, 0xcc},
1170 	{0xb3, 0x15, 0x00, 0xcc},
1171 	{0xb3, 0x16, 0x04, 0xcc},
1172 	{0xb3, 0x17, 0xff, 0xcc},
1173 	{0xb3, 0x00, 0x67, 0xcc},
1174 	{0xbc, 0x00, 0x71, 0xcc},
1175 	{0xbc, 0x01, 0x01, 0xcc},
1176 	{0xb3, 0x5c, 0x01, 0xcc},
1177 	{0xf0, 0x00, 0x02, 0xbb},
1178 	{0x00, 0x00, 0x30, 0xdd},
1179 	{0xc8, 0x9f, 0x0b, 0xbb},
1180 	{0x00, 0x00, 0x20, 0xdd},
1181 	{0x5b, 0x00, 0x01, 0xbb},
1182 	{0x00, 0x00, 0x20, 0xdd},
1183 	{0xf0, 0x00, 0x00, 0xbb},
1184 	{0x00, 0x00, 0x30, 0xdd},
1185 	{0x20, 0x01, 0x03, 0xbb},	/* h/v flip */
1186 	{0x00, 0x00, 0x20, 0xdd},
1187 	{0xbf, 0xc0, 0x26, 0xcc},
1188 	{0xbf, 0xc1, 0x02, 0xcc},
1189 	{0xbf, 0xcc, 0x04, 0xcc},
1190 	{0xb3, 0x01, 0x41, 0xcc},
1191 	{0xf0, 0x00, 0x00, 0xbb},
1192 	{0x05, 0x01, 0x78, 0xbb},
1193 	{0x06, 0x00, 0x11, 0xbb},
1194 	{0x07, 0x01, 0x42, 0xbb},
1195 	{0x08, 0x00, 0x11, 0xbb},
1196 	{0x20, 0x01, 0x03, 0xbb},	/* h/v flip */
1197 	{0x21, 0x80, 0x00, 0xbb},
1198 	{0x22, 0x0d, 0x0f, 0xbb},
1199 	{0x24, 0x80, 0x00, 0xbb},
1200 	{0x59, 0x00, 0xff, 0xbb},
1201 	{0xf0, 0x00, 0x02, 0xbb},
1202 	{0x39, 0x03, 0xca, 0xbb},
1203 	{0x3a, 0x06, 0x80, 0xbb},
1204 	{0x3b, 0x01, 0x52, 0xbb},
1205 	{0x3c, 0x05, 0x40, 0xbb},
1206 	{0x57, 0x01, 0x9c, 0xbb},
1207 	{0x58, 0x01, 0xee, 0xbb},
1208 	{0x59, 0x00, 0xf0, 0xbb},
1209 	{0x5a, 0x01, 0x20, 0xbb},
1210 	{0x5c, 0x1d, 0x17, 0xbb},
1211 	{0x5d, 0x22, 0x1c, 0xbb},
1212 	{0x64, 0x1e, 0x1c, 0xbb},
1213 	{0x5b, 0x00, 0x00, 0xbb},
1214 	{0xf0, 0x00, 0x02, 0xbb},
1215 	{0x22, 0xa0, 0x78, 0xbb},
1216 	{0x23, 0xa0, 0x78, 0xbb},
1217 	{0x24, 0x7f, 0x00, 0xbb},
1218 	{0x28, 0xea, 0x02, 0xbb},
1219 	{0x29, 0x86, 0x7a, 0xbb},
1220 	{0x5e, 0x52, 0x4c, 0xbb},
1221 	{0x5f, 0x20, 0x24, 0xbb},
1222 	{0x60, 0x00, 0x02, 0xbb},
1223 	{0x02, 0x00, 0xee, 0xbb},
1224 	{0x03, 0x39, 0x23, 0xbb},
1225 	{0x04, 0x07, 0x24, 0xbb},
1226 	{0x09, 0x00, 0xc0, 0xbb},
1227 	{0x0a, 0x00, 0x79, 0xbb},
1228 	{0x0b, 0x00, 0x04, 0xbb},
1229 	{0x0c, 0x00, 0x5c, 0xbb},
1230 	{0x0d, 0x00, 0xd9, 0xbb},
1231 	{0x0e, 0x00, 0x53, 0xbb},
1232 	{0x0f, 0x00, 0x21, 0xbb},
1233 	{0x10, 0x00, 0xa4, 0xbb},
1234 	{0x11, 0x00, 0xe5, 0xbb},
1235 	{0x15, 0x00, 0x00, 0xbb},
1236 	{0x16, 0x00, 0x00, 0xbb},
1237 	{0x17, 0x00, 0x00, 0xbb},
1238 	{0x18, 0x00, 0x00, 0xbb},
1239 	{0x19, 0x00, 0x00, 0xbb},
1240 	{0x1a, 0x00, 0x00, 0xbb},
1241 	{0x1b, 0x00, 0x00, 0xbb},
1242 	{0x1c, 0x00, 0x00, 0xbb},
1243 	{0x1d, 0x00, 0x00, 0xbb},
1244 	{0x1e, 0x00, 0x00, 0xbb},
1245 	{0xf0, 0x00, 0x01, 0xbb},
1246 	{0x06, 0xe0, 0x0e, 0xbb},
1247 	{0x06, 0x60, 0x0e, 0xbb},
1248 	{0xb3, 0x5c, 0x01, 0xcc},
1249 	{0xf0, 0x00, 0x00, 0xbb},
1250 	{0x05, 0x01, 0x13, 0xbb},
1251 	{0x06, 0x00, 0x11, 0xbb},
1252 	{0x07, 0x00, 0x85, 0xbb},
1253 	{0x08, 0x00, 0x27, 0xbb},
1254 	{0x20, 0x01, 0x03, 0xbb},	/* h/v flip */
1255 	{0x21, 0x80, 0x00, 0xbb},
1256 	{0x22, 0x0d, 0x0f, 0xbb},
1257 	{0x24, 0x80, 0x00, 0xbb},
1258 	{0x59, 0x00, 0xff, 0xbb},
1259 	{0xf0, 0x00, 0x02, 0xbb},
1260 	{0x39, 0x03, 0x0d, 0xbb},
1261 	{0x3a, 0x06, 0x1b, 0xbb},
1262 	{0x3b, 0x00, 0x95, 0xbb},
1263 	{0x3c, 0x04, 0xdb, 0xbb},
1264 	{0x57, 0x02, 0x00, 0xbb},
1265 	{0x58, 0x02, 0x66, 0xbb},
1266 	{0x59, 0x00, 0xff, 0xbb},
1267 	{0x5a, 0x01, 0x33, 0xbb},
1268 	{0x5c, 0x12, 0x0d, 0xbb},
1269 	{0x5d, 0x16, 0x11, 0xbb},
1270 	{0x64, 0x5e, 0x1c, 0xbb},
1271 	{}
1272 };
1273 static const u8 po3130_gamma[17] = {
1274 	0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1275 	0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1276 };
1277 static const u8 po3130_matrix[9] = {
1278 	0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1279 };
1280 
1281 static const u8 po3130_initVGA_data[][4] = {
1282 	{0xb0, 0x4d, 0x00, 0xcc},	{0xb3, 0x01, 0x01, 0xcc},
1283 	{0x00, 0x00, 0x50, 0xdd},	{0xb0, 0x03, 0x01, 0xcc},
1284 	{0xb3, 0x00, 0x04, 0xcc},	{0xb3, 0x00, 0x24, 0xcc},
1285 	{0xb3, 0x00, 0x25, 0xcc},	{0xb3, 0x08, 0x01, 0xcc},
1286 	{0xb3, 0x09, 0x0c, 0xcc},	{0xb3, 0x05, 0x00, 0xcc},
1287 	{0xb3, 0x06, 0x01, 0xcc},	{0xb3, 0x03, 0x1a, 0xcc},
1288 	{0xb3, 0x04, 0x15, 0xcc},	{0xb3, 0x20, 0x00, 0xcc},
1289 	{0xb3, 0x21, 0x00, 0xcc},	{0xb3, 0x22, 0x01, 0xcc},
1290 	{0xb3, 0x23, 0xe8, 0xcc},	{0xb8, 0x08, 0xe8, 0xcc},
1291 	{0xb3, 0x14, 0x00, 0xcc},	{0xb3, 0x15, 0x00, 0xcc},
1292 	{0xb3, 0x16, 0x02, 0xcc},	{0xb3, 0x17, 0x7f, 0xcc},
1293 	{0xb3, 0x34, 0x01, 0xcc},
1294 	{0xb3, 0x35, 0xf6, 0xcc},	/* i2c add: 76 */
1295 	{0xb3, 0x00, 0x27, 0xcc},	{0xbc, 0x00, 0x71, 0xcc},
1296 	{0xb8, 0x00, 0x21, 0xcc},	{0xb8, 0x27, 0x20, 0xcc},
1297 	{0xb8, 0x01, 0x79, 0xcc},	{0xb8, 0x81, 0x09, 0xcc},
1298 	{0xb8, 0x2c, 0x50, 0xcc},	{0xb8, 0x2d, 0xf8, 0xcc},
1299 	{0xb8, 0x2e, 0xf8, 0xcc},	{0xb8, 0x2f, 0xf8, 0xcc},
1300 	{0xb8, 0x30, 0x50, 0xcc},	{0xb8, 0x31, 0xf8, 0xcc},
1301 	{0xb8, 0x32, 0xf8, 0xcc},	{0xb8, 0x33, 0xf8, 0xcc},
1302 	{0xb8, 0x34, 0x50, 0xcc},	{0xb8, 0x35, 0x00, 0xcc},
1303 	{0xb8, 0x36, 0x00, 0xcc},	{0xb8, 0x37, 0x00, 0xcc},
1304 	{0x00, 0x1e, 0xc6, 0xaa},	{0x00, 0x20, 0x44, 0xaa},
1305 	{0x00, 0xad, 0x02, 0xaa},	{0x00, 0xae, 0x2c, 0xaa},
1306 	{0x00, 0x12, 0x08, 0xaa},	{0x00, 0x17, 0x41, 0xaa},
1307 	{0x00, 0x19, 0x41, 0xaa},	{0x00, 0x1e, 0x06, 0xaa},
1308 	{0x00, 0x21, 0x00, 0xaa},	{0x00, 0x36, 0xc0, 0xaa},
1309 	{0x00, 0x37, 0xc8, 0xaa},	{0x00, 0x3b, 0x36, 0xaa},
1310 	{0x00, 0x4b, 0xfe, 0xaa},	{0x00, 0x51, 0x1c, 0xaa},
1311 	{0x00, 0x52, 0x01, 0xaa},	{0x00, 0x55, 0x0a, 0xaa},
1312 	{0x00, 0x59, 0x02, 0xaa},	{0x00, 0x5a, 0x04, 0xaa},
1313 	{0x00, 0x5c, 0x10, 0xaa},	{0x00, 0x5d, 0x10, 0xaa},
1314 	{0x00, 0x5e, 0x10, 0xaa},	{0x00, 0x5f, 0x10, 0xaa},
1315 	{0x00, 0x61, 0x00, 0xaa},	{0x00, 0x62, 0x18, 0xaa},
1316 	{0x00, 0x63, 0x30, 0xaa},	{0x00, 0x70, 0x68, 0xaa},
1317 	{0x00, 0x80, 0x71, 0xaa},	{0x00, 0x81, 0x08, 0xaa},
1318 	{0x00, 0x82, 0x00, 0xaa},	{0x00, 0x83, 0x55, 0xaa},
1319 	{0x00, 0x84, 0x06, 0xaa},	{0x00, 0x85, 0x06, 0xaa},
1320 	{0x00, 0x86, 0x13, 0xaa},	{0x00, 0x87, 0x18, 0xaa},
1321 	{0x00, 0xaa, 0x3f, 0xaa},	{0x00, 0xab, 0x44, 0xaa},
1322 	{0x00, 0xb0, 0x68, 0xaa},	{0x00, 0xb5, 0x10, 0xaa},
1323 	{0x00, 0xb8, 0x20, 0xaa},	{0x00, 0xb9, 0xa0, 0xaa},
1324 	{0x00, 0xbc, 0x04, 0xaa},	{0x00, 0x8b, 0x40, 0xaa},
1325 	{0x00, 0x8c, 0x91, 0xaa},	{0x00, 0x8d, 0x8f, 0xaa},
1326 	{0x00, 0x8e, 0x91, 0xaa},	{0x00, 0x8f, 0x43, 0xaa},
1327 	{0x00, 0x90, 0x92, 0xaa},	{0x00, 0x91, 0x89, 0xaa},
1328 	{0x00, 0x92, 0x9d, 0xaa},	{0x00, 0x93, 0x46, 0xaa},
1329 	{0x00, 0xd6, 0x22, 0xaa},	{0x00, 0x73, 0x00, 0xaa},
1330 	{0x00, 0x74, 0x10, 0xaa},	{0x00, 0x75, 0x20, 0xaa},
1331 	{0x00, 0x76, 0x2b, 0xaa},	{0x00, 0x77, 0x36, 0xaa},
1332 	{0x00, 0x78, 0x49, 0xaa},	{0x00, 0x79, 0x5a, 0xaa},
1333 	{0x00, 0x7a, 0x7f, 0xaa},	{0x00, 0x7b, 0x9b, 0xaa},
1334 	{0x00, 0x7c, 0xba, 0xaa},	{0x00, 0x7d, 0xd4, 0xaa},
1335 	{0x00, 0x7e, 0xea, 0xaa},	{0x00, 0xd6, 0x62, 0xaa},
1336 	{0x00, 0x73, 0x00, 0xaa},	{0x00, 0x74, 0x10, 0xaa},
1337 	{0x00, 0x75, 0x20, 0xaa},	{0x00, 0x76, 0x2b, 0xaa},
1338 	{0x00, 0x77, 0x36, 0xaa},	{0x00, 0x78, 0x49, 0xaa},
1339 	{0x00, 0x79, 0x5a, 0xaa},	{0x00, 0x7a, 0x7f, 0xaa},
1340 	{0x00, 0x7b, 0x9b, 0xaa},	{0x00, 0x7c, 0xba, 0xaa},
1341 	{0x00, 0x7d, 0xd4, 0xaa},	{0x00, 0x7e, 0xea, 0xaa},
1342 	{0x00, 0xd6, 0xa2, 0xaa},	{0x00, 0x73, 0x00, 0xaa},
1343 	{0x00, 0x74, 0x10, 0xaa},	{0x00, 0x75, 0x20, 0xaa},
1344 	{0x00, 0x76, 0x2b, 0xaa},	{0x00, 0x77, 0x36, 0xaa},
1345 	{0x00, 0x78, 0x49, 0xaa},	{0x00, 0x79, 0x5a, 0xaa},
1346 	{0x00, 0x7a, 0x7f, 0xaa},	{0x00, 0x7b, 0x9b, 0xaa},
1347 	{0x00, 0x7c, 0xba, 0xaa},	{0x00, 0x7d, 0xd4, 0xaa},
1348 	{0x00, 0x7e, 0xea, 0xaa},
1349 	{0x00, 0x4c, 0x07, 0xaa},
1350 	{0x00, 0x4b, 0xe0, 0xaa},	{0x00, 0x4e, 0x77, 0xaa},
1351 	{0x00, 0x59, 0x02, 0xaa},	{0x00, 0x4d, 0x0a, 0xaa},
1352 /*	{0x00, 0xd1, 0x00, 0xaa},	{0x00, 0x20, 0xc4, 0xaa},
1353 	{0xb8, 0x8e, 0x00, 0xcc},	{0xb8, 0x8f, 0xff, 0xcc}, */
1354 	{0x00, 0xd1, 0x3c, 0xaa},	{0x00, 0x20, 0xc4, 0xaa},
1355 	{0xb8, 0x8e, 0x00, 0xcc},	{0xb8, 0x8f, 0xff, 0xcc},
1356 	{0xb8, 0xfe, 0x00, 0xcc},	{0xb8, 0xff, 0x28, 0xcc},
1357 	{0xb9, 0x00, 0x28, 0xcc},	{0xb9, 0x01, 0x28, 0xcc},
1358 	{0xb9, 0x02, 0x28, 0xcc},	{0xb9, 0x03, 0x00, 0xcc},
1359 	{0xb9, 0x04, 0x00, 0xcc},	{0xb9, 0x05, 0x3c, 0xcc},
1360 	{0xb9, 0x06, 0x3c, 0xcc},	{0xb9, 0x07, 0x3c, 0xcc},
1361 	{0xb9, 0x08, 0x3c, 0xcc},	{0x00, 0x05, 0x00, 0xaa},
1362 	{0xb3, 0x5c, 0x00, 0xcc},	{0xb3, 0x01, 0x41, 0xcc},
1363 	{}
1364 };
1365 static const u8 po3130_rundata[][4] = {
1366 	{0x00, 0x47, 0x45, 0xaa},	{0x00, 0x48, 0x9b, 0xaa},
1367 	{0x00, 0x49, 0x3a, 0xaa},	{0x00, 0x4a, 0x01, 0xaa},
1368 	{0x00, 0x44, 0x40, 0xaa},
1369 /*	{0x00, 0xd5, 0x7c, 0xaa}, */
1370 	{0x00, 0xad, 0x04, 0xaa},	{0x00, 0xae, 0x00, 0xaa},
1371 	{0x00, 0xb0, 0x78, 0xaa},	{0x00, 0x98, 0x02, 0xaa},
1372 	{0x00, 0x94, 0x25, 0xaa},	{0x00, 0x95, 0x25, 0xaa},
1373 	{0x00, 0x59, 0x68, 0xaa},	{0x00, 0x44, 0x20, 0xaa},
1374 	{0x00, 0x17, 0x50, 0xaa},	{0x00, 0x19, 0x50, 0xaa},
1375 	{0x00, 0xd1, 0x3c, 0xaa},	{0x00, 0xd1, 0x3c, 0xaa},
1376 	{0x00, 0x1e, 0x06, 0xaa},	{0x00, 0x1e, 0x06, 0xaa},
1377 	{}
1378 };
1379 
1380 static const u8 po3130_initQVGA_data[][4] = {
1381 	{0xb0, 0x4d, 0x00, 0xcc},	{0xb3, 0x01, 0x01, 0xcc},
1382 	{0x00, 0x00, 0x50, 0xdd},	{0xb0, 0x03, 0x09, 0xcc},
1383 	{0xb3, 0x00, 0x04, 0xcc},	{0xb3, 0x00, 0x24, 0xcc},
1384 	{0xb3, 0x00, 0x25, 0xcc},	{0xb3, 0x08, 0x01, 0xcc},
1385 	{0xb3, 0x09, 0x0c, 0xcc},	{0xb3, 0x05, 0x00, 0xcc},
1386 	{0xb3, 0x06, 0x01, 0xcc},	{0xb3, 0x03, 0x1a, 0xcc},
1387 	{0xb3, 0x04, 0x15, 0xcc},	{0xb3, 0x20, 0x00, 0xcc},
1388 	{0xb3, 0x21, 0x00, 0xcc},	{0xb3, 0x22, 0x01, 0xcc},
1389 	{0xb3, 0x23, 0xe0, 0xcc},	{0xb8, 0x08, 0xe0, 0xcc},
1390 	{0xb3, 0x14, 0x00, 0xcc},	{0xb3, 0x15, 0x00, 0xcc},
1391 	{0xb3, 0x16, 0x02, 0xcc},	{0xb3, 0x17, 0x7f, 0xcc},
1392 	{0xb3, 0x34, 0x01, 0xcc},	{0xb3, 0x35, 0xf6, 0xcc},
1393 	{0xb3, 0x00, 0x27, 0xcc},	{0xbc, 0x00, 0xd1, 0xcc},
1394 	{0xb8, 0x00, 0x21, 0xcc},	{0xb8, 0x27, 0x20, 0xcc},
1395 	{0xb8, 0x01, 0x79, 0xcc},	{0xb8, 0x81, 0x09, 0xcc},
1396 	{0xb8, 0x2c, 0x50, 0xcc},	{0xb8, 0x2d, 0xf8, 0xcc},
1397 	{0xb8, 0x2e, 0xf8, 0xcc},	{0xb8, 0x2f, 0xf8, 0xcc},
1398 	{0xb8, 0x30, 0x50, 0xcc},	{0xb8, 0x31, 0xf8, 0xcc},
1399 	{0xb8, 0x32, 0xf8, 0xcc},	{0xb8, 0x33, 0xf8, 0xcc},
1400 	{0xb8, 0x34, 0x50, 0xcc},	{0xb8, 0x35, 0x00, 0xcc},
1401 	{0xb8, 0x36, 0x00, 0xcc},	{0xb8, 0x37, 0x00, 0xcc},
1402 	{0x00, 0x1e, 0xc6, 0xaa},	{0x00, 0x20, 0x44, 0xaa},
1403 	{0x00, 0xad, 0x02, 0xaa},	{0x00, 0xae, 0x2c, 0xaa},
1404 	{0x00, 0x12, 0x08, 0xaa},	{0x00, 0x17, 0x41, 0xaa},
1405 	{0x00, 0x19, 0x41, 0xaa},	{0x00, 0x1e, 0x06, 0xaa},
1406 	{0x00, 0x21, 0x00, 0xaa},	{0x00, 0x36, 0xc0, 0xaa},
1407 	{0x00, 0x37, 0xc8, 0xaa},	{0x00, 0x3b, 0x36, 0xaa},
1408 	{0x00, 0x4b, 0xfe, 0xaa},	{0x00, 0x51, 0x1c, 0xaa},
1409 	{0x00, 0x52, 0x01, 0xaa},	{0x00, 0x55, 0x0a, 0xaa},
1410 	{0x00, 0x59, 0x6f, 0xaa},	{0x00, 0x5a, 0x04, 0xaa},
1411 	{0x00, 0x5c, 0x10, 0xaa},	{0x00, 0x5d, 0x10, 0xaa},
1412 	{0x00, 0x5e, 0x10, 0xaa},	{0x00, 0x5f, 0x10, 0xaa},
1413 	{0x00, 0x61, 0x00, 0xaa},	{0x00, 0x62, 0x18, 0xaa},
1414 	{0x00, 0x63, 0x30, 0xaa},	{0x00, 0x70, 0x68, 0xaa},
1415 	{0x00, 0x80, 0x71, 0xaa},	{0x00, 0x81, 0x08, 0xaa},
1416 	{0x00, 0x82, 0x00, 0xaa},	{0x00, 0x83, 0x55, 0xaa},
1417 	{0x00, 0x84, 0x06, 0xaa},	{0x00, 0x85, 0x06, 0xaa},
1418 	{0x00, 0x86, 0x13, 0xaa},	{0x00, 0x87, 0x18, 0xaa},
1419 	{0x00, 0xaa, 0x3f, 0xaa},	{0x00, 0xab, 0x44, 0xaa},
1420 	{0x00, 0xb0, 0x68, 0xaa},	{0x00, 0xb5, 0x10, 0xaa},
1421 	{0x00, 0xb8, 0x20, 0xaa},	{0x00, 0xb9, 0xa0, 0xaa},
1422 	{0x00, 0xbc, 0x04, 0xaa},	{0x00, 0x8b, 0x40, 0xaa},
1423 	{0x00, 0x8c, 0x91, 0xaa},	{0x00, 0x8d, 0x8f, 0xaa},
1424 	{0x00, 0x8e, 0x91, 0xaa},	{0x00, 0x8f, 0x43, 0xaa},
1425 	{0x00, 0x90, 0x92, 0xaa},	{0x00, 0x91, 0x89, 0xaa},
1426 	{0x00, 0x92, 0x9d, 0xaa},	{0x00, 0x93, 0x46, 0xaa},
1427 	{0x00, 0xd6, 0x22, 0xaa},	{0x00, 0x73, 0x00, 0xaa},
1428 	{0x00, 0x74, 0x10, 0xaa},	{0x00, 0x75, 0x20, 0xaa},
1429 	{0x00, 0x76, 0x2b, 0xaa},	{0x00, 0x77, 0x36, 0xaa},
1430 	{0x00, 0x78, 0x49, 0xaa},	{0x00, 0x79, 0x5a, 0xaa},
1431 	{0x00, 0x7a, 0x7f, 0xaa},	{0x00, 0x7b, 0x9b, 0xaa},
1432 	{0x00, 0x7c, 0xba, 0xaa},	{0x00, 0x7d, 0xd4, 0xaa},
1433 	{0x00, 0x7e, 0xea, 0xaa},	{0x00, 0xd6, 0x62, 0xaa},
1434 	{0x00, 0x73, 0x00, 0xaa},	{0x00, 0x74, 0x10, 0xaa},
1435 	{0x00, 0x75, 0x20, 0xaa},	{0x00, 0x76, 0x2b, 0xaa},
1436 	{0x00, 0x77, 0x36, 0xaa},	{0x00, 0x78, 0x49, 0xaa},
1437 	{0x00, 0x79, 0x5a, 0xaa},	{0x00, 0x7a, 0x7f, 0xaa},
1438 	{0x00, 0x7b, 0x9b, 0xaa},	{0x00, 0x7c, 0xba, 0xaa},
1439 	{0x00, 0x7d, 0xd4, 0xaa},	{0x00, 0x7e, 0xea, 0xaa},
1440 	{0x00, 0xd6, 0xa2, 0xaa},	{0x00, 0x73, 0x00, 0xaa},
1441 	{0x00, 0x74, 0x10, 0xaa},	{0x00, 0x75, 0x20, 0xaa},
1442 	{0x00, 0x76, 0x2b, 0xaa},	{0x00, 0x77, 0x36, 0xaa},
1443 	{0x00, 0x78, 0x49, 0xaa},	{0x00, 0x79, 0x5a, 0xaa},
1444 	{0x00, 0x7a, 0x7f, 0xaa},	{0x00, 0x7b, 0x9b, 0xaa},
1445 	{0x00, 0x7c, 0xba, 0xaa},	{0x00, 0x7d, 0xd4, 0xaa},
1446 	{0x00, 0x7e, 0xea, 0xaa},	{0x00, 0x4c, 0x07, 0xaa},
1447 	{0x00, 0x4b, 0xe0, 0xaa},	{0x00, 0x4e, 0x77, 0xaa},
1448 	{0x00, 0x59, 0x66, 0xaa},	{0x00, 0x4d, 0x0a, 0xaa},
1449 	{0x00, 0xd1, 0x00, 0xaa},	{0x00, 0x20, 0xc4, 0xaa},
1450 	{0xb8, 0x8e, 0x00, 0xcc},	{0xb8, 0x8f, 0xff, 0xcc},
1451 	{0xb8, 0xfe, 0x00, 0xcc},	{0xb8, 0xff, 0x28, 0xcc},
1452 	{0xb9, 0x00, 0x28, 0xcc},	{0xb9, 0x01, 0x28, 0xcc},
1453 	{0xb9, 0x02, 0x28, 0xcc},	{0xb9, 0x03, 0x00, 0xcc},
1454 	{0xb9, 0x04, 0x00, 0xcc},	{0xb9, 0x05, 0x3c, 0xcc},
1455 	{0xb9, 0x06, 0x3c, 0xcc},	{0xb9, 0x07, 0x3c, 0xcc},
1456 	{0xb9, 0x08, 0x3c, 0xcc},	{0xbc, 0x02, 0x18, 0xcc},
1457 	{0xbc, 0x03, 0x50, 0xcc},	{0xbc, 0x04, 0x18, 0xcc},
1458 	{0xbc, 0x05, 0x00, 0xcc},	{0xbc, 0x06, 0x00, 0xcc},
1459 	{0xbc, 0x08, 0x30, 0xcc},	{0xbc, 0x09, 0x40, 0xcc},
1460 	{0xbc, 0x0a, 0x10, 0xcc},	{0xbc, 0x0b, 0x00, 0xcc},
1461 	{0xbc, 0x0c, 0x00, 0xcc},	{0x00, 0x05, 0x00, 0xaa},
1462 	{0xb3, 0x5c, 0x00, 0xcc},	{0xb3, 0x01, 0x41, 0xcc},
1463 	{}
1464 };
1465 
1466 static const u8 hv7131r_gamma[17] = {
1467 	0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1468 	0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1469 };
1470 static const u8 hv7131r_matrix[9] = {
1471 	0x5f, 0xec, 0xf5, 0xf1, 0x5a, 0xf5, 0xf1, 0xec, 0x63
1472 };
1473 static const u8 hv7131r_initVGA_data[][4] = {
1474 	{0xb3, 0x01, 0x01, 0xcc},
1475 	{0xb0, 0x03, 0x19, 0xcc},
1476 	{0xb0, 0x04, 0x02, 0xcc},
1477 	{0x00, 0x00, 0x20, 0xdd},
1478 	{0xb3, 0x00, 0x24, 0xcc},
1479 	{0xb3, 0x00, 0x25, 0xcc},
1480 	{0xb3, 0x08, 0x01, 0xcc},
1481 	{0xb3, 0x09, 0x0c, 0xcc},
1482 	{0xb3, 0x05, 0x01, 0xcc},
1483 	{0xb3, 0x06, 0x03, 0xcc},
1484 	{0xb3, 0x01, 0x45, 0xcc},
1485 	{0xb3, 0x03, 0x0b, 0xcc},
1486 	{0xb3, 0x04, 0x05, 0xcc},
1487 	{0xb3, 0x20, 0x00, 0xcc},
1488 	{0xb3, 0x21, 0x00, 0xcc},
1489 	{0xb3, 0x22, 0x01, 0xcc},
1490 	{0xb3, 0x23, 0xe0, 0xcc},
1491 	{0xb3, 0x14, 0x00, 0xcc},
1492 	{0xb3, 0x15, 0x02, 0xcc},
1493 	{0xb3, 0x16, 0x02, 0xcc},
1494 	{0xb3, 0x17, 0x7f, 0xcc},
1495 	{0xb3, 0x34, 0x01, 0xcc},
1496 	{0xb3, 0x35, 0x91, 0xcc},	/* i2c add: 11 */
1497 	{0xb3, 0x00, 0x27, 0xcc},
1498 	{0xbc, 0x00, 0x73, 0xcc},
1499 	{0xb8, 0x00, 0x23, 0xcc},
1500 	{0xb8, 0x2c, 0x50, 0xcc},
1501 	{0xb8, 0x2d, 0xf8, 0xcc},
1502 	{0xb8, 0x2e, 0xf8, 0xcc},
1503 	{0xb8, 0x2f, 0xf8, 0xcc},
1504 	{0xb8, 0x30, 0x50, 0xcc},
1505 	{0xb8, 0x31, 0xf8, 0xcc},
1506 	{0xb8, 0x32, 0xf8, 0xcc},
1507 	{0xb8, 0x33, 0xf8, 0xcc},
1508 	{0xb8, 0x34, 0x58, 0xcc},
1509 	{0xb8, 0x35, 0x00, 0xcc},
1510 	{0xb8, 0x36, 0x00, 0xcc},
1511 	{0xb8, 0x37, 0x00, 0xcc},
1512 	{0xb8, 0x27, 0x20, 0xcc},
1513 	{0xb8, 0x01, 0x7d, 0xcc},
1514 	{0xb8, 0x81, 0x09, 0xcc},
1515 	{0xb3, 0x01, 0x41, 0xcc},
1516 	{0xb8, 0x8e, 0x00, 0xcc},
1517 	{0xb8, 0x8f, 0xff, 0xcc},
1518 	{0x00, 0x01, 0x0c, 0xaa},
1519 	{0x00, 0x14, 0x01, 0xaa},
1520 	{0x00, 0x15, 0xe6, 0xaa},
1521 	{0x00, 0x16, 0x02, 0xaa},
1522 	{0x00, 0x17, 0x86, 0xaa},
1523 	{0x00, 0x23, 0x00, 0xaa},
1524 	{0x00, 0x25, 0x03, 0xaa},
1525 	{0x00, 0x26, 0xa9, 0xaa},
1526 	{0x00, 0x27, 0x80, 0xaa},
1527 	{0x00, 0x30, 0x18, 0xaa},
1528 	{0xb6, 0x00, 0x00, 0xcc},
1529 	{0xb6, 0x03, 0x02, 0xcc},
1530 	{0xb6, 0x02, 0x80, 0xcc},
1531 	{0xb6, 0x05, 0x01, 0xcc},
1532 	{0xb6, 0x04, 0xe0, 0xcc},
1533 	{0xb6, 0x12, 0x78, 0xcc},
1534 	{0xb6, 0x18, 0x02, 0xcc},
1535 	{0xb6, 0x17, 0x58, 0xcc},
1536 	{0xb6, 0x16, 0x00, 0xcc},
1537 	{0xb6, 0x22, 0x12, 0xcc},
1538 	{0xb6, 0x23, 0x0b, 0xcc},
1539 	{0xb3, 0x02, 0x02, 0xcc},
1540 	{0xbf, 0xc0, 0x39, 0xcc},
1541 	{0xbf, 0xc1, 0x04, 0xcc},
1542 	{0xbf, 0xcc, 0x10, 0xcc},
1543 	{0xb6, 0x12, 0xf8, 0xcc},
1544 	{0xb6, 0x13, 0x13, 0xcc},
1545 	{0xb9, 0x12, 0x00, 0xcc},
1546 	{0xb9, 0x13, 0x0a, 0xcc},
1547 	{0xb9, 0x14, 0x0a, 0xcc},
1548 	{0xb9, 0x15, 0x0a, 0xcc},
1549 	{0xb9, 0x16, 0x0a, 0xcc},
1550 	{0xb8, 0x0c, 0x20, 0xcc},
1551 	{0xb8, 0x0d, 0x70, 0xcc},
1552 	{0xb9, 0x18, 0x00, 0xcc},
1553 	{0xb9, 0x19, 0x0f, 0xcc},
1554 	{0xb9, 0x1a, 0x0f, 0xcc},
1555 	{0xb9, 0x1b, 0x0f, 0xcc},
1556 	{0xb9, 0x1c, 0x0f, 0xcc},
1557 	{0xb3, 0x5c, 0x01, 0xcc},
1558 	{}
1559 };
1560 
1561 static const u8 hv7131r_initQVGA_data[][4] = {
1562 	{0xb3, 0x01, 0x01, 0xcc},
1563 	{0xb0, 0x03, 0x19, 0xcc},
1564 	{0xb0, 0x04, 0x02, 0xcc},
1565 	{0x00, 0x00, 0x20, 0xdd},
1566 	{0xb3, 0x00, 0x24, 0xcc},
1567 	{0xb3, 0x00, 0x25, 0xcc},
1568 	{0xb3, 0x08, 0x01, 0xcc},
1569 	{0xb3, 0x09, 0x0c, 0xcc},
1570 	{0xb3, 0x05, 0x01, 0xcc},
1571 	{0xb3, 0x06, 0x03, 0xcc},
1572 	{0xb3, 0x01, 0x45, 0xcc},
1573 	{0xb3, 0x03, 0x0b, 0xcc},
1574 	{0xb3, 0x04, 0x05, 0xcc},
1575 	{0xb3, 0x20, 0x00, 0xcc},
1576 	{0xb3, 0x21, 0x00, 0xcc},
1577 	{0xb3, 0x22, 0x01, 0xcc},
1578 	{0xb3, 0x23, 0xe0, 0xcc},
1579 	{0xb3, 0x14, 0x00, 0xcc},
1580 	{0xb3, 0x15, 0x02, 0xcc},
1581 	{0xb3, 0x16, 0x02, 0xcc},
1582 	{0xb3, 0x17, 0x7f, 0xcc},
1583 	{0xb3, 0x34, 0x01, 0xcc},
1584 	{0xb3, 0x35, 0x91, 0xcc},
1585 	{0xb3, 0x00, 0x27, 0xcc},
1586 	{0xbc, 0x00, 0xd3, 0xcc},
1587 	{0xb8, 0x00, 0x23, 0xcc},
1588 	{0xb8, 0x2c, 0x50, 0xcc},
1589 	{0xb8, 0x2d, 0xf8, 0xcc},
1590 	{0xb8, 0x2e, 0xf8, 0xcc},
1591 	{0xb8, 0x2f, 0xf8, 0xcc},
1592 	{0xb8, 0x30, 0x50, 0xcc},
1593 	{0xb8, 0x31, 0xf8, 0xcc},
1594 	{0xb8, 0x32, 0xf8, 0xcc},
1595 	{0xb8, 0x33, 0xf8, 0xcc},
1596 	{0xb8, 0x34, 0x58, 0xcc},
1597 	{0xb8, 0x35, 0x00, 0xcc},
1598 	{0xb8, 0x36, 0x00, 0xcc},
1599 	{0xb8, 0x37, 0x00, 0xcc},
1600 	{0xb8, 0x27, 0x20, 0xcc},
1601 	{0xb8, 0x01, 0x7d, 0xcc},
1602 	{0xb8, 0x81, 0x09, 0xcc},
1603 	{0xb3, 0x01, 0x41, 0xcc},
1604 	{0xb8, 0x8e, 0x00, 0xcc},
1605 	{0xb8, 0x8f, 0xff, 0xcc},
1606 	{0x00, 0x01, 0x0c, 0xaa},
1607 	{0x00, 0x14, 0x01, 0xaa},
1608 	{0x00, 0x15, 0xe6, 0xaa},
1609 	{0x00, 0x16, 0x02, 0xaa},
1610 	{0x00, 0x17, 0x86, 0xaa},
1611 	{0x00, 0x23, 0x00, 0xaa},
1612 	{0x00, 0x25, 0x03, 0xaa},
1613 	{0x00, 0x26, 0xa9, 0xaa},
1614 	{0x00, 0x27, 0x80, 0xaa},
1615 	{0x00, 0x30, 0x18, 0xaa},
1616 	{0xb6, 0x00, 0x00, 0xcc},
1617 	{0xb6, 0x03, 0x01, 0xcc},
1618 	{0xb6, 0x02, 0x40, 0xcc},
1619 	{0xb6, 0x05, 0x00, 0xcc},
1620 	{0xb6, 0x04, 0xf0, 0xcc},
1621 	{0xb6, 0x12, 0x78, 0xcc},
1622 	{0xb6, 0x18, 0x00, 0xcc},
1623 	{0xb6, 0x17, 0x96, 0xcc},
1624 	{0xb6, 0x16, 0x00, 0xcc},
1625 	{0xb6, 0x22, 0x12, 0xcc},
1626 	{0xb6, 0x23, 0x0b, 0xcc},
1627 	{0xb3, 0x02, 0x02, 0xcc},
1628 	{0xbf, 0xc0, 0x39, 0xcc},
1629 	{0xbf, 0xc1, 0x04, 0xcc},
1630 	{0xbf, 0xcc, 0x10, 0xcc},
1631 	{0xbc, 0x02, 0x18, 0xcc},
1632 	{0xbc, 0x03, 0x50, 0xcc},
1633 	{0xbc, 0x04, 0x18, 0xcc},
1634 	{0xbc, 0x05, 0x00, 0xcc},
1635 	{0xbc, 0x06, 0x00, 0xcc},
1636 	{0xbc, 0x08, 0x30, 0xcc},
1637 	{0xbc, 0x09, 0x40, 0xcc},
1638 	{0xbc, 0x0a, 0x10, 0xcc},
1639 	{0xbc, 0x0b, 0x00, 0xcc},
1640 	{0xbc, 0x0c, 0x00, 0xcc},
1641 	{0xb9, 0x12, 0x00, 0xcc},
1642 	{0xb9, 0x13, 0x0a, 0xcc},
1643 	{0xb9, 0x14, 0x0a, 0xcc},
1644 	{0xb9, 0x15, 0x0a, 0xcc},
1645 	{0xb9, 0x16, 0x0a, 0xcc},
1646 	{0xb9, 0x18, 0x00, 0xcc},
1647 	{0xb9, 0x19, 0x0f, 0xcc},
1648 	{0xb8, 0x0c, 0x20, 0xcc},
1649 	{0xb8, 0x0d, 0x70, 0xcc},
1650 	{0xb9, 0x1a, 0x0f, 0xcc},
1651 	{0xb9, 0x1b, 0x0f, 0xcc},
1652 	{0xb9, 0x1c, 0x0f, 0xcc},
1653 	{0xb6, 0x12, 0xf8, 0xcc},
1654 	{0xb6, 0x13, 0x13, 0xcc},
1655 	{0xb3, 0x5c, 0x01, 0xcc},
1656 	{}
1657 };
1658 
1659 static const u8 ov7660_gamma[17] = {
1660 	0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
1661 	0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
1662 };
1663 static const u8 ov7660_matrix[9] = {
1664 	0x5a, 0xf0, 0xf6, 0xf3, 0x57, 0xf6, 0xf3, 0xef, 0x62
1665 };
1666 static const u8 ov7660_initVGA_data[][4] = {
1667 	{0xb0, 0x4d, 0x00, 0xcc},	{0xb3, 0x01, 0x01, 0xcc},
1668 	{0x00, 0x00, 0x50, 0xdd},
1669 	{0xb0, 0x03, 0x01, 0xcc},
1670 	{0xb3, 0x00, 0x21, 0xcc},	{0xb3, 0x00, 0x26, 0xcc},
1671 	{0xb3, 0x05, 0x01, 0xcc},
1672 	{0xb3, 0x06, 0x03, 0xcc},
1673 	{0xb3, 0x03, 0x1f, 0xcc},	{0xb3, 0x04, 0x05, 0xcc},
1674 	{0xb3, 0x05, 0x00, 0xcc},
1675 	{0xb3, 0x06, 0x01, 0xcc},
1676 	{0xb3, 0x15, 0x00, 0xcc},/* 0xb315  <-0 href startl */
1677 	{0xb3, 0x16, 0x02, 0xcc},	{0xb3, 0x17, 0x7f, 0xcc},
1678 	{0xb3, 0x21, 0x00, 0xcc},
1679 	{0xb3, 0x23, 0xe0, 0xcc},	{0xb3, 0x1d, 0x01, 0xcc},
1680 	{0xb3, 0x1f, 0x02, 0xcc},
1681 	{0xb3, 0x34, 0x01, 0xcc},
1682 	{0xb3, 0x35, 0xa1, 0xcc},	/* i2c add: 21 */
1683 	{0xb3, 0x00, 0x26, 0xcc},
1684 	{0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1685 	{0xb8, 0x01, 0x7d, 0xcc},
1686 	{0xbc, 0x00, 0x73, 0xcc},	{0xb8, 0x81, 0x09, 0xcc},
1687 	{0xb8, 0x27, 0x20, 0xcc},
1688 	{0xb8, 0x8f, 0x50, 0xcc},
1689 	{0x00, 0x01, 0x80, 0xaa},	{0x00, 0x02, 0x80, 0xaa},
1690 	{0x00, 0x12, 0x80, 0xaa},
1691 	{0x00, 0x12, 0x05, 0xaa},
1692 	{0x00, 0x1e, 0x01, 0xaa},	/* MVFP */
1693 	{0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1694 	{0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1695 	{0x00, 0x0d, 0x48, 0xaa},	{0x00, 0x0e, 0x04, 0xaa},
1696 	{0x00, 0x13, 0xa7, 0xaa},
1697 	{0x00, 0x40, 0xc1, 0xaa},	{0x00, 0x35, 0x00, 0xaa},
1698 	{0x00, 0x36, 0x00, 0xaa},
1699 	{0x00, 0x3c, 0x68, 0xaa},	{0x00, 0x1b, 0x05, 0xaa},
1700 	{0x00, 0x39, 0x43, 0xaa},
1701 	{0x00, 0x8d, 0xcf, 0xaa},
1702 	{0x00, 0x8b, 0xcc, 0xaa},	{0x00, 0x8c, 0xcc, 0xaa},
1703 	{0x00, 0x0f, 0x62, 0xaa},
1704 	{0x00, 0x35, 0x84, 0xaa},
1705 	{0x00, 0x3b, 0x08, 0xaa}, /* 0 * Nightframe 1/4 + 50Hz -> 0xC8 */
1706 	{0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1707 	{0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1708 	{0x00, 0x9e, 0x40, 0xaa},	{0xb8, 0x8f, 0x50, 0xcc},
1709 	{0x00, 0x01, 0x80, 0xaa},
1710 	{0x00, 0x02, 0x80, 0xaa},
1711 	{0xb8, 0xfe, 0x00, 0xcc},	{0xb8, 0xff, 0x28, 0xcc},
1712 	{0xb9, 0x00, 0x28, 0xcc},
1713 	{0xb9, 0x01, 0x28, 0xcc},	{0xb9, 0x02, 0x28, 0xcc},
1714 	{0xb9, 0x03, 0x00, 0xcc},
1715 	{0xb9, 0x04, 0x00, 0xcc},
1716 	{0xb9, 0x05, 0x3c, 0xcc},	{0xb9, 0x06, 0x3c, 0xcc},
1717 	{0xb9, 0x07, 0x3c, 0xcc},
1718 	{0xb9, 0x08, 0x3c, 0xcc},
1719 
1720 	{0xb8, 0x8e, 0x00, 0xcc},	{0xb8, 0x8f, 0xff, 0xcc},
1721 
1722 	{0x00, 0x29, 0x3c, 0xaa},	{0xb3, 0x01, 0x45, 0xcc},
1723 	{}
1724 };
1725 static const u8 ov7660_initQVGA_data[][4] = {
1726 	{0xb0, 0x4d, 0x00, 0xcc},	{0xb3, 0x01, 0x01, 0xcc},
1727 	{0x00, 0x00, 0x50, 0xdd},	{0xb0, 0x03, 0x01, 0xcc},
1728 	{0xb3, 0x00, 0x21, 0xcc},	{0xb3, 0x00, 0x26, 0xcc},
1729 	{0xb3, 0x05, 0x01, 0xcc},	{0xb3, 0x06, 0x03, 0xcc},
1730 	{0xb3, 0x03, 0x1f, 0xcc},	{0xb3, 0x04, 0x05, 0xcc},
1731 	{0xb3, 0x05, 0x00, 0xcc},	{0xb3, 0x06, 0x01, 0xcc},
1732 	{0xb3, 0x15, 0x00, 0xcc},/* 0xb315  <-0 href startl */
1733 	{0xb3, 0x16, 0x02, 0xcc},	{0xb3, 0x17, 0x7f, 0xcc},
1734 	{0xb3, 0x21, 0x00, 0xcc},
1735 	{0xb3, 0x23, 0xe0, 0xcc},	{0xb3, 0x1d, 0x01, 0xcc},
1736 	{0xb3, 0x1f, 0x02, 0xcc},	{0xb3, 0x34, 0x01, 0xcc},
1737 	{0xb3, 0x35, 0xa1, 0xcc},	{0xb3, 0x00, 0x26, 0xcc},
1738 	{0xb8, 0x00, 0x33, 0xcc}, /* 13 */
1739 	{0xb8, 0x01, 0x7d, 0xcc},
1740 /* sizer */
1741 	{0xbc, 0x00, 0xd3, 0xcc},
1742 	{0xb8, 0x81, 0x09, 0xcc},	{0xb8, 0x81, 0x09, 0xcc},
1743 	{0xb8, 0x27, 0x20, 0xcc},	{0xb8, 0x8f, 0x50, 0xcc},
1744 	{0x00, 0x01, 0x80, 0xaa},	{0x00, 0x02, 0x80, 0xaa},
1745 	{0x00, 0x12, 0x80, 0xaa},	{0x00, 0x12, 0x05, 0xaa},
1746 	{0x00, 0x1e, 0x01, 0xaa},	/* MVFP */
1747 	{0x00, 0x3d, 0x40, 0xaa}, /* 0x3d <-40 gamma 01 */
1748 	{0x00, 0x41, 0x00, 0xaa}, /* edge 00 */
1749 	{0x00, 0x0d, 0x48, 0xaa},	{0x00, 0x0e, 0x04, 0xaa},
1750 	{0x00, 0x13, 0xa7, 0xaa},
1751 	{0x00, 0x40, 0xc1, 0xaa},	{0x00, 0x35, 0x00, 0xaa},
1752 	{0x00, 0x36, 0x00, 0xaa},
1753 	{0x00, 0x3c, 0x68, 0xaa},	{0x00, 0x1b, 0x05, 0xaa},
1754 	{0x00, 0x39, 0x43, 0xaa},	{0x00, 0x8d, 0xcf, 0xaa},
1755 	{0x00, 0x8b, 0xcc, 0xaa},	{0x00, 0x8c, 0xcc, 0xaa},
1756 	{0x00, 0x0f, 0x62, 0xaa},	{0x00, 0x35, 0x84, 0xaa},
1757 	{0x00, 0x3b, 0x08, 0xaa}, /* 0  * Nightframe 1/4 + 50Hz -> 0xC8 */
1758 	{0x00, 0x3a, 0x00, 0xaa}, /* mx change yuyv format 00, 04, 01; 08, 0c*/
1759 	{0x00, 0x14, 0x2a, 0xaa}, /* agc ampli */
1760 	{0x00, 0x9e, 0x40, 0xaa},	{0xb8, 0x8f, 0x50, 0xcc},
1761 	{0x00, 0x01, 0x80, 0xaa},
1762 	{0x00, 0x02, 0x80, 0xaa},
1763 /* sizer filters */
1764 	{0xbc, 0x02, 0x08, 0xcc},
1765 	{0xbc, 0x03, 0x70, 0xcc},
1766 	{0xb8, 0x35, 0x00, 0xcc},
1767 	{0xb8, 0x36, 0x00, 0xcc},
1768 	{0xb8, 0x37, 0x00, 0xcc},
1769 	{0xbc, 0x04, 0x08, 0xcc},
1770 	{0xbc, 0x05, 0x00, 0xcc},
1771 	{0xbc, 0x06, 0x00, 0xcc},
1772 	{0xbc, 0x08, 0x3c, 0xcc},
1773 	{0xbc, 0x09, 0x40, 0xcc},
1774 	{0xbc, 0x0a, 0x04, 0xcc},
1775 	{0xbc, 0x0b, 0x00, 0xcc},
1776 	{0xbc, 0x0c, 0x00, 0xcc},
1777 /* */
1778 	{0xb8, 0xfe, 0x00, 0xcc},
1779 	{0xb8, 0xff, 0x28, 0xcc},
1780 /* */
1781 	{0xb9, 0x00, 0x28, 0xcc},	{0xb9, 0x01, 0x28, 0xcc},
1782 	{0xb9, 0x02, 0x28, 0xcc},	{0xb9, 0x03, 0x00, 0xcc},
1783 	{0xb9, 0x04, 0x00, 0xcc},	{0xb9, 0x05, 0x3c, 0xcc},
1784 	{0xb9, 0x06, 0x3c, 0xcc},	{0xb9, 0x07, 0x3c, 0xcc},
1785 	{0xb9, 0x08, 0x3c, 0xcc},
1786 /* */
1787 	{0xb8, 0x8e, 0x00, 0xcc},
1788 	{0xb8, 0x8f, 0xff, 0xcc}, /* ff */
1789 	{0x00, 0x29, 0x3c, 0xaa},
1790 	{0xb3, 0x01, 0x45, 0xcc}, /* 45 */
1791 	{}
1792 };
1793 
1794 static const u8 ov7660_50HZ[][4] = {
1795 	{0x00, 0x3b, 0x08, 0xaa},
1796 	{0x00, 0x9d, 0x40, 0xaa},
1797 	{0x00, 0x13, 0xa7, 0xaa},
1798 	{}
1799 };
1800 
1801 static const u8 ov7660_60HZ[][4] = {
1802 	{0x00, 0x3b, 0x00, 0xaa},
1803 	{0x00, 0x9e, 0x40, 0xaa},
1804 	{0x00, 0x13, 0xa7, 0xaa},
1805 	{}
1806 };
1807 
1808 static const u8 ov7660_NoFliker[][4] = {
1809 	{0x00, 0x13, 0x87, 0xaa},
1810 	{}
1811 };
1812 
1813 static const u8 ov7670_InitVGA[][4] = {
1814 	{0xb3, 0x01, 0x05, 0xcc},
1815 	{0x00, 0x00, 0x30, 0xdd},
1816 	{0xb0, 0x03, 0x19, 0xcc},
1817 	{0x00, 0x00, 0x10, 0xdd},
1818 	{0xb0, 0x04, 0x02, 0xcc},
1819 	{0x00, 0x00, 0x10, 0xdd},
1820 	{0xb3, 0x00, 0x66, 0xcc},
1821 	{0xb3, 0x00, 0x67, 0xcc},
1822 	{0xb0, 0x16, 0x01, 0xcc},
1823 	{0xb3, 0x35, 0xa1, 0xcc},	/* i2c add: 21 */
1824 	{0xb3, 0x34, 0x01, 0xcc},
1825 	{0xb3, 0x05, 0x01, 0xcc},
1826 	{0xb3, 0x06, 0x01, 0xcc},
1827 	{0xb3, 0x08, 0x01, 0xcc},
1828 	{0xb3, 0x09, 0x0c, 0xcc},
1829 	{0xb3, 0x02, 0x02, 0xcc},
1830 	{0xb3, 0x03, 0x1f, 0xcc},
1831 	{0xb3, 0x14, 0x00, 0xcc},
1832 	{0xb3, 0x15, 0x00, 0xcc},
1833 	{0xb3, 0x16, 0x02, 0xcc},
1834 	{0xb3, 0x17, 0x7f, 0xcc},
1835 	{0xb3, 0x04, 0x05, 0xcc},
1836 	{0xb3, 0x20, 0x00, 0xcc},
1837 	{0xb3, 0x21, 0x00, 0xcc},
1838 	{0xb3, 0x22, 0x01, 0xcc},
1839 	{0xb3, 0x23, 0xe0, 0xcc},
1840 	{0xbc, 0x00, 0x41, 0xcc},
1841 	{0xbc, 0x01, 0x01, 0xcc},
1842 	{0x00, 0x12, 0x80, 0xaa},
1843 	{0x00, 0x00, 0x20, 0xdd},
1844 	{0x00, 0x12, 0x00, 0xaa},
1845 	{0x00, 0x11, 0x40, 0xaa},
1846 	{0x00, 0x6b, 0x0a, 0xaa},
1847 	{0x00, 0x3a, 0x04, 0xaa},
1848 	{0x00, 0x40, 0xc0, 0xaa},
1849 	{0x00, 0x8c, 0x00, 0xaa},
1850 	{0x00, 0x7a, 0x29, 0xaa},
1851 	{0x00, 0x7b, 0x0e, 0xaa},
1852 	{0x00, 0x7c, 0x1a, 0xaa},
1853 	{0x00, 0x7d, 0x31, 0xaa},
1854 	{0x00, 0x7e, 0x53, 0xaa},
1855 	{0x00, 0x7f, 0x60, 0xaa},
1856 	{0x00, 0x80, 0x6b, 0xaa},
1857 	{0x00, 0x81, 0x73, 0xaa},
1858 	{0x00, 0x82, 0x7b, 0xaa},
1859 	{0x00, 0x83, 0x82, 0xaa},
1860 	{0x00, 0x84, 0x89, 0xaa},
1861 	{0x00, 0x85, 0x96, 0xaa},
1862 	{0x00, 0x86, 0xa1, 0xaa},
1863 	{0x00, 0x87, 0xb7, 0xaa},
1864 	{0x00, 0x88, 0xcc, 0xaa},
1865 	{0x00, 0x89, 0xe1, 0xaa},
1866 	{0x00, 0x13, 0xe0, 0xaa},
1867 	{0x00, 0x00, 0x00, 0xaa},
1868 	{0x00, 0x10, 0x00, 0xaa},
1869 	{0x00, 0x0d, 0x40, 0xaa},
1870 	{0x00, 0x14, 0x28, 0xaa},
1871 	{0x00, 0xa5, 0x05, 0xaa},
1872 	{0x00, 0xab, 0x07, 0xaa},
1873 	{0x00, 0x24, 0x95, 0xaa},
1874 	{0x00, 0x25, 0x33, 0xaa},
1875 	{0x00, 0x26, 0xe3, 0xaa},
1876 	{0x00, 0x9f, 0x88, 0xaa},
1877 	{0x00, 0xa0, 0x78, 0xaa},
1878 	{0x00, 0x55, 0x90, 0xaa},
1879 	{0x00, 0xa1, 0x03, 0xaa},
1880 	{0x00, 0xa6, 0xe0, 0xaa},
1881 	{0x00, 0xa7, 0xd8, 0xaa},
1882 	{0x00, 0xa8, 0xf0, 0xaa},
1883 	{0x00, 0xa9, 0x90, 0xaa},
1884 	{0x00, 0xaa, 0x14, 0xaa},
1885 	{0x00, 0x13, 0xe5, 0xaa},
1886 	{0x00, 0x0e, 0x61, 0xaa},
1887 	{0x00, 0x0f, 0x4b, 0xaa},
1888 	{0x00, 0x16, 0x02, 0xaa},
1889 	{0x00, 0x1e, 0x07, 0xaa},	/* MVFP */
1890 	{0x00, 0x21, 0x02, 0xaa},
1891 	{0x00, 0x22, 0x91, 0xaa},
1892 	{0x00, 0x29, 0x07, 0xaa},
1893 	{0x00, 0x33, 0x0b, 0xaa},
1894 	{0x00, 0x35, 0x0b, 0xaa},
1895 	{0x00, 0x37, 0x1d, 0xaa},
1896 	{0x00, 0x38, 0x71, 0xaa},
1897 	{0x00, 0x39, 0x2a, 0xaa},
1898 	{0x00, 0x3c, 0x78, 0xaa},
1899 	{0x00, 0x4d, 0x40, 0xaa},
1900 	{0x00, 0x4e, 0x20, 0xaa},
1901 	{0x00, 0x74, 0x19, 0xaa},
1902 	{0x00, 0x8d, 0x4f, 0xaa},
1903 	{0x00, 0x8e, 0x00, 0xaa},
1904 	{0x00, 0x8f, 0x00, 0xaa},
1905 	{0x00, 0x90, 0x00, 0xaa},
1906 	{0x00, 0x91, 0x00, 0xaa},
1907 	{0x00, 0x96, 0x00, 0xaa},
1908 	{0x00, 0x9a, 0x80, 0xaa},
1909 	{0x00, 0xb0, 0x84, 0xaa},
1910 	{0x00, 0xb1, 0x0c, 0xaa},
1911 	{0x00, 0xb2, 0x0e, 0xaa},
1912 	{0x00, 0xb3, 0x82, 0xaa},
1913 	{0x00, 0xb8, 0x0a, 0xaa},
1914 	{0x00, 0x43, 0x14, 0xaa},
1915 	{0x00, 0x44, 0xf0, 0xaa},
1916 	{0x00, 0x45, 0x45, 0xaa},
1917 	{0x00, 0x46, 0x63, 0xaa},
1918 	{0x00, 0x47, 0x2d, 0xaa},
1919 	{0x00, 0x48, 0x46, 0xaa},
1920 	{0x00, 0x59, 0x88, 0xaa},
1921 	{0x00, 0x5a, 0xa0, 0xaa},
1922 	{0x00, 0x5b, 0xc6, 0xaa},
1923 	{0x00, 0x5c, 0x7d, 0xaa},
1924 	{0x00, 0x5d, 0x5f, 0xaa},
1925 	{0x00, 0x5e, 0x19, 0xaa},
1926 	{0x00, 0x6c, 0x0a, 0xaa},
1927 	{0x00, 0x6d, 0x55, 0xaa},
1928 	{0x00, 0x6e, 0x11, 0xaa},
1929 	{0x00, 0x6f, 0x9e, 0xaa},
1930 	{0x00, 0x69, 0x00, 0xaa},
1931 	{0x00, 0x6a, 0x40, 0xaa},
1932 	{0x00, 0x01, 0x40, 0xaa},
1933 	{0x00, 0x02, 0x40, 0xaa},
1934 	{0x00, 0x13, 0xe7, 0xaa},
1935 	{0x00, 0x5f, 0xf0, 0xaa},
1936 	{0x00, 0x60, 0xf0, 0xaa},
1937 	{0x00, 0x61, 0xf0, 0xaa},
1938 	{0x00, 0x27, 0xa0, 0xaa},
1939 	{0x00, 0x28, 0x80, 0xaa},
1940 	{0x00, 0x2c, 0x90, 0xaa},
1941 	{0x00, 0x4f, 0x66, 0xaa},
1942 	{0x00, 0x50, 0x66, 0xaa},
1943 	{0x00, 0x51, 0x00, 0xaa},
1944 	{0x00, 0x52, 0x22, 0xaa},
1945 	{0x00, 0x53, 0x5e, 0xaa},
1946 	{0x00, 0x54, 0x80, 0xaa},
1947 	{0x00, 0x58, 0x9e, 0xaa},
1948 	{0x00, 0x41, 0x08, 0xaa},
1949 	{0x00, 0x3f, 0x00, 0xaa},
1950 	{0x00, 0x75, 0x85, 0xaa},
1951 	{0x00, 0x76, 0xe1, 0xaa},
1952 	{0x00, 0x4c, 0x00, 0xaa},
1953 	{0x00, 0x77, 0x0a, 0xaa},
1954 	{0x00, 0x3d, 0x88, 0xaa},
1955 	{0x00, 0x4b, 0x09, 0xaa},
1956 	{0x00, 0xc9, 0x60, 0xaa},
1957 	{0x00, 0x41, 0x38, 0xaa},
1958 	{0x00, 0x62, 0x30, 0xaa},
1959 	{0x00, 0x63, 0x30, 0xaa},
1960 	{0x00, 0x64, 0x08, 0xaa},
1961 	{0x00, 0x94, 0x07, 0xaa},
1962 	{0x00, 0x95, 0x0b, 0xaa},
1963 	{0x00, 0x65, 0x00, 0xaa},
1964 	{0x00, 0x66, 0x05, 0xaa},
1965 	{0x00, 0x56, 0x50, 0xaa},
1966 	{0x00, 0x34, 0x11, 0xaa},
1967 	{0x00, 0xa4, 0x88, 0xaa},
1968 	{0x00, 0x96, 0x00, 0xaa},
1969 	{0x00, 0x97, 0x30, 0xaa},
1970 	{0x00, 0x98, 0x20, 0xaa},
1971 	{0x00, 0x99, 0x30, 0xaa},
1972 	{0x00, 0x9a, 0x84, 0xaa},
1973 	{0x00, 0x9b, 0x29, 0xaa},
1974 	{0x00, 0x9c, 0x03, 0xaa},
1975 	{0x00, 0x78, 0x04, 0xaa},
1976 	{0x00, 0x79, 0x01, 0xaa},
1977 	{0x00, 0xc8, 0xf0, 0xaa},
1978 	{0x00, 0x79, 0x0f, 0xaa},
1979 	{0x00, 0xc8, 0x00, 0xaa},
1980 	{0x00, 0x79, 0x10, 0xaa},
1981 	{0x00, 0xc8, 0x7e, 0xaa},
1982 	{0x00, 0x79, 0x0a, 0xaa},
1983 	{0x00, 0xc8, 0x80, 0xaa},
1984 	{0x00, 0x79, 0x0b, 0xaa},
1985 	{0x00, 0xc8, 0x01, 0xaa},
1986 	{0x00, 0x79, 0x0c, 0xaa},
1987 	{0x00, 0xc8, 0x0f, 0xaa},
1988 	{0x00, 0x79, 0x0d, 0xaa},
1989 	{0x00, 0xc8, 0x20, 0xaa},
1990 	{0x00, 0x79, 0x09, 0xaa},
1991 	{0x00, 0xc8, 0x80, 0xaa},
1992 	{0x00, 0x79, 0x02, 0xaa},
1993 	{0x00, 0xc8, 0xc0, 0xaa},
1994 	{0x00, 0x79, 0x03, 0xaa},
1995 	{0x00, 0xc8, 0x40, 0xaa},
1996 	{0x00, 0x79, 0x05, 0xaa},
1997 	{0x00, 0xc8, 0x30, 0xaa},
1998 	{0x00, 0x79, 0x26, 0xaa},
1999 	{0x00, 0x11, 0x40, 0xaa},
2000 	{0x00, 0x3a, 0x04, 0xaa},
2001 	{0x00, 0x12, 0x00, 0xaa},
2002 	{0x00, 0x40, 0xc0, 0xaa},
2003 	{0x00, 0x8c, 0x00, 0xaa},
2004 	{0x00, 0x17, 0x14, 0xaa},
2005 	{0x00, 0x18, 0x02, 0xaa},
2006 	{0x00, 0x32, 0x92, 0xaa},
2007 	{0x00, 0x19, 0x02, 0xaa},
2008 	{0x00, 0x1a, 0x7a, 0xaa},
2009 	{0x00, 0x03, 0x0a, 0xaa},
2010 	{0x00, 0x0c, 0x00, 0xaa},
2011 	{0x00, 0x3e, 0x00, 0xaa},
2012 	{0x00, 0x70, 0x3a, 0xaa},
2013 	{0x00, 0x71, 0x35, 0xaa},
2014 	{0x00, 0x72, 0x11, 0xaa},
2015 	{0x00, 0x73, 0xf0, 0xaa},
2016 	{0x00, 0xa2, 0x02, 0xaa},
2017 	{0x00, 0xb1, 0x00, 0xaa},
2018 	{0x00, 0xb1, 0x0c, 0xaa},
2019 	{0x00, 0x1e, 0x37, 0xaa},	/* MVFP */
2020 	{0x00, 0xaa, 0x14, 0xaa},
2021 	{0x00, 0x24, 0x80, 0xaa},
2022 	{0x00, 0x25, 0x74, 0xaa},
2023 	{0x00, 0x26, 0xd3, 0xaa},
2024 	{0x00, 0x0d, 0x00, 0xaa},
2025 	{0x00, 0x14, 0x18, 0xaa},
2026 	{0x00, 0x9d, 0x99, 0xaa},
2027 	{0x00, 0x9e, 0x7f, 0xaa},
2028 	{0x00, 0x64, 0x08, 0xaa},
2029 	{0x00, 0x94, 0x07, 0xaa},
2030 	{0x00, 0x95, 0x06, 0xaa},
2031 	{0x00, 0x66, 0x05, 0xaa},
2032 	{0x00, 0x41, 0x08, 0xaa},
2033 	{0x00, 0x3f, 0x00, 0xaa},
2034 	{0x00, 0x75, 0x07, 0xaa},
2035 	{0x00, 0x76, 0xe1, 0xaa},
2036 	{0x00, 0x4c, 0x00, 0xaa},
2037 	{0x00, 0x77, 0x00, 0xaa},
2038 	{0x00, 0x3d, 0xc2, 0xaa},
2039 	{0x00, 0x4b, 0x09, 0xaa},
2040 	{0x00, 0xc9, 0x60, 0xaa},
2041 	{0x00, 0x41, 0x38, 0xaa},
2042 	{0xbf, 0xc0, 0x26, 0xcc},
2043 	{0xbf, 0xc1, 0x02, 0xcc},
2044 	{0xbf, 0xcc, 0x04, 0xcc},
2045 	{0xb3, 0x5c, 0x01, 0xcc},
2046 	{0xb3, 0x01, 0x45, 0xcc},
2047 	{0x00, 0x77, 0x05, 0xaa},
2048 	{},
2049 };
2050 
2051 static const u8 ov7670_InitQVGA[][4] = {
2052 	{0xb3, 0x01, 0x05, 0xcc},
2053 	{0x00, 0x00, 0x30, 0xdd},
2054 	{0xb0, 0x03, 0x19, 0xcc},
2055 	{0x00, 0x00, 0x10, 0xdd},
2056 	{0xb0, 0x04, 0x02, 0xcc},
2057 	{0x00, 0x00, 0x10, 0xdd},
2058 	{0xb3, 0x00, 0x66, 0xcc},
2059 	{0xb3, 0x00, 0x67, 0xcc},
2060 	{0xb0, 0x16, 0x01, 0xcc},
2061 	{0xb3, 0x35, 0xa1, 0xcc},	/* i2c add: 21 */
2062 	{0xb3, 0x34, 0x01, 0xcc},
2063 	{0xb3, 0x05, 0x01, 0xcc},
2064 	{0xb3, 0x06, 0x01, 0xcc},
2065 	{0xb3, 0x08, 0x01, 0xcc},
2066 	{0xb3, 0x09, 0x0c, 0xcc},
2067 	{0xb3, 0x02, 0x02, 0xcc},
2068 	{0xb3, 0x03, 0x1f, 0xcc},
2069 	{0xb3, 0x14, 0x00, 0xcc},
2070 	{0xb3, 0x15, 0x00, 0xcc},
2071 	{0xb3, 0x16, 0x02, 0xcc},
2072 	{0xb3, 0x17, 0x7f, 0xcc},
2073 	{0xb3, 0x04, 0x05, 0xcc},
2074 	{0xb3, 0x20, 0x00, 0xcc},
2075 	{0xb3, 0x21, 0x00, 0xcc},
2076 	{0xb3, 0x22, 0x01, 0xcc},
2077 	{0xb3, 0x23, 0xe0, 0xcc},
2078 	{0xbc, 0x00, 0xd1, 0xcc},
2079 	{0xbc, 0x01, 0x01, 0xcc},
2080 	{0x00, 0x12, 0x80, 0xaa},
2081 	{0x00, 0x00, 0x20, 0xdd},
2082 	{0x00, 0x12, 0x00, 0xaa},
2083 	{0x00, 0x11, 0x40, 0xaa},
2084 	{0x00, 0x6b, 0x0a, 0xaa},
2085 	{0x00, 0x3a, 0x04, 0xaa},
2086 	{0x00, 0x40, 0xc0, 0xaa},
2087 	{0x00, 0x8c, 0x00, 0xaa},
2088 	{0x00, 0x7a, 0x29, 0xaa},
2089 	{0x00, 0x7b, 0x0e, 0xaa},
2090 	{0x00, 0x7c, 0x1a, 0xaa},
2091 	{0x00, 0x7d, 0x31, 0xaa},
2092 	{0x00, 0x7e, 0x53, 0xaa},
2093 	{0x00, 0x7f, 0x60, 0xaa},
2094 	{0x00, 0x80, 0x6b, 0xaa},
2095 	{0x00, 0x81, 0x73, 0xaa},
2096 	{0x00, 0x82, 0x7b, 0xaa},
2097 	{0x00, 0x83, 0x82, 0xaa},
2098 	{0x00, 0x84, 0x89, 0xaa},
2099 	{0x00, 0x85, 0x96, 0xaa},
2100 	{0x00, 0x86, 0xa1, 0xaa},
2101 	{0x00, 0x87, 0xb7, 0xaa},
2102 	{0x00, 0x88, 0xcc, 0xaa},
2103 	{0x00, 0x89, 0xe1, 0xaa},
2104 	{0x00, 0x13, 0xe0, 0xaa},
2105 	{0x00, 0x00, 0x00, 0xaa},
2106 	{0x00, 0x10, 0x00, 0xaa},
2107 	{0x00, 0x0d, 0x40, 0xaa},
2108 	{0x00, 0x14, 0x28, 0xaa},
2109 	{0x00, 0xa5, 0x05, 0xaa},
2110 	{0x00, 0xab, 0x07, 0xaa},
2111 	{0x00, 0x24, 0x95, 0xaa},
2112 	{0x00, 0x25, 0x33, 0xaa},
2113 	{0x00, 0x26, 0xe3, 0xaa},
2114 	{0x00, 0x9f, 0x88, 0xaa},
2115 	{0x00, 0xa0, 0x78, 0xaa},
2116 	{0x00, 0x55, 0x90, 0xaa},
2117 	{0x00, 0xa1, 0x03, 0xaa},
2118 	{0x00, 0xa6, 0xe0, 0xaa},
2119 	{0x00, 0xa7, 0xd8, 0xaa},
2120 	{0x00, 0xa8, 0xf0, 0xaa},
2121 	{0x00, 0xa9, 0x90, 0xaa},
2122 	{0x00, 0xaa, 0x14, 0xaa},
2123 	{0x00, 0x13, 0xe5, 0xaa},
2124 	{0x00, 0x0e, 0x61, 0xaa},
2125 	{0x00, 0x0f, 0x4b, 0xaa},
2126 	{0x00, 0x16, 0x02, 0xaa},
2127 	{0x00, 0x1e, 0x07, 0xaa},	/* MVFP */
2128 	{0x00, 0x21, 0x02, 0xaa},
2129 	{0x00, 0x22, 0x91, 0xaa},
2130 	{0x00, 0x29, 0x07, 0xaa},
2131 	{0x00, 0x33, 0x0b, 0xaa},
2132 	{0x00, 0x35, 0x0b, 0xaa},
2133 	{0x00, 0x37, 0x1d, 0xaa},
2134 	{0x00, 0x38, 0x71, 0xaa},
2135 	{0x00, 0x39, 0x2a, 0xaa},
2136 	{0x00, 0x3c, 0x78, 0xaa},
2137 	{0x00, 0x4d, 0x40, 0xaa},
2138 	{0x00, 0x4e, 0x20, 0xaa},
2139 	{0x00, 0x74, 0x19, 0xaa},
2140 	{0x00, 0x8d, 0x4f, 0xaa},
2141 	{0x00, 0x8e, 0x00, 0xaa},
2142 	{0x00, 0x8f, 0x00, 0xaa},
2143 	{0x00, 0x90, 0x00, 0xaa},
2144 	{0x00, 0x91, 0x00, 0xaa},
2145 	{0x00, 0x96, 0x00, 0xaa},
2146 	{0x00, 0x9a, 0x80, 0xaa},
2147 	{0x00, 0xb0, 0x84, 0xaa},
2148 	{0x00, 0xb1, 0x0c, 0xaa},
2149 	{0x00, 0xb2, 0x0e, 0xaa},
2150 	{0x00, 0xb3, 0x82, 0xaa},
2151 	{0x00, 0xb8, 0x0a, 0xaa},
2152 	{0x00, 0x43, 0x14, 0xaa},
2153 	{0x00, 0x44, 0xf0, 0xaa},
2154 	{0x00, 0x45, 0x45, 0xaa},
2155 	{0x00, 0x46, 0x63, 0xaa},
2156 	{0x00, 0x47, 0x2d, 0xaa},
2157 	{0x00, 0x48, 0x46, 0xaa},
2158 	{0x00, 0x59, 0x88, 0xaa},
2159 	{0x00, 0x5a, 0xa0, 0xaa},
2160 	{0x00, 0x5b, 0xc6, 0xaa},
2161 	{0x00, 0x5c, 0x7d, 0xaa},
2162 	{0x00, 0x5d, 0x5f, 0xaa},
2163 	{0x00, 0x5e, 0x19, 0xaa},
2164 	{0x00, 0x6c, 0x0a, 0xaa},
2165 	{0x00, 0x6d, 0x55, 0xaa},
2166 	{0x00, 0x6e, 0x11, 0xaa},
2167 	{0x00, 0x6f, 0x9e, 0xaa},
2168 	{0x00, 0x69, 0x00, 0xaa},
2169 	{0x00, 0x6a, 0x40, 0xaa},
2170 	{0x00, 0x01, 0x40, 0xaa},
2171 	{0x00, 0x02, 0x40, 0xaa},
2172 	{0x00, 0x13, 0xe7, 0xaa},
2173 	{0x00, 0x5f, 0xf0, 0xaa},
2174 	{0x00, 0x60, 0xf0, 0xaa},
2175 	{0x00, 0x61, 0xf0, 0xaa},
2176 	{0x00, 0x27, 0xa0, 0xaa},
2177 	{0x00, 0x28, 0x80, 0xaa},
2178 	{0x00, 0x2c, 0x90, 0xaa},
2179 	{0x00, 0x4f, 0x66, 0xaa},
2180 	{0x00, 0x50, 0x66, 0xaa},
2181 	{0x00, 0x51, 0x00, 0xaa},
2182 	{0x00, 0x52, 0x22, 0xaa},
2183 	{0x00, 0x53, 0x5e, 0xaa},
2184 	{0x00, 0x54, 0x80, 0xaa},
2185 	{0x00, 0x58, 0x9e, 0xaa},
2186 	{0x00, 0x41, 0x08, 0xaa},
2187 	{0x00, 0x3f, 0x00, 0xaa},
2188 	{0x00, 0x75, 0x85, 0xaa},
2189 	{0x00, 0x76, 0xe1, 0xaa},
2190 	{0x00, 0x4c, 0x00, 0xaa},
2191 	{0x00, 0x77, 0x0a, 0xaa},
2192 	{0x00, 0x3d, 0x88, 0xaa},
2193 	{0x00, 0x4b, 0x09, 0xaa},
2194 	{0x00, 0xc9, 0x60, 0xaa},
2195 	{0x00, 0x41, 0x38, 0xaa},
2196 	{0x00, 0x62, 0x30, 0xaa},
2197 	{0x00, 0x63, 0x30, 0xaa},
2198 	{0x00, 0x64, 0x08, 0xaa},
2199 	{0x00, 0x94, 0x07, 0xaa},
2200 	{0x00, 0x95, 0x0b, 0xaa},
2201 	{0x00, 0x65, 0x00, 0xaa},
2202 	{0x00, 0x66, 0x05, 0xaa},
2203 	{0x00, 0x56, 0x50, 0xaa},
2204 	{0x00, 0x34, 0x11, 0xaa},
2205 	{0x00, 0xa4, 0x88, 0xaa},
2206 	{0x00, 0x96, 0x00, 0xaa},
2207 	{0x00, 0x97, 0x30, 0xaa},
2208 	{0x00, 0x98, 0x20, 0xaa},
2209 	{0x00, 0x99, 0x30, 0xaa},
2210 	{0x00, 0x9a, 0x84, 0xaa},
2211 	{0x00, 0x9b, 0x29, 0xaa},
2212 	{0x00, 0x9c, 0x03, 0xaa},
2213 	{0x00, 0x78, 0x04, 0xaa},
2214 	{0x00, 0x79, 0x01, 0xaa},
2215 	{0x00, 0xc8, 0xf0, 0xaa},
2216 	{0x00, 0x79, 0x0f, 0xaa},
2217 	{0x00, 0xc8, 0x00, 0xaa},
2218 	{0x00, 0x79, 0x10, 0xaa},
2219 	{0x00, 0xc8, 0x7e, 0xaa},
2220 	{0x00, 0x79, 0x0a, 0xaa},
2221 	{0x00, 0xc8, 0x80, 0xaa},
2222 	{0x00, 0x79, 0x0b, 0xaa},
2223 	{0x00, 0xc8, 0x01, 0xaa},
2224 	{0x00, 0x79, 0x0c, 0xaa},
2225 	{0x00, 0xc8, 0x0f, 0xaa},
2226 	{0x00, 0x79, 0x0d, 0xaa},
2227 	{0x00, 0xc8, 0x20, 0xaa},
2228 	{0x00, 0x79, 0x09, 0xaa},
2229 	{0x00, 0xc8, 0x80, 0xaa},
2230 	{0x00, 0x79, 0x02, 0xaa},
2231 	{0x00, 0xc8, 0xc0, 0xaa},
2232 	{0x00, 0x79, 0x03, 0xaa},
2233 	{0x00, 0xc8, 0x40, 0xaa},
2234 	{0x00, 0x79, 0x05, 0xaa},
2235 	{0x00, 0xc8, 0x30, 0xaa},
2236 	{0x00, 0x79, 0x26, 0xaa},
2237 	{0x00, 0x11, 0x40, 0xaa},
2238 	{0x00, 0x3a, 0x04, 0xaa},
2239 	{0x00, 0x12, 0x00, 0xaa},
2240 	{0x00, 0x40, 0xc0, 0xaa},
2241 	{0x00, 0x8c, 0x00, 0xaa},
2242 	{0x00, 0x17, 0x14, 0xaa},
2243 	{0x00, 0x18, 0x02, 0xaa},
2244 	{0x00, 0x32, 0x92, 0xaa},
2245 	{0x00, 0x19, 0x02, 0xaa},
2246 	{0x00, 0x1a, 0x7a, 0xaa},
2247 	{0x00, 0x03, 0x0a, 0xaa},
2248 	{0x00, 0x0c, 0x00, 0xaa},
2249 	{0x00, 0x3e, 0x00, 0xaa},
2250 	{0x00, 0x70, 0x3a, 0xaa},
2251 	{0x00, 0x71, 0x35, 0xaa},
2252 	{0x00, 0x72, 0x11, 0xaa},
2253 	{0x00, 0x73, 0xf0, 0xaa},
2254 	{0x00, 0xa2, 0x02, 0xaa},
2255 	{0x00, 0xb1, 0x00, 0xaa},
2256 	{0x00, 0xb1, 0x0c, 0xaa},
2257 	{0x00, 0x1e, 0x37, 0xaa},	/* MVFP */
2258 	{0x00, 0xaa, 0x14, 0xaa},
2259 	{0x00, 0x24, 0x80, 0xaa},
2260 	{0x00, 0x25, 0x74, 0xaa},
2261 	{0x00, 0x26, 0xd3, 0xaa},
2262 	{0x00, 0x0d, 0x00, 0xaa},
2263 	{0x00, 0x14, 0x18, 0xaa},
2264 	{0x00, 0x9d, 0x99, 0xaa},
2265 	{0x00, 0x9e, 0x7f, 0xaa},
2266 	{0x00, 0x64, 0x08, 0xaa},
2267 	{0x00, 0x94, 0x07, 0xaa},
2268 	{0x00, 0x95, 0x06, 0xaa},
2269 	{0x00, 0x66, 0x05, 0xaa},
2270 	{0x00, 0x41, 0x08, 0xaa},
2271 	{0x00, 0x3f, 0x00, 0xaa},
2272 	{0x00, 0x75, 0x07, 0xaa},
2273 	{0x00, 0x76, 0xe1, 0xaa},
2274 	{0x00, 0x4c, 0x00, 0xaa},
2275 	{0x00, 0x77, 0x00, 0xaa},
2276 	{0x00, 0x3d, 0xc2, 0xaa},
2277 	{0x00, 0x4b, 0x09, 0xaa},
2278 	{0x00, 0xc9, 0x60, 0xaa},
2279 	{0x00, 0x41, 0x38, 0xaa},
2280 	{0xbc, 0x02, 0x18, 0xcc},
2281 	{0xbc, 0x03, 0x50, 0xcc},
2282 	{0xbc, 0x04, 0x18, 0xcc},
2283 	{0xbc, 0x05, 0x00, 0xcc},
2284 	{0xbc, 0x06, 0x00, 0xcc},
2285 	{0xbc, 0x08, 0x30, 0xcc},
2286 	{0xbc, 0x09, 0x40, 0xcc},
2287 	{0xbc, 0x0a, 0x10, 0xcc},
2288 	{0xbc, 0x0b, 0x00, 0xcc},
2289 	{0xbc, 0x0c, 0x00, 0xcc},
2290 	{0xbf, 0xc0, 0x26, 0xcc},
2291 	{0xbf, 0xc1, 0x02, 0xcc},
2292 	{0xbf, 0xcc, 0x04, 0xcc},
2293 	{0xb3, 0x5c, 0x01, 0xcc},
2294 	{0xb3, 0x01, 0x45, 0xcc},
2295 	{0x00, 0x77, 0x05, 0xaa},
2296 	{},
2297 };
2298 
2299 /* PO1200 - values from usbvm326.inf and ms-win trace */
2300 static const u8 po1200_gamma[17] = {
2301 	0x00, 0x13, 0x38, 0x59, 0x79, 0x92, 0xa7, 0xb9, 0xc8,
2302 	0xd4, 0xdf, 0xe7, 0xee, 0xf4, 0xf9, 0xfc, 0xff
2303 };
2304 static const u8 po1200_matrix[9] = {
2305 	0x60, 0xf9, 0xe5, 0xe7, 0x50, 0x05, 0xf3, 0xe6, 0x5e
2306 };
2307 static const u8 po1200_initVGA_data[][4] = {
2308 	{0xb0, 0x03, 0x19, 0xcc},	/* reset? */
2309 	{0xb0, 0x03, 0x19, 0xcc},
2310 /*	{0x00, 0x00, 0x33, 0xdd}, */
2311 	{0xb0, 0x04, 0x02, 0xcc},
2312 	{0xb0, 0x02, 0x02, 0xcc},
2313 	{0xb3, 0x5d, 0x00, 0xcc},
2314 	{0xb3, 0x01, 0x01, 0xcc},
2315 	{0xb3, 0x00, 0x64, 0xcc},
2316 	{0xb3, 0x00, 0x65, 0xcc},
2317 	{0xb3, 0x05, 0x01, 0xcc},
2318 	{0xb3, 0x06, 0x01, 0xcc},
2319 	{0xb3, 0x5c, 0x01, 0xcc},
2320 	{0xb3, 0x08, 0x01, 0xcc},
2321 	{0xb3, 0x09, 0x0c, 0xcc},
2322 	{0xb3, 0x00, 0x67, 0xcc},
2323 	{0xb3, 0x02, 0xb2, 0xcc},
2324 	{0xb3, 0x03, 0x18, 0xcc},
2325 	{0xb3, 0x04, 0x15, 0xcc},
2326 	{0xb3, 0x20, 0x00, 0xcc},
2327 	{0xb3, 0x21, 0x00, 0xcc},
2328 	{0xb3, 0x22, 0x02, 0xcc},
2329 	{0xb3, 0x23, 0x58, 0xcc},
2330 	{0xb3, 0x14, 0x00, 0xcc},
2331 	{0xb3, 0x15, 0x00, 0xcc},
2332 	{0xb3, 0x16, 0x03, 0xcc},
2333 	{0xb3, 0x17, 0x1f, 0xcc},
2334 	{0xbc, 0x00, 0x71, 0xcc},
2335 	{0xbc, 0x01, 0x01, 0xcc},
2336 	{0xb0, 0x54, 0x13, 0xcc},
2337 	{0xb3, 0x00, 0x67, 0xcc},
2338 	{0xb3, 0x34, 0x01, 0xcc},
2339 	{0xb3, 0x35, 0xdc, 0xcc},	/* i2c add: 5c */
2340 	{0x00, 0x03, 0x00, 0xaa},
2341 	{0x00, 0x12, 0x05, 0xaa},
2342 	{0x00, 0x13, 0x02, 0xaa},
2343 	{0x00, 0x1e, 0xc6, 0xaa},	/* h/v flip */
2344 	{0x00, 0x21, 0x00, 0xaa},
2345 	{0x00, 0x25, 0x02, 0xaa},
2346 	{0x00, 0x3c, 0x4f, 0xaa},
2347 	{0x00, 0x3f, 0xe0, 0xaa},
2348 	{0x00, 0x42, 0xff, 0xaa},
2349 	{0x00, 0x45, 0x34, 0xaa},
2350 	{0x00, 0x55, 0xfe, 0xaa},
2351 	{0x00, 0x59, 0xd3, 0xaa},
2352 	{0x00, 0x5e, 0x04, 0xaa},
2353 	{0x00, 0x61, 0xb8, 0xaa},	/* sharpness */
2354 	{0x00, 0x62, 0x02, 0xaa},
2355 	{0x00, 0xa7, 0x31, 0xaa},
2356 	{0x00, 0xa9, 0x66, 0xaa},
2357 	{0x00, 0xb0, 0x00, 0xaa},
2358 	{0x00, 0xb1, 0x00, 0xaa},
2359 	{0x00, 0xb3, 0x11, 0xaa},
2360 	{0x00, 0xb6, 0x26, 0xaa},
2361 	{0x00, 0xb7, 0x20, 0xaa},
2362 	{0x00, 0xba, 0x04, 0xaa},
2363 	{0x00, 0x88, 0x42, 0xaa},
2364 	{0x00, 0x89, 0x9a, 0xaa},
2365 	{0x00, 0x8a, 0x88, 0xaa},
2366 	{0x00, 0x8b, 0x8e, 0xaa},
2367 	{0x00, 0x8c, 0x3e, 0xaa},
2368 	{0x00, 0x8d, 0x90, 0xaa},
2369 	{0x00, 0x8e, 0x87, 0xaa},
2370 	{0x00, 0x8f, 0x96, 0xaa},
2371 	{0x00, 0x90, 0x3d, 0xaa},
2372 	{0x00, 0x64, 0x00, 0xaa},
2373 	{0x00, 0x65, 0x10, 0xaa},
2374 	{0x00, 0x66, 0x20, 0xaa},
2375 	{0x00, 0x67, 0x2b, 0xaa},
2376 	{0x00, 0x68, 0x36, 0xaa},
2377 	{0x00, 0x69, 0x49, 0xaa},
2378 	{0x00, 0x6a, 0x5a, 0xaa},
2379 	{0x00, 0x6b, 0x7f, 0xaa},
2380 	{0x00, 0x6c, 0x9b, 0xaa},
2381 	{0x00, 0x6d, 0xba, 0xaa},
2382 	{0x00, 0x6e, 0xd4, 0xaa},
2383 	{0x00, 0x6f, 0xea, 0xaa},
2384 	{0x00, 0x70, 0x00, 0xaa},
2385 	{0x00, 0x71, 0x10, 0xaa},
2386 	{0x00, 0x72, 0x20, 0xaa},
2387 	{0x00, 0x73, 0x2b, 0xaa},
2388 	{0x00, 0x74, 0x36, 0xaa},
2389 	{0x00, 0x75, 0x49, 0xaa},
2390 	{0x00, 0x76, 0x5a, 0xaa},
2391 	{0x00, 0x77, 0x7f, 0xaa},
2392 	{0x00, 0x78, 0x9b, 0xaa},
2393 	{0x00, 0x79, 0xba, 0xaa},
2394 	{0x00, 0x7a, 0xd4, 0xaa},
2395 	{0x00, 0x7b, 0xea, 0xaa},
2396 	{0x00, 0x7c, 0x00, 0xaa},
2397 	{0x00, 0x7d, 0x10, 0xaa},
2398 	{0x00, 0x7e, 0x20, 0xaa},
2399 	{0x00, 0x7f, 0x2b, 0xaa},
2400 	{0x00, 0x80, 0x36, 0xaa},
2401 	{0x00, 0x81, 0x49, 0xaa},
2402 	{0x00, 0x82, 0x5a, 0xaa},
2403 	{0x00, 0x83, 0x7f, 0xaa},
2404 	{0x00, 0x84, 0x9b, 0xaa},
2405 	{0x00, 0x85, 0xba, 0xaa},
2406 	{0x00, 0x86, 0xd4, 0xaa},
2407 	{0x00, 0x87, 0xea, 0xaa},
2408 	{0x00, 0x57, 0x2a, 0xaa},
2409 	{0x00, 0x03, 0x01, 0xaa},
2410 	{0x00, 0x04, 0x10, 0xaa},
2411 	{0x00, 0x05, 0x10, 0xaa},
2412 	{0x00, 0x06, 0x10, 0xaa},
2413 	{0x00, 0x07, 0x10, 0xaa},
2414 	{0x00, 0x08, 0x13, 0xaa},
2415 	{0x00, 0x0a, 0x00, 0xaa},
2416 	{0x00, 0x0b, 0x10, 0xaa},
2417 	{0x00, 0x0c, 0x20, 0xaa},
2418 	{0x00, 0x0d, 0x18, 0xaa},
2419 	{0x00, 0x22, 0x01, 0xaa},
2420 	{0x00, 0x23, 0x60, 0xaa},
2421 	{0x00, 0x25, 0x08, 0xaa},
2422 	{0x00, 0x26, 0x82, 0xaa},
2423 	{0x00, 0x2e, 0x0f, 0xaa},
2424 	{0x00, 0x2f, 0x1e, 0xaa},
2425 	{0x00, 0x30, 0x2d, 0xaa},
2426 	{0x00, 0x31, 0x3c, 0xaa},
2427 	{0x00, 0x32, 0x4b, 0xaa},
2428 	{0x00, 0x33, 0x5a, 0xaa},
2429 	{0x00, 0x34, 0x69, 0xaa},
2430 	{0x00, 0x35, 0x78, 0xaa},
2431 	{0x00, 0x36, 0x87, 0xaa},
2432 	{0x00, 0x37, 0x96, 0xaa},
2433 	{0x00, 0x38, 0xa5, 0xaa},
2434 	{0x00, 0x39, 0xb4, 0xaa},
2435 	{0x00, 0x3a, 0xc3, 0xaa},
2436 	{0x00, 0x3b, 0xd2, 0xaa},
2437 	{0x00, 0x3c, 0xe1, 0xaa},
2438 	{0x00, 0x3e, 0xff, 0xaa},
2439 	{0x00, 0x3f, 0xff, 0xaa},
2440 	{0x00, 0x40, 0xff, 0xaa},
2441 	{0x00, 0x41, 0xff, 0xaa},
2442 	{0x00, 0x42, 0xff, 0xaa},
2443 	{0x00, 0x43, 0xff, 0xaa},
2444 	{0x00, 0x03, 0x00, 0xaa},
2445 	{0x00, 0x03, 0x00, 0xaa},
2446 	{0x00, 0x20, 0xc4, 0xaa},
2447 	{0x00, 0x13, 0x03, 0xaa},
2448 	{0x00, 0x3c, 0x50, 0xaa},
2449 	{0x00, 0x61, 0x6a, 0xaa},	/* sharpness? */
2450 	{0x00, 0x51, 0x5b, 0xaa},
2451 	{0x00, 0x52, 0x91, 0xaa},
2452 	{0x00, 0x53, 0x4c, 0xaa},
2453 	{0x00, 0x54, 0x50, 0xaa},
2454 	{0x00, 0x56, 0x02, 0xaa},
2455 	{0xb6, 0x00, 0x00, 0xcc},
2456 	{0xb6, 0x03, 0x03, 0xcc},
2457 	{0xb6, 0x02, 0x20, 0xcc},
2458 	{0xb6, 0x05, 0x02, 0xcc},
2459 	{0xb6, 0x04, 0x58, 0xcc},
2460 	{0xb6, 0x12, 0xf8, 0xcc},
2461 	{0xb6, 0x13, 0x21, 0xcc},
2462 	{0xb6, 0x18, 0x03, 0xcc},
2463 	{0xb6, 0x17, 0xa9, 0xcc},
2464 	{0xb6, 0x16, 0x80, 0xcc},
2465 	{0xb6, 0x22, 0x12, 0xcc},
2466 	{0xb6, 0x23, 0x0b, 0xcc},
2467 	{0xbf, 0xc0, 0x39, 0xcc},
2468 	{0xbf, 0xc1, 0x04, 0xcc},
2469 	{0xbf, 0xcc, 0x00, 0xcc},
2470 	{0xb8, 0x06, 0x20, 0xcc},
2471 	{0xb8, 0x07, 0x03, 0xcc},
2472 	{0xb8, 0x08, 0x58, 0xcc},
2473 	{0xb8, 0x09, 0x02, 0xcc},
2474 	{0xb3, 0x01, 0x41, 0xcc},
2475 	{0x00, 0x03, 0x00, 0xaa},
2476 	{0x00, 0xd9, 0x0f, 0xaa},
2477 	{0x00, 0xda, 0xaa, 0xaa},
2478 	{0x00, 0xd9, 0x10, 0xaa},
2479 	{0x00, 0xda, 0xaa, 0xaa},
2480 	{0x00, 0xd9, 0x11, 0xaa},
2481 	{0x00, 0xda, 0x00, 0xaa},
2482 	{0x00, 0xd9, 0x12, 0xaa},
2483 	{0x00, 0xda, 0xff, 0xaa},
2484 	{0x00, 0xd9, 0x13, 0xaa},
2485 	{0x00, 0xda, 0xff, 0xaa},
2486 	{0x00, 0xe8, 0x11, 0xaa},
2487 	{0x00, 0xe9, 0x12, 0xaa},
2488 	{0x00, 0xea, 0x5c, 0xaa},
2489 	{0x00, 0xeb, 0xff, 0xaa},
2490 	{0x00, 0xd8, 0x80, 0xaa},
2491 	{0x00, 0xe6, 0x02, 0xaa},
2492 	{0x00, 0xd6, 0x40, 0xaa},
2493 	{0x00, 0xe3, 0x05, 0xaa},
2494 	{0x00, 0xe0, 0x40, 0xaa},
2495 	{0x00, 0xde, 0x03, 0xaa},
2496 	{0x00, 0xdf, 0x03, 0xaa},
2497 	{0x00, 0xdb, 0x02, 0xaa},
2498 	{0x00, 0xdc, 0x00, 0xaa},
2499 	{0x00, 0xdd, 0x03, 0xaa},
2500 	{0x00, 0xe1, 0x08, 0xaa},
2501 	{0x00, 0xe2, 0x01, 0xaa},
2502 	{0x00, 0xd6, 0x40, 0xaa},
2503 	{0x00, 0xe4, 0x40, 0xaa},
2504 	{0x00, 0xa8, 0x8f, 0xaa},
2505 	{0x00, 0xb4, 0x16, 0xaa},
2506 	{0xb0, 0x02, 0x06, 0xcc},
2507 	{0xb0, 0x18, 0x06, 0xcc},
2508 	{0xb0, 0x19, 0x06, 0xcc},
2509 	{0xb3, 0x5d, 0x18, 0xcc},
2510 	{0xb3, 0x05, 0x00, 0xcc},
2511 	{0xb3, 0x06, 0x00, 0xcc},
2512 	{0x00, 0xb4, 0x0e, 0xaa},
2513 	{0x00, 0xb5, 0x49, 0xaa},
2514 	{0x00, 0xb6, 0x1c, 0xaa},
2515 	{0x00, 0xb7, 0x96, 0xaa},
2516 /* end of usbvm326.inf - start of ms-win trace */
2517 	{0xb6, 0x12, 0xf8, 0xcc},
2518 	{0xb6, 0x13, 0x3d, 0xcc},
2519 /*read b306*/
2520 	{0x00, 0x03, 0x00, 0xaa},
2521 	{0x00, 0x1a, 0x09, 0xaa},
2522 	{0x00, 0x1b, 0x8a, 0xaa},
2523 /*read b827*/
2524 	{0xb8, 0x27, 0x00, 0xcc},
2525 	{0xb8, 0x26, 0x60, 0xcc},
2526 	{0xb8, 0x26, 0x60, 0xcc},
2527 /*gamma - to do?*/
2528 	{0x00, 0x03, 0x00, 0xaa},
2529 	{0x00, 0xae, 0x84, 0xaa},
2530 /*gamma again*/
2531 	{0x00, 0x03, 0x00, 0xaa},
2532 	{0x00, 0x96, 0xa0, 0xaa},
2533 /*matrix*/
2534 	{0x00, 0x03, 0x00, 0xaa},
2535 	{0x00, 0x91, 0x35, 0xaa},
2536 	{0x00, 0x92, 0x22, 0xaa},
2537 /*gamma*/
2538 	{0x00, 0x03, 0x00, 0xaa},
2539 	{0x00, 0x95, 0x85, 0xaa},
2540 /*matrix*/
2541 	{0x00, 0x03, 0x00, 0xaa},
2542 	{0x00, 0x4d, 0x20, 0xaa},
2543 	{0xb8, 0x22, 0x40, 0xcc},
2544 	{0xb8, 0x23, 0x40, 0xcc},
2545 	{0xb8, 0x24, 0x40, 0xcc},
2546 	{0xb8, 0x81, 0x09, 0xcc},
2547 	{0x00, 0x00, 0x64, 0xdd},
2548 	{0x00, 0x03, 0x01, 0xaa},
2549 /*read 46*/
2550 	{0x00, 0x46, 0x3c, 0xaa},
2551 	{0x00, 0x03, 0x00, 0xaa},
2552 	{0x00, 0x16, 0x40, 0xaa},
2553 	{0x00, 0x17, 0x40, 0xaa},
2554 	{0x00, 0x18, 0x40, 0xaa},
2555 	{0x00, 0x19, 0x41, 0xaa},
2556 	{0x00, 0x03, 0x01, 0xaa},
2557 	{0x00, 0x46, 0x3c, 0xaa},
2558 	{0x00, 0x00, 0x18, 0xdd},
2559 /*read bfff*/
2560 	{0x00, 0x03, 0x00, 0xaa},
2561 	{0x00, 0xb4, 0x1c, 0xaa},
2562 	{0x00, 0xb5, 0x92, 0xaa},
2563 	{0x00, 0xb6, 0x39, 0xaa},
2564 	{0x00, 0xb7, 0x24, 0xaa},
2565 /*write 89 0400 1415*/
2566 	{}
2567 };
2568 
2569 static const u8 poxxxx_init_common[][4] = {
2570 	{0xb3, 0x00, 0x04, 0xcc},
2571 	{0x00, 0x00, 0x10, 0xdd},
2572 	{0xb3, 0x00, 0x64, 0xcc},
2573 	{0x00, 0x00, 0x10, 0xdd},
2574 	{0xb3, 0x00, 0x65, 0xcc},
2575 	{0x00, 0x00, 0x10, 0xdd},
2576 	{0xb3, 0x00, 0x67, 0xcc},
2577 	{0xb0, 0x03, 0x09, 0xcc},
2578 	{0xb3, 0x05, 0x00, 0xcc},
2579 	{0xb3, 0x06, 0x00, 0xcc},
2580 	{0xb3, 0x5c, 0x01, 0xcc},
2581 	{0xb3, 0x08, 0x01, 0xcc},
2582 	{0xb3, 0x09, 0x0c, 0xcc},
2583 	{0xb3, 0x34, 0x01, 0xcc},
2584 	{0xb3, 0x35, 0xf6, 0xcc},	/* i2c add: 76 */
2585 	{0xb3, 0x02, 0xb0, 0xcc},
2586 	{0xb3, 0x03, 0x18, 0xcc},
2587 	{0xb3, 0x04, 0x15, 0xcc},
2588 	{0xb3, 0x20, 0x00, 0xcc},
2589 	{0xb3, 0x21, 0x00, 0xcc},
2590 	{0xb3, 0x22, 0x04, 0xcc},	/* sensor height = 1024 */
2591 	{0xb3, 0x23, 0x00, 0xcc},
2592 	{0xb3, 0x14, 0x00, 0xcc},
2593 	{0xb3, 0x15, 0x00, 0xcc},
2594 	{0xb3, 0x16, 0x04, 0xcc},	/* sensor width = 1280 */
2595 	{0xb3, 0x17, 0xff, 0xcc},
2596 	{0xb3, 0x2c, 0x03, 0xcc},
2597 	{0xb3, 0x2d, 0x56, 0xcc},
2598 	{0xb3, 0x2e, 0x02, 0xcc},
2599 	{0xb3, 0x2f, 0x0a, 0xcc},
2600 	{0xb3, 0x40, 0x00, 0xcc},
2601 	{0xb3, 0x41, 0x34, 0xcc},
2602 	{0xb3, 0x42, 0x01, 0xcc},
2603 	{0xb3, 0x43, 0xe0, 0xcc},
2604 	{0xbc, 0x00, 0x71, 0xcc},
2605 	{0xbc, 0x01, 0x01, 0xcc},
2606 	{0xb3, 0x01, 0x41, 0xcc},
2607 	{0xb3, 0x4d, 0x00, 0xcc},
2608 	{0x00, 0x0b, 0x2a, 0xaa},
2609 	{0x00, 0x0e, 0x03, 0xaa},
2610 	{0x00, 0x0f, 0xea, 0xaa},
2611 	{0x00, 0x12, 0x08, 0xaa},
2612 	{0x00, 0x1e, 0x06, 0xaa},
2613 	{0x00, 0x21, 0x00, 0xaa},
2614 	{0x00, 0x31, 0x1f, 0xaa},
2615 	{0x00, 0x33, 0x38, 0xaa},
2616 	{0x00, 0x36, 0xc0, 0xaa},
2617 	{0x00, 0x37, 0xc8, 0xaa},
2618 	{0x00, 0x3b, 0x36, 0xaa},
2619 	{0x00, 0x4b, 0xfe, 0xaa},
2620 	{0x00, 0x4d, 0x2e, 0xaa},
2621 	{0x00, 0x51, 0x1c, 0xaa},
2622 	{0x00, 0x52, 0x01, 0xaa},
2623 	{0x00, 0x55, 0x0a, 0xaa},
2624 	{0x00, 0x56, 0x0a, 0xaa},
2625 	{0x00, 0x57, 0x07, 0xaa},
2626 	{0x00, 0x58, 0x07, 0xaa},
2627 	{0x00, 0x59, 0x04, 0xaa},
2628 	{0x00, 0x70, 0x68, 0xaa},
2629 	{0x00, 0x71, 0x04, 0xaa},
2630 	{0x00, 0x72, 0x10, 0xaa},
2631 	{0x00, 0x80, 0x71, 0xaa},
2632 	{0x00, 0x81, 0x08, 0xaa},
2633 	{0x00, 0x82, 0x00, 0xaa},
2634 	{0x00, 0x83, 0x55, 0xaa},
2635 	{0x00, 0x84, 0x06, 0xaa},
2636 	{0x00, 0x85, 0x06, 0xaa},
2637 	{0x00, 0x8b, 0x25, 0xaa},
2638 	{0x00, 0x8c, 0x00, 0xaa},
2639 	{0x00, 0x8d, 0x86, 0xaa},
2640 	{0x00, 0x8e, 0x82, 0xaa},
2641 	{0x00, 0x8f, 0x2d, 0xaa},
2642 	{0x00, 0x90, 0x8b, 0xaa},
2643 	{0x00, 0x91, 0x81, 0xaa},
2644 	{0x00, 0x92, 0x81, 0xaa},
2645 	{0x00, 0x93, 0x23, 0xaa},
2646 	{0x00, 0xa3, 0x2a, 0xaa},
2647 	{0x00, 0xa4, 0x03, 0xaa},
2648 	{0x00, 0xa5, 0xea, 0xaa},
2649 	{0x00, 0xb0, 0x68, 0xaa},
2650 	{0x00, 0xbc, 0x04, 0xaa},
2651 	{0x00, 0xbe, 0x3b, 0xaa},
2652 	{0x00, 0x4e, 0x40, 0xaa},
2653 	{0x00, 0x06, 0x04, 0xaa},
2654 	{0x00, 0x07, 0x03, 0xaa},
2655 	{0x00, 0xcd, 0x18, 0xaa},
2656 	{0x00, 0x28, 0x03, 0xaa},
2657 	{0x00, 0x29, 0xef, 0xaa},
2658 /* reinit on alt 2 (qvga) or alt7 (vga) */
2659 	{0xb3, 0x05, 0x00, 0xcc},
2660 	{0xb3, 0x06, 0x00, 0xcc},
2661 	{0xb8, 0x00, 0x01, 0xcc},
2662 
2663 	{0x00, 0x1d, 0x85, 0xaa},
2664 	{0x00, 0x1e, 0xc6, 0xaa},
2665 	{0x00, 0x00, 0x40, 0xdd},
2666 	{0x00, 0x1d, 0x05, 0xaa},
2667 	{}
2668 };
2669 static const u8 poxxxx_gamma[][4] = {
2670 	{0x00, 0xd6, 0x22, 0xaa},	/* gamma 0 */
2671 	{0x00, 0x73, 0x00, 0xaa},
2672 	{0x00, 0x74, 0x0a, 0xaa},
2673 	{0x00, 0x75, 0x16, 0xaa},
2674 	{0x00, 0x76, 0x25, 0xaa},
2675 	{0x00, 0x77, 0x34, 0xaa},
2676 	{0x00, 0x78, 0x49, 0xaa},
2677 	{0x00, 0x79, 0x5a, 0xaa},
2678 	{0x00, 0x7a, 0x7f, 0xaa},
2679 	{0x00, 0x7b, 0x9b, 0xaa},
2680 	{0x00, 0x7c, 0xba, 0xaa},
2681 	{0x00, 0x7d, 0xd4, 0xaa},
2682 	{0x00, 0x7e, 0xea, 0xaa},
2683 
2684 	{0x00, 0xd6, 0x62, 0xaa},	/* gamma 1 */
2685 	{0x00, 0x73, 0x00, 0xaa},
2686 	{0x00, 0x74, 0x0a, 0xaa},
2687 	{0x00, 0x75, 0x16, 0xaa},
2688 	{0x00, 0x76, 0x25, 0xaa},
2689 	{0x00, 0x77, 0x34, 0xaa},
2690 	{0x00, 0x78, 0x49, 0xaa},
2691 	{0x00, 0x79, 0x5a, 0xaa},
2692 	{0x00, 0x7a, 0x7f, 0xaa},
2693 	{0x00, 0x7b, 0x9b, 0xaa},
2694 	{0x00, 0x7c, 0xba, 0xaa},
2695 	{0x00, 0x7d, 0xd4, 0xaa},
2696 	{0x00, 0x7e, 0xea, 0xaa},
2697 
2698 	{0x00, 0xd6, 0xa2, 0xaa},	/* gamma 2 */
2699 	{0x00, 0x73, 0x00, 0xaa},
2700 	{0x00, 0x74, 0x0a, 0xaa},
2701 	{0x00, 0x75, 0x16, 0xaa},
2702 	{0x00, 0x76, 0x25, 0xaa},
2703 	{0x00, 0x77, 0x34, 0xaa},
2704 	{0x00, 0x78, 0x49, 0xaa},
2705 	{0x00, 0x79, 0x5a, 0xaa},
2706 	{0x00, 0x7a, 0x7f, 0xaa},
2707 	{0x00, 0x7b, 0x9b, 0xaa},
2708 	{0x00, 0x7c, 0xba, 0xaa},
2709 	{0x00, 0x7d, 0xd4, 0xaa},
2710 	{0x00, 0x7e, 0xea, 0xaa},
2711 	{}
2712 };
2713 static const u8 poxxxx_init_start_3[][4] = {
2714 	{0x00, 0xb8, 0x28, 0xaa},
2715 	{0x00, 0xb9, 0x1e, 0xaa},
2716 	{0x00, 0xb6, 0x14, 0xaa},
2717 	{0x00, 0xb7, 0x0f, 0xaa},
2718 	{0x00, 0x5c, 0x10, 0xaa},
2719 	{0x00, 0x5d, 0x18, 0xaa},
2720 	{0x00, 0x5e, 0x24, 0xaa},
2721 	{0x00, 0x5f, 0x24, 0xaa},
2722 	{0x00, 0x86, 0x1a, 0xaa},
2723 	{0x00, 0x60, 0x00, 0xaa},
2724 	{0x00, 0x61, 0x1b, 0xaa},
2725 	{0x00, 0x62, 0x30, 0xaa},
2726 	{0x00, 0x63, 0x40, 0xaa},
2727 	{0x00, 0x87, 0x1a, 0xaa},
2728 	{0x00, 0x64, 0x00, 0xaa},
2729 	{0x00, 0x65, 0x08, 0xaa},
2730 	{0x00, 0x66, 0x10, 0xaa},
2731 	{0x00, 0x67, 0x20, 0xaa},
2732 	{0x00, 0x88, 0x10, 0xaa},
2733 	{0x00, 0x68, 0x00, 0xaa},
2734 	{0x00, 0x69, 0x08, 0xaa},
2735 	{0x00, 0x6a, 0x0f, 0xaa},
2736 	{0x00, 0x6b, 0x0f, 0xaa},
2737 	{0x00, 0x89, 0x07, 0xaa},
2738 	{0x00, 0xd5, 0x4c, 0xaa},
2739 	{0x00, 0x0a, 0x00, 0xaa},
2740 	{0x00, 0x0b, 0x2a, 0xaa},
2741 	{0x00, 0x0e, 0x03, 0xaa},
2742 	{0x00, 0x0f, 0xea, 0xaa},
2743 	{0x00, 0xa2, 0x00, 0xaa},
2744 	{0x00, 0xa3, 0x2a, 0xaa},
2745 	{0x00, 0xa4, 0x03, 0xaa},
2746 	{0x00, 0xa5, 0xea, 0xaa},
2747 	{}
2748 };
2749 static const u8 poxxxx_initVGA[][4] = {
2750 	{0x00, 0x20, 0x11, 0xaa},
2751 	{0x00, 0x33, 0x38, 0xaa},
2752 	{0x00, 0xbb, 0x0d, 0xaa},
2753 	{0xb3, 0x22, 0x01, 0xcc},	/* change to 640x480 */
2754 	{0xb3, 0x23, 0xe0, 0xcc},
2755 	{0xb3, 0x16, 0x02, 0xcc},
2756 	{0xb3, 0x17, 0x7f, 0xcc},
2757 	{0xb3, 0x02, 0xb0, 0xcc},
2758 	{0xb3, 0x06, 0x00, 0xcc},
2759 	{0xb3, 0x5c, 0x01, 0xcc},
2760 	{0x00, 0x04, 0x06, 0xaa},
2761 	{0x00, 0x05, 0x3f, 0xaa},
2762 	{0x00, 0x04, 0x00, 0xdd},	/* delay 1s */
2763 	{}
2764 };
2765 static const u8 poxxxx_initQVGA[][4] = {
2766 	{0x00, 0x20, 0x33, 0xaa},
2767 	{0x00, 0x33, 0x38, 0xaa},
2768 	{0x00, 0xbb, 0x0d, 0xaa},
2769 	{0xb3, 0x22, 0x00, 0xcc},	/* change to 320x240 */
2770 	{0xb3, 0x23, 0xf0, 0xcc},
2771 	{0xb3, 0x16, 0x01, 0xcc},
2772 	{0xb3, 0x17, 0x3f, 0xcc},
2773 	{0xb3, 0x02, 0xb0, 0xcc},
2774 	{0xb3, 0x06, 0x01, 0xcc},
2775 	{0xb3, 0x5c, 0x00, 0xcc},
2776 	{0x00, 0x04, 0x06, 0xaa},
2777 	{0x00, 0x05, 0x3f, 0xaa},
2778 	{0x00, 0x04, 0x00, 0xdd},	/* delay 1s */
2779 	{}
2780 };
2781 static const u8 poxxxx_init_end_1[][4] = {
2782 	{0x00, 0x47, 0x25, 0xaa},
2783 	{0x00, 0x48, 0x80, 0xaa},
2784 	{0x00, 0x49, 0x1f, 0xaa},
2785 	{0x00, 0x4a, 0x40, 0xaa},
2786 	{0x00, 0x44, 0x40, 0xaa},
2787 	{0x00, 0xab, 0x4a, 0xaa},
2788 	{0x00, 0xb1, 0x00, 0xaa},
2789 	{0x00, 0xb2, 0x04, 0xaa},
2790 	{0x00, 0xb3, 0x08, 0xaa},
2791 	{0x00, 0xb4, 0x0b, 0xaa},
2792 	{0x00, 0xb5, 0x0d, 0xaa},
2793 	{}
2794 };
2795 static const u8 poxxxx_init_end_2[][4] = {
2796 	{0x00, 0x1d, 0x85, 0xaa},
2797 	{0x00, 0x1e, 0x06, 0xaa},
2798 	{0x00, 0x1d, 0x05, 0xaa},
2799 	{}
2800 };
2801 
2802 struct sensor_info {
2803 	s8 sensorId;
2804 	u8 I2cAdd;
2805 	u8 IdAdd;
2806 	u16 VpId;
2807 	u8 m1;
2808 	u8 m2;
2809 	u8 op;
2810 };
2811 
2812 /* probe values */
2813 static const struct sensor_info vc0321_probe_data[] = {
2814 /*      sensorId,	   I2cAdd,	IdAdd,  VpId,  m1,    m2,  op */
2815 /* 0 OV9640 */
2816 	{-1,		    0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2817 /* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
2818 	{-1,		    0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
2819 /* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
2820 	{-1,		    0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
2821 /* 3 MI1310 */
2822 	{-1,		    0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
2823 /* 4 MI360 - tested in vc032x_probe_sensor */
2824 /*	{SENSOR_MI0360,	    0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
2825 /* 5 7131R */
2826 	{SENSOR_HV7131R,    0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
2827 /* 6 OV7649 */
2828 	{-1,		    0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
2829 /* 7 PAS302BCW */
2830 	{-1,		    0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
2831 /* 8 OV7660 */
2832 	{SENSOR_OV7660,     0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
2833 /* 9 PO3130NC - (tested in vc032x_probe_sensor) */
2834 /*	{SENSOR_PO3130NC,   0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
2835 /* 10 PO1030KC */
2836 	{-1,		    0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2837 /* 11 MI1310_SOC */
2838 	{SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
2839 /* 12 OV9650 */
2840 	{-1,		    0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2841 /* 13 S5K532 */
2842 	{-1,		    0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
2843 /* 14 MI360_SOC - ??? */
2844 /* 15 PO1200N */
2845 	{SENSOR_PO1200,     0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
2846 /* 16 PO3030K */
2847 	{-1,		    0x80 | 0x18, 0x00, 0x0000, 0x24, 0x25, 0x01},
2848 /* 17 PO2030 */
2849 	{-1,		    0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2850 /* ?? */
2851 	{-1,		    0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
2852 	{SENSOR_MI1320,     0x80 | 0x48, 0x00, 0x148c, 0x64, 0x65, 0x01},
2853 };
2854 static const struct sensor_info vc0323_probe_data[] = {
2855 /*      sensorId,	   I2cAdd,	IdAdd,  VpId,  m1,    m2,  op */
2856 /* 0 OV9640 */
2857 	{-1,		    0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2858 /* 1 ICM108T (may respond on IdAdd == 0x83 - tested in vc032x_probe_sensor) */
2859 	{-1,		    0x80 | 0x20, 0x82, 0x0000, 0x24, 0x25, 0x01},
2860 /* 2 PO2130 (may detect PO3130NC - tested in vc032x_probe_sensor)*/
2861 	{-1,		    0x80 | 0x76, 0x00, 0x0000, 0x24, 0x25, 0x01},
2862 /* 3 MI1310 */
2863 	{-1,		    0x80 | 0x5d, 0x00, 0x0000, 0x24, 0x25, 0x01},
2864 /* 4 MI360 - tested in vc032x_probe_sensor */
2865 /*	{SENSOR_MI0360,	    0x80 | 0x5d, 0x00, 0x8243, 0x24, 0x25, 0x01}, */
2866 /* 5 7131R */
2867 	{SENSOR_HV7131R,    0x80 | 0x11, 0x00, 0x0209, 0x24, 0x25, 0x01},
2868 /* 6 OV7649 */
2869 	{-1,		    0x80 | 0x21, 0x0a, 0x0000, 0x21, 0x20, 0x05},
2870 /* 7 PAS302BCW */
2871 	{-1,		    0x80 | 0x40, 0x00, 0x0000, 0x20, 0x22, 0x05},
2872 /* 8 OV7660 */
2873 	{SENSOR_OV7660,     0x80 | 0x21, 0x0a, 0x7660, 0x26, 0x26, 0x05},
2874 /* 9 PO3130NC - (tested in vc032x_probe_sensor) */
2875 /*	{SENSOR_PO3130NC,   0x80 | 0x76, 0x00, 0x3130, 0x24, 0x25, 0x01}, */
2876 /* 10 PO1030KC */
2877 	{-1,		    0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2878 /* 11 MI1310_SOC */
2879 	{SENSOR_MI1310_SOC, 0x80 | 0x5d, 0x00, 0x143a, 0x24, 0x25, 0x01},
2880 /* 12 OV9650 */
2881 	{-1,		    0x80 | 0x30, 0x0a, 0x0000, 0x25, 0x24, 0x05},
2882 /* 13 S5K532 */
2883 	{-1,		    0x80 | 0x11, 0x39, 0x0000, 0x24, 0x25, 0x01},
2884 /* 14 MI360_SOC - ??? */
2885 /* 15 PO1200N */
2886 	{SENSOR_PO1200,     0x80 | 0x5c, 0x00, 0x1200, 0x67, 0x67, 0x01},
2887 /* 16 ?? */
2888 	{-1,		    0x80 | 0x2d, 0x00, 0x0000, 0x65, 0x67, 0x01},
2889 /* 17 PO2030 */
2890 	{-1,		    0x80 | 0x6e, 0x00, 0x0000, 0x24, 0x25, 0x01},
2891 /* ?? */
2892 	{-1,		    0x80 | 0x56, 0x01, 0x0000, 0x64, 0x67, 0x01},
2893 	{SENSOR_MI1320_SOC, 0x80 | 0x48, 0x00, 0x148c, 0x64, 0x67, 0x01},
2894 /*fixme: not in the ms-win probe - may be found before? */
2895 	{SENSOR_OV7670,     0x80 | 0x21, 0x0a, 0x7673, 0x66, 0x67, 0x05},
2896 };
2897 
2898 /* read 'len' bytes in gspca_dev->usb_buf */
2899 static void reg_r_i(struct gspca_dev *gspca_dev,
2900 		  u16 req,
2901 		  u16 index,
2902 		  u16 len)
2903 {
2904 	int ret;
2905 
2906 	if (gspca_dev->usb_err < 0)
2907 		return;
2908 	ret = usb_control_msg(gspca_dev->dev,
2909 			usb_rcvctrlpipe(gspca_dev->dev, 0),
2910 			req,
2911 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2912 			1,			/* value */
2913 			index, gspca_dev->usb_buf, len,
2914 			500);
2915 	if (ret < 0) {
2916 		pr_err("reg_r err %d\n", ret);
2917 		gspca_dev->usb_err = ret;
2918 	}
2919 }
2920 static void reg_r(struct gspca_dev *gspca_dev,
2921 		  u16 req,
2922 		  u16 index,
2923 		  u16 len)
2924 {
2925 	reg_r_i(gspca_dev, req, index, len);
2926 	if (gspca_dev->usb_err < 0)
2927 		return;
2928 	if (len == 1)
2929 		gspca_dbg(gspca_dev, D_USBI, "GET %02x 0001 %04x %02x\n",
2930 			  req, index,
2931 			  gspca_dev->usb_buf[0]);
2932 	else
2933 		gspca_dbg(gspca_dev, D_USBI, "GET %02x 0001 %04x %*ph\n",
2934 			  req, index, 3, gspca_dev->usb_buf);
2935 }
2936 
2937 static void reg_w_i(struct gspca_dev *gspca_dev,
2938 			    u16 req,
2939 			    u16 value,
2940 			    u16 index)
2941 {
2942 	int ret;
2943 
2944 	if (gspca_dev->usb_err < 0)
2945 		return;
2946 	ret = usb_control_msg(gspca_dev->dev,
2947 			usb_sndctrlpipe(gspca_dev->dev, 0),
2948 			req,
2949 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
2950 			value, index, NULL, 0,
2951 			500);
2952 	if (ret < 0) {
2953 		pr_err("reg_w err %d\n", ret);
2954 		gspca_dev->usb_err = ret;
2955 	}
2956 }
2957 static void reg_w(struct gspca_dev *gspca_dev,
2958 			    u16 req,
2959 			    u16 value,
2960 			    u16 index)
2961 {
2962 	if (gspca_dev->usb_err < 0)
2963 		return;
2964 	gspca_dbg(gspca_dev, D_USBO, "SET %02x %04x %04x\n", req, value, index);
2965 	reg_w_i(gspca_dev, req, value, index);
2966 }
2967 
2968 static u16 read_sensor_register(struct gspca_dev *gspca_dev,
2969 				u16 address)
2970 {
2971 	u8 ldata, mdata, hdata;
2972 	int retry = 50;
2973 
2974 	reg_r(gspca_dev, 0xa1, 0xb33f, 1);
2975 	if (!(gspca_dev->usb_buf[0] & 0x02)) {
2976 		pr_err("I2c Bus Busy Wait %02x\n", gspca_dev->usb_buf[0]);
2977 		return 0;
2978 	}
2979 	reg_w(gspca_dev, 0xa0, address, 0xb33a);
2980 	reg_w(gspca_dev, 0xa0, 0x02, 0xb339);
2981 
2982 	do {
2983 		reg_r(gspca_dev, 0xa1, 0xb33b, 1);
2984 		if (gspca_dev->usb_buf[0] == 0x00)
2985 			break;
2986 		msleep(40);
2987 	} while (--retry >= 0);
2988 
2989 	reg_r(gspca_dev, 0xa1, 0xb33e, 1);
2990 	ldata = gspca_dev->usb_buf[0];
2991 	reg_r(gspca_dev, 0xa1, 0xb33d, 1);
2992 	mdata = gspca_dev->usb_buf[0];
2993 	reg_r(gspca_dev, 0xa1, 0xb33c, 1);
2994 	hdata = gspca_dev->usb_buf[0];
2995 	if (hdata != 0 && mdata != 0 && ldata != 0)
2996 		gspca_dbg(gspca_dev, D_PROBE, "Read Sensor %02x%02x %02x\n",
2997 			  hdata, mdata, ldata);
2998 	reg_r(gspca_dev, 0xa1, 0xb334, 1);
2999 	if (gspca_dev->usb_buf[0] == 0x02)
3000 		return (hdata << 8) + mdata;
3001 	return hdata;
3002 }
3003 
3004 static int vc032x_probe_sensor(struct gspca_dev *gspca_dev)
3005 {
3006 	struct sd *sd = (struct sd *) gspca_dev;
3007 	int i, n;
3008 	u16 value;
3009 	const struct sensor_info *ptsensor_info;
3010 
3011 /*fixme: should also check the other sensor (back mi1320_soc, front mc501cb)*/
3012 	if (sd->flags & FL_SAMSUNG) {
3013 		reg_w(gspca_dev, 0xa0, 0x01, 0xb301);
3014 		reg_w(gspca_dev, 0x89, 0xf0ff, 0xffff);
3015 						/* select the back sensor */
3016 	}
3017 
3018 	reg_r(gspca_dev, 0xa1, 0xbfcf, 1);
3019 	gspca_dbg(gspca_dev, D_PROBE, "vc032%d check sensor header %02x\n",
3020 		  sd->bridge == BRIDGE_VC0321 ? 1 : 3, gspca_dev->usb_buf[0]);
3021 	if (sd->bridge == BRIDGE_VC0321) {
3022 		ptsensor_info = vc0321_probe_data;
3023 		n = ARRAY_SIZE(vc0321_probe_data);
3024 	} else {
3025 		ptsensor_info = vc0323_probe_data;
3026 		n = ARRAY_SIZE(vc0323_probe_data);
3027 	}
3028 	for (i = 0; i < n; i++) {
3029 		reg_w(gspca_dev, 0xa0, 0x02, 0xb334);
3030 		reg_w(gspca_dev, 0xa0, ptsensor_info->m1, 0xb300);
3031 		reg_w(gspca_dev, 0xa0, ptsensor_info->m2, 0xb300);
3032 		reg_w(gspca_dev, 0xa0, 0x01, 0xb308);
3033 		reg_w(gspca_dev, 0xa0, 0x0c, 0xb309);
3034 		reg_w(gspca_dev, 0xa0, ptsensor_info->I2cAdd, 0xb335);
3035 		reg_w(gspca_dev, 0xa0, ptsensor_info->op, 0xb301);
3036 		value = read_sensor_register(gspca_dev, ptsensor_info->IdAdd);
3037 		if (value == 0 && ptsensor_info->IdAdd == 0x82)
3038 			value = read_sensor_register(gspca_dev, 0x83);
3039 		if (value != 0) {
3040 			gspca_dbg(gspca_dev, D_PROBE, "Sensor ID %04x (%d)\n",
3041 				  value, i);
3042 			if (value == ptsensor_info->VpId)
3043 				return ptsensor_info->sensorId;
3044 
3045 			switch (value) {
3046 			case 0x3130:
3047 				return SENSOR_PO3130NC;
3048 			case 0x7673:
3049 				return SENSOR_OV7670;
3050 			case 0x8243:
3051 				return SENSOR_MI0360;
3052 			}
3053 		}
3054 		ptsensor_info++;
3055 	}
3056 	return -1;
3057 }
3058 
3059 static void i2c_write(struct gspca_dev *gspca_dev,
3060 			u8 reg, const u8 *val,
3061 			u8 size)		/* 1 or 2 */
3062 {
3063 	int retry;
3064 
3065 	if (gspca_dev->usb_err < 0)
3066 		return;
3067 	if (size == 1)
3068 		gspca_dbg(gspca_dev, D_USBO, "i2c_w %02x %02x\n", reg, *val);
3069 	else
3070 		gspca_dbg(gspca_dev, D_USBO, "i2c_w %02x %02x%02x\n",
3071 			  reg, *val, val[1]);
3072 	reg_r_i(gspca_dev, 0xa1, 0xb33f, 1);
3073 /*fixme:should check if (!(gspca_dev->usb_buf[0] & 0x02)) error*/
3074 	reg_w_i(gspca_dev, 0xa0, size, 0xb334);
3075 	reg_w_i(gspca_dev, 0xa0, reg, 0xb33a);
3076 	reg_w_i(gspca_dev, 0xa0, val[0], 0xb336);
3077 	if (size > 1)
3078 		reg_w_i(gspca_dev, 0xa0, val[1], 0xb337);
3079 	reg_w_i(gspca_dev, 0xa0, 0x01, 0xb339);
3080 	retry = 4;
3081 	do {
3082 		reg_r_i(gspca_dev, 0xa1, 0xb33b, 1);
3083 		if (gspca_dev->usb_buf[0] == 0)
3084 			break;
3085 		msleep(20);
3086 	} while (--retry > 0);
3087 	if (retry <= 0)
3088 		pr_err("i2c_write timeout\n");
3089 }
3090 
3091 static void put_tab_to_reg(struct gspca_dev *gspca_dev,
3092 			const u8 *tab, u8 tabsize, u16 addr)
3093 {
3094 	int j;
3095 	u16 ad = addr;
3096 
3097 	for (j = 0; j < tabsize; j++)
3098 		reg_w(gspca_dev, 0xa0, tab[j], ad++);
3099 }
3100 
3101 static void usb_exchange(struct gspca_dev *gspca_dev,
3102 			const u8 data[][4])
3103 {
3104 	int i = 0;
3105 
3106 	for (;;) {
3107 		switch (data[i][3]) {
3108 		default:
3109 			return;
3110 		case 0xcc:			/* normal write */
3111 			reg_w(gspca_dev, 0xa0, data[i][2],
3112 					(data[i][0]) << 8 | data[i][1]);
3113 			break;
3114 		case 0xaa:			/* i2c op */
3115 			i2c_write(gspca_dev, data[i][1], &data[i][2], 1);
3116 			break;
3117 		case 0xbb:			/* i2c op */
3118 			i2c_write(gspca_dev, data[i][0], &data[i][1], 2);
3119 			break;
3120 		case 0xdd:
3121 			msleep(data[i][1] * 256 + data[i][2] + 10);
3122 			break;
3123 		}
3124 		i++;
3125 	}
3126 	/*not reached*/
3127 }
3128 
3129 
3130 /* this function is called at probe time */
3131 static int sd_config(struct gspca_dev *gspca_dev,
3132 			const struct usb_device_id *id)
3133 {
3134 	struct sd *sd = (struct sd *) gspca_dev;
3135 
3136 	sd->bridge = id->driver_info >> 8;
3137 	sd->flags = id->driver_info & 0xff;
3138 
3139 	if (id->idVendor == 0x046d &&
3140 	    (id->idProduct == 0x0892 || id->idProduct == 0x0896))
3141 		sd->sensor = SENSOR_POxxxx;	/* no probe */
3142 
3143 	return 0;
3144 }
3145 
3146 /* this function is called at probe and resume time */
3147 static int sd_init(struct gspca_dev *gspca_dev)
3148 {
3149 	struct sd *sd = (struct sd *) gspca_dev;
3150 	struct cam *cam;
3151 	int sensor;
3152 	/* number of packets per ISOC message */
3153 	static u8 npkt[NSENSORS] = {
3154 		[SENSOR_HV7131R] =	64,
3155 		[SENSOR_MI0360] =	32,
3156 		[SENSOR_MI1310_SOC] =	32,
3157 		[SENSOR_MI1320] =	64,
3158 		[SENSOR_MI1320_SOC] =	128,
3159 		[SENSOR_OV7660] =	32,
3160 		[SENSOR_OV7670] =	64,
3161 		[SENSOR_PO1200] =	128,
3162 		[SENSOR_PO3130NC] =	128,
3163 		[SENSOR_POxxxx] =	128,
3164 	};
3165 
3166 	if (sd->sensor != SENSOR_POxxxx)
3167 		sensor = vc032x_probe_sensor(gspca_dev);
3168 	else
3169 		sensor = sd->sensor;
3170 
3171 	switch (sensor) {
3172 	case -1:
3173 		pr_err("Unknown sensor...\n");
3174 		return -EINVAL;
3175 	case SENSOR_HV7131R:
3176 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor HV7131R\n");
3177 		break;
3178 	case SENSOR_MI0360:
3179 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI0360\n");
3180 		sd->bridge = BRIDGE_VC0323;
3181 		break;
3182 	case SENSOR_MI1310_SOC:
3183 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI1310_SOC\n");
3184 		break;
3185 	case SENSOR_MI1320:
3186 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI1320\n");
3187 		break;
3188 	case SENSOR_MI1320_SOC:
3189 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor MI1320_SOC\n");
3190 		break;
3191 	case SENSOR_OV7660:
3192 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor OV7660\n");
3193 		break;
3194 	case SENSOR_OV7670:
3195 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor OV7670\n");
3196 		break;
3197 	case SENSOR_PO1200:
3198 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor PO1200\n");
3199 		break;
3200 	case SENSOR_PO3130NC:
3201 		gspca_dbg(gspca_dev, D_PROBE, "Find Sensor PO3130NC\n");
3202 		break;
3203 	case SENSOR_POxxxx:
3204 		gspca_dbg(gspca_dev, D_PROBE, "Sensor POxxxx\n");
3205 		break;
3206 	}
3207 	sd->sensor = sensor;
3208 
3209 	cam = &gspca_dev->cam;
3210 	if (sd->bridge == BRIDGE_VC0321) {
3211 		cam->cam_mode = vc0321_mode;
3212 		cam->nmodes = ARRAY_SIZE(vc0321_mode);
3213 	} else {
3214 		switch (sensor) {
3215 		case SENSOR_PO1200:
3216 			cam->cam_mode = svga_mode;
3217 			cam->nmodes = ARRAY_SIZE(svga_mode);
3218 			break;
3219 		case SENSOR_MI1310_SOC:
3220 			cam->cam_mode = vc0323_mode;
3221 			cam->nmodes = ARRAY_SIZE(vc0323_mode);
3222 			break;
3223 		case SENSOR_MI1320_SOC:
3224 			cam->cam_mode = bi_mode;
3225 			cam->nmodes = ARRAY_SIZE(bi_mode);
3226 			break;
3227 		case SENSOR_OV7670:
3228 			cam->cam_mode = bi_mode;
3229 			cam->nmodes = ARRAY_SIZE(bi_mode) - 1;
3230 			break;
3231 		default:
3232 			cam->cam_mode = vc0323_mode;
3233 			cam->nmodes = ARRAY_SIZE(vc0323_mode) - 1;
3234 			break;
3235 		}
3236 	}
3237 	cam->npkt = npkt[sd->sensor];
3238 
3239 	if (sd->sensor == SENSOR_OV7670)
3240 		sd->flags |= FL_HFLIP | FL_VFLIP;
3241 
3242 	if (sd->bridge == BRIDGE_VC0321) {
3243 		reg_r(gspca_dev, 0x8a, 0, 3);
3244 		reg_w(gspca_dev, 0x87, 0x00, 0x0f0f);
3245 		reg_r(gspca_dev, 0x8b, 0, 3);
3246 		reg_w(gspca_dev, 0x88, 0x00, 0x0202);
3247 		if (sd->sensor == SENSOR_POxxxx) {
3248 			reg_r(gspca_dev, 0xa1, 0xb300, 1);
3249 			if (gspca_dev->usb_buf[0] != 0) {
3250 				reg_w(gspca_dev, 0xa0, 0x26, 0xb300);
3251 				reg_w(gspca_dev, 0xa0, 0x04, 0xb300);
3252 			}
3253 			reg_w(gspca_dev, 0xa0, 0x00, 0xb300);
3254 		}
3255 	}
3256 	return gspca_dev->usb_err;
3257 }
3258 
3259 static void setbrightness(struct gspca_dev *gspca_dev, s32 val)
3260 {
3261 	u8 data;
3262 
3263 	data = val;
3264 	if (data >= 0x80)
3265 		data &= 0x7f;
3266 	else
3267 		data = 0xff ^ data;
3268 	i2c_write(gspca_dev, 0x98, &data, 1);
3269 }
3270 
3271 static void setcontrast(struct gspca_dev *gspca_dev, u8 val)
3272 {
3273 	i2c_write(gspca_dev, 0x99, &val, 1);
3274 }
3275 
3276 static void setcolors(struct gspca_dev *gspca_dev, u8 val)
3277 {
3278 	u8 data;
3279 
3280 	data = val - (val >> 3) - 1;
3281 	i2c_write(gspca_dev, 0x94, &data, 1);
3282 	i2c_write(gspca_dev, 0x95, &val, 1);
3283 }
3284 
3285 static void sethvflip(struct gspca_dev *gspca_dev, bool hflip, bool vflip)
3286 {
3287 	struct sd *sd = (struct sd *) gspca_dev;
3288 	u8 data[2];
3289 
3290 	if (sd->flags & FL_HFLIP)
3291 		hflip = !hflip;
3292 	if (sd->flags & FL_VFLIP)
3293 		vflip = !vflip;
3294 	switch (sd->sensor) {
3295 	case SENSOR_MI1310_SOC:
3296 	case SENSOR_MI1320:
3297 	case SENSOR_MI1320_SOC:
3298 		data[0] = data[1] = 0;		/* select page 0 */
3299 		i2c_write(gspca_dev, 0xf0, data, 2);
3300 		data[0] = sd->sensor == SENSOR_MI1310_SOC ? 0x03 : 0x01;
3301 		data[1] = 0x02 * hflip
3302 			| 0x01 * vflip;
3303 		i2c_write(gspca_dev, 0x20, data, 2);
3304 		break;
3305 	case SENSOR_OV7660:
3306 	case SENSOR_OV7670:
3307 		data[0] = sd->sensor == SENSOR_OV7660 ? 0x01 : 0x07;
3308 		data[0] |= OV7660_MVFP_MIRROR * hflip
3309 			| OV7660_MVFP_VFLIP * vflip;
3310 		i2c_write(gspca_dev, OV7660_REG_MVFP, data, 1);
3311 		break;
3312 	case SENSOR_PO1200:
3313 		data[0] = 0;
3314 		i2c_write(gspca_dev, 0x03, data, 1);
3315 		data[0] = 0x80 * hflip
3316 			| 0x40 * vflip
3317 			| 0x06;
3318 		i2c_write(gspca_dev, 0x1e, data, 1);
3319 		break;
3320 	}
3321 }
3322 
3323 static void setlightfreq(struct gspca_dev *gspca_dev, s32 val)
3324 {
3325 	struct sd *sd = (struct sd *) gspca_dev;
3326 	static const u8 (*ov7660_freq_tb[3])[4] =
3327 		{ov7660_NoFliker, ov7660_50HZ, ov7660_60HZ};
3328 
3329 	if (sd->sensor != SENSOR_OV7660)
3330 		return;
3331 	usb_exchange(gspca_dev, ov7660_freq_tb[val]);
3332 }
3333 
3334 static void setsharpness(struct gspca_dev *gspca_dev, s32 val)
3335 {
3336 	struct sd *sd = (struct sd *) gspca_dev;
3337 	u8 data;
3338 
3339 	switch (sd->sensor) {
3340 	case SENSOR_PO1200:
3341 		data = 0;
3342 		i2c_write(gspca_dev, 0x03, &data, 1);
3343 		if (val < 0)
3344 			data = 0x6a;
3345 		else
3346 			data = 0xb5 + val * 3;
3347 		i2c_write(gspca_dev, 0x61, &data, 1);
3348 		break;
3349 	case SENSOR_POxxxx:
3350 		if (val < 0)
3351 			data = 0x7e;	/* def = max */
3352 		else
3353 			data = 0x60 + val * 0x0f;
3354 		i2c_write(gspca_dev, 0x59, &data, 1);
3355 		break;
3356 	}
3357 }
3358 static void setgain(struct gspca_dev *gspca_dev, u8 val)
3359 {
3360 	i2c_write(gspca_dev, 0x15, &val, 1);
3361 }
3362 
3363 static void setexposure(struct gspca_dev *gspca_dev, s32 val)
3364 {
3365 	u8 data;
3366 
3367 	data = val >> 8;
3368 	i2c_write(gspca_dev, 0x1a, &data, 1);
3369 	data = val;
3370 	i2c_write(gspca_dev, 0x1b, &data, 1);
3371 }
3372 
3373 static void setautogain(struct gspca_dev *gspca_dev, s32 val)
3374 {
3375 	static const u8 data[2] = {0x28, 0x3c};
3376 
3377 	i2c_write(gspca_dev, 0xd1, &data[val], 1);
3378 }
3379 
3380 static void setgamma(struct gspca_dev *gspca_dev)
3381 {
3382 /*fixme:to do */
3383 	usb_exchange(gspca_dev, poxxxx_gamma);
3384 }
3385 
3386 static void setbacklight(struct gspca_dev *gspca_dev, s32 val)
3387 {
3388 	u16 v;
3389 	u8 data;
3390 
3391 	data = (val << 4) | 0x0f;
3392 	i2c_write(gspca_dev, 0xaa, &data, 1);
3393 	v = 613 + 12 * val;
3394 	data = v >> 8;
3395 	i2c_write(gspca_dev, 0xc4, &data, 1);
3396 	data = v;
3397 	i2c_write(gspca_dev, 0xc5, &data, 1);
3398 	v = 1093 - 12 * val;
3399 	data = v >> 8;
3400 	i2c_write(gspca_dev, 0xc6, &data, 1);
3401 	data = v;
3402 	i2c_write(gspca_dev, 0xc7, &data, 1);
3403 	v = 342 + 9 * val;
3404 	data = v >> 8;
3405 	i2c_write(gspca_dev, 0xc8, &data, 1);
3406 	data = v;
3407 	i2c_write(gspca_dev, 0xc9, &data, 1);
3408 	v = 702 - 9 * val;
3409 	data = v >> 8;
3410 	i2c_write(gspca_dev, 0xca, &data, 1);
3411 	data = v;
3412 	i2c_write(gspca_dev, 0xcb, &data, 1);
3413 }
3414 
3415 static void setwb(struct gspca_dev *gspca_dev)
3416 {
3417 /*fixme:to do - valid when reg d1 = 0x1c - (reg16 + reg15 = 0xa3)*/
3418 	static const u8 data[2] = {0x00, 0x00};
3419 
3420 	i2c_write(gspca_dev, 0x16, &data[0], 1);
3421 	i2c_write(gspca_dev, 0x18, &data[1], 1);
3422 }
3423 
3424 static int sd_start(struct gspca_dev *gspca_dev)
3425 {
3426 	struct sd *sd = (struct sd *) gspca_dev;
3427 	const u8 (*init)[4];
3428 	const u8 *GammaT = NULL;
3429 	const u8 *MatrixT = NULL;
3430 	int mode;
3431 	static const u8 (*mi1320_soc_init[])[4] = {
3432 		mi1320_soc_InitSXGA,
3433 		mi1320_soc_InitVGA,
3434 		mi1320_soc_InitQVGA,
3435 	};
3436 
3437 /*fixme: back sensor only*/
3438 	if (sd->flags & FL_SAMSUNG) {
3439 		reg_w(gspca_dev, 0x89, 0xf0ff, 0xffff);
3440 		reg_w(gspca_dev, 0xa9, 0x8348, 0x000e);
3441 		reg_w(gspca_dev, 0xa9, 0x0000, 0x001a);
3442 	}
3443 
3444 	/* Assume start use the good resolution from gspca_dev->mode */
3445 	if (sd->bridge == BRIDGE_VC0321) {
3446 		reg_w(gspca_dev, 0xa0, 0xff, 0xbfec);
3447 		reg_w(gspca_dev, 0xa0, 0xff, 0xbfed);
3448 		reg_w(gspca_dev, 0xa0, 0xff, 0xbfee);
3449 		reg_w(gspca_dev, 0xa0, 0xff, 0xbfef);
3450 		sd->image_offset = 46;
3451 	} else {
3452 		if (gspca_dev->cam.cam_mode[gspca_dev->curr_mode].pixelformat
3453 				== V4L2_PIX_FMT_JPEG)
3454 			sd->image_offset = 0;
3455 		else
3456 			sd->image_offset = 32;
3457 	}
3458 
3459 	mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
3460 	switch (sd->sensor) {
3461 	case SENSOR_HV7131R:
3462 		GammaT = hv7131r_gamma;
3463 		MatrixT = hv7131r_matrix;
3464 		if (mode)
3465 			init = hv7131r_initQVGA_data;	/* 320x240 */
3466 		else
3467 			init = hv7131r_initVGA_data;	/* 640x480 */
3468 		break;
3469 	case SENSOR_OV7660:
3470 		GammaT = ov7660_gamma;
3471 		MatrixT = ov7660_matrix;
3472 		if (mode)
3473 			init = ov7660_initQVGA_data;	/* 320x240 */
3474 		else
3475 			init = ov7660_initVGA_data;	/* 640x480 */
3476 		break;
3477 	case SENSOR_MI0360:
3478 		GammaT = mi1320_gamma;
3479 		MatrixT = mi0360_matrix;
3480 		if (mode)
3481 			init = mi0360_initQVGA_JPG;	/* 320x240 */
3482 		else
3483 			init = mi0360_initVGA_JPG;	/* 640x480 */
3484 		break;
3485 	case SENSOR_MI1310_SOC:
3486 		GammaT = mi1320_gamma;
3487 		MatrixT = mi1320_matrix;
3488 		switch (mode) {
3489 		case 1:
3490 			init = mi1310_socinitQVGA_JPG;	/* 320x240 */
3491 			break;
3492 		case 0:
3493 			init = mi1310_socinitVGA_JPG;	/* 640x480 */
3494 			break;
3495 		default:
3496 			init = mi1310_soc_InitSXGA_JPG;	/* 1280x1024 */
3497 			break;
3498 		}
3499 		break;
3500 	case SENSOR_MI1320:
3501 		GammaT = mi1320_gamma;
3502 		MatrixT = mi1320_matrix;
3503 		if (mode)
3504 			init = mi1320_initQVGA_data;	/* 320x240 */
3505 		else
3506 			init = mi1320_initVGA_data;	/* 640x480 */
3507 		break;
3508 	case SENSOR_MI1320_SOC:
3509 		GammaT = mi1320_gamma;
3510 		MatrixT = mi1320_matrix;
3511 		init = mi1320_soc_init[mode];
3512 		break;
3513 	case SENSOR_OV7670:
3514 		init = mode == 1 ? ov7670_InitVGA : ov7670_InitQVGA;
3515 		break;
3516 	case SENSOR_PO3130NC:
3517 		GammaT = po3130_gamma;
3518 		MatrixT = po3130_matrix;
3519 		if (mode)
3520 			init = po3130_initQVGA_data;	/* 320x240 */
3521 		else
3522 			init = po3130_initVGA_data;	/* 640x480 */
3523 		usb_exchange(gspca_dev, init);
3524 		init = po3130_rundata;
3525 		break;
3526 	case SENSOR_PO1200:
3527 		GammaT = po1200_gamma;
3528 		MatrixT = po1200_matrix;
3529 		init = po1200_initVGA_data;
3530 		break;
3531 	default:
3532 /*	case SENSOR_POxxxx: */
3533 		usb_exchange(gspca_dev, poxxxx_init_common);
3534 		setgamma(gspca_dev);
3535 		usb_exchange(gspca_dev, poxxxx_init_start_3);
3536 		if (mode)
3537 			init = poxxxx_initQVGA;
3538 		else
3539 			init = poxxxx_initVGA;
3540 		usb_exchange(gspca_dev, init);
3541 		reg_r(gspca_dev, 0x8c, 0x0000, 3);
3542 		reg_w(gspca_dev, 0xa0,
3543 				gspca_dev->usb_buf[2] & 1 ? 0 : 1,
3544 				0xb35c);
3545 		msleep(300);
3546 /*fixme: i2c read 04 and 05*/
3547 		init = poxxxx_init_end_1;
3548 		break;
3549 	}
3550 	usb_exchange(gspca_dev, init);
3551 	if (GammaT && MatrixT) {
3552 		put_tab_to_reg(gspca_dev, GammaT, 17, 0xb84a);
3553 		put_tab_to_reg(gspca_dev, GammaT, 17, 0xb85b);
3554 		put_tab_to_reg(gspca_dev, GammaT, 17, 0xb86c);
3555 		put_tab_to_reg(gspca_dev, MatrixT, 9, 0xb82c);
3556 
3557 		switch (sd->sensor) {
3558 		case SENSOR_PO1200:
3559 		case SENSOR_HV7131R:
3560 			reg_w(gspca_dev, 0x89, 0x0400, 0x1415);
3561 			break;
3562 		case SENSOR_MI1310_SOC:
3563 			reg_w(gspca_dev, 0x89, 0x058c, 0x0000);
3564 			break;
3565 		}
3566 		msleep(100);
3567 	}
3568 	switch (sd->sensor) {
3569 	case SENSOR_OV7670:
3570 		reg_w(gspca_dev, 0x87, 0xffff, 0xffff);
3571 		reg_w(gspca_dev, 0x88, 0xff00, 0xf0f1);
3572 		reg_w(gspca_dev, 0xa0, 0x0000, 0xbfff);
3573 		break;
3574 	case SENSOR_POxxxx:
3575 		usb_exchange(gspca_dev, poxxxx_init_end_2);
3576 		setwb(gspca_dev);
3577 		msleep(80);		/* led on */
3578 		reg_w(gspca_dev, 0x89, 0xffff, 0xfdff);
3579 		break;
3580 	}
3581 	return gspca_dev->usb_err;
3582 }
3583 
3584 static void sd_stopN(struct gspca_dev *gspca_dev)
3585 {
3586 	struct sd *sd = (struct sd *) gspca_dev;
3587 
3588 	switch (sd->sensor) {
3589 	case SENSOR_MI1310_SOC:
3590 		reg_w(gspca_dev, 0x89, 0x058c, 0x00ff);
3591 		break;
3592 	case SENSOR_POxxxx:
3593 		return;
3594 	default:
3595 		if (!(sd->flags & FL_SAMSUNG))
3596 			reg_w(gspca_dev, 0x89, 0xffff, 0xffff);
3597 		break;
3598 	}
3599 	reg_w(gspca_dev, 0xa0, 0x01, 0xb301);
3600 	reg_w(gspca_dev, 0xa0, 0x09, 0xb003);
3601 }
3602 
3603 /* called on streamoff with alt 0 and on disconnect */
3604 static void sd_stop0(struct gspca_dev *gspca_dev)
3605 {
3606 	struct sd *sd = (struct sd *) gspca_dev;
3607 
3608 	if (!gspca_dev->present)
3609 		return;
3610 /*fixme: is this useful?*/
3611 	if (sd->sensor == SENSOR_MI1310_SOC)
3612 		reg_w(gspca_dev, 0x89, 0x058c, 0x00ff);
3613 	else if (!(sd->flags & FL_SAMSUNG))
3614 		reg_w(gspca_dev, 0x89, 0xffff, 0xffff);
3615 
3616 	if (sd->sensor == SENSOR_POxxxx) {
3617 		reg_w(gspca_dev, 0xa0, 0x26, 0xb300);
3618 		reg_w(gspca_dev, 0xa0, 0x04, 0xb300);
3619 		reg_w(gspca_dev, 0xa0, 0x00, 0xb300);
3620 	}
3621 }
3622 
3623 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
3624 			u8 *data,			/* isoc packet */
3625 			int len)			/* iso pkt length */
3626 {
3627 	struct sd *sd = (struct sd *) gspca_dev;
3628 
3629 	if (data[0] == 0xff && data[1] == 0xd8) {
3630 		gspca_dbg(gspca_dev, D_PACK,
3631 			  "vc032x header packet found len %d\n", len);
3632 		gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
3633 		data += sd->image_offset;
3634 		len -= sd->image_offset;
3635 		gspca_frame_add(gspca_dev, FIRST_PACKET, data, len);
3636 		return;
3637 	}
3638 
3639 	/* The vc0321 sends some additional data after sending the complete
3640 	 * frame, we ignore this. */
3641 	if (sd->bridge == BRIDGE_VC0321) {
3642 		int size, l;
3643 
3644 		l = gspca_dev->image_len;
3645 		size = gspca_dev->pixfmt.sizeimage;
3646 		if (len > size - l)
3647 			len = size - l;
3648 	}
3649 	gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
3650 }
3651 
3652 static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
3653 {
3654 	struct gspca_dev *gspca_dev =
3655 		container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
3656 	struct sd *sd = (struct sd *)gspca_dev;
3657 
3658 	gspca_dev->usb_err = 0;
3659 
3660 	if (!gspca_dev->streaming && ctrl->id != V4L2_CID_POWER_LINE_FREQUENCY)
3661 		return 0;
3662 
3663 	switch (ctrl->id) {
3664 	case V4L2_CID_BRIGHTNESS:
3665 		setbrightness(gspca_dev, ctrl->val);
3666 		break;
3667 	case V4L2_CID_CONTRAST:
3668 		setcontrast(gspca_dev, ctrl->val);
3669 		break;
3670 	case V4L2_CID_SATURATION:
3671 		setcolors(gspca_dev, ctrl->val);
3672 		break;
3673 	case V4L2_CID_HFLIP:
3674 		sethvflip(gspca_dev, sd->hflip->val, sd->vflip->val);
3675 		break;
3676 	case V4L2_CID_SHARPNESS:
3677 		setsharpness(gspca_dev, ctrl->val);
3678 		break;
3679 	case V4L2_CID_AUTOGAIN:
3680 		setautogain(gspca_dev, ctrl->val);
3681 		break;
3682 	case V4L2_CID_GAIN:
3683 		setgain(gspca_dev, ctrl->val);
3684 		break;
3685 	case V4L2_CID_EXPOSURE:
3686 		setexposure(gspca_dev, ctrl->val);
3687 		break;
3688 	case V4L2_CID_BACKLIGHT_COMPENSATION:
3689 		setbacklight(gspca_dev, ctrl->val);
3690 		break;
3691 	case V4L2_CID_POWER_LINE_FREQUENCY:
3692 		setlightfreq(gspca_dev, ctrl->val);
3693 		break;
3694 	}
3695 	return gspca_dev->usb_err;
3696 }
3697 
3698 static const struct v4l2_ctrl_ops sd_ctrl_ops = {
3699 	.s_ctrl = sd_s_ctrl,
3700 };
3701 
3702 static int sd_init_controls(struct gspca_dev *gspca_dev)
3703 {
3704 	struct sd *sd = (struct sd *)gspca_dev;
3705 	struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
3706 	bool has_brightness = false;
3707 	bool has_contrast = false;
3708 	bool has_sat = false;
3709 	bool has_hvflip = false;
3710 	bool has_freq = false;
3711 	bool has_backlight = false;
3712 	bool has_exposure = false;
3713 	bool has_autogain = false;
3714 	bool has_gain = false;
3715 	bool has_sharpness = false;
3716 
3717 	switch (sd->sensor) {
3718 	case SENSOR_HV7131R:
3719 	case SENSOR_MI0360:
3720 	case SENSOR_PO3130NC:
3721 		break;
3722 	case SENSOR_MI1310_SOC:
3723 	case SENSOR_MI1320:
3724 	case SENSOR_MI1320_SOC:
3725 	case SENSOR_OV7660:
3726 		has_hvflip = true;
3727 		break;
3728 	case SENSOR_OV7670:
3729 		has_hvflip = has_freq = true;
3730 		break;
3731 	case SENSOR_PO1200:
3732 		has_hvflip = has_sharpness = true;
3733 		break;
3734 	case SENSOR_POxxxx:
3735 		has_brightness = has_contrast = has_sat = has_backlight =
3736 			has_exposure = has_autogain = has_gain =
3737 			has_sharpness = true;
3738 		break;
3739 	}
3740 
3741 	gspca_dev->vdev.ctrl_handler = hdl;
3742 	v4l2_ctrl_handler_init(hdl, 8);
3743 	if (has_brightness)
3744 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3745 			V4L2_CID_BRIGHTNESS, 0, 255, 1, 128);
3746 	if (has_contrast)
3747 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3748 			V4L2_CID_CONTRAST, 0, 255, 1, 127);
3749 	if (has_sat)
3750 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3751 			V4L2_CID_SATURATION, 1, 127, 1, 63);
3752 	if (has_hvflip) {
3753 		sd->hflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3754 			V4L2_CID_HFLIP, 0, 1, 1, 0);
3755 		sd->vflip = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3756 			V4L2_CID_VFLIP, 0, 1, 1, 0);
3757 	}
3758 	if (has_sharpness)
3759 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3760 			V4L2_CID_SHARPNESS, -1, 2, 1, -1);
3761 	if (has_freq)
3762 		v4l2_ctrl_new_std_menu(hdl, &sd_ctrl_ops,
3763 			V4L2_CID_POWER_LINE_FREQUENCY,
3764 			V4L2_CID_POWER_LINE_FREQUENCY_60HZ, 0,
3765 			V4L2_CID_POWER_LINE_FREQUENCY_50HZ);
3766 	if (has_autogain)
3767 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3768 			V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
3769 	if (has_gain)
3770 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3771 			V4L2_CID_GAIN, 0, 78, 1, 0);
3772 	if (has_exposure)
3773 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3774 			V4L2_CID_EXPOSURE, 0, 4095, 1, 450);
3775 	if (has_backlight)
3776 		v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
3777 			V4L2_CID_BACKLIGHT_COMPENSATION, 0, 15, 1, 15);
3778 
3779 	if (hdl->error) {
3780 		pr_err("Could not initialize controls\n");
3781 		return hdl->error;
3782 	}
3783 	if (sd->hflip)
3784 		v4l2_ctrl_cluster(2, &sd->hflip);
3785 	return 0;
3786 }
3787 
3788 /* sub-driver description */
3789 static const struct sd_desc sd_desc = {
3790 	.name = MODULE_NAME,
3791 	.init_controls = sd_init_controls,
3792 	.config = sd_config,
3793 	.init = sd_init,
3794 	.start = sd_start,
3795 	.stopN = sd_stopN,
3796 	.stop0 = sd_stop0,
3797 	.pkt_scan = sd_pkt_scan,
3798 };
3799 
3800 /* -- module initialisation -- */
3801 #define BF(bridge, flags) \
3802 	.driver_info = (BRIDGE_ ## bridge << 8) \
3803 		| (flags)
3804 static const struct usb_device_id device_table[] = {
3805 	{USB_DEVICE(0x041e, 0x405b), BF(VC0323, FL_VFLIP)},
3806 	{USB_DEVICE(0x046d, 0x0892), BF(VC0321, 0)},
3807 	{USB_DEVICE(0x046d, 0x0896), BF(VC0321, 0)},
3808 	{USB_DEVICE(0x046d, 0x0897), BF(VC0321, 0)},
3809 	{USB_DEVICE(0x0ac8, 0x0321), BF(VC0321, 0)},
3810 	{USB_DEVICE(0x0ac8, 0x0323), BF(VC0323, 0)},
3811 	{USB_DEVICE(0x0ac8, 0x0328), BF(VC0321, 0)},
3812 	{USB_DEVICE(0x0ac8, 0xc001), BF(VC0321, 0)},
3813 	{USB_DEVICE(0x0ac8, 0xc002), BF(VC0321, 0)},
3814 	{USB_DEVICE(0x0ac8, 0xc301), BF(VC0323, FL_SAMSUNG)},
3815 	{USB_DEVICE(0x15b8, 0x6001), BF(VC0323, 0)},
3816 	{USB_DEVICE(0x15b8, 0x6002), BF(VC0323, 0)},
3817 	{USB_DEVICE(0x17ef, 0x4802), BF(VC0323, 0)},
3818 	{}
3819 };
3820 MODULE_DEVICE_TABLE(usb, device_table);
3821 
3822 /* -- device connect -- */
3823 static int sd_probe(struct usb_interface *intf,
3824 			const struct usb_device_id *id)
3825 {
3826 	return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
3827 				THIS_MODULE);
3828 }
3829 
3830 static struct usb_driver sd_driver = {
3831 	.name = MODULE_NAME,
3832 	.id_table = device_table,
3833 	.probe = sd_probe,
3834 	.disconnect = gspca_disconnect,
3835 #ifdef CONFIG_PM
3836 	.suspend = gspca_suspend,
3837 	.resume = gspca_resume,
3838 	.reset_resume = gspca_resume,
3839 #endif
3840 };
3841 
3842 module_usb_driver(sd_driver);
3843