34 #include <linux/module.h>
35 #include <linux/init.h>
36 #include <linux/kernel.h>
37 #include <linux/version.h>
38 #include <linux/errno.h>
39 #include <linux/slab.h>
40 #include <linux/kref.h>
42 #include <linux/usb.h>
43 #include <media/v4l2-common.h>
44 #include <media/v4l2-ioctl.h>
75 STK_INFO(
"Initialize USB2.0 Syntek Camera\n");
131 STK_INFO(
"Syntek USB2.0 Camera is ready\n");
155 static const int values_001B[] = {
158 static const int values_001C[] = {
161 static const int values_0202[] = {
164 static const int values_0110[] = {
167 static const int values_0112[] = {
170 static const int values_0114[] = {
173 static const int values_0115[] = {
176 static const int values_0116[] = {
179 static const int values_0117[] = {
182 static const int values_0100[] = {
187 STK_DEBUG(
"dev_stk6a54_configure_device : %d\n", step);
322 static const int values_204[] = {
323 0xff, 0x12, 0xff, 0x2c, 0x2e, 0xff, 0x3c, 0x11, 0x09, 0x04,
324 0x13, 0x14, 0x2c, 0x33, 0x3a, 0x3b, 0x3e, 0x43, 0x16, 0x39,
325 0x35, 0x22, 0x37, 0x23, 0x34, 0x36, 0x06, 0x07, 0x0d, 0x0e,
326 0x4c, 0x4a, 0x21, 0x24, 0x25, 0x26, 0x5c, 0x63, 0x46, 0x0c,
327 0x61, 0x62, 0x7c, 0x20, 0x28, 0x6c, 0x6d, 0x6e, 0x70, 0x71,
328 0x73, 0x3d, 0x5a, 0x4f, 0x50, 0xff, 0xe5, 0xf9, 0x41, 0xe0,
329 0x76, 0x33, 0x42, 0x43, 0x4c, 0x87, 0x88, 0xd7, 0xd9, 0xd3,
330 0xc8, 0xc9, 0x7c, 0x7d, 0x7c, 0x7d, 0x7d, 0x7c, 0x7d, 0x7d,
331 0x7d, 0x90, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
332 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x92, 0x93,
333 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93, 0x93,
334 0x93, 0x93, 0x96, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97,
335 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0xc3, 0xa4, 0xa8, 0xc5,
336 0xc6, 0xbf, 0xc7, 0xb6, 0xb8, 0xb7, 0xb9, 0xb3, 0xb4, 0xb5,
337 0xb0, 0xb1, 0xb2, 0xc4, 0xc0, 0xc1, 0x86, 0x50, 0x51, 0x52,
338 0x53, 0x54, 0x55, 0x57, 0x5a, 0x5b, 0x5c, 0xc3, 0x7f, 0xda,
339 0xd7, 0xe5, 0xe1, 0xe0, 0xdd, 0x05, 0xff, 0x12, 0x11, 0x17,
340 0x18, 0x19, 0x1a, 0x32, 0x37, 0x4f, 0x50, 0x5a, 0x6d, 0x3d,
341 0x39, 0x35, 0x22, 0x37, 0x23, 0x34, 0x36, 0x06, 0x07, 0x0d,
342 0x0e, 0x4c, 0xff, 0xe0, 0xc0, 0xc1, 0x8c, 0x86, 0x50, 0x51,
343 0x52, 0x53, 0x54, 0x55, 0x5a, 0x5b, 0x5c, 0xd3, 0xe0, 0xff,
344 0xe0, 0xc0, 0xc1, 0x8c, 0x86, 0x50, 0x51, 0x52, 0x53, 0x54,
345 0x55, 0x5a, 0x5b, 0x5c, 0xd3, 0xe0, 0xff, 0xff, 0x04, 0xff,
346 0xff, 0xff, 0x7c, 0x7d, 0x7c, 0x7c, 0x7d, 0x7c, 0x7d, 0x7c,
347 0xff, 0x7c, 0x7d, 0x7c, 0x7d, 0x7c, 0xff, 0x7c, 0x7d, 0x7c,
348 0x7d, 0x7c, 0x7d, 0x7c, 0x7c, 0xff, 0x7c, 0x7d, 0x7c, 0x7d,
349 0x7c, 0x7d, 0xff, 0x92, 0x93, 0xff, 0x90, 0x91, 0x91, 0x91,
350 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
351 0x91, 0x91, 0x91, 0xff, 0xc3, 0xc7, 0xce, 0xcc, 0xcd, 0xff,
355 static const int values_205[] = {
356 0x01, 0x80, 0x00, 0xff, 0xdf, 0x01, 0x32, 0x00, 0x02, 0x28,
357 0xe5, 0x48, 0x0c, 0x78, 0x33, 0xfb, 0x00, 0x11, 0x10, 0x02,
358 0x88, 0x0a, 0x40, 0x00, 0xa0, 0x1a, 0x02, 0xc0, 0xb7, 0x01,
359 0x00, 0x81, 0x99, 0x40, 0x38, 0x82, 0x00, 0x00, 0x3f, 0x3c,
360 0x70, 0x80, 0x05, 0x80, 0x30, 0x00, 0x80, 0x00, 0x02, 0x94,
361 0xc1, 0x34, 0x57, 0xbb, 0x9c, 0x00, 0x7f, 0xc0, 0x24, 0x14,
362 0xff, 0xa0, 0x20, 0x18, 0x00, 0xd0, 0x3f, 0x03, 0x10, 0x82,
363 0x08, 0x80, 0x00, 0x00, 0x03, 0x48, 0x48, 0x08, 0x20, 0x10,
364 0x0e, 0x00, 0x0e, 0x1a, 0x31, 0x5a, 0x69, 0x75, 0x7e, 0x88,
365 0x8f, 0x96, 0xa3, 0xaf, 0xc4, 0xd7, 0xe8, 0x20, 0x00, 0x06,
366 0xe3, 0x05, 0x05, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
367 0x00, 0x00, 0x00, 0x08, 0x19, 0x02, 0x0c, 0x24, 0x30, 0x28,
368 0x26, 0x02, 0x98, 0x80, 0x00, 0x00, 0xed, 0x00, 0x00, 0x11,
369 0x51, 0x80, 0x10, 0x66, 0xa5, 0x64, 0x7c, 0xaf, 0x97, 0xff,
370 0xc5, 0x94, 0x0f, 0x5c, 0xc8, 0x96, 0x3d, 0x00, 0x90, 0x18,
371 0x00, 0x00, 0x88, 0x00, 0x90, 0x18, 0x05, 0xed, 0x00, 0x00,
372 0x01, 0x1f, 0x67, 0x00, 0xff, 0x00, 0x01, 0x40, 0x00, 0x11,
373 0x43, 0x00, 0x4b, 0x09, 0xc0, 0xca, 0xa8, 0x23, 0x00, 0x38,
374 0x12, 0xda, 0x1a, 0xc3, 0x00, 0xc0, 0x1a, 0x88, 0xc0, 0x87,
375 0x41, 0x00, 0x00, 0x04, 0x64, 0x4b, 0x00, 0x1d, 0x00, 0xc8,
376 0x96, 0x00, 0x00, 0x00, 0xc8, 0x96, 0x00, 0x82, 0x00, 0x00,
377 0x04, 0x64, 0x4b, 0x00, 0x3d, 0x00, 0xc8, 0x96, 0x00, 0x00,
378 0x00, 0xa0, 0x78, 0x00, 0x82, 0x00, 0x00, 0x01, 0xfa, 0x01,
379 0x00, 0x00, 0x00, 0x04, 0x0a, 0x09, 0x16, 0x0a, 0x06, 0x09,
380 0x00, 0x00, 0x04, 0x08, 0x28, 0x08, 0x00, 0x00, 0x05, 0x01,
381 0x7f, 0x02, 0x00, 0x0a, 0x05, 0x00, 0x00, 0x07, 0x03, 0x4d,
382 0x04, 0x4d, 0x00, 0x01, 0xc5, 0x00, 0x00, 0x00, 0x23, 0x3c,
383 0x50, 0x63, 0x73, 0x83, 0x92, 0xa0, 0xad, 0xba, 0xc6, 0xd2,
384 0xde, 0xe9, 0xf5, 0x01, 0x0c, 0x00, 0x80, 0x80, 0x80, 0x01,
388 asize = ARRAY_SIZE(values_204);
390 for(i=0; i<asize; i++) {
403 STK_ERROR(
"Load default sensor settings fail !\n");