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