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