xref: /openbmc/linux/drivers/media/usb/gspca/nw80x.c (revision 4a3fad70)
1 /*
2  * DivIO nw80x subdriver
3  *
4  * Copyright (C) 2011 Jean-François Moine (http://moinejf.free.fr)
5  * Copyright (C) 2003 Sylvain Munaut <tnt@246tNt.com>
6  *			Kjell Claesson <keyson@users.sourceforge.net>
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 "nw80x"
22 
23 #include "gspca.h"
24 
25 MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>");
26 MODULE_DESCRIPTION("NW80x USB Camera Driver");
27 MODULE_LICENSE("GPL");
28 
29 static int webcam;
30 
31 /* specific webcam descriptor */
32 struct sd {
33 	struct gspca_dev gspca_dev;	/* !! must be the first item */
34 
35 	u32 ae_res;
36 	s8 ag_cnt;
37 #define AG_CNT_START 13
38 	u8 exp_too_low_cnt;
39 	u8 exp_too_high_cnt;
40 
41 	u8 bridge;
42 	u8 webcam;
43 };
44 
45 enum bridges {
46 	BRIDGE_NW800,	/* and et31x110 */
47 	BRIDGE_NW801,
48 	BRIDGE_NW802,
49 };
50 enum webcams {
51 	Generic800,
52 	SpaceCam,	/* Trust 120 SpaceCam */
53 	SpaceCam2,	/* other Trust 120 SpaceCam */
54 	Cvideopro,	/* Conceptronic Video Pro */
55 	Dlink350c,
56 	DS3303u,
57 	Kr651us,
58 	Kritter,
59 	Mustek300,
60 	Proscope,
61 	Twinkle,
62 	DvcV6,
63 	P35u,
64 	Generic802,
65 	NWEBCAMS	/* number of webcams */
66 };
67 
68 static const u8 webcam_chip[NWEBCAMS] = {
69 	[Generic800]	= BRIDGE_NW800,	/* 06a5:0000
70 					 * Typhoon Webcam 100 USB */
71 
72 	[SpaceCam]	= BRIDGE_NW800,	/* 06a5:d800
73 				* Trust SpaceCam120 or SpaceCam100 PORTABLE */
74 
75 	[SpaceCam2]	= BRIDGE_NW800,	/* 06a5:d800 - pas106
76 			* other Trust SpaceCam120 or SpaceCam100 PORTABLE */
77 
78 	[Cvideopro]	= BRIDGE_NW802,	/* 06a5:d001
79 			* Conceptronic Video Pro 'CVIDEOPRO USB Webcam CCD' */
80 
81 	[Dlink350c]	= BRIDGE_NW802,	/* 06a5:d001
82 					 * D-Link NetQam Pro 250plus */
83 
84 	[DS3303u]	= BRIDGE_NW801,	/* 06a5:d001
85 				* Plustek Opticam 500U or ProLink DS3303u */
86 
87 	[Kr651us]	= BRIDGE_NW802,	/* 06a5:d001
88 					 * Panasonic GP-KR651US */
89 
90 	[Kritter]	= BRIDGE_NW802,	/* 06a5:d001
91 					 * iRez Kritter cam */
92 
93 	[Mustek300]	= BRIDGE_NW802,	/* 055f:d001
94 					 * Mustek Wcam 300 mini */
95 
96 	[Proscope]	= BRIDGE_NW802,	/* 06a5:d001
97 					 * Scalar USB Microscope (ProScope) */
98 
99 	[Twinkle]	= BRIDGE_NW800,	/* 06a5:d800 - hv7121b? (seems pas106)
100 					 * Divio Chicony TwinkleCam
101 					 * DSB-C110 */
102 
103 	[DvcV6]		= BRIDGE_NW802,	/* 0502:d001
104 					 * DVC V6 */
105 
106 	[P35u]		= BRIDGE_NW801,	/* 052b:d001, 06a5:d001 and 06be:d001
107 					 * EZCam Pro p35u */
108 
109 	[Generic802]	= BRIDGE_NW802,
110 };
111 /*
112  * other webcams:
113  *	- nw801 046d:d001
114  *		Logitech QuickCam Pro (dark focus ring)
115  *	- nw801 0728:d001
116  *		AVerMedia Camguard
117  *	- nw??? 06a5:d001
118  *		D-Link NetQam Pro 250plus
119  *	- nw800 065a:d800
120  *		Showcam NGS webcam
121  *	- nw??? ????:????
122  *		Sceptre svc300
123  */
124 
125 /*
126  * registers
127  *    nw800/et31x110	  nw801		  nw802
128  *	0000..009e	0000..00a1	0000..009e
129  *	0200..0211	   id		   id
130  *	0300..0302	   id		   id
131  *	0400..0406	  (inex)	0400..0406
132  *	0500..0505	0500..0506	  (inex)
133  *	0600..061a	0600..0601	0600..0601
134  *	0800..0814	   id		   id
135  *	1000..109c	1000..10a1	1000..109a
136  */
137 
138 /* resolutions
139  *	nw800: 320x240, 352x288
140  *	nw801/802: 320x240, 640x480
141  */
142 static const struct v4l2_pix_format cif_mode[] = {
143 	{320, 240, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
144 		.bytesperline = 320,
145 		.sizeimage = 320 * 240 * 4 / 8,
146 		.colorspace = V4L2_COLORSPACE_JPEG},
147 	{352, 288, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
148 		.bytesperline = 352,
149 		.sizeimage = 352 * 288 * 4 / 8,
150 		.colorspace = V4L2_COLORSPACE_JPEG}
151 };
152 static const struct v4l2_pix_format vga_mode[] = {
153 	{320, 240, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
154 		.bytesperline = 320,
155 		.sizeimage = 320 * 240 * 4 / 8,
156 		.colorspace = V4L2_COLORSPACE_JPEG},
157 	{640, 480, V4L2_PIX_FMT_JPGL, V4L2_FIELD_NONE,
158 		.bytesperline = 640,
159 		.sizeimage = 640 * 480 * 3 / 8,
160 		.colorspace = V4L2_COLORSPACE_JPEG},
161 };
162 
163 /*
164  * The sequences below contain:
165  *	- 1st and 2nd bytes: either
166  *		- register number (BE)
167  *		- I2C0 + i2c address
168  *	- 3rd byte: data length (=0 for end of sequence)
169  *	- n bytes: data
170  */
171 #define I2C0 0xff
172 
173 static const u8 nw800_init[] = {
174 	0x04, 0x05, 0x01, 0x61,
175 	0x04, 0x04, 0x01, 0x01,
176 	0x04, 0x06, 0x01, 0x04,
177 	0x04, 0x04, 0x03, 0x00, 0x00, 0x00,
178 	0x05, 0x05, 0x01, 0x00,
179 	0, 0, 0
180 };
181 static const u8 nw800_start[] = {
182 	0x04, 0x06, 0x01, 0xc0,
183 	0x00, 0x00, 0x40, 0x10, 0x43, 0x00, 0xb4, 0x01, 0x10, 0x00, 0x4f,
184 			  0xef, 0x0e, 0x00, 0x74, 0x01, 0x01, 0x00, 0x19,
185 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
186 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x3e, 0x00, 0x24,
187 			  0x03, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
188 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
189 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
190 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
191 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
192 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
193 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
194 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
195 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
196 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
197 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
198 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
199 	0x00, 0x80, 0x1f, 0xa0, 0x48, 0xc3, 0x02, 0x88, 0x0c, 0x68, 0x00,
200 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x08,
201 			  0x00, 0x32, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
202 			  0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
203 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
204 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
205 			  0x40, 0x20,
206 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
207 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0xc0,
208 	0x05, 0x00, 0x06, 0xe8, 0x00, 0x00, 0x00, 0x20, 0x20,
209 	0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
210 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
211 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
212 			  0x00, 0x00, 0x00,
213 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
214 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
215 			  0x00, 0x00, 0x00, 0x00, 0x00,
216 	0x10, 0x00, 0x40, 0x83, 0x02, 0x20, 0x00, 0x13, 0x00, 0x00, 0x00,
217 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
218 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
219 			  0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
220 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
221 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
222 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
223 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
224 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
225 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
226 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
227 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
228 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
229 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
230 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
231 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
232 	0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
233 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x62,
234 			  0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
235 			  0x01, 0x60, 0x01, 0x00, 0x00,
236 
237 	0x04, 0x04, 0x01, 0xff,
238 	0x04, 0x06, 0x01, 0xc4,
239 
240 	0x04, 0x06, 0x01, 0xc0,
241 	0x00, 0x00, 0x40, 0x10, 0x43, 0x00, 0xb4, 0x01, 0x10, 0x00, 0x4f,
242 			  0xef, 0x0e, 0x00, 0x74, 0x01, 0x01, 0x00, 0x19,
243 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
244 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x3e, 0x00, 0x24,
245 			  0x03, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
246 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
247 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
248 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
249 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
250 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
251 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
252 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
253 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
254 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
255 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
256 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
257 	0x00, 0x80, 0x1f, 0xa0, 0x48, 0xc3, 0x02, 0x88, 0x0c, 0x68, 0x00,
258 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x08,
259 			  0x00, 0x32, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
260 			  0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
261 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
262 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
263 			  0x40, 0x20,
264 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
265 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0xc0,
266 	0x05, 0x00, 0x06, 0xe8, 0x00, 0x00, 0x00, 0x20, 0x20,
267 	0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
268 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
269 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
270 			  0x00, 0x00, 0x00,
271 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
272 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
273 			  0x00, 0x00, 0x00, 0x00, 0x00,
274 	0x10, 0x00, 0x40, 0x83, 0x02, 0x20, 0x00, 0x13, 0x00, 0x00, 0x00,
275 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
276 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
277 			  0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
278 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
279 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
280 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
281 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
282 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
283 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
284 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
285 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
286 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
287 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
288 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
289 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
290 	0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
291 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x62,
292 			  0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
293 			  0x01, 0x60, 0x01, 0x00, 0x00,
294 
295 	0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
296 			  0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
297 			  0x40,
298 	0x00, 0x80, 0x01, 0xa0,
299 	0x10, 0x1a, 0x01, 0x00,
300 	0x00, 0x91, 0x02, 0x6c, 0x01,
301 	0x00, 0x03, 0x02, 0xc8, 0x01,
302 	0x10, 0x1a, 0x01, 0x00,
303 	0x10, 0x00, 0x01, 0x83,
304 	0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
305 			  0x20, 0x01, 0x60, 0x01,
306 	0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
307 	0x10, 0x1b, 0x02, 0x69, 0x00,
308 	0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
309 	0x05, 0x02, 0x01, 0x02,
310 	0x06, 0x00, 0x02, 0x04, 0xd9,
311 	0x05, 0x05, 0x01, 0x20,
312 	0x05, 0x05, 0x01, 0x21,
313 	0x10, 0x0e, 0x01, 0x08,
314 	0x10, 0x41, 0x11, 0x00, 0x08, 0x21, 0x3d, 0x52, 0x63, 0x75, 0x83,
315 			  0x91, 0x9e, 0xaa, 0xb6, 0xc1, 0xcc, 0xd6, 0xe0,
316 			  0xea,
317 	0x10, 0x03, 0x01, 0x00,
318 	0x10, 0x0f, 0x02, 0x13, 0x13,
319 	0x10, 0x03, 0x01, 0x14,
320 	0x10, 0x41, 0x11, 0x00, 0x08, 0x21, 0x3d, 0x52, 0x63, 0x75, 0x83,
321 			  0x91, 0x9e, 0xaa, 0xb6, 0xc1, 0xcc, 0xd6, 0xe0,
322 			  0xea,
323 	0x10, 0x0b, 0x01, 0x14,
324 	0x10, 0x0d, 0x01, 0x20,
325 	0x10, 0x0c, 0x01, 0x34,
326 	0x04, 0x06, 0x01, 0xc3,
327 	0x04, 0x04, 0x01, 0x00,
328 	0x05, 0x02, 0x01, 0x02,
329 	0x06, 0x00, 0x02, 0x00, 0x48,
330 	0x05, 0x05, 0x01, 0x20,
331 	0x05, 0x05, 0x01, 0x21,
332 	0, 0, 0
333 };
334 
335 /* 06a5:d001 - nw801 - Panasonic
336  *		P35u */
337 static const u8 nw801_start_1[] = {
338 	0x05, 0x06, 0x01, 0x04,
339 	0x00, 0x00, 0x40, 0x0e, 0x00, 0x00, 0xf9, 0x02, 0x11, 0x00, 0x0e,
340 			  0x01, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
341 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
342 			  0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
343 			  0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
344 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
345 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
346 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
347 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
348 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
349 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
350 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
351 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
352 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
353 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
354 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
355 	0x00, 0x80, 0x22, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x08, 0x00,
356 			  0x00, 0x00, 0x00, 0x00, 0x69, 0xa8, 0x1f, 0x00,
357 			  0x0d, 0x02, 0x07, 0x00, 0x01, 0x00, 0x19, 0x00,
358 			  0xf2, 0x00, 0x18, 0x06, 0x10, 0x06, 0x10, 0x00,
359 			  0x36, 0x00,
360 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
361 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
362 			  0x40, 0x20,
363 	0x03, 0x00, 0x03, 0x00, 0x00, 0x00,
364 	0x05, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
365 	0x06, 0x00, 0x02, 0x09, 0x99,
366 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
367 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
368 			  0x00, 0x00, 0x00, 0x00, 0x00,
369 	0x10, 0x00, 0x40, 0x22, 0x02, 0x80, 0x00, 0x1e, 0x00, 0x00, 0x00,
370 			  0x00, 0x00, 0x00, 0x0a, 0x15, 0x08, 0x08, 0x0a,
371 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
372 			  0x00, 0x01, 0x35, 0xfd, 0x07, 0x3d, 0x00, 0x00,
373 			  0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x14, 0x02,
374 			  0x00, 0x01, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
375 			  0x40, 0x00, 0x00, 0x00, 0x40, 0x20, 0x10, 0x06,
376 			  0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06, 0xf7,
377 	0x10, 0x40, 0x40, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80, 0x80,
378 			  0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99, 0xa4,
379 			  0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc, 0xcf,
380 			  0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54, 0x64,
381 			  0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2, 0xe2,
382 			  0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
383 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
384 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
385 	0x10, 0x80, 0x22, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
386 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00, 0x00,
387 			  0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x82, 0x02,
388 			  0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40, 0x01,
389 			  0xf0, 0x00,
390 	0, 0, 0,
391 };
392 static const u8 nw801_start_qvga[] = {
393 	0x02, 0x00, 0x10, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
394 			  0x00, 0x78, 0x18, 0x0b, 0x06, 0xa2, 0x86, 0x78,
395 	0x02, 0x0f, 0x01, 0x6b,
396 	0x10, 0x1a, 0x01, 0x15,
397 	0x00, 0x00, 0x01, 0x1e,
398 	0x10, 0x00, 0x01, 0x2f,
399 	0x10, 0x8c, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
400 	0x10, 0x11, 0x08, 0x29, 0x00, 0x18, 0x01, 0x1f, 0x00, 0xd2, 0x00,
401 							/* AE window */
402 	0, 0, 0,
403 };
404 static const u8 nw801_start_vga[] = {
405 	0x02, 0x00, 0x10, 0x78, 0xa0, 0x97, 0x78, 0xa0, 0x00, 0x00, 0x00,
406 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xf0,
407 	0x02, 0x0f, 0x01, 0xd5,
408 	0x10, 0x1a, 0x01, 0x15,
409 	0x00, 0x00, 0x01, 0x0e,
410 	0x10, 0x00, 0x01, 0x22,
411 	0x10, 0x8c, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
412 	0x10, 0x11, 0x08, 0x51, 0x00, 0x30, 0x02, 0x3d, 0x00, 0xa4, 0x01,
413 	0, 0, 0,
414 };
415 static const u8 nw801_start_2[] = {
416 	0x10, 0x04, 0x01, 0x1a,
417 	0x10, 0x19, 0x01, 0x09,				/* clock */
418 	0x10, 0x24, 0x06, 0xc0, 0x00, 0x3f, 0x02, 0x00, 0x01,
419 							 /* .. gain .. */
420 	0x00, 0x03, 0x02, 0x92, 0x03,
421 	0x00, 0x1d, 0x04, 0xf2, 0x00, 0x24, 0x07,
422 	0x00, 0x7b, 0x01, 0xcf,
423 	0x10, 0x94, 0x01, 0x07,
424 	0x05, 0x05, 0x01, 0x01,
425 	0x05, 0x04, 0x01, 0x01,
426 	0x10, 0x0e, 0x01, 0x08,
427 	0x10, 0x48, 0x11, 0x00, 0x37, 0x55, 0x6b, 0x7d, 0x8d, 0x9b, 0xa8,
428 			  0xb4, 0xbf, 0xca, 0xd4, 0xdd, 0xe6, 0xef, 0xf0,
429 			  0xf0,
430 	0x10, 0x03, 0x01, 0x00,
431 	0x10, 0x0f, 0x02, 0x0c, 0x0c,
432 	0x10, 0x03, 0x01, 0x08,
433 	0x10, 0x48, 0x11, 0x00, 0x37, 0x55, 0x6b, 0x7d, 0x8d, 0x9b, 0xa8,
434 			  0xb4, 0xbf, 0xca, 0xd4, 0xdd, 0xe6, 0xef, 0xf0,
435 			  0xf0,
436 	0x10, 0x0b, 0x01, 0x0b,
437 	0x10, 0x0d, 0x01, 0x0b,
438 	0x10, 0x0c, 0x01, 0x1f,
439 	0x05, 0x06, 0x01, 0x03,
440 	0, 0, 0
441 };
442 
443 /* nw802 (sharp IR3Y38M?) */
444 static const u8 nw802_start[] = {
445 	0x04, 0x06, 0x01, 0x04,
446 	0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0xf9, 0x02, 0x10, 0x00, 0x4d,
447 			  0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
448 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
449 			  0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
450 			  0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
451 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
452 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
453 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
454 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
455 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
456 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
457 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
458 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
459 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
460 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
461 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
462 	0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x68, 0x00,
463 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
464 			  0x00, 0x0c, 0x02, 0x01, 0x00, 0x16, 0x00, 0x94,
465 			  0x00, 0x10, 0x06, 0x08, 0x00, 0x18, 0x00,
466 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
467 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
468 			  0x40, 0x20,
469 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
470 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
471 	0x06, 0x00, 0x02, 0x09, 0x99,
472 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
473 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
474 			  0x00, 0x00, 0x00, 0x00, 0x00,
475 	0x10, 0x00, 0x40, 0xa1, 0x02, 0x80, 0x00, 0x1d, 0x00, 0x00, 0x00,
476 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
477 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
478 			  0x00, 0x49, 0x13, 0xff, 0x01, 0xc0, 0x00, 0x14,
479 			  0x02, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00,
480 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
481 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
482 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
483 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
484 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
485 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
486 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
487 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
488 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
489 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
490 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
491 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
492 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x05, 0x82,
493 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
494 			  0x01, 0xf0, 0x00,
495 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
496 			  0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
497 			  0x40,
498 	0x10, 0x1a, 0x01, 0x00,
499 	0x10, 0x00, 0x01, 0xad,
500 	0x00, 0x00, 0x01, 0x08,
501 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
502 	0x10, 0x1b, 0x02, 0x00, 0x00,
503 	0x10, 0x11, 0x08, 0x51, 0x00, 0xf0, 0x00, 0x3d, 0x00, 0xb4, 0x00,
504 	0x10, 0x1d, 0x08, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0, 0x00, 0xa0,
505 	0x10, 0x0e, 0x01, 0x27,
506 	0x10, 0x41, 0x11, 0x00, 0x0e, 0x35, 0x4f, 0x62, 0x71, 0x7f, 0x8b,
507 			  0x96, 0xa0, 0xa9, 0xb2, 0xbb, 0xc3, 0xca, 0xd2,
508 			  0xd8,
509 	0x10, 0x03, 0x01, 0x00,
510 	0x10, 0x0f, 0x02, 0x14, 0x14,
511 	0x10, 0x03, 0x01, 0x0c,
512 	0x10, 0x41, 0x11, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54, 0x64, 0x74,
513 			  0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2, 0xe2, 0xf1,
514 			  0xff,
515 /*			  0x00, 0x0e, 0x35, 0x4f, 0x62, 0x71, 0x7f, 0x8b,
516  *			  0x96, 0xa0, 0xa9, 0xb2, 0xbb, 0xc3, 0xca, 0xd2,
517  *			  0xd8,	*/
518 	0x10, 0x0b, 0x01, 0x10,
519 	0x10, 0x0d, 0x01, 0x11,
520 	0x10, 0x0c, 0x01, 0x1c,
521 	0x04, 0x06, 0x01, 0x03,
522 	0x04, 0x04, 0x01, 0x00,
523 	0, 0, 0
524 };
525 /* et31x110 - Trust 120 SpaceCam */
526 static const u8 spacecam_init[] = {
527 	0x04, 0x05, 0x01, 0x01,
528 	0x04, 0x04, 0x01, 0x01,
529 	0x04, 0x06, 0x01, 0x04,
530 	0x04, 0x04, 0x03, 0x00, 0x00, 0x00,
531 	0x05, 0x05, 0x01, 0x00,
532 	0, 0, 0
533 };
534 static const u8 spacecam_start[] = {
535 	0x04, 0x06, 0x01, 0x44,
536 	0x00, 0x00, 0x40, 0x10, 0x43, 0x00, 0xb4, 0x01, 0x10, 0x00, 0x4f,
537 			  0xef, 0x0e, 0x00, 0x74, 0x01, 0x01, 0x00, 0x19,
538 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
539 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x3e, 0x00, 0x24,
540 			  0x03, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
541 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
542 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
543 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
544 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
545 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
546 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
547 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
548 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
549 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
550 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
551 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
552 	0x00, 0x80, 0x1f, 0xa0, 0x48, 0xc3, 0x02, 0x88, 0x0c, 0x68, 0x00,
553 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x06, 0x00, 0x08,
554 			  0x00, 0x32, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
555 			  0x00, 0x4b, 0x00, 0x7c, 0x00, 0x80, 0x00,
556 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
557 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
558 			  0x40, 0x20,
559 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
560 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
561 	0x05, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
562 	0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
563 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
564 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
565 			  0x00, 0x00, 0x00,
566 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
567 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
568 			  0x00, 0x00, 0x00, 0x00, 0x00,
569 	0x10, 0x00, 0x40, 0x83, 0x02, 0x20, 0x00, 0x11, 0x00, 0x00, 0x00,
570 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
571 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
572 			  0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
573 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
574 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
575 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
576 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
577 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
578 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
579 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
580 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
581 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
582 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
583 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
584 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
585 	0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
586 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x2d, 0x00, 0x62,
587 			  0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
588 			  0x01, 0x60, 0x01, 0x00, 0x00,
589 	0x04, 0x06, 0x01, 0xc0,
590 	0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
591 	0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
592 			  0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
593 			  0x40,
594 	0x00, 0x80, 0x01, 0xa0,
595 	0x10, 0x1a, 0x01, 0x00,
596 	0x00, 0x91, 0x02, 0x32, 0x01,
597 	0x00, 0x03, 0x02, 0x08, 0x02,
598 	0x10, 0x00, 0x01, 0x83,
599 	0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
600 			  0x20, 0x01, 0x60, 0x01,
601 	0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
602 	0x10, 0x0e, 0x01, 0x08,
603 	0x10, 0x41, 0x11, 0x00, 0x64, 0x99, 0xc0, 0xe2, 0xf9, 0xf9, 0xf9,
604 			  0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
605 			  0xf9,
606 	0x10, 0x03, 0x01, 0x00,
607 	0x10, 0x0f, 0x02, 0x13, 0x13,
608 	0x10, 0x03, 0x01, 0x06,
609 	0x10, 0x41, 0x11, 0x00, 0x64, 0x99, 0xc0, 0xe2, 0xf9, 0xf9, 0xf9,
610 			  0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
611 			  0xf9,
612 	0x10, 0x0b, 0x01, 0x08,
613 	0x10, 0x0d, 0x01, 0x10,
614 	0x10, 0x0c, 0x01, 0x1f,
615 	0x04, 0x06, 0x01, 0xc3,
616 	0x04, 0x05, 0x01, 0x40,
617 	0x04, 0x04, 0x01, 0x40,
618 	0, 0, 0
619 };
620 /* et31x110 - pas106 - other Trust SpaceCam120 */
621 static const u8 spacecam2_start[] = {
622 	0x04, 0x06, 0x01, 0x44,
623 	0x04, 0x06, 0x01, 0x00,
624 	0x00, 0x00, 0x40, 0x14, 0x83, 0x00, 0xba, 0x01, 0x10, 0x00, 0x4f,
625 			  0xef, 0x00, 0x00, 0x60, 0x00, 0x01, 0x00, 0x19,
626 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
627 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x06, 0x00, 0xfc,
628 			  0x01, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
629 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
630 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
631 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
632 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
633 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
634 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
635 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
636 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
637 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
638 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
639 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
640 	0x00, 0x80, 0x1f, 0xb8, 0x48, 0x0f, 0x04, 0x88, 0x14, 0x68, 0x00,
641 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x03,
642 			  0x00, 0x24, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
643 			  0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
644 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
645 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
646 			  0x40, 0x20,
647 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
648 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0x00,
649 	0x05, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
650 	0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
651 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
652 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
653 			  0x00, 0x00, 0x00,
654 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
655 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
656 			  0x00, 0x00, 0x00, 0x00, 0x00,
657 	0x10, 0x00, 0x40, 0x80, 0x02, 0x20, 0x00, 0x13, 0x00, 0x00, 0x00,
658 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
659 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
660 			  0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
661 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
662 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
663 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
664 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
665 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
666 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
667 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
668 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
669 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
670 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
671 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
672 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
673 	0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
674 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x62,
675 			  0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
676 			  0x01, 0x60, 0x01, 0x00, 0x00,
677 	0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
678 	0x04, 0x04, 0x01, 0x40,
679 	0x04, 0x04, 0x01, 0x00,
680 	I2C0, 0x40, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x05,
681 			  0x00, 0x00, 0x05, 0x05,
682 	I2C0, 0x40, 0x02, 0x11, 0x06,
683 	I2C0, 0x40, 0x02, 0x14, 0x00,
684 	I2C0, 0x40, 0x02, 0x13, 0x01,		/* i2c end */
685 	0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
686 			  0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
687 			  0x40,
688 	I2C0, 0x40, 0x02, 0x02, 0x0c,		/* pixel clock */
689 	I2C0, 0x40, 0x02, 0x0f, 0x00,
690 	I2C0, 0x40, 0x02, 0x13, 0x01,		/* i2c end */
691 	0x10, 0x00, 0x01, 0x01,
692 	0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
693 			  0x20, 0x01, 0x60, 0x01,
694 	I2C0, 0x40, 0x02, 0x05, 0x0f,		/* exposure */
695 	I2C0, 0x40, 0x02, 0x13, 0x01,		/* i2c end */
696 	I2C0, 0x40, 0x07, 0x09, 0x0b, 0x0f, 0x05, 0x05, 0x0f, 0x00,
697 						/* gains */
698 	I2C0, 0x40, 0x03, 0x12, 0x04, 0x01,
699 	0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
700 	0x10, 0x0e, 0x01, 0x08,
701 	0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
702 			  0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
703 			  0xf9,
704 	0x10, 0x03, 0x01, 0x00,
705 	0x10, 0x0f, 0x02, 0x13, 0x13,
706 	0x10, 0x03, 0x01, 0x06,
707 	0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
708 			  0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
709 			  0xf9,
710 	0x10, 0x0b, 0x01, 0x11,
711 	0x10, 0x0d, 0x01, 0x10,
712 	0x10, 0x0c, 0x01, 0x14,
713 	0x04, 0x06, 0x01, 0x03,
714 	0x04, 0x05, 0x01, 0x61,
715 	0x04, 0x04, 0x01, 0x00,
716 	0, 0, 0
717 };
718 
719 /* nw802 - Conceptronic Video Pro */
720 static const u8 cvideopro_start[] = {
721 	0x04, 0x06, 0x01, 0x04,
722 	0x00, 0x00, 0x40, 0x54, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x4c,
723 			  0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
724 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
725 			  0x00, 0x0b, 0x00, 0x1b, 0x00, 0xc8, 0x00, 0xf4,
726 			  0x05, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
727 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
728 			  0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
729 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
730 	0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
731 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
732 			  0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
733 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
734 			  0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
735 			  0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
736 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
737 			  0x00, 0x5d, 0x00, 0xc7, 0x00, 0x7e, 0x00, 0x30,
738 	0x00, 0x80, 0x1f, 0x98, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
739 			  0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
740 			  0x00, 0x0c, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
741 			  0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
742 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
743 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
744 			  0x40, 0x20,
745 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
746 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
747 	0x06, 0x00, 0x02, 0x09, 0x99,
748 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
749 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
750 			  0x00, 0x00, 0x00, 0x00, 0x00,
751 	0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
752 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
753 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
754 			  0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
755 			  0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
756 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
757 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
758 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
759 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
760 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
761 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
762 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
763 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
764 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
765 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
766 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
767 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
768 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x82,
769 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
770 			  0x01, 0xf0, 0x00,
771 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x8c, 0x3c, 0x50, 0x00, 0x00, 0x00,
772 			  0x00, 0x78, 0x3f, 0x3f, 0x06, 0xf2, 0x8f, 0xf0,
773 			  0x40,
774 	0x10, 0x1a, 0x01, 0x03,
775 	0x10, 0x00, 0x01, 0xac,
776 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
777 	0x10, 0x1b, 0x02, 0x3b, 0x01,
778 	0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
779 	0x10, 0x1f, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
780 	0x10, 0x1d, 0x02, 0x40, 0x06,
781 	0x10, 0x0e, 0x01, 0x08,
782 	0x10, 0x41, 0x11, 0x00, 0x0f, 0x46, 0x62, 0x76, 0x86, 0x94, 0xa0,
783 			  0xab, 0xb6, 0xbf, 0xc8, 0xcf, 0xd7, 0xdc, 0xdc,
784 			  0xdc,
785 	0x10, 0x03, 0x01, 0x00,
786 	0x10, 0x0f, 0x02, 0x12, 0x12,
787 	0x10, 0x03, 0x01, 0x0c,
788 	0x10, 0x41, 0x11, 0x00, 0x0f, 0x46, 0x62, 0x76, 0x86, 0x94, 0xa0,
789 			  0xab, 0xb6, 0xbf, 0xc8, 0xcf, 0xd7, 0xdc, 0xdc,
790 			  0xdc,
791 	0x10, 0x0b, 0x01, 0x09,
792 	0x10, 0x0d, 0x01, 0x10,
793 	0x10, 0x0c, 0x01, 0x2f,
794 	0x04, 0x06, 0x01, 0x03,
795 	0x04, 0x04, 0x01, 0x00,
796 	0, 0, 0
797 };
798 
799 /* nw802 - D-link dru-350c cam */
800 static const u8 dlink_start[] = {
801 	0x04, 0x06, 0x01, 0x04,
802 	0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x92, 0x03, 0x10, 0x00, 0x4d,
803 			  0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
804 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
805 			  0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
806 			  0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
807 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
808 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
809 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
810 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
811 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
812 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
813 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
814 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
815 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
816 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
817 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
818 	0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x68, 0x00,
819 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
820 			  0x00, 0x0c, 0x02, 0x01, 0x00, 0x16, 0x00, 0x94,
821 			  0x00, 0x10, 0x06, 0x10, 0x00, 0x36, 0x00,
822 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
823 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
824 			  0x40, 0x20,
825 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
826 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
827 	0x06, 0x00, 0x02, 0x09, 0x99,
828 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
829 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
830 			  0x00, 0x00, 0x00, 0x00, 0x00,
831 	0x10, 0x00, 0x40, 0xa1, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
832 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
833 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
834 			  0x00, 0x49, 0x13, 0x00, 0x00, 0xc0, 0x00, 0x14,
835 			  0x02, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00,
836 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
837 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
838 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
839 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
840 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
841 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
842 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
843 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
844 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
845 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
846 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
847 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
848 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x01, 0x82,
849 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
850 			  0x01, 0xf0, 0x00,
851 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
852 			  0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
853 			  0x40,
854 	0x10, 0x1a, 0x01, 0x00,
855 	0x10, 0x00, 0x01, 0xad,
856 	0x00, 0x00, 0x01, 0x08,
857 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
858 	0x10, 0x1b, 0x02, 0x00, 0x00,
859 	0x10, 0x11, 0x08, 0x51, 0x00, 0xf0, 0x00, 0x3d, 0x00, 0xb4, 0x00,
860 	0x10, 0x1d, 0x08, 0x40, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
861 	0x10, 0x0e, 0x01, 0x20,
862 	0x10, 0x41, 0x11, 0x00, 0x07, 0x1e, 0x38, 0x4d, 0x60, 0x70, 0x7f,
863 			  0x8e, 0x9b, 0xa8, 0xb4, 0xbf, 0xca, 0xd5, 0xdf,
864 			  0xea,
865 	0x10, 0x03, 0x01, 0x00,
866 	0x10, 0x0f, 0x02, 0x11, 0x11,
867 	0x10, 0x03, 0x01, 0x10,
868 	0x10, 0x41, 0x11, 0x00, 0x07, 0x1e, 0x38, 0x4d, 0x60, 0x70, 0x7f,
869 			  0x8e, 0x9b, 0xa8, 0xb4, 0xbf, 0xca, 0xd5, 0xdf,
870 			  0xea,
871 	0x10, 0x0b, 0x01, 0x19,
872 	0x10, 0x0d, 0x01, 0x10,
873 	0x10, 0x0c, 0x01, 0x1e,
874 	0x04, 0x06, 0x01, 0x03,
875 	0x04, 0x04, 0x01, 0x00,
876 	0, 0, 0
877 };
878 
879 /* 06a5:d001 - nw801 - Sony
880  *		Plustek Opticam 500U or ProLink DS3303u (Hitachi HD49322BF) */
881 /*fixme: 320x240 only*/
882 static const u8 ds3303_start[] = {
883 	0x05, 0x06, 0x01, 0x04,
884 	0x00, 0x00, 0x40, 0x16, 0x00, 0x00, 0xf9, 0x02, 0x11, 0x00, 0x0e,
885 			  0x01, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
886 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
887 			  0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
888 			  0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
889 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
890 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
891 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
892 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
893 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
894 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
895 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
896 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
897 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
898 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
899 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
900 	0x00, 0x80, 0x22, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x08, 0x00,
901 			  0x00, 0x00, 0x00, 0x00, 0xa9, 0xa8, 0x1f, 0x00,
902 			  0x0d, 0x02, 0x07, 0x00, 0x01, 0x00, 0x19, 0x00,
903 			  0xf2, 0x00, 0x18, 0x06, 0x10, 0x06, 0x10, 0x00,
904 			  0x36, 0x00,
905 	0x02, 0x00, 0x12, 0x03, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
906 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0x50,
907 			  0x40, 0x20,
908 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
909 	0x05, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
910 	0x06, 0x00, 0x02, 0x09, 0x99,
911 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
912 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
913 			  0x00, 0x00, 0x00, 0x00, 0x00,
914 	0x10, 0x00, 0x40, 0x2f, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
915 			  0x00, 0x00, 0x00, 0x10, 0x1f, 0x10, 0x08, 0x0a,
916 			  0x0a, 0x51, 0x00, 0xf1, 0x00, 0x3c, 0x00, 0xb4,
917 			  0x00, 0x01, 0x15, 0xfd, 0x07, 0x3d, 0x00, 0x00,
918 			  0x00, 0x00, 0x00, 0x00, 0x8c, 0x04, 0x01, 0x20,
919 			  0x02, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00, 0x00,
920 			  0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08, 0x03,
921 			  0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06, 0xf7,
922 	0x10, 0x40, 0x40, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80, 0x80,
923 			  0x00, 0x2d, 0x46, 0x58, 0x67, 0x74, 0x7f, 0x88,
924 			  0x94, 0x9d, 0xa6, 0xae, 0xb5, 0xbd, 0xc4, 0xcb,
925 			  0xd1, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54, 0x64,
926 			  0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2, 0xe2,
927 			  0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
928 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
929 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
930 	0x10, 0x80, 0x22, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
931 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x3f, 0x01,
932 			  0x00, 0x00, 0xef, 0x00, 0x02, 0x0a, 0x82, 0x02,
933 			  0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40, 0x01,
934 			  0xf0, 0x00,
935 
936 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
937 			  0x00, 0x78, 0x3f, 0x3f, 0x00, 0xf2, 0x8f, 0x81,
938 			  0x40,
939 	0x10, 0x1a, 0x01, 0x15,
940 	0x10, 0x00, 0x01, 0x2f,
941 	0x10, 0x8c, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
942 	0x10, 0x1b, 0x02, 0x00, 0x00,
943 	0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
944 	0x10, 0x26, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
945 	0x10, 0x24, 0x02, 0x40, 0x06,
946 	0x10, 0x0e, 0x01, 0x08,
947 	0x10, 0x48, 0x11, 0x00, 0x15, 0x40, 0x67, 0x84, 0x9d, 0xb2, 0xc6,
948 			  0xd6, 0xe7, 0xf6, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
949 			  0xf9,
950 	0x10, 0x03, 0x01, 0x00,
951 	0x10, 0x0f, 0x02, 0x16, 0x16,
952 	0x10, 0x03, 0x01, 0x0c,
953 	0x10, 0x48, 0x11, 0x00, 0x15, 0x40, 0x67, 0x84, 0x9d, 0xb2, 0xc6,
954 			  0xd6, 0xe7, 0xf6, 0xf9, 0xf9, 0xf9, 0xf9, 0xf9,
955 			  0xf9,
956 	0x10, 0x0b, 0x01, 0x26,
957 	0x10, 0x0d, 0x01, 0x10,
958 	0x10, 0x0c, 0x01, 0x1c,
959 	0x05, 0x06, 0x01, 0x03,
960 	0x05, 0x04, 0x01, 0x00,
961 	0, 0, 0
962 };
963 
964 /* 06a5:d001 - nw802 - Panasonic
965  *		GP-KR651US (Philips TDA8786) */
966 static const u8 kr651_start_1[] = {
967 	0x04, 0x06, 0x01, 0x04,
968 	0x00, 0x00, 0x40, 0x44, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x48,
969 			  0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
970 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
971 			  0x00, 0x0b, 0x00, 0x1b, 0x00, 0xc8, 0x00, 0xf4,
972 			  0x05, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
973 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
974 			  0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
975 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
976 	0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
977 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
978 			  0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
979 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
980 			  0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
981 			  0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
982 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
983 			  0x00, 0x5d, 0x00, 0xc7, 0x00, 0x7e, 0x00, 0x30,
984 	0x00, 0x80, 0x1f, 0x18, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
985 			  0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
986 			  0x00, 0x0c, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
987 			  0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
988 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
989 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
990 			  0x40, 0x20,
991 	0x03, 0x00, 0x03, 0x02, 0x00, 0x00,
992 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
993 	0x06, 0x00, 0x02, 0x09, 0x99,
994 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
995 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
996 			  0x00, 0x00, 0x00, 0x00, 0x00,
997 	0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
998 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
999 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1000 			  0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
1001 			  0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
1002 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
1003 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
1004 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
1005 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
1006 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
1007 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
1008 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
1009 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
1010 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
1011 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
1012 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
1013 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
1014 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x82,
1015 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
1016 			  0x01, 0xf0, 0x00,
1017 	0, 0, 0
1018 };
1019 static const u8 kr651_start_qvga[] = {
1020 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
1021 			  0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
1022 			  0x40,
1023 	0x10, 0x1a, 0x01, 0x03,
1024 	0x10, 0x00, 0x01, 0xac,
1025 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
1026 	0x10, 0x1b, 0x02, 0x00, 0x00,
1027 	0x10, 0x11, 0x08, 0x29, 0x00, 0x18, 0x01, 0x1f, 0x00, 0xd2, 0x00,
1028 	0x10, 0x1d, 0x06, 0xe0, 0x00, 0x0c, 0x00, 0x52, 0x00,
1029 	0x10, 0x1d, 0x02, 0x28, 0x01,
1030 	0, 0, 0
1031 };
1032 static const u8 kr651_start_vga[] = {
1033 	0x02, 0x00, 0x11, 0x78, 0xa0, 0x8c, 0x78, 0xa0, 0x00, 0x00, 0x00,
1034 			  0x00, 0xf0, 0x30, 0x03, 0x01, 0x82, 0x82, 0x98,
1035 			  0x80,
1036 	0x10, 0x1a, 0x01, 0x03,
1037 	0x10, 0x00, 0x01, 0xa0,
1038 	0x10, 0x85, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
1039 	0x10, 0x1b, 0x02, 0x00, 0x00,
1040 	0x10, 0x11, 0x08, 0x51, 0x00, 0x30, 0x02, 0x3d, 0x00, 0xa4, 0x01,
1041 	0x10, 0x1d, 0x06, 0xe0, 0x00, 0x0c, 0x00, 0x52, 0x00,
1042 	0x10, 0x1d, 0x02, 0x68, 0x00,
1043 };
1044 static const u8 kr651_start_2[] = {
1045 	0x10, 0x0e, 0x01, 0x08,
1046 	0x10, 0x41, 0x11, 0x00, 0x11, 0x3c, 0x5c, 0x74, 0x88, 0x99, 0xa8,
1047 			  0xb7, 0xc4, 0xd0, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
1048 			  0xdc,
1049 	0x10, 0x03, 0x01, 0x00,
1050 	0x10, 0x0f, 0x02, 0x0c, 0x0c,
1051 	0x10, 0x03, 0x01, 0x0c,
1052 	0x10, 0x41, 0x11, 0x00, 0x11, 0x3c, 0x5c, 0x74, 0x88, 0x99, 0xa8,
1053 			  0xb7, 0xc4, 0xd0, 0xdc, 0xdc, 0xdc, 0xdc, 0xdc,
1054 			  0xdc,
1055 	0x10, 0x0b, 0x01, 0x10,
1056 	0x10, 0x0d, 0x01, 0x10,
1057 	0x10, 0x0c, 0x01, 0x2d,
1058 	0x04, 0x06, 0x01, 0x03,
1059 	0x04, 0x04, 0x01, 0x00,
1060 	0, 0, 0
1061 };
1062 
1063 /* nw802 - iRez Kritter cam */
1064 static const u8 kritter_start[] = {
1065 	0x04, 0x06, 0x01, 0x06,
1066 	0x00, 0x00, 0x40, 0x44, 0x96, 0x98, 0x94, 0x03, 0x18, 0x00, 0x48,
1067 			  0x0f, 0x1e, 0x00, 0x0c, 0x02, 0x01, 0x00, 0x19,
1068 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
1069 			  0x00, 0x0b, 0x00, 0x1b, 0x00, 0x0a, 0x01, 0x28,
1070 			  0x07, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
1071 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1072 			  0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
1073 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1074 	0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
1075 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1076 			  0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
1077 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1078 			  0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
1079 			  0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
1080 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
1081 			  0x00, 0x5d, 0x00, 0x0e, 0x00, 0x7e, 0x00, 0x30,
1082 	0x00, 0x80, 0x1f, 0x18, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
1083 			  0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
1084 			  0x00, 0x0b, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
1085 			  0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
1086 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
1087 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
1088 			  0x40, 0x20,
1089 	0x03, 0x00, 0x03, 0x02, 0x00, 0x00,
1090 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
1091 	0x06, 0x00, 0x02, 0x09, 0x99,
1092 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1093 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1094 			  0x00, 0x00, 0x00, 0x00, 0x00,
1095 	0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
1096 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
1097 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1098 			  0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
1099 			  0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
1100 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
1101 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
1102 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
1103 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
1104 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
1105 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
1106 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
1107 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
1108 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
1109 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
1110 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
1111 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
1112 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x82,
1113 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
1114 			  0x01, 0xf0, 0x00,
1115 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x8c, 0x3c, 0x50, 0x00, 0x00, 0x00,
1116 			  0x00, 0x78, 0x3f, 0x3f, 0x06, 0xf2, 0x8f, 0xf0,
1117 			  0x40,
1118 	0x10, 0x1a, 0x01, 0x03,
1119 	0x10, 0x00, 0x01, 0xaf,
1120 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
1121 	0x10, 0x1b, 0x02, 0x3b, 0x01,
1122 	0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
1123 	0x10, 0x1d, 0x06, 0xe0, 0x00, 0x0c, 0x00, 0x52, 0x00,
1124 	0x10, 0x1d, 0x02, 0x00, 0x00,
1125 	0x10, 0x0e, 0x01, 0x08,
1126 	0x10, 0x41, 0x11, 0x00, 0x0d, 0x36, 0x4e, 0x60, 0x6f, 0x7b, 0x86,
1127 			  0x90, 0x98, 0xa1, 0xa9, 0xb1, 0xb7, 0xbe, 0xc4,
1128 			  0xcb,
1129 	0x10, 0x03, 0x01, 0x00,
1130 	0x10, 0x0f, 0x02, 0x0d, 0x0d,
1131 	0x10, 0x03, 0x01, 0x02,
1132 	0x10, 0x41, 0x11, 0x00, 0x0d, 0x36, 0x4e, 0x60, 0x6f, 0x7b, 0x86,
1133 			  0x90, 0x98, 0xa1, 0xa9, 0xb1, 0xb7, 0xbe, 0xc4,
1134 			  0xcb,
1135 	0x10, 0x0b, 0x01, 0x17,
1136 	0x10, 0x0d, 0x01, 0x10,
1137 	0x10, 0x0c, 0x01, 0x1e,
1138 	0x04, 0x06, 0x01, 0x03,
1139 	0x04, 0x04, 0x01, 0x00,
1140 	0, 0, 0
1141 };
1142 
1143 /* nw802 - Mustek Wcam 300 mini */
1144 static const u8 mustek_start[] = {
1145 	0x04, 0x06, 0x01, 0x04,
1146 	0x00, 0x00, 0x40, 0x10, 0x00, 0x00, 0x92, 0x03, 0x10, 0x00, 0x4d,
1147 			  0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
1148 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
1149 			  0x00, 0x01, 0x00, 0x19, 0x00, 0xce, 0x00, 0xf4,
1150 			  0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
1151 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
1152 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
1153 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
1154 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
1155 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
1156 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
1157 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
1158 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
1159 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
1160 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
1161 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
1162 	0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x3f, 0x0f, 0x88, 0x20, 0x68, 0x00,
1163 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
1164 			  0x00, 0x0c, 0x02, 0x01, 0x00, 0x16, 0x00, 0x94,
1165 			  0x00, 0x10, 0x06, 0xfc, 0x05, 0x0c, 0x06,
1166 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
1167 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
1168 			  0x40, 0x20,
1169 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
1170 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
1171 	0x06, 0x00, 0x02, 0x09, 0x99,
1172 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1173 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1174 			  0x00, 0x00, 0x00, 0x00, 0x00,
1175 	0x10, 0x00, 0x40, 0xa1, 0x02, 0x80, 0x00, 0x13, 0x00, 0x00, 0x00,
1176 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
1177 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1178 			  0x00, 0x49, 0x13, 0x00, 0x00, 0xc0, 0x00, 0x14,
1179 			  0x02, 0x00, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00,
1180 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
1181 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
1182 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
1183 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
1184 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
1185 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
1186 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
1187 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
1188 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
1189 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
1190 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
1191 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
1192 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x01, 0x82,
1193 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
1194 			  0x01, 0xf0, 0x00,
1195 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
1196 			  0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
1197 			  0x40,
1198 	0x10, 0x1a, 0x01, 0x00,
1199 	0x10, 0x00, 0x01, 0xad,
1200 	0x00, 0x00, 0x01, 0x08,
1201 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
1202 	0x10, 0x1b, 0x02, 0x00, 0x00,
1203 	0x10, 0x11, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
1204 	0x10, 0x1d, 0x08, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20, 0x00, 0x20,
1205 	0x10, 0x0e, 0x01, 0x0f,
1206 	0x10, 0x41, 0x11, 0x00, 0x0f, 0x29, 0x4a, 0x64, 0x7a, 0x8c, 0x9e,
1207 			  0xad, 0xba, 0xc7, 0xd3, 0xde, 0xe8, 0xf1, 0xf9,
1208 			  0xff,
1209 	0x10, 0x0f, 0x02, 0x11, 0x11,
1210 	0x10, 0x03, 0x01, 0x0c,
1211 	0x10, 0x41, 0x11, 0x00, 0x0f, 0x29, 0x4a, 0x64, 0x7a, 0x8c, 0x9e,
1212 			  0xad, 0xba, 0xc7, 0xd3, 0xde, 0xe8, 0xf1, 0xf9,
1213 			  0xff,
1214 	0x10, 0x0b, 0x01, 0x1c,
1215 	0x10, 0x0d, 0x01, 0x1a,
1216 	0x10, 0x0c, 0x01, 0x34,
1217 	0x04, 0x05, 0x01, 0x61,
1218 	0x04, 0x04, 0x01, 0x40,
1219 	0x04, 0x06, 0x01, 0x03,
1220 	0, 0, 0
1221 };
1222 
1223 /* nw802 - Scope USB Microscope M2 (ProScope) (Hitachi HD49322BF) */
1224 static const u8 proscope_init[] = {
1225 	0x04, 0x05, 0x01, 0x21,
1226 	0x04, 0x04, 0x01, 0x01,
1227 	0, 0, 0
1228 };
1229 static const u8 proscope_start_1[] = {
1230 	0x04, 0x06, 0x01, 0x04,
1231 	0x00, 0x00, 0x40, 0x10, 0x01, 0x00, 0xf9, 0x02, 0x10, 0x00, 0x04,
1232 			  0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
1233 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
1234 			  0x00, 0x08, 0x00, 0x17, 0x00, 0xce, 0x00, 0xf4,
1235 			  0x05, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
1236 			  0x00, 0xce, 0x00, 0xf8, 0x03, 0x3e, 0x00, 0x86,
1237 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
1238 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
1239 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0xb6,
1240 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
1241 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
1242 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
1243 			  0x00, 0xf6, 0x03, 0x34, 0x04, 0xf6, 0x03, 0x34,
1244 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
1245 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xe8,
1246 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
1247 	0x00, 0x80, 0x1f, 0xb4, 0x6f, 0x1f, 0x0f, 0x08, 0x20, 0xa8, 0x00,
1248 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
1249 			  0x00, 0x0c, 0x02, 0x01, 0x00, 0x19, 0x00, 0x94,
1250 			  0x00, 0x10, 0x06, 0x10, 0x00, 0x36, 0x00,
1251 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
1252 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
1253 			  0x40, 0x20,
1254 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
1255 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x21, 0x00,
1256 	0x06, 0x00, 0x02, 0x09, 0x99,
1257 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1258 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1259 			  0x00, 0x00, 0x00, 0x00, 0x00,
1260 	0x10, 0x00, 0x40, 0xad, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
1261 			  0x00, 0x00, 0x00, 0x10, 0x1f, 0x10, 0x08, 0x0a,
1262 			  0x0a, 0x51, 0x00, 0xf1, 0x00, 0x3c, 0x00, 0xb4,
1263 			  0x00, 0x49, 0x13, 0x00, 0x00, 0x8c, 0x04, 0x01,
1264 			  0x20, 0x02, 0x00, 0x03, 0x00, 0x20, 0x00, 0x00,
1265 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
1266 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
1267 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
1268 	0x10, 0x40, 0x40, 0x80, 0x00, 0x2d, 0x46, 0x58, 0x67, 0x74, 0x7f,
1269 			  0x88, 0x94, 0x9d, 0xa6, 0xae, 0xb5, 0xbd, 0xc4,
1270 			  0xcb, 0xd1, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
1271 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
1272 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
1273 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
1274 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
1275 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
1276 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x3f,
1277 			  0x01, 0x00, 0x00, 0xef, 0x00, 0x09, 0x05, 0x82,
1278 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
1279 			  0x01, 0xf0, 0x00,
1280 	0, 0, 0
1281 };
1282 static const u8 proscope_start_qvga[] = {
1283 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x9e, 0x3c, 0x50, 0x00, 0x00, 0x00,
1284 			  0x00, 0x78, 0x3f, 0x10, 0x02, 0xf2, 0x8f, 0x78,
1285 			  0x40,
1286 	0x10, 0x1a, 0x01, 0x06,
1287 	0x00, 0x03, 0x02, 0xf9, 0x02,
1288 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
1289 	0x10, 0x1b, 0x02, 0x00, 0x00,
1290 	0x10, 0x11, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
1291 	0x10, 0x1d, 0x08, 0xc0, 0x0d, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
1292 	0x10, 0x0e, 0x01, 0x10,
1293 	0, 0, 0
1294 };
1295 static const u8 proscope_start_vga[] = {
1296 	0x00, 0x03, 0x02, 0xf9, 0x02,
1297 	0x10, 0x85, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
1298 	0x02, 0x00, 0x11, 0x78, 0xa0, 0x8c, 0x78, 0xa0, 0x00, 0x00, 0x00,
1299 			  0x00, 0xf0, 0x16, 0x00, 0x00, 0x82, 0x84, 0x00,
1300 			  0x80,
1301 	0x10, 0x1a, 0x01, 0x06,
1302 	0x10, 0x00, 0x01, 0xa1,
1303 	0x10, 0x1b, 0x02, 0x00, 0x00,
1304 	0x10, 0x1d, 0x08, 0xc0, 0x0d, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
1305 	0x10, 0x11, 0x08, 0x00, 0x00, 0x7f, 0x02, 0x00, 0x00, 0xdf, 0x01,
1306 	0x10, 0x0e, 0x01, 0x10,
1307 	0x10, 0x41, 0x11, 0x00, 0x10, 0x51, 0x6e, 0x83, 0x93, 0xa1, 0xae,
1308 			  0xb9, 0xc3, 0xcc, 0xd4, 0xdd, 0xe4, 0xeb, 0xf2,
1309 			  0xf9,
1310 	0x10, 0x03, 0x01, 0x00,
1311 	0, 0, 0
1312 };
1313 static const u8 proscope_start_2[] = {
1314 	0x10, 0x0f, 0x02, 0x0c, 0x0c,
1315 	0x10, 0x03, 0x01, 0x0c,
1316 	0x10, 0x41, 0x11, 0x00, 0x10, 0x51, 0x6e, 0x83, 0x93, 0xa1, 0xae,
1317 			  0xb9, 0xc3, 0xcc, 0xd4, 0xdd, 0xe4, 0xeb, 0xf2,
1318 			  0xf9,
1319 	0x10, 0x0b, 0x01, 0x0b,
1320 	0x10, 0x0d, 0x01, 0x10,
1321 	0x10, 0x0c, 0x01, 0x1b,
1322 	0x04, 0x06, 0x01, 0x03,
1323 	0x04, 0x05, 0x01, 0x21,
1324 	0x04, 0x04, 0x01, 0x00,
1325 	0, 0, 0
1326 };
1327 
1328 /* nw800 - hv7121b? (seems pas106) - Divio Chicony TwinkleCam */
1329 static const u8 twinkle_start[] = {
1330 	0x04, 0x06, 0x01, 0x44,
1331 	0x04, 0x06, 0x01, 0x00,
1332 	0x00, 0x00, 0x40, 0x14, 0x83, 0x00, 0xba, 0x01, 0x10, 0x00, 0x4f,
1333 			  0xef, 0x00, 0x00, 0x60, 0x00, 0x01, 0x00, 0x19,
1334 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
1335 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x06, 0x00, 0xfc,
1336 			  0x01, 0x3e, 0x00, 0x86, 0x00, 0x3e, 0x00, 0x86,
1337 			  0x00, 0x3e, 0x00, 0x86, 0x00, 0x01, 0x00, 0x01,
1338 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x56, 0x00, 0x9e,
1339 			  0x00, 0x56, 0x00, 0x9e, 0x00, 0x01, 0x00, 0x01,
1340 	0x00, 0x40, 0x40, 0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
1341 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
1342 			  0x00, 0x6e, 0x00, 0xb6, 0x00, 0x6e, 0x00, 0x78,
1343 			  0x04, 0x6e, 0x00, 0xb6, 0x00, 0x01, 0x00, 0x01,
1344 			  0x00, 0xca, 0x03, 0x46, 0x04, 0xca, 0x03, 0x46,
1345 			  0x04, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
1346 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0xf0,
1347 			  0x00, 0x3e, 0x00, 0xaa, 0x00, 0x88, 0x00, 0x2e,
1348 	0x00, 0x80, 0x1f, 0xb8, 0x48, 0x0f, 0x04, 0x88, 0x14, 0x68, 0x00,
1349 			  0x00, 0x00, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x03,
1350 			  0x00, 0x24, 0x01, 0x01, 0x00, 0x16, 0x00, 0x04,
1351 			  0x00, 0x4b, 0x00, 0x76, 0x00, 0x86, 0x00,
1352 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
1353 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
1354 			  0x40, 0x20,
1355 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
1356 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0x61, 0x00,
1357 	0x05, 0x00, 0x06, 0xe0, 0x00, 0x00, 0x00, 0x00, 0x00,
1358 	0x06, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1359 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1360 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1361 			  0x00, 0x00, 0x00,
1362 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1363 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1364 			  0x00, 0x00, 0x00, 0x00, 0x00,
1365 	0x10, 0x00, 0x40, 0x80, 0x02, 0x20, 0x00, 0x11, 0x00, 0x00, 0x00,
1366 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x08,
1367 			  0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1368 			  0x00, 0x49, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00,
1369 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
1370 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
1371 			  0x03, 0x00, 0x00, 0x10, 0x00, 0x20, 0x10, 0x06,
1372 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x00, 0x80,
1373 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
1374 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
1375 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
1376 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
1377 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
1378 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
1379 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
1380 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
1381 	0x10, 0x80, 0x1d, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
1382 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x62,
1383 			  0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01, 0x20,
1384 			  0x01, 0x60, 0x01, 0x00, 0x00,
1385 
1386 	0x10, 0x85, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
1387 	0x04, 0x04, 0x01, 0x10,
1388 	0x04, 0x04, 0x01, 0x00,
1389 	0x04, 0x05, 0x01, 0x61,
1390 	0x04, 0x04, 0x01, 0x01,
1391 	I2C0, 0x40, 0x0c, 0x02, 0x0c, 0x12, 0x07, 0x00, 0x00, 0x00, 0x00,
1392 			  0x00, 0x00, 0x00, 0x0a,
1393 	I2C0, 0x40, 0x02, 0x11, 0x06,
1394 	I2C0, 0x40, 0x02, 0x14, 0x00,
1395 	I2C0, 0x40, 0x02, 0x13, 0x01,		/* i2c end */
1396 	I2C0, 0x40, 0x02, 0x07, 0x01,
1397 	0x02, 0x00, 0x11, 0x48, 0x58, 0x9e, 0x48, 0x58, 0x00, 0x00, 0x00,
1398 			  0x00, 0x84, 0x36, 0x05, 0x01, 0xf2, 0x86, 0x65,
1399 			  0x40,
1400 	I2C0, 0x40, 0x02, 0x02, 0x0c,
1401 	I2C0, 0x40, 0x02, 0x13, 0x01,
1402 	0x10, 0x00, 0x01, 0x01,
1403 	0x10, 0x8f, 0x0c, 0x62, 0x01, 0x24, 0x01, 0x62, 0x01, 0x24, 0x01,
1404 			  0x20, 0x01, 0x60, 0x01,
1405 	I2C0, 0x40, 0x02, 0x05, 0x0f,
1406 	I2C0, 0x40, 0x02, 0x13, 0x01,
1407 	I2C0, 0x40, 0x08, 0x08, 0x04, 0x0b, 0x01, 0x01, 0x02, 0x00, 0x17,
1408 	I2C0, 0x40, 0x03, 0x12, 0x00, 0x01,
1409 	0x10, 0x11, 0x08, 0x00, 0x00, 0x5f, 0x01, 0x00, 0x00, 0x1f, 0x01,
1410 	I2C0, 0x40, 0x02, 0x12, 0x00,
1411 	I2C0, 0x40, 0x02, 0x0e, 0x00,
1412 	I2C0, 0x40, 0x02, 0x11, 0x06,
1413 	0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
1414 			  0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
1415 			  0xf9,
1416 	0x10, 0x03, 0x01, 0x00,
1417 	0x10, 0x0f, 0x02, 0x0c, 0x0c,
1418 	0x10, 0x03, 0x01, 0x06,
1419 	0x10, 0x41, 0x11, 0x00, 0x17, 0x3f, 0x69, 0x7b, 0x8c, 0x9a, 0xa7,
1420 			  0xb3, 0xbf, 0xc9, 0xd3, 0xdd, 0xe6, 0xef, 0xf7,
1421 			  0xf9,
1422 	0x10, 0x0b, 0x01, 0x19,
1423 	0x10, 0x0d, 0x01, 0x10,
1424 	0x10, 0x0c, 0x01, 0x0d,
1425 	0x04, 0x06, 0x01, 0x03,
1426 	0x04, 0x05, 0x01, 0x61,
1427 	0x04, 0x04, 0x01, 0x41,
1428 	0, 0, 0
1429 };
1430 
1431 /* nw802 dvc-v6 */
1432 static const u8 dvcv6_start[] = {
1433 	0x04, 0x06, 0x01, 0x06,
1434 	0x00, 0x00, 0x40, 0x54, 0x96, 0x98, 0xf9, 0x02, 0x18, 0x00, 0x4c,
1435 			  0x0f, 0x1f, 0x00, 0x0d, 0x02, 0x01, 0x00, 0x19,
1436 			  0x00, 0x01, 0x00, 0x19, 0x00, 0x01, 0x00, 0x19,
1437 			  0x00, 0x0b, 0x00, 0x1b, 0x00, 0xc8, 0x00, 0xf4,
1438 			  0x05, 0xb4, 0x00, 0xcc, 0x00, 0x01, 0x00, 0x01,
1439 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1440 			  0x00, 0xa2, 0x00, 0xc6, 0x00, 0x60, 0x00, 0xc6,
1441 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1442 	0x00, 0x40, 0x40, 0x00, 0xae, 0x00, 0xd2, 0x00, 0xae, 0x00, 0xd2,
1443 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1444 			  0x00, 0xa8, 0x00, 0xc0, 0x00, 0x66, 0x00, 0xc0,
1445 			  0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01,
1446 			  0x00, 0x0a, 0x00, 0x54, 0x00, 0x0a, 0x00, 0x54,
1447 			  0x00, 0x10, 0x00, 0x36, 0x00, 0xd2, 0x00, 0xee,
1448 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6,
1449 			  0x00, 0x5d, 0x00, 0xc7, 0x00, 0x7e, 0x00, 0x30,
1450 	0x00, 0x80, 0x1f, 0x98, 0x43, 0x3f, 0x0d, 0x88, 0x20, 0x80, 0x3f,
1451 			  0x47, 0xaf, 0x00, 0x00, 0xa8, 0x08, 0x00, 0x11,
1452 			  0x00, 0x0c, 0x02, 0x0c, 0x00, 0x1c, 0x00, 0x94,
1453 			  0x00, 0x10, 0x06, 0x24, 0x00, 0x4a, 0x00,
1454 	0x02, 0x00, 0x12, 0x78, 0xa0, 0x9e, 0x78, 0xa0, 0x00, 0x00, 0x00,
1455 			  0x00, 0xf0, 0x18, 0x0b, 0x06, 0x62, 0x82, 0xa0,
1456 			  0x40, 0x20,
1457 	0x03, 0x00, 0x03, 0x03, 0x00, 0x00,
1458 	0x04, 0x00, 0x07, 0x01, 0x10, 0x00, 0x00, 0x00, 0xff, 0x00,
1459 	0x06, 0x00, 0x02, 0x09, 0x99,
1460 	0x08, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1461 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1462 			  0x00, 0x00, 0x00, 0x00, 0x00,
1463 	0x10, 0x00, 0x40, 0xa0, 0x02, 0x80, 0x00, 0x12, 0x00, 0x00, 0x00,
1464 			  0x00, 0x00, 0x00, 0x10, 0x10, 0x10, 0x08, 0x0a,
1465 			  0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
1466 			  0x00, 0x49, 0x13, 0x00, 0x00, 0xe0, 0x00, 0x0c,
1467 			  0x00, 0x52, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
1468 			  0x00, 0x20, 0x00, 0x00, 0x00, 0x20, 0x10, 0x08,
1469 			  0x03, 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x06,
1470 			  0xf7, 0xee, 0x1c, 0x1c, 0xe9, 0xfc, 0x10, 0x80,
1471 	0x10, 0x40, 0x40, 0x80, 0x00, 0x05, 0x35, 0x5e, 0x78, 0x8b, 0x99,
1472 			  0xa4, 0xae, 0xb5, 0xbc, 0xc1, 0xc6, 0xc9, 0xcc,
1473 			  0xcf, 0xd0, 0x00, 0x11, 0x22, 0x32, 0x43, 0x54,
1474 			  0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3, 0xd2,
1475 			  0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32, 0x43,
1476 			  0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3, 0xc3,
1477 			  0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x11, 0x22, 0x32,
1478 			  0x43, 0x54, 0x64, 0x74, 0x84, 0x94, 0xa4, 0xb3,
1479 	0x10, 0x80, 0x1b, 0xc3, 0xd2, 0xe2, 0xf1, 0xff, 0x00, 0x00, 0x00,
1480 			  0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x05, 0x82,
1481 			  0x02, 0xe4, 0x01, 0x40, 0x01, 0xf0, 0x00, 0x40,
1482 			  0x01, 0xf0, 0x00,
1483 	0x00, 0x03, 0x02, 0x94, 0x03,
1484 	0x00, 0x1d, 0x04, 0x0a, 0x01, 0x28, 0x07,
1485 	0x00, 0x7b, 0x02, 0xe0, 0x00,
1486 	0x10, 0x8d, 0x01, 0x00,
1487 	0x00, 0x09, 0x04, 0x1e, 0x00, 0x0c, 0x02,
1488 	0x00, 0x91, 0x02, 0x0b, 0x02,
1489 	0x10, 0x00, 0x01, 0xaf,
1490 	0x02, 0x00, 0x11, 0x3c, 0x50, 0x8f, 0x3c, 0x50, 0x00, 0x00, 0x00,
1491 			  0x00, 0x78, 0x3f, 0x3f, 0x06, 0xf2, 0x8f, 0xf0,
1492 			  0x40,
1493 	0x10, 0x1a, 0x01, 0x02,
1494 	0x10, 0x00, 0x01, 0xaf,
1495 	0x10, 0x85, 0x08, 0x00, 0x00, 0x3f, 0x01, 0x00, 0x00, 0xef, 0x00,
1496 	0x10, 0x1b, 0x02, 0x07, 0x01,
1497 	0x10, 0x11, 0x08, 0x61, 0x00, 0xe0, 0x00, 0x49, 0x00, 0xa8, 0x00,
1498 	0x10, 0x1f, 0x06, 0x01, 0x20, 0x02, 0xe8, 0x03, 0x00,
1499 	0x10, 0x1d, 0x02, 0x40, 0x06,
1500 	0x10, 0x0e, 0x01, 0x08,
1501 	0x10, 0x41, 0x11, 0x00, 0x0f, 0x54, 0x6f, 0x82, 0x91, 0x9f, 0xaa,
1502 			  0xb4, 0xbd, 0xc5, 0xcd, 0xd5, 0xdb, 0xdc, 0xdc,
1503 			  0xdc,
1504 	0x10, 0x03, 0x01, 0x00,
1505 	0x10, 0x0f, 0x02, 0x12, 0x12,
1506 	0x10, 0x03, 0x01, 0x11,
1507 	0x10, 0x41, 0x11, 0x00, 0x0f, 0x54, 0x6f, 0x82, 0x91, 0x9f, 0xaa,
1508 			  0xb4, 0xbd, 0xc5, 0xcd, 0xd5, 0xdb, 0xdc, 0xdc,
1509 			  0xdc,
1510 	0x10, 0x0b, 0x01, 0x16,
1511 	0x10, 0x0d, 0x01, 0x10,
1512 	0x10, 0x0c, 0x01, 0x1a,
1513 	0x04, 0x06, 0x01, 0x03,
1514 	0x04, 0x04, 0x01, 0x00,
1515 };
1516 
1517 static const u8 *webcam_start[] = {
1518 	[Generic800] = nw800_start,
1519 	[SpaceCam] = spacecam_start,
1520 	[SpaceCam2] = spacecam2_start,
1521 	[Cvideopro] = cvideopro_start,
1522 	[Dlink350c] = dlink_start,
1523 	[DS3303u] = ds3303_start,
1524 	[Kr651us] = kr651_start_1,
1525 	[Kritter] = kritter_start,
1526 	[Mustek300] = mustek_start,
1527 	[Proscope] = proscope_start_1,
1528 	[Twinkle] = twinkle_start,
1529 	[DvcV6] = dvcv6_start,
1530 	[P35u] = nw801_start_1,
1531 	[Generic802] = nw802_start,
1532 };
1533 
1534 /* -- write a register -- */
1535 static void reg_w(struct gspca_dev *gspca_dev,
1536 			u16 index,
1537 			const u8 *data,
1538 			int len)
1539 {
1540 	struct usb_device *dev = gspca_dev->dev;
1541 	int ret;
1542 
1543 	if (gspca_dev->usb_err < 0)
1544 		return;
1545 	if (len == 1)
1546 		gspca_dbg(gspca_dev, D_USBO, "SET 00 0000 %04x %02x\n",
1547 			  index, *data);
1548 	else
1549 		gspca_dbg(gspca_dev, D_USBO, "SET 00 0000 %04x %02x %02x ...\n",
1550 			  index, *data, data[1]);
1551 	memcpy(gspca_dev->usb_buf, data, len);
1552 	ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1553 			0x00,
1554 			USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1555 			0x00,		/* value */
1556 			index,
1557 			gspca_dev->usb_buf,
1558 			len,
1559 			500);
1560 	if (ret < 0) {
1561 		pr_err("reg_w err %d\n", ret);
1562 		gspca_dev->usb_err = ret;
1563 	}
1564 }
1565 
1566 /* -- read registers in usb_buf -- */
1567 static void reg_r(struct gspca_dev *gspca_dev,
1568 			u16 index,
1569 			int len)
1570 {
1571 	struct usb_device *dev = gspca_dev->dev;
1572 	int ret;
1573 
1574 	if (gspca_dev->usb_err < 0)
1575 		return;
1576 	ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
1577 			0x00,
1578 			USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
1579 			0x00, index,
1580 			gspca_dev->usb_buf, len, 500);
1581 	if (ret < 0) {
1582 		pr_err("reg_r err %d\n", ret);
1583 		gspca_dev->usb_err = ret;
1584 		return;
1585 	}
1586 	if (len == 1)
1587 		gspca_dbg(gspca_dev, D_USBI, "GET 00 0000 %04x %02x\n",
1588 			  index, gspca_dev->usb_buf[0]);
1589 	else
1590 		gspca_dbg(gspca_dev, D_USBI, "GET 00 0000 %04x %02x %02x ..\n",
1591 			  index, gspca_dev->usb_buf[0],
1592 			  gspca_dev->usb_buf[1]);
1593 }
1594 
1595 static void i2c_w(struct gspca_dev *gspca_dev,
1596 			u8 i2c_addr,
1597 			const u8 *data,
1598 			int len)
1599 {
1600 	u8 val[2];
1601 	int i;
1602 
1603 	reg_w(gspca_dev, 0x0600, data + 1, len - 1);
1604 	reg_w(gspca_dev, 0x0600, data, len);
1605 	val[0] = len;
1606 	val[1] = i2c_addr;
1607 	reg_w(gspca_dev, 0x0502, val, 2);
1608 	val[0] = 0x01;
1609 	reg_w(gspca_dev, 0x0501, val, 1);
1610 	for (i = 5; --i >= 0; ) {
1611 		msleep(4);
1612 		reg_r(gspca_dev, 0x0505, 1);
1613 		if (gspca_dev->usb_err < 0)
1614 			return;
1615 		if (gspca_dev->usb_buf[0] == 0)
1616 			return;
1617 	}
1618 	gspca_dev->usb_err = -ETIME;
1619 }
1620 
1621 static void reg_w_buf(struct gspca_dev *gspca_dev,
1622 			const u8 *cmd)
1623 {
1624 	u16 reg;
1625 	int len;
1626 
1627 	for (;;) {
1628 		reg = *cmd++ << 8;
1629 		reg += *cmd++;
1630 		len = *cmd++;
1631 		if (len == 0)
1632 			break;
1633 		if (cmd[-3] != I2C0)
1634 			reg_w(gspca_dev, reg, cmd, len);
1635 		else
1636 			i2c_w(gspca_dev, reg, cmd, len);
1637 		cmd += len;
1638 	}
1639 }
1640 
1641 static int swap_bits(int v)
1642 {
1643 	int r, i;
1644 
1645 	r = 0;
1646 	for (i = 0; i < 8; i++) {
1647 		r <<= 1;
1648 		if (v & 1)
1649 			r++;
1650 		v >>= 1;
1651 	}
1652 	return r;
1653 }
1654 
1655 static void setgain(struct gspca_dev *gspca_dev, u8 val)
1656 {
1657 	struct sd *sd = (struct sd *) gspca_dev;
1658 	u8 v[2];
1659 
1660 	switch (sd->webcam) {
1661 	case P35u:
1662 		reg_w(gspca_dev, 0x1026, &val, 1);
1663 		break;
1664 	case Kr651us:
1665 		/* 0 - 253 */
1666 		val = swap_bits(val);
1667 		v[0] = val << 3;
1668 		v[1] = val >> 5;
1669 		reg_w(gspca_dev, 0x101d, v, 2);	/* SIF reg0/1 (AGC) */
1670 		break;
1671 	}
1672 }
1673 
1674 static void setexposure(struct gspca_dev *gspca_dev, s32 val)
1675 {
1676 	struct sd *sd = (struct sd *) gspca_dev;
1677 	u8 v[2];
1678 
1679 	switch (sd->webcam) {
1680 	case P35u:
1681 		v[0] = ((9 - val) << 3) | 0x01;
1682 		reg_w(gspca_dev, 0x1019, v, 1);
1683 		break;
1684 	case Cvideopro:
1685 	case DvcV6:
1686 	case Kritter:
1687 	case Kr651us:
1688 		v[0] = val;
1689 		v[1] = val >> 8;
1690 		reg_w(gspca_dev, 0x101b, v, 2);
1691 		break;
1692 	}
1693 }
1694 
1695 static void setautogain(struct gspca_dev *gspca_dev, s32 val)
1696 {
1697 	struct sd *sd = (struct sd *) gspca_dev;
1698 	int w, h;
1699 
1700 	if (!val) {
1701 		sd->ag_cnt = -1;
1702 		return;
1703 	}
1704 	sd->ag_cnt = AG_CNT_START;
1705 
1706 	reg_r(gspca_dev, 0x1004, 1);
1707 	if (gspca_dev->usb_buf[0] & 0x04) {	/* if AE_FULL_FRM */
1708 		sd->ae_res = gspca_dev->pixfmt.width * gspca_dev->pixfmt.height;
1709 	} else {				/* get the AE window size */
1710 		reg_r(gspca_dev, 0x1011, 8);
1711 		w = (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0]
1712 		  - (gspca_dev->usb_buf[3] << 8) - gspca_dev->usb_buf[2];
1713 		h = (gspca_dev->usb_buf[5] << 8) + gspca_dev->usb_buf[4]
1714 		  - (gspca_dev->usb_buf[7] << 8) - gspca_dev->usb_buf[6];
1715 		sd->ae_res = h * w;
1716 		if (sd->ae_res == 0)
1717 			sd->ae_res = gspca_dev->pixfmt.width *
1718 					gspca_dev->pixfmt.height;
1719 	}
1720 }
1721 
1722 static int nw802_test_reg(struct gspca_dev *gspca_dev,
1723 			u16 index,
1724 			u8 value)
1725 {
1726 	/* write the value */
1727 	reg_w(gspca_dev, index, &value, 1);
1728 
1729 	/* read it */
1730 	reg_r(gspca_dev, index, 1);
1731 
1732 	return gspca_dev->usb_buf[0] == value;
1733 }
1734 
1735 /* this function is called at probe time */
1736 static int sd_config(struct gspca_dev *gspca_dev,
1737 			const struct usb_device_id *id)
1738 {
1739 	struct sd *sd = (struct sd *) gspca_dev;
1740 
1741 	if ((unsigned) webcam >= NWEBCAMS)
1742 		webcam = 0;
1743 	sd->webcam = webcam;
1744 	gspca_dev->cam.needs_full_bandwidth = 1;
1745 	sd->ag_cnt = -1;
1746 
1747 	/*
1748 	 * Autodetect sequence inspired from some log.
1749 	 * We try to detect what registers exist or not.
1750 	 * If 0x0500 does not exist => NW802
1751 	 * If it does, test 0x109b. If it doesn't exist,
1752 	 * then it's a NW801. Else, a NW800
1753 	 * If a et31x110 (nw800 and 06a5:d800)
1754 	 *	get the sensor ID
1755 	 */
1756 	if (!nw802_test_reg(gspca_dev, 0x0500, 0x55)) {
1757 		sd->bridge = BRIDGE_NW802;
1758 		if (sd->webcam == Generic800)
1759 			sd->webcam = Generic802;
1760 	} else if (!nw802_test_reg(gspca_dev, 0x109b, 0xaa)) {
1761 		sd->bridge = BRIDGE_NW801;
1762 		if (sd->webcam == Generic800)
1763 			sd->webcam = P35u;
1764 	} else if (id->idVendor == 0x06a5 && id->idProduct == 0xd800) {
1765 		reg_r(gspca_dev, 0x0403, 1);		/* GPIO */
1766 		gspca_dbg(gspca_dev, D_PROBE, "et31x110 sensor type %02x\n",
1767 			  gspca_dev->usb_buf[0]);
1768 		switch (gspca_dev->usb_buf[0] >> 1) {
1769 		case 0x00:				/* ?? */
1770 			if (sd->webcam == Generic800)
1771 				sd->webcam = SpaceCam;
1772 			break;
1773 		case 0x01:				/* Hynix? */
1774 			if (sd->webcam == Generic800)
1775 				sd->webcam = Twinkle;
1776 			break;
1777 		case 0x0a:				/* Pixart */
1778 			if (sd->webcam == Generic800)
1779 				sd->webcam = SpaceCam2;
1780 			break;
1781 		}
1782 	}
1783 	if (webcam_chip[sd->webcam] != sd->bridge) {
1784 		pr_err("Bad webcam type %d for NW80%d\n",
1785 		       sd->webcam, sd->bridge);
1786 		gspca_dev->usb_err = -ENODEV;
1787 		return gspca_dev->usb_err;
1788 	}
1789 	gspca_dbg(gspca_dev, D_PROBE, "Bridge nw80%d - type: %d\n",
1790 		  sd->bridge, sd->webcam);
1791 
1792 	if (sd->bridge == BRIDGE_NW800) {
1793 		switch (sd->webcam) {
1794 		case DS3303u:
1795 			gspca_dev->cam.cam_mode = cif_mode;	/* qvga */
1796 			break;
1797 		default:
1798 			gspca_dev->cam.cam_mode = &cif_mode[1];	/* cif */
1799 			break;
1800 		}
1801 		gspca_dev->cam.nmodes = 1;
1802 	} else {
1803 		gspca_dev->cam.cam_mode = vga_mode;
1804 		switch (sd->webcam) {
1805 		case Kr651us:
1806 		case Proscope:
1807 		case P35u:
1808 			gspca_dev->cam.nmodes = ARRAY_SIZE(vga_mode);
1809 			break;
1810 		default:
1811 			gspca_dev->cam.nmodes = 1;	/* qvga only */
1812 			break;
1813 		}
1814 	}
1815 
1816 	return gspca_dev->usb_err;
1817 }
1818 
1819 /* this function is called at probe and resume time */
1820 static int sd_init(struct gspca_dev *gspca_dev)
1821 {
1822 	struct sd *sd = (struct sd *) gspca_dev;
1823 
1824 	switch (sd->bridge) {
1825 	case BRIDGE_NW800:
1826 		switch (sd->webcam) {
1827 		case SpaceCam:
1828 			reg_w_buf(gspca_dev, spacecam_init);
1829 			break;
1830 		default:
1831 			reg_w_buf(gspca_dev, nw800_init);
1832 			break;
1833 		}
1834 		break;
1835 	default:
1836 		switch (sd->webcam) {
1837 		case Mustek300:
1838 		case P35u:
1839 		case Proscope:
1840 			reg_w_buf(gspca_dev, proscope_init);
1841 			break;
1842 		}
1843 		break;
1844 	}
1845 	return gspca_dev->usb_err;
1846 }
1847 
1848 /* -- start the camera -- */
1849 static int sd_start(struct gspca_dev *gspca_dev)
1850 {
1851 	struct sd *sd = (struct sd *) gspca_dev;
1852 	const u8 *cmd;
1853 
1854 	cmd = webcam_start[sd->webcam];
1855 	reg_w_buf(gspca_dev, cmd);
1856 	switch (sd->webcam) {
1857 	case P35u:
1858 		if (gspca_dev->pixfmt.width == 320)
1859 			reg_w_buf(gspca_dev, nw801_start_qvga);
1860 		else
1861 			reg_w_buf(gspca_dev, nw801_start_vga);
1862 		reg_w_buf(gspca_dev, nw801_start_2);
1863 		break;
1864 	case Kr651us:
1865 		if (gspca_dev->pixfmt.width == 320)
1866 			reg_w_buf(gspca_dev, kr651_start_qvga);
1867 		else
1868 			reg_w_buf(gspca_dev, kr651_start_vga);
1869 		reg_w_buf(gspca_dev, kr651_start_2);
1870 		break;
1871 	case Proscope:
1872 		if (gspca_dev->pixfmt.width == 320)
1873 			reg_w_buf(gspca_dev, proscope_start_qvga);
1874 		else
1875 			reg_w_buf(gspca_dev, proscope_start_vga);
1876 		reg_w_buf(gspca_dev, proscope_start_2);
1877 		break;
1878 	}
1879 
1880 	sd->exp_too_high_cnt = 0;
1881 	sd->exp_too_low_cnt = 0;
1882 	return gspca_dev->usb_err;
1883 }
1884 
1885 static void sd_stopN(struct gspca_dev *gspca_dev)
1886 {
1887 	struct sd *sd = (struct sd *) gspca_dev;
1888 	u8 value;
1889 
1890 	/* 'go' off */
1891 	if (sd->bridge != BRIDGE_NW801) {
1892 		value = 0x02;
1893 		reg_w(gspca_dev, 0x0406, &value, 1);
1894 	}
1895 
1896 	/* LED off */
1897 	switch (sd->webcam) {
1898 	case Cvideopro:
1899 	case Kr651us:
1900 	case DvcV6:
1901 	case Kritter:
1902 		value = 0xff;
1903 		break;
1904 	case Dlink350c:
1905 		value = 0x21;
1906 		break;
1907 	case SpaceCam:
1908 	case SpaceCam2:
1909 	case Proscope:
1910 	case Twinkle:
1911 		value = 0x01;
1912 		break;
1913 	default:
1914 		return;
1915 	}
1916 	reg_w(gspca_dev, 0x0404, &value, 1);
1917 }
1918 
1919 static void sd_pkt_scan(struct gspca_dev *gspca_dev,
1920 			u8 *data,			/* isoc packet */
1921 			int len)			/* iso packet length */
1922 {
1923 	/*
1924 	 * frame header = '00 00 hh ww ss xx ff ff'
1925 	 * with:
1926 	 *	- 'hh': height / 4
1927 	 *	- 'ww': width / 4
1928 	 *	- 'ss': frame sequence number c0..dd
1929 	 */
1930 	if (data[0] == 0x00 && data[1] == 0x00
1931 	 && data[6] == 0xff && data[7] == 0xff) {
1932 		gspca_frame_add(gspca_dev, LAST_PACKET, NULL, 0);
1933 		gspca_frame_add(gspca_dev, FIRST_PACKET, data + 8, len - 8);
1934 	} else {
1935 		gspca_frame_add(gspca_dev, INTER_PACKET, data, len);
1936 	}
1937 }
1938 
1939 static void do_autogain(struct gspca_dev *gspca_dev)
1940 {
1941 	struct sd *sd = (struct sd *) gspca_dev;
1942 	int luma;
1943 
1944 	if (sd->ag_cnt < 0)
1945 		return;
1946 	if (--sd->ag_cnt >= 0)
1947 		return;
1948 	sd->ag_cnt = AG_CNT_START;
1949 
1950 	/* get the average luma */
1951 	reg_r(gspca_dev, sd->bridge == BRIDGE_NW801 ? 0x080d : 0x080c, 4);
1952 	luma = (gspca_dev->usb_buf[3] << 24) + (gspca_dev->usb_buf[2] << 16)
1953 		+ (gspca_dev->usb_buf[1] << 8) + gspca_dev->usb_buf[0];
1954 	luma /= sd->ae_res;
1955 
1956 	switch (sd->webcam) {
1957 	case P35u:
1958 		gspca_coarse_grained_expo_autogain(gspca_dev, luma, 100, 5);
1959 		break;
1960 	default:
1961 		gspca_expo_autogain(gspca_dev, luma, 100, 5, 230, 0);
1962 		break;
1963 	}
1964 }
1965 
1966 
1967 static int sd_s_ctrl(struct v4l2_ctrl *ctrl)
1968 {
1969 	struct gspca_dev *gspca_dev =
1970 		container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
1971 
1972 	gspca_dev->usb_err = 0;
1973 
1974 	if (!gspca_dev->streaming)
1975 		return 0;
1976 
1977 	switch (ctrl->id) {
1978 	/* autogain/gain/exposure control cluster */
1979 	case V4L2_CID_AUTOGAIN:
1980 		if (ctrl->is_new)
1981 			setautogain(gspca_dev, ctrl->val);
1982 		if (!ctrl->val) {
1983 			if (gspca_dev->gain->is_new)
1984 				setgain(gspca_dev, gspca_dev->gain->val);
1985 			if (gspca_dev->exposure->is_new)
1986 				setexposure(gspca_dev,
1987 					    gspca_dev->exposure->val);
1988 		}
1989 		break;
1990 	/* Some webcams only have exposure, so handle that separately from the
1991 	   autogain/gain/exposure cluster in the previous case. */
1992 	case V4L2_CID_EXPOSURE:
1993 		setexposure(gspca_dev, gspca_dev->exposure->val);
1994 		break;
1995 	}
1996 	return gspca_dev->usb_err;
1997 }
1998 
1999 static const struct v4l2_ctrl_ops sd_ctrl_ops = {
2000 	.s_ctrl = sd_s_ctrl,
2001 };
2002 
2003 static int sd_init_controls(struct gspca_dev *gspca_dev)
2004 {
2005 	struct sd *sd = (struct sd *)gspca_dev;
2006 	struct v4l2_ctrl_handler *hdl = &gspca_dev->ctrl_handler;
2007 
2008 	gspca_dev->vdev.ctrl_handler = hdl;
2009 	v4l2_ctrl_handler_init(hdl, 3);
2010 	switch (sd->webcam) {
2011 	case P35u:
2012 		gspca_dev->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
2013 			V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
2014 		/* For P35u choose coarse expo auto gain function gain minimum,
2015 		 * to avoid a large settings jump the first auto adjustment */
2016 		gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
2017 			V4L2_CID_GAIN, 0, 127, 1, 127 / 5 * 2);
2018 		gspca_dev->exposure = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
2019 			V4L2_CID_EXPOSURE, 0, 9, 1, 9);
2020 		break;
2021 	case Kr651us:
2022 		gspca_dev->autogain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
2023 			V4L2_CID_AUTOGAIN, 0, 1, 1, 1);
2024 		gspca_dev->gain = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
2025 			V4L2_CID_GAIN, 0, 253, 1, 128);
2026 		/* fall through */
2027 	case Cvideopro:
2028 	case DvcV6:
2029 	case Kritter:
2030 		gspca_dev->exposure = v4l2_ctrl_new_std(hdl, &sd_ctrl_ops,
2031 			V4L2_CID_EXPOSURE, 0, 315, 1, 150);
2032 		break;
2033 	default:
2034 		break;
2035 	}
2036 
2037 	if (hdl->error) {
2038 		pr_err("Could not initialize controls\n");
2039 		return hdl->error;
2040 	}
2041 	if (gspca_dev->autogain)
2042 		v4l2_ctrl_auto_cluster(3, &gspca_dev->autogain, 0, false);
2043 	return 0;
2044 }
2045 
2046 /* sub-driver description */
2047 static const struct sd_desc sd_desc = {
2048 	.name = MODULE_NAME,
2049 	.config = sd_config,
2050 	.init = sd_init,
2051 	.init_controls = sd_init_controls,
2052 	.start = sd_start,
2053 	.stopN = sd_stopN,
2054 	.pkt_scan = sd_pkt_scan,
2055 	.dq_callback = do_autogain,
2056 };
2057 
2058 /* -- module initialisation -- */
2059 static const struct usb_device_id device_table[] = {
2060 	{USB_DEVICE(0x046d, 0xd001)},
2061 	{USB_DEVICE(0x0502, 0xd001)},
2062 	{USB_DEVICE(0x052b, 0xd001)},
2063 	{USB_DEVICE(0x055f, 0xd001)},
2064 	{USB_DEVICE(0x06a5, 0x0000)},
2065 	{USB_DEVICE(0x06a5, 0xd001)},
2066 	{USB_DEVICE(0x06a5, 0xd800)},
2067 	{USB_DEVICE(0x06be, 0xd001)},
2068 	{USB_DEVICE(0x0728, 0xd001)},
2069 	{}
2070 };
2071 MODULE_DEVICE_TABLE(usb, device_table);
2072 
2073 /* -- device connect -- */
2074 static int sd_probe(struct usb_interface *intf,
2075 			const struct usb_device_id *id)
2076 {
2077 	return gspca_dev_probe(intf, id, &sd_desc, sizeof(struct sd),
2078 				THIS_MODULE);
2079 }
2080 
2081 static struct usb_driver sd_driver = {
2082 	.name = MODULE_NAME,
2083 	.id_table = device_table,
2084 	.probe = sd_probe,
2085 	.disconnect = gspca_disconnect,
2086 #ifdef CONFIG_PM
2087 	.suspend = gspca_suspend,
2088 	.resume = gspca_resume,
2089 	.reset_resume = gspca_resume,
2090 #endif
2091 };
2092 
2093 module_usb_driver(sd_driver);
2094 
2095 module_param(webcam, int, 0644);
2096 MODULE_PARM_DESC(webcam,
2097 	"Webcam type\n"
2098 	"0: generic\n"
2099 	"1: Trust 120 SpaceCam\n"
2100 	"2: other Trust 120 SpaceCam\n"
2101 	"3: Conceptronic Video Pro\n"
2102 	"4: D-link dru-350c\n"
2103 	"5: Plustek Opticam 500U\n"
2104 	"6: Panasonic GP-KR651US\n"
2105 	"7: iRez Kritter\n"
2106 	"8: Mustek Wcam 300 mini\n"
2107 	"9: Scalar USB Microscope M2 (Proscope)\n"
2108 	"10: Divio Chicony TwinkleCam\n"
2109 	"11: DVC-V6\n");
2110