3 * @author Nicolas VIVIEN
7 * @brief Driver for Microdia USB video camera
9 * @note Copyright (C) Nicolas VIVIEN
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 2 of the License, or
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
23 * You should have received a copy of the GNU General Public License
24 * along with this program; if not, write to the Free Software
25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include <linux/errno.h>
29 #include <linux/string.h>
39 int dev_microdia_init_camera(struct usb_microdia
*dev
)
44 int dev_microdia_camera_on(struct usb_microdia
*dev
)
47 struct usb_device
*udev
= dev
->udev
;
49 ret
= usb_set_interface(udev
, 0, 8);
52 UDIA_ERROR("usb_set_interface failed !\n");
57 int dev_microdia_camera_off(struct usb_microdia
*dev
)
60 struct usb_device
*udev
= dev
->udev
;
62 ret
= usb_set_interface(udev
, 0, 0);
65 UDIA_ERROR("usb_set_interface failed !\n");
70 int dev_microdia_camera_settings(struct usb_microdia
*dev
)
72 dev_microdia_camera_set_contrast(dev
);
73 dev_microdia_camera_set_brightness(dev
);
74 dev_microdia_camera_set_gamma(dev
);
75 dev_microdia_camera_set_exposure(dev
);
76 dev_microdia_camera_set_hvflip(dev
);
77 dev_microdia_camera_set_sharpness(dev
);
78 dev_microdia_camera_set_rgb_gain(dev
);
79 dev_microdia_camera_set_auto_exposure(dev
);
80 dev_microdia_camera_set_auto_whitebalance(dev
);
84 int dev_microdia_camera_set_contrast(struct usb_microdia
*dev
)
87 if(dev
&& dev
->set_contrast
)
88 ret
= dev
->set_contrast(dev
);
92 int dev_microdia_camera_set_brightness(struct usb_microdia
*dev
)
95 if(dev
&& dev
->set_brightness
)
96 ret
= dev
->set_brightness(dev
);
100 int dev_microdia_camera_set_gamma(struct usb_microdia
*dev
)
103 if(dev
&& dev
->set_gamma
)
104 ret
= dev
->set_gamma(dev
);
108 int dev_microdia_camera_set_exposure(struct usb_microdia
*dev
)
110 if (dev
->set_exposure
!= NULL
) {
111 return dev
->set_exposure(dev
);
116 int dev_microdia_camera_set_hvflip(struct usb_microdia
*dev
)
119 if(dev
&& dev
->set_hvflip
)
120 ret
= dev
->set_hvflip(dev
);
125 int dev_microdia_camera_set_sharpness(struct usb_microdia
*dev
)
128 if(dev
&& dev
->set_sharpness
)
129 ret
= dev
->set_sharpness(dev
);
134 int dev_microdia_camera_set_rgb_gain(struct usb_microdia
*dev
)
137 if (dev
&& dev
->set_rgb_gain
)
138 ret
= dev
->set_rgb_gain(dev
);
143 int dev_microdia_camera_set_auto_exposure(struct usb_microdia
*dev
)
146 if(dev
&& dev
->set_auto_exposure
)
147 ret
= dev
->set_auto_exposure(dev
);
152 int dev_microdia_camera_set_auto_whitebalance(struct usb_microdia
*dev
)
155 if(dev
&& dev
->set_auto_whitebalance
)
156 ret
= dev
->set_auto_whitebalance(dev
);
163 * @brief From UsbSnoop-plugin-parsed.log
169 int dev_microdia_initialize_device(struct usb_microdia
*dev
)
173 if(dev
&& dev
->initialize
)
174 ret
= dev
->initialize(dev
);
180 * @brief From init-physical-replug.log
188 * For SN9C201 with MI1300.
191 int microdia_6240_initialize(struct usb_microdia
*dev
)
196 UDIA_INFO("Initializing camera...\n");
198 ret
= usb_microdia_control_read(dev
, 0x130d, &buf
, 1); /* URB 5 0x81 */
199 UDIA_INFO("...init: read %x, ret = %d\n", buf
, ret
);
201 ret
+= usb_microdia_control_read(dev
, 0x1040, &buf
, 1); /* URB 6 0xe4 */
202 UDIA_INFO("...init: read %x, ret = %d\n", buf
, ret
);
205 ret
+= usb_microdia_control_write(dev
, 0x10c8, &buf
, 1); /* URB 7 */
206 UDIA_INFO("...init: write %x, ret = %d\n", buf
, ret
);
208 /* Interrupt going down (URB 8) */
211 ret
+= usb_microdia_control_write(dev
, 0x1020, &buf
, 1); /* URB 9 */
212 UDIA_INFO("...init: write %x, ret = %d\n", buf
, ret
);
215 UDIA_ERROR("One or more errors occured during initialization!\n");
223 * @brief From start.log (14 jun 2008)
231 * For SN9C201 with MI1300.
234 int microdia_6240_start_stream(struct usb_microdia
*dev
)
242 __u8 buf10e1
[21] = { 0x16, 0x00, 0x2d, 0x00, 0x08, 0x00, 0xf1, 0x0f,
243 0xd3, 0x0f, 0x3c, 0x00, 0x36, 0x00, 0xce, 0x0f,
244 0xfc, 0x0f, 0x00, 0x00, 0x00
246 __u8 buf1100
[64] = { 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
247 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
248 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
249 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
250 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
251 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
252 0x4f, 0x54, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
253 0x64, 0x5c, 0x54, 0x64, 0x4b, 0x54, 0x58, 0x54
255 UDIA_INFO("Starting camera data stream...\n");
257 /* UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
258 // URB 10 <<< GETTING SELECT_INTERFACE Interface: AlternateSetting = 8
259 // UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: */
262 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 12 */
266 /* UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: */
267 /* UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: */
271 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 14 */
276 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
281 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
286 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* cf */
292 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
297 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
302 ret
= usb_microdia_control_read(dev
, reg
, buf24
, 7); /* URB 20 << 20 00 ff 81 00 00 00 */
307 buf24
[0] = 0x80; buf24
[1] = 0xa0;
308 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 2);
313 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
318 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
322 buf24
[0] = 0x40; buf24
[1] = 0x30; buf24
[2] = 0x20; buf24
[3] = 0x10;
324 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
328 buf24
[0] = 0x80; buf24
[1] = 0x5d; buf24
[2] = 0x00; buf24
[3] = 0x00;
329 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x00;
331 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 9);
335 buf24
[0] = 0x45; buf24
[1] = 0x18; buf24
[2] = 0x00; buf24
[3] = 0x30;
336 buf24
[4] = 0x00; buf24
[5] = 0x09; buf24
[6] = 0x00; buf24
[7] = 0xed;
337 buf24
[8] = 0x0f; buf24
[9] = 0xda; buf24
[10] = 0x0f; buf24
[11] = 0x3a;
338 buf24
[12] = 0x00; buf24
[13] = 0x3a; buf24
[14] = 0x00; buf24
[15] = 0xd0;
339 buf24
[16] = 0x0f; buf24
[17] = 0xf7; buf24
[18] = 0x0f; buf24
[19] = 0x00;
340 buf24
[20] = 0x00; buf24
[21] = 0x00; buf24
[22] = 0x60; buf24
[23] = 0x0a;
341 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 24);
345 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x00;
346 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 3);
350 buf24
[0] = 0x00; buf24
[1] = 0xa0; buf24
[2] = 0x00; buf24
[3] = 0xf0;
352 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
356 buf24
[0] = 0x06; buf24
[1] = 0x4c; buf24
[2] = 0x08;
357 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 3);
362 buf24
[0] = 0x00; buf24
[1] = 0x20; buf24
[2] = 0x20; buf24
[3] = 0x20;
363 buf24
[4] = 0x20; buf24
[5] = 0x00; buf24
[6] = 0x24; buf24
[7] = 0x3b;
364 buf24
[8] = 0x4f; buf24
[9] = 0x61; buf24
[10] = 0x71; buf24
[11] = 0x80;
365 buf24
[12] = 0x8f; buf24
[13] = 0x9d; buf24
[14] = 0xab; buf24
[15] = 0xb8;
367 buf24
[16] = 0xc4; buf24
[17] = 0xd1; buf24
[18] = 0xdd; buf24
[19] = 0xe9;
368 buf24
[20] = 0xf4; buf24
[21] = 0xff;
369 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 22); /* URB 30 */
374 buf24
[0] = 0x00; buf24
[1] = 0x00;
375 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 2);
380 buf24
[0] = 0x60; buf24
[1] = 0x28; buf24
[2] = 0x00; buf24
[3] = 0x08;
381 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x00;
383 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 9);
389 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
395 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
400 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
401 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
402 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 35..90 --> */
406 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* << b0 */
409 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* << b4 */
413 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x0d; buf24
[3] = 0x00;
414 buf24
[4] = 0x01; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
415 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
419 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* << b0 */
422 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* << b4 */
426 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x0d; buf24
[3] = 0x00;
427 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
428 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
432 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* << b0 */
435 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* << b4 */
439 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x01; buf24
[3] = 0x00;
440 buf24
[4] = 0x0e; buf24
[5] = 0x00; buf24
[6] = 0x14; buf24
[7] = 0x10;
441 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
445 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // URB 45 << d0 */
448 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
452 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x03; buf24
[3] = 0x03;
453 buf24
[4] = 0xc1; buf24
[5] = 0x05; buf24
[6] = 0x01; buf24
[7] = 0x10;
454 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
458 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
461 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
465 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x05; buf24
[3] = 0x00;
466 buf24
[4] = 0x83; buf24
[5] = 0x00; buf24
[6] = 0x06; buf24
[7] = 0x10;
467 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
471 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
474 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
478 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x0d; buf24
[3] = 0x00;
479 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
480 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
484 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
487 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
491 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x09; buf24
[3] = 0x00;
492 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
493 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
497 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
500 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
504 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x0b; buf24
[3] = 0x00;
505 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
506 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
510 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
513 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
517 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x11; buf24
[3] = 0x00;
518 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
519 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
523 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
526 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
530 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x1e; buf24
[3] = 0x80;
531 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
532 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 65 */
536 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
539 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
543 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x20; buf24
[3] = 0x11;
544 buf24
[4] = 0x05; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
545 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
549 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
552 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
556 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2b; buf24
[3] = 0x00;
557 buf24
[4] = 0x08; buf24
[5] = 0x00; buf24
[6] = 0x10; buf24
[7] = 0x10;
558 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
562 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
565 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
569 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2d; buf24
[3] = 0x00;
570 buf24
[4] = 0x14; buf24
[5] = 0x00; buf24
[6] = 0x08; buf24
[7] = 0x10;
571 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
575 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
578 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
582 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x33; buf24
[3] = 0x00;
583 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
584 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 77 */
588 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
592 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x5f; buf24
[3] = 0x89;
593 buf24
[4] = 0x04; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
594 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 79 */
598 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
599 if(ret
< 0) goto err
;
600 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
604 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x60; buf24
[3] = 0x00;
605 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
606 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
610 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
613 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
617 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x62; buf24
[3] = 0x04;
618 buf24
[4] = 0x98; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
619 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 85 */
623 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
626 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
630 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x68; buf24
[3] = 0x00;
631 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
632 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
636 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
639 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
644 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* URB 91 // << 5d*/
648 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
653 buf24
[0] = 0x90; buf24
[1] = 0x50; buf24
[2] = 0x00; buf24
[3] = 0x00;
654 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
655 for(i
=93; i
<=108; i
++){
656 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 93..108 */
659 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 9c */
663 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
667 buf24
[0] = 0x92; /* // change only 1st value */
668 for(i
=110; i
<=126; i
++){
669 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 110..126 */
672 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 9e */
678 ret
= usb_microdia_control_read(dev
, reg
, buf24
, 5); /* // << ff ff ff ff ff */
684 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
690 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
694 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
700 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
704 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
708 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
714 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
720 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 135..138 */
724 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
728 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
732 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
737 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x20; buf24
[3] = 0x11;
738 buf24
[4] = 0x1d; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
739 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 139 */
743 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
746 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
751 buf24
[0] = 0x02; buf24
[1] = 0x00; buf24
[2] = 0x02; buf24
[3] = 0x00;
752 buf24
[4] = 0x28; buf24
[5] = 0x3c;
753 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 6); /* URB 142 */
758 buf24
[0] = 0x00; buf24
[1] = 0xa0; buf24
[2] = 0x00; buf24
[3] = 0xf0;
760 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
766 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
771 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x6a; buf24
[3] = 0x50;
772 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
777 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x50; buf24
[3] = 0x3c;
778 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
784 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
790 for(i
=148; i
<=149; i
++){
791 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
798 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 150 */
804 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
810 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
816 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 153..163 */
819 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 38 */
823 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
826 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 39 */
830 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
833 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3a */
837 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
840 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << bb */
844 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
847 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3c */
851 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
856 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x06; buf24
[3] = 0x00;
857 buf24
[4] = 0xf2; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
858 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 164..169 */
862 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
865 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
869 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x05; buf24
[3] = 0x00;
870 buf24
[4] = 0x13; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
871 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
875 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
878 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
884 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
890 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
894 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
898 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
902 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
908 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
913 buf24
[0] = 0x08; buf24
[1] = 0x2e; buf24
[2] = 0x55; buf24
[3] = 0x6f;
914 buf24
[4] = 0x7f; buf24
[5] = 0x8d; buf24
[6] = 0x9a; buf24
[7] = 0xa6;
915 buf24
[8] = 0xb1; buf24
[9] = 0xbb; buf24
[10] = 0xc5; buf24
[11] = 0xce;
916 buf24
[12] = 0xd7; buf24
[13] = 0xdf; buf24
[14] = 0xe8; buf24
[15] = 0xef;
918 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 17); /* URB 176 */
923 for (i
= 0; i
< 21; i
++) /* // zeroes */
925 for (i
= 177; i
<= 184; i
++) {
926 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 21); /* URB 177..185 */
930 ret
= usb_microdia_control_write(dev
, reg
, buf10e1
, 21); /* ..URB 185 */
936 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
941 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
946 ret
= usb_microdia_control_write(dev
, reg
, buf10e1
, 21); /* URB 188 */
952 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
957 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
962 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
966 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
972 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
977 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x00; buf24
[3] = 0x00;
978 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
983 for (i
= 0; i
< 48; i
++)
984 buf64
[i
] = 0; /* // zeroes */
985 ret
= usb_microdia_control_write(dev
, reg
, buf64
, 48); /* URB 195 */
991 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 196..199 */
995 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
999 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1000 if(ret
< 0) goto err
;
1002 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1007 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x20; buf24
[3] = 0x11;
1008 buf24
[4] = 0x1d; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1009 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 200 */
1013 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1016 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1022 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1028 buf24[0] = 0xb0; buf24[1] = 0x5d; buf24[2] = 0x20; buf24[3] = 0x11;
1029 buf24[4] = 0x1d; buf24[5] = 0x00; buf24[6] = 0x00; buf24[7] = 0x10;
1031 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 204..206 */
1035 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* << b0 */
1038 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1044 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1049 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x09; buf24
[3] = 0x03;
1050 buf24
[4] = 0xe8; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1051 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 208..224 */
1055 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1058 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1062 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
1063 buf24
[4] = 0x03; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1064 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1068 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1071 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1075 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2b; buf24
[3] = 0x00;
1076 buf24
[4] = 0x10; buf24
[5] = 0x00; buf24
[6] = 0x10; buf24
[7] = 0x10;
1077 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 214 */
1081 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1084 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1088 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2d; buf24
[3] = 0x00;
1089 buf24
[4] = 0x10; buf24
[5] = 0x00; buf24
[6] = 0x10; buf24
[7] = 0x10;
1090 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1094 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1097 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1101 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x33; buf24
[3] = 0x00;
1102 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1103 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1104 if(ret
< 0) goto err
;
1106 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
1110 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
1111 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1112 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1116 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1119 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1125 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 225..228 */
1129 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1133 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1137 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1142 buf24
[0] = 0x2d; buf24
[1] = 0x2d; buf24
[2] = 0x3a; buf24
[3] = 0x05;
1143 buf24
[4] = 0x04; buf24
[5] = 0x3f;
1144 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 6);
1148 buf24
[0] = 0x28; buf24
[1] = 0xd8; buf24
[2] = 0x14; buf24
[3] = 0xec;
1149 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
1153 buf24
[0] = 0x32; buf24
[1] = 0xdd; buf24
[2] = 0x2d; buf24
[3] = 0xdd;
1154 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
1159 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
1160 buf24
[4] = 0x03; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1161 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 232..242 */
1165 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1168 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1172 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2c; buf24
[3] = 0x00;
1173 buf24
[4] = 0x1d; buf24
[5] = 0x00; buf24
[6] = 0x1d; buf24
[7] = 0x10;
1174 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1178 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1181 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1185 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x30; buf24
[3] = 0x00;
1186 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1187 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1191 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
1195 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
1196 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1197 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1201 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1204 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1210 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1215 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1220 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1225 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1231 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1235 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1240 ret
= usb_microdia_control_write(dev
, reg
, buf1100
, 64); /* URB 249 (see also 509/510) */
1244 reg
= 0x1140; /* 00000000: */
1245 buf64
[0] = 0x0d; buf64
[1] = 0x11; buf64
[2] = 0x11; buf64
[3] = 0x15;
1246 buf64
[4] = 0x11; buf64
[5] = 0x15; buf64
[6] = 0x26; buf64
[7] = 0x15;
1247 buf64
[8] = 0x15; buf64
[9] = 0x26; buf64
[10] = 0x54; buf64
[11] = 0x36;
1248 buf64
[12] = 0x2e; buf64
[13] = 0x36; buf64
[14] = 0x54; buf64
[15] = 0x54; /* 00000010: .. 00000030: 0x54 */
1249 for(i
=16; i
<=63; i
++) buf64
[i
] = 0x54;
1250 ret
= usb_microdia_control_write(dev
, reg
, buf64
, 64); /* URB 250 */
1256 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1260 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1266 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1272 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 254..257 */
1276 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1280 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1284 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1289 buf24
[0] = 0x02; buf24
[1] = 0x00; buf24
[2] = 0x02; buf24
[3] = 0x00;
1290 buf24
[4] = 0x28; buf24
[5] = 0x3c;
1291 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 6);
1296 buf24
[0] = 0x00; buf24
[1] = 0xa0; buf24
[2] = 0x00; buf24
[3] = 0xf0;
1298 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
1304 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1309 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x6a; buf24
[3] = 0x50;
1310 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
1314 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x50; buf24
[3] = 0x3c;
1315 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
1321 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1326 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1331 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1336 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1341 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1346 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1351 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1355 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1360 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1365 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1370 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1377 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 274..284 */
1380 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 38 */
1384 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1387 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 39 */
1391 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1394 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3a */
1398 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1401 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << bb */
1405 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1408 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3c */
1412 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1417 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x06; buf24
[3] = 0x00;
1418 buf24
[4] = 0xf2; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1419 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 285..295 */
1423 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1426 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1430 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x05; buf24
[3] = 0x00;
1431 buf24
[4] = 0x13; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1432 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1436 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1439 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1443 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x00; buf24
[3] = 0x00;
1444 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1445 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1449 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
1453 buf24
[0] = 0xa2; buf24
[1] = 0x5d; buf24
[2] = 0x00; buf24
[3] = 0x00;
1454 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1455 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1459 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << a2 */
1462 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << a6 */
1467 ret
= usb_microdia_control_read(dev
, reg
, buf24
, 5); /* URB 296 // << 00 00 00 84 31 */
1473 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1477 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1482 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
1483 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1484 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1488 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1491 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1497 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1502 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1507 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1512 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1517 buf24
[0] = 0x98; buf24
[1] = 0xef; buf24
[2] = 0x11;
1518 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 3);
1522 /* UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
1523 // URB 307 <<< GETTING SELECT_INTERFACE Interface: AlternateSetting = 0
1524 // UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
1529 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1533 /* UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
1534 // URB 310 <<< GETTING SELECT_INTERFACE Interface: AlternateSetting = 8
1535 // UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
1537 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 312 */
1541 /* UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
1542 // UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER:
1547 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 314 */
1552 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1557 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1561 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << ef */
1565 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1570 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1575 ret
= usb_microdia_control_read(dev
, reg
, buf24
, 7); /* URB 320 // << a0 00 ff 81 00 00 00 */
1579 buf24
[0] = 0x80; buf24
[1] = 0xa0;
1580 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 2);
1586 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1591 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1596 buf24
[0] = 0x40; buf24
[1] = 0x30; buf24
[2] = 0x20; buf24
[3] = 0x10;
1598 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
1603 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
1604 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1606 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 9);
1612 buf24
[0] = 0x45; buf24
[1] = 0x18; buf24
[2] = 0x00; buf24
[3] = 0x30;
1613 buf24
[4] = 0x00; buf24
[5] = 0x09; buf24
[6] = 0x00; buf24
[7] = 0xed;
1614 buf24
[8] = 0x0f; buf24
[9] = 0xda; buf24
[10] = 0x0f; buf24
[11] = 0x3a;
1615 buf24
[12] = 0x00; buf24
[13] = 0x3a; buf24
[14] = 0x00; buf24
[15] = 0xd0;
1617 buf24
[16] = 0x0f; buf24
[17] = 0xf7; buf24
[18] = 0x0f; buf24
[19] = 0x10;
1618 buf24
[20] = 0x00; buf24
[21] = 0x00; buf24
[22] = 0x60; buf24
[23] = 0x0a;
1619 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 24); /* URB 326 */
1624 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x00;
1625 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 3);
1630 buf24
[0] = 0x00; buf24
[1] = 0xa0; buf24
[2] = 0x00; buf24
[3] = 0xf0;
1632 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
1637 buf24
[0] = 0x06; buf24
[1] = 0x4c; buf24
[2] = 0x08;
1638 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 3);
1644 buf24
[0] = 0x00; buf24
[1] = 0x20; buf24
[2] = 0x20; buf24
[3] = 0x20;
1645 buf24
[4] = 0x20; buf24
[5] = 0x00; buf24
[6] = 0x24; buf24
[7] = 0x3b;
1646 buf24
[8] = 0x4f; buf24
[9] = 0x61; buf24
[10] = 0x71; buf24
[11] = 0x80;
1647 buf24
[12] = 0x8f; buf24
[13] = 0x9d; buf24
[14] = 0xab; buf24
[15] = 0xb8;
1649 buf24
[16] = 0xc4; buf24
[17] = 0xd1; buf24
[18] = 0xdd; buf24
[19] = 0xe9;
1650 buf24
[20] = 0xf4; buf24
[21] = 0xff;
1651 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 22); /* URB 330 */
1656 buf24
[0] = 0x00; buf24
[1] = 0x00;
1657 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 2);
1662 buf24
[0] = 0x60; buf24
[1] = 0x28; buf24
[2] = 0x00; buf24
[3] = 0x08;
1663 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x00;
1665 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 9);
1671 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1676 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1681 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
1682 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1683 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 335..390 */
1687 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1690 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1694 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x0d; buf24
[3] = 0x00;
1695 buf24
[4] = 0x01; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1696 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1700 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1703 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1707 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x0d; buf24
[3] = 0x00;
1708 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1709 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1713 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1716 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1720 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x01; buf24
[3] = 0x00;
1721 buf24
[4] = 0x0e; buf24
[5] = 0x00; buf24
[6] = 0x14; buf24
[7] = 0x10;
1722 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 344 */
1726 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1729 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1733 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x03; buf24
[3] = 0x03;
1734 buf24
[4] = 0xc1; buf24
[5] = 0x05; buf24
[6] = 0x01; buf24
[7] = 0x10;
1735 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1739 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1742 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1746 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x05; buf24
[3] = 0x00;
1747 buf24
[4] = 0x83; buf24
[5] = 0x00; buf24
[6] = 0x06; buf24
[7] = 0x10;
1748 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1752 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1755 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1759 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x0d; buf24
[3] = 0x00;
1760 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1761 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1765 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1768 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1772 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x09; buf24
[3] = 0x00;
1773 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1774 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 356 */
1778 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1779 if(ret
< 0) goto err
;
1780 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1784 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x0b; buf24
[3] = 0x00;
1785 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1786 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1790 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1793 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1797 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x11; buf24
[3] = 0x00;
1798 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1799 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1803 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1806 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1810 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x1e; buf24
[3] = 0x80;
1811 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1812 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 365 */
1816 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1819 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1823 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x20; buf24
[3] = 0x11;
1824 buf24
[4] = 0x05; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1825 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1829 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1832 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1836 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2b; buf24
[3] = 0x00;
1837 buf24
[4] = 0x08; buf24
[5] = 0x00; buf24
[6] = 0x10; buf24
[7] = 0x10;
1838 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1842 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1845 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1849 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2d; buf24
[3] = 0x00;
1850 buf24
[4] = 0x14; buf24
[5] = 0x00; buf24
[6] = 0x08; buf24
[7] = 0x10;
1851 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1855 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1858 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1862 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x33; buf24
[3] = 0x00;
1863 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1864 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 377 */
1868 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
1872 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x5f; buf24
[3] = 0x89;
1873 buf24
[4] = 0x04; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1874 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1878 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1881 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); // << b4
1885 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x60; buf24
[3] = 0x00;
1886 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1887 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1891 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1894 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); // << d4
1898 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x62; buf24
[3] = 0x04;
1899 buf24
[4] = 0x98; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1900 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 385 */
1904 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
1907 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
1911 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x68; buf24
[3] = 0x00;
1912 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1913 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
1917 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1920 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1926 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 391 */
1930 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1936 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1940 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1944 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1950 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1956 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 397..400 */
1960 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1964 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1968 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
1973 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x20; buf24
[3] = 0x11;
1974 buf24
[4] = 0x1d; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
1975 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 401 */
1979 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
1982 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
1987 buf24
[0] = 0x02; buf24
[1] = 0x00; buf24
[2] = 0x02; buf24
[3] = 0x00;
1988 buf24
[4] = 0x28; buf24
[5] = 0x3c;
1989 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 6);
1993 buf24
[0] = 0x00; buf24
[1] = 0xa0; buf24
[2] = 0x00; buf24
[3] = 0xf0;
1995 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
2001 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2006 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x6a; buf24
[3] = 0x50;
2007 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
2011 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x50; buf24
[3] = 0x3c;
2012 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
2018 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2024 for(i
=410; i
<=411; i
++){
2025 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2032 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2037 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2042 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2048 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 415..425 */
2051 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 38 */
2055 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2058 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 39 */
2062 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2065 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3a */
2069 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2072 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << bb */
2076 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2079 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3c */
2083 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2089 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x06; buf24
[3] = 0x00;
2090 buf24
[4] = 0xf2; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2091 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 426..431 */
2095 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2098 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2102 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x05; buf24
[3] = 0x00;
2103 buf24
[4] = 0x13; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2104 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2108 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2111 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2117 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2122 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2127 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2131 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2136 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2141 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2146 buf24
[0] = 0x08; buf24
[1] = 0x2e; buf24
[2] = 0x55; buf24
[3] = 0x6f;
2147 buf24
[4] = 0x7f; buf24
[5] = 0x8d; buf24
[6] = 0x9a; buf24
[7] = 0xa6;
2148 buf24
[8] = 0xb1; buf24
[9] = 0xbb; buf24
[10] = 0xc5; buf24
[11] = 0xce;
2149 buf24
[12] = 0xd7; buf24
[13] = 0xdf; buf24
[14] = 0xe8; buf24
[15] = 0xef;
2151 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 17); /* URB 438 */
2156 for(i
=439; i
<=447; i
++){
2157 ret
= usb_microdia_control_write(dev
, reg
, buf10e1
, 21); /* URB 439..447 */
2164 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2169 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2174 ret
= usb_microdia_control_write(dev
, reg
, buf10e1
, 21); /* URB 450 */
2180 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2185 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2191 for(i
=453; i
<454; i
++){
2192 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2199 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2204 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x00; buf24
[3] = 0x00;
2205 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
2210 for (i
= 0; i
< 48; i
++)
2211 buf64
[i
] = 0; /* // zeroes */
2212 ret
= usb_microdia_control_write(dev
, reg
, buf64
, 48); /* URB 457 */
2218 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 458..461 */
2222 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2226 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2230 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2235 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x20; buf24
[3] = 0x11;
2236 buf24
[4] = 0x1d; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2237 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 462 */
2241 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2244 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2250 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2255 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x20; buf24
[3] = 0x11;
2256 buf24
[4] = 0x1d; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2257 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 466 */
2261 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2264 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2270 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2275 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
2276 buf24
[4] = 0x03; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2277 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 470..483 */
2281 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2284 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2288 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2b; buf24
[3] = 0x00;
2289 buf24
[4] = 0x10; buf24
[5] = 0x00; buf24
[6] = 0x10; buf24
[7] = 0x10;
2290 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2294 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
2297 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
2301 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2d; buf24
[3] = 0x00;
2302 buf24
[4] = 0x10; buf24
[5] = 0x00; buf24
[6] = 0x10; buf24
[7] = 0x10;
2303 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2307 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d0 */
2310 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
2314 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x33; buf24
[3] = 0x00;
2315 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2316 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 479 */
2320 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
2324 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
2325 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2326 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2330 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2333 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2339 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 484..487 */
2343 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2347 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2351 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2356 buf24
[0] = 0x2d; buf24
[1] = 0x2d; buf24
[2] = 0x3a; buf24
[3] = 0x05;
2357 buf24
[4] = 0x04; buf24
[5] = 0x3f;
2358 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 6);
2362 buf24
[0] = 0x28; buf24
[1] = 0xd8; buf24
[2] = 0x14; buf24
[3] = 0xec;
2363 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
2367 buf24
[0] = 0x32; buf24
[1] = 0xdd; buf24
[2] = 0x2d; buf24
[3] = 0xdd;
2368 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
2373 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
2374 buf24
[4] = 0x03; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2375 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 491..502 */
2379 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2382 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2386 buf24
[0] = 0xd0; buf24
[1] = 0x5d; buf24
[2] = 0x2c; buf24
[3] = 0x00;
2387 buf24
[4] = 0x1d; buf24
[5] = 0x00; buf24
[6] = 0x1d; buf24
[7] = 0x10;
2388 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2392 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 495: d0 */
2395 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 496: d0 */
2398 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << d4 */
2402 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x30; buf24
[3] = 0x00;
2403 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2404 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2408 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
2412 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x07; buf24
[3] = 0x00;
2413 buf24
[4] = 0x02; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2414 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2418 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2421 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2427 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2432 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2437 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2442 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2448 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2452 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2457 ret
= usb_microdia_control_write(dev
, reg
, buf1100
, 64); /* URB 509 (see also 249/250) */
2463 buf64
[0] = 0x0d; buf64
[1] = 0x11; buf64
[2] = 0x11; buf64
[3] = 0x15;
2464 buf64
[4] = 0x11; buf64
[5] = 0x15; buf64
[6] = 0x26; buf64
[7] = 0x15;
2465 buf64
[8] = 0x15; buf64
[9] = 0x26; buf64
[10] = 0x54; buf64
[11] = 0x36;
2466 buf64
[12] = 0x2e; buf64
[13] = 0x36; buf64
[14] = 0x54; buf64
[15] = 0x54;
2467 /* // 00000010: .. 00000030: 0x54 */
2468 for(i
=16; i
<=63; i
++) buf64
[i
] = 0x54;
2469 ret
= usb_microdia_control_write(dev
, reg
, buf64
, 64); /* URB 510 */
2475 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2479 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2485 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2491 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 514..517 */
2495 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2499 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2503 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2508 buf24
[0] = 0x02; buf24
[1] = 0x00; buf24
[2] = 0x02; buf24
[3] = 0x00;
2509 buf24
[4] = 0x28; buf24
[5] = 0x3c;
2510 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 6);
2513 buf24
[0] = 0x00; buf24
[1] = 0xa0; buf24
[2] = 0x00; buf24
[3] = 0xf0;
2515 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
2519 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2524 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x6a; buf24
[3] = 0x50;
2525 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
2528 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x50; buf24
[3] = 0x3c;
2529 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 4);
2533 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2538 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2543 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2548 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2553 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2558 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2564 for(i
=529; i
<=530; i
++){
2565 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2572 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2577 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2582 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2588 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 534..544 */
2591 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 38 */
2595 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2598 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 39 */
2602 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2605 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3a */
2609 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2612 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << bb */
2616 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2619 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 3c */
2623 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1);
2628 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x06; buf24
[3] = 0x00;
2629 buf24
[4] = 0xf2; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2630 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8); /* URB 545..555 */
2634 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2637 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2641 buf24
[0] = 0xb0; buf24
[1] = 0x5d; buf24
[2] = 0x05; buf24
[3] = 0x00;
2642 buf24
[4] = 0x13; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2643 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2647 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b0 */
2650 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << b4 */
2654 buf24
[0] = 0x90; buf24
[1] = 0x5d; buf24
[2] = 0x00; buf24
[3] = 0x00;
2655 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2656 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2660 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << 94 */
2664 buf24
[0] = 0xa2; buf24
[1] = 0x5d; buf24
[2] = 0x00; buf24
[3] = 0x00;
2665 buf24
[4] = 0x00; buf24
[5] = 0x00; buf24
[6] = 0x00; buf24
[7] = 0x10;
2666 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 8);
2670 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << a2 */
2673 ret
= usb_microdia_control_read(dev
, reg
, &buf
, 1); /* // << a6 */
2678 buf24
[0] = 0x00; buf24
[1] = 0x00; buf24
[2] = 0x00; buf24
[3] = 0x84;
2680 ret
= usb_microdia_control_write(dev
, reg
, buf24
, 5);
2686 ret
= usb_microdia_control_write(dev
, reg
, &buf
, 1); /* URB 557 */
2690 /* UNKNOWN -- URB_FUNCTION_RESET_PIPE:
2691 // UNKNOWN -- URB_FUNCTION_RESET_PIPE:
2692 // UNKNOWN -- URB_FUNCTION_GET_CURRENT_FRAME_NUMBER:
2693 // UNKNOWN -- URB_FUNCTION_GET_CURRENT_FRAME_NUMBER:
2694 // URB 560 >>> SENDING ISO REQUEST
2696 UDIA_INFO("...start function completed without errors.\n");
2699 UDIA_ERROR("r/w in bridge register %x failed (%d)!\n", reg
, ret
);
2704 * @brief From stop-close-amcap.log
2712 * For SN9C201 with MI1300. Comments from parser-usbsnoop(updated_13Mar2008).pl output
2715 int microdia_6240_stop_stream(struct usb_microdia
*dev
)
2720 UDIA_INFO("Stopping camera...\n");
2723 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 25319 */
2724 UDIA_INFO("...stop: write %x, ret = %d\n",buf
[0],ret
);
2726 buf
[0]=0xb0; buf
[1]=0x5d; buf
[2]=0x07; buf
[3]=0x00;
2727 buf
[4]=0x00; buf
[5]=0x00; buf
[6]=0x00; buf
[7]=0x10;
2728 ret
+= usb_microdia_control_write(dev
, 0x10c0, buf
, 8); /* URB 25320 */
2729 UDIA_INFO("...stop: write buf[8], ret = %d\n",ret
);
2731 ret
+= usb_microdia_control_read(dev
, 0x10c0, buf
, 1); /* URB 25321 << b0 */
2732 UDIA_INFO("...stop: read %x, ret = %d\n",buf
[0],ret
);
2734 ret
+= usb_microdia_control_read(dev
, 0x10c0, buf
, 1); /* URB 25322 << b4 */
2735 UDIA_INFO("...stop: read %x, ret = %d\n",buf
[0],ret
);
2738 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 25323 */
2739 UDIA_INFO("...stop: write %x, ret = %d\n",buf
[0],ret
);
2742 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 25324 */
2743 UDIA_INFO("...stop: write %x, ret = %d\n",buf
[0],ret
);
2746 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); /* URB 25325 */
2747 UDIA_INFO("...stop: write %x, ret = %d\n",buf
[0],ret
);
2750 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); /* URB 25326 */
2751 UDIA_INFO("...stop: write %x, ret = %d\n",buf
[0],ret
);
2753 buf
[0]=0x98; buf
[1]=0xef; buf
[2]=0x11;
2754 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 3); /* URB 25327 */
2755 UDIA_INFO("...stop: write buf[3], ret = %d\n",ret
);
2757 /* UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: (URB 5009)
2758 // URB 25328 <<< GETTING SELECT_INTERFACE Interface: AlternateSetting = 0
2759 // UNKNOWN -- URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER: (URB 25329)
2763 ret
+= usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 25330 */
2764 UDIA_INFO("...stop: write %x, ret = %d\n",buf
[0],ret
);
2767 UDIA_ERROR("One ore more errors occured during stop sequence !\n");
2775 * @brief From init.sequence.log
2783 * For SN9C201 with SOI968.
2784 * Tests showed this function is actually unnecessary.
2785 * Nevertheless the reads may give us valuable values we don't know about yet.
2787 int microdia_624e_initialize(struct usb_microdia
*dev
)
2791 usb_microdia_control_read(dev
, 0x130d, &buf
, 1);
2792 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
2798 * @brief From UsbSnoop-plugin-parsed.log
2804 int microdia_624f_initialize(struct usb_microdia
*dev
)
2806 /* Do nothing here */
2811 * @brief From UsbSnoop-plugin-parsed.log
2817 int microdia_6260_initialize(struct usb_microdia
*dev
)
2821 usb_microdia_control_read(dev
, 0x130d, &buf
, 1);
2822 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
2824 usb_microdia_control_write(dev
, 0x10c8, &buf
, 1);
2825 usb_microdia_control_read(dev
, 0x100a, &buf
, 1);
2827 usb_microdia_control_write(dev
, 0x100a, &buf
, 1);
2828 usb_microdia_control_read(dev
, 0x100b, &buf
, 1);
2830 usb_microdia_control_write(dev
, 0x100b, &buf
, 1);
2831 usb_microdia_control_read(dev
, 0x1001, &buf
, 1);
2833 usb_microdia_control_write(dev
, 0x1001, &buf
, 1);
2834 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
2836 usb_microdia_control_write(dev
, 0x1040, &buf
, 1);
2837 usb_microdia_control_read(dev
, 0x1045, &buf
, 1);
2839 usb_microdia_control_write(dev
, 0x1045, &buf
, 1);
2840 usb_microdia_control_read(dev
, 0x1046, &buf
, 1);
2842 usb_microdia_control_write(dev
, 0x1046, &buf
, 1);
2844 usb_microdia_control_write(dev
, 0x1045, &buf
, 1);
2846 usb_microdia_control_write(dev
, 0x1040, &buf
, 1);
2848 usb_microdia_control_write(dev
, 0x1020, &buf
, 1);
2854 * @brief From 6 init-logs
2858 * @returns 0 (ok) or -1 (error)
2862 * Windows driver versions: 5.5.8.12 and 5.7.23.000
2863 * Windows versions: 2000 and XP
2864 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
2866 * Comments behind read oprations contain HEX-values that appeared in the logs
2868 int microdia_6270_initialize(struct usb_microdia
*dev
)
2880 ret
+= usb_microdia_control_read(dev
, 0x130d, buf
, 1); // URB 5 0x81,0x85,0x04,0x8b,0x02,...
2882 ret
+= usb_microdia_control_read(dev
, 0x1040, buf
, 1); // URB 6 0xe4,0xc4,0xa4,0x44,...
2885 * THE OLD DRIVER 5.5.8.12 DOES AN ADDITIONAL WRITE HERE:
2887 * usb_microdia_control_write(dev, 0x10c8, buf, 1);
2890 ret
+= usb_microdia_control_read(dev
, 0x118a, buf
, 1); // URB 7 0x05,0x7b,0x01,0x04,...
2892 ret
+= usb_microdia_control_read(dev
, 0x0395, buf_0395
, 1); // URB 8 0xc2,0x82,0x38,0x98,0x04,...
2893 // => this value will be rewritten to 0x118a and 0x0395 later (URBs 81+82)
2896 ret
+= usb_microdia_control_write(dev
, 0x118a, buf
, 1); // URB 9
2898 ret
+= usb_microdia_control_write(dev
, 0x0395, buf
, 1); // URB 10
2900 ret
+= usb_microdia_control_read(dev
, 0x11b8, buf_11b8
, 1); // URB 11 0xa0,0x00,0x24,...
2901 // => this value will be rewritten to 0x11b8 later (URB 83)
2904 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 12
2906 ret
+= usb_microdia_control_read(dev
, 0x1000, buf_1000
, 5); // URB 13 0x30 0xCF 0x00 0x03 (0x02 or 0x00)
2907 // => these values will be rewritten to 0x1000 later (URB 84)
2909 buf
[0] = 0x70; buf
[1] = 0x00; buf
[2] = 0x18; buf
[3] = 0x00; buf
[4] = 0x00;
2910 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 5); // URB 14
2912 ret
+= usb_microdia_control_read(dev
, 0x1060, buf_1060
, 2); // URB 15 0x08 0x00 (always ???)
2913 // => this value will be rewritten to 0x1060 later (URB 85)
2915 buf
[0] = 0x00; buf
[1] = 0x03;
2916 ret
+= usb_microdia_control_write(dev
, 0x1060, buf
, 2); // URB 16
2918 // initialize I2C registers to avoid getting no ACK at first I2C operation:
2919 ret
+= sn9c20x_initialize_i2c(dev
, SN9C20X_I2C_2WIRE
, MT9V011_I2C_SLAVE_ADDRESS
);
2921 // enable I2C communication (bit 0)
2922 buf
[0] = 0x21; // THE OLD DRIVER 5.5.8.12 WRITES 0x5d
2923 ret
+= usb_microdia_control_write(dev
, 0x10c8, buf
, 1); // URB 17
2925 // probe sensor model:
2926 retSP
= mt9vx11_sensor_probe(dev
); // substitutes URBs 18-48
2927 if ((retSP
== 0) && (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
))
2928 // switch (back) to IFP address space:
2929 retASS
= mt9v111_select_address_space(dev
, MT9V111_ADDRESSSPACE_IFP
);
2931 ret
+= usb_microdia_control_write(dev
, 0x118a, buf_0395
, 1); // URB 81 => write value read with URB 8
2933 ret
+= usb_microdia_control_write(dev
, 0x0395, buf_0395
, 1); // URB 82 => write value read with URB 8
2935 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf_11b8
, 1); // URB 83 => write value read with URB 11
2937 ret
+= usb_microdia_control_write(dev
, 0x1000, buf_1000
, 5); // URB 84 => write value read with URB 13
2939 ret
+= usb_microdia_control_write(dev
, 0x1060, buf_1060
, 2); // URB 85 => write value read with URB 15; (always 08 00 ???)
2941 // USB-interrupt-message: doesn't work yet (returns error -110)
2942 //usb_interrupt_msg(dev->udev, usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr), dev->int_in_buffer, dev->int_in_size, &actual, 1000); // URB 86
2945 * THE OLD DRIVER 5.5.8.12 DOES AN ADDITIONAL WRITE HERE:
2947 * usb_microdia_control_write(dev, 0x1020, wbuf, 1);
2950 if ((retSP
!= 0) || (retASS
!= 0) || (ret
< 33))
2953 UDIA_INFO("One ore more errors occured during initialization !\n");
2961 * @brief From UsbSnoop-plugin-parsed.log
2967 int microdia_627b_initialize(struct usb_microdia
*dev
)
2980 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1); /* URB 5 */
2984 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1); /* URB 6 */
2989 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1); /* URB 7 */
2993 ret
= usb_microdia_control_read(dev
, reg
, reg0395
, 1); /* URB 8 */
2999 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 9 */
3003 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 10 */
3008 ret
= usb_microdia_control_read(dev
, reg
, reg11b8
, 1); /* URB 11 */
3014 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 12 */
3018 ret
= usb_microdia_control_read(dev
, reg
, reg1000
, 5); /* URB 13 */
3023 buf
[0] = 0x70; buf
[1] = 0x00; buf
[2] = 0x18; buf
[3] = 0x00; buf
[4] = 0x00;
3024 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5); /* URB 14 */
3029 ret
= usb_microdia_control_read(dev
, reg
, reg1060
, 2); /* URB 15 */
3034 buf
[0] = 0x00; buf
[1] = 0x03;
3035 ret
= usb_microdia_control_write(dev
, reg
, buf
, 2); /* URB 16 */
3041 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 17 */
3045 retI2C
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3046 OV7660_CTL_PID
, dev
->sensor_flags
, buf
); /* URBs 18-29 */
3051 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 30 */
3055 retI2C
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3056 OV7660_CTL_PID
, dev
->sensor_flags
, buf
); /* URBs 31-35 */
3059 UDIA_ERROR("Read of sensor register 0x0a failed.");
3063 ret
= usb_microdia_control_write(dev
, reg
, reg0395
, 1); /* URB 36 */
3067 ret
= usb_microdia_control_write(dev
, reg
, reg0395
, 1); /* URB 37 */
3073 ret
= usb_microdia_control_write(dev
, reg
, reg11b8
, 1); /* URB 38 */
3078 buf
[0] = 0x30; buf
[1] = 0xcf; buf
[2] = 0x00; buf
[3] = 0x03; buf
[4] = 0x02;
3079 ret
= usb_microdia_control_write(dev
, reg
, reg1000
, 5); /* URB 39 */
3084 buf
[0] = 0x08; buf
[1] = 0x00;
3085 ret
= usb_microdia_control_write(dev
, reg
, reg1060
, 2); /* URB 40 */
3091 ret = usb_interrupt_msg(dev->udev, 0x00000083, buf, 0x0000001, &actual, 1000);
3096 UDIA_ERROR("r/w in bridge register %x failed (%d)!\n", reg
, ret
);
3101 * @brief From init-start-stop-log (made by VÃctor M. Hernández Rocamora)
3105 * @returns 0 (ok) or -1 (error)
3109 * USB-Logger: SniffUSB 2.0
3111 * Comments behind read oprations contain HEX-values that appeared in the log
3113 int microdia_627f_initialize(struct usb_microdia
*dev
)
3118 ret
+= usb_microdia_control_read(dev
, 0x130d, buf
, 1); // URB 5 0x81
3120 ret
+= usb_microdia_control_read(dev
, 0x1040, buf
, 1); // URB 6 0xe4
3123 ret
+= usb_microdia_control_write(dev
, 0x10c8, buf
, 1); // URB 7
3126 ret
+= usb_microdia_control_write(dev
, 0x1020, buf
, 1); // URB 8
3128 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); // URB 9 0x0f
3131 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); // URB 10
3133 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); // URB 11 0x1f
3136 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); // URB 12
3138 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); // URB 13 0x0f
3141 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); // URB 14
3145 UDIA_INFO("One ore more errors occured during initialization !\n");
3152 * @brief From UsbSnoop-plugin-parsed.log
3156 * @returns 0 (OK) or <0 (Error)
3158 * @author Vincent, Kuzja
3160 int microdia_6288_initialize(struct usb_microdia
*dev
)
3168 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3169 if(ret
< 0) goto err
;
3172 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3173 if(ret
< 0) goto err
;
3180 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
3185 * @brief From UsbSnoop-plugin-parsed.log
3189 * @returns 0 if all OK
3191 * Function to initialize Microdia 6128 webcam
3192 * Bridge SN9C325 + OM6802 CMOS sensor
3193 * note: comments are my observations so they could be wrong
3195 int microdia_6128_initialize(struct usb_microdia
*dev
)
3200 UDIA_INFO("Initializing camera...\n");
3203 ret
+= usb_microdia_control_write(dev
, 0xf1, buf
, 1);
3204 ret
+= usb_microdia_control_read(dev
, 0x00, buf
, 1); // read reg 0x00 must write 0x00 in buf[0]
3205 ret
+= usb_microdia_control_write(dev
, 0xf1, buf
, 1);
3206 ret
+= usb_microdia_control_read(dev
, 0x00, buf
, 1); // get cam ID, must read 0x12
3209 UDIA_ERROR("Microdia 6128 is not connected or working !!!\n");
3213 buf
[0] = 0x29; buf
[1] = 0x70; // Configure GPIO
3214 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 2);
3217 ret
+= usb_microdia_control_write(dev
, 0xf1, buf
, 1); // Maybe wakeup
3220 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1); // Command to initialize cam
3223 UDIA_DEBUG("Some read or writes were not successful in initialization !\n");
3225 /* Device is initialized and ready */
3226 UDIA_INFO("Microdia USB2.0 Camera is ready\n");
3232 int dev_microdia_start_stream(struct usb_microdia
*dev
)
3235 if(dev
&& dev
->start_stream
)
3236 ret
= dev
->start_stream(dev
);
3242 * @brief From start.htm
3250 * For SN9C201 with MI1310.
3251 * This function has not been tested yet.
3253 int microdia_6242_start_stream(struct usb_microdia
*dev
)
3259 0x01, 0x18, 0x00, 0x30, 0x00, 0x09, 0x00, 0xed,
3260 0x0f, 0xda, 0x0f, 0x3a, 0x00, 0x3a, 0x00, 0xd0,
3261 0x0f, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x60, 0x0a};
3264 0x02, 0x00, 0x02, 0x00, 0x50, 0x78, 0x00, 0x00,
3268 0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0x24, 0x3b,
3269 0x4f, 0x61, 0x71, 0x80, 0x8f, 0x9d, 0xab, 0xb8,
3270 0xc4, 0xd1, 0xdd, 0xe9, 0xf4, 0xff};
3273 0x08, 0x38, 0x58, 0x6f, 0x7f, 0x8d, 0x9a, 0xa6,
3274 0xb1, 0xbb, 0xc5, 0xce, 0xd7, 0xdf, 0xe8, 0xef,
3278 0x16, 0x00, 0x2b, 0x00, 0x08, 0x00, 0x00, 0x00,
3279 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
3280 0x00, 0x00, 0x00, 0x00, 0x00};
3282 __u8 qtable1
[64] = {
3283 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
3284 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
3285 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
3286 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
3287 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
3288 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
3289 0x4f, 0x54, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
3290 0x64, 0x5c, 0x54, 0x64, 0x4b, 0x54, 0x58, 0x54};
3292 __u8 qtable2
[64] = {
3293 0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
3294 0x15, 0x26, 0x54, 0x36, 0x2e, 0x36, 0x54, 0x54,
3295 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
3296 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
3297 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
3298 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
3299 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
3300 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54};
3302 __u8 first10c0
[7][3] = {
3309 {0xf0, 0x00, 0x00}};
3311 __u8 second10c0a
[2][5] = {
3312 {0x01, 0x00, 0x0e, 0x00, 0x14},
3313 {0x03, 0x03, 0xc4, 0x05, 0x14}};
3314 __u8 second10c0b
[3] =
3317 __u8 third10c0
[4][3] = {
3321 {0x20, 0x00, 0x00}};
3323 __u8 fourth10c0a
[3][3] = {
3326 {0x0d, 0x80, 0x08}};
3327 __u8 fourth10c0b
[2][5] = {
3328 {0x2b, 0x01, 0x88, 0x01, 0x88},
3329 {0x2d, 0x01, 0x88, 0x01, 0x88}};
3331 __u8 fifth10c0
[4][3] = {
3334 {0x05, 0x00, 0x72}};
3339 usb_microdia_control_write(dev
, 0x1066, buf
, 1); // URB 1
3346 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
3349 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
3352 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3355 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3358 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3361 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3364 usb_microdia_control_write(dev
, 0x1020, buf
, 1);
3366 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
3367 buf
[3] = 0x10; buf
[4] = 0x08;
3368 usb_microdia_control_write(dev
, 0x1067, buf
, 5);
3370 buf
[0] = 0xb0; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x0d;
3371 buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00;
3372 buf
[6] = 0x00; buf
[7] = 0x10; buf
[8] = 0x03;
3373 usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
3375 usb_microdia_control_write(dev
, 0x10e0, urb10
, 24); // URB 10
3377 buf
[0] = 0x00; buf
[1] = 0x00; buf
[3] = 0x00;
3378 usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
3380 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00;
3381 buf
[3] = 0xe0; buf
[4] = 0x03;
3382 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
3384 usb_microdia_control_write(dev
, 0x1180, urb13
, 11);
3386 usb_microdia_control_write(dev
, 0x118b, urb14
, 22);
3388 buf
[0] = 0x00; buf
[1] = 0x00;
3389 usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
3391 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00;
3392 buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00;
3393 buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00;
3394 usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
3397 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3400 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3402 for (i
= 0; i
< 7; i
++) // URB 9-48
3403 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3404 first10c0
[i
][0], dev
->sensor_flags
, &first10c0
[i
][1]);
3407 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
3410 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
3413 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 50
3416 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3419 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3422 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3425 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3428 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3431 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
3434 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
3437 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
3440 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
3442 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3443 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
3445 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3446 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
3448 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3449 0x09, dev
->sensor_flags
, NULL
);
3451 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3452 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
3454 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
3455 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
3456 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
3458 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3459 buf
[3] = 0xf0; buf
[4] = 0x00;
3460 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 70
3463 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3465 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3466 usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
3468 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3469 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
3472 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3475 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3478 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3481 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3484 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
3487 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
3490 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 80
3491 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3494 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3495 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3498 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3499 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3502 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3503 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3506 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3507 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3510 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 90
3512 for (i
= 0; i
< 4; i
++) // URB 97-106
3513 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3514 third10c0
[i
][0], dev
->sensor_flags
, &third10c0
[i
][1]);
3517 usb_microdia_control_write(dev
, 0x1180, buf
, 1);
3519 for (i
= 0; i
< 3; i
++)
3520 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3521 fourth10c0a
[i
][0], dev
->sensor_flags
, &fourth10c0a
[i
][1]);
3523 for (i
= 0; i
< 2; i
++)
3524 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3525 fourth10c0b
[i
][0], dev
->sensor_flags
, &fourth10c0b
[i
][1]);
3527 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3528 0x33, dev
->sensor_flags
, NULL
);
3530 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3531 first10c0
[0][0], dev
->sensor_flags
, &first10c0
[0][1]);
3534 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
3537 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 110
3540 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
3543 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
3546 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3549 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
3552 usb_microdia_control_write(dev
, 0x118d, buf
, 1);
3555 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
3558 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
3561 usb_microdia_control_write(dev
, 0x118b, buf
, 1);
3563 usb_microdia_control_write(dev
, 0x1190, urb119
, 17);
3565 for (i
= 0; i
< 9; i
++) // URB 120-128
3566 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21);
3569 usb_microdia_control_write(dev
, 0x10f7, buf
, 1);
3572 usb_microdia_control_write(dev
, 0x10f6, buf
, 1); // URB 130
3574 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21);
3577 usb_microdia_control_write(dev
, 0x10f8, buf
, 1);
3580 usb_microdia_control_write(dev
, 0x10fa, buf
, 1);
3583 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
3586 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
3589 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3591 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
3592 usb_microdia_control_write(dev
, 0x11bc, buf
, 4);
3594 /* Set whole array buf to 0x00 */
3595 memset(buf
, 0x00, 48);
3596 usb_microdia_control_write(dev
, 0x11c0, buf
, 48);
3599 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
3602 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 140
3605 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
3608 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
3610 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a;
3611 buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
3612 usb_microdia_control_write(dev
, 0x11a5, buf
, 6);
3614 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
3615 usb_microdia_control_write(dev
, 0x11af, buf
, 4);
3617 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
3618 usb_microdia_control_write(dev
, 0x11b3, buf
, 4);
3621 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3624 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3627 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3629 usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
3631 usb_microdia_control_write(dev
, 0x1140, qtable2
, 64); // URB 150
3634 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3637 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3640 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3643 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3646 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
3649 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
3652 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
3655 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
3657 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3658 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
3660 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3661 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
3663 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3664 0x09, dev
->sensor_flags
, NULL
);
3666 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3667 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
3669 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
3670 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
3671 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
3673 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3674 buf
[3] = 0xf0; buf
[4] = 0x00;
3675 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
3678 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3680 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3681 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); // URB 170
3683 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3684 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
3687 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3690 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3693 usb_microdia_control_write(dev
, 0x11b9, buf
, 1);
3696 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3699 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3702 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3705 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3708 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3711 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 180
3714 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
3717 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
3720 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3721 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3724 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3725 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3728 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3729 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3732 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3733 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 190
3736 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3737 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3740 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3742 for (i
= 0; i
< 3; i
++) // URB 200-205
3743 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3744 fifth10c0
[i
][0], dev
->sensor_flags
, &fifth10c0
[i
][1]);
3746 sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3747 0x00, dev
->sensor_flags
, buf
);
3748 /* __u8 result[2] = {buf[3], buf[4]}; */
3751 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3757 * @brief From startstream.log
3765 * For SN9C201 with SOI968.
3766 * This is function triggers a working stream of image data and a glowing LED.
3768 int microdia_624e_start_stream(struct usb_microdia
*dev
)
3774 {0x47, 0x18, 0x00, 0x30, 0x00, 0x09, 0x00, 0xed,
3775 0x0f, 0xda, 0x0f, 0x3a, 0x00, 0x3a, 0x00, 0xd0,
3776 0x0f, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x60, 0x0a};
3779 {0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0x24, 0x3b,
3780 0x4f, 0x61, 0x71, 0x80, 0x8f, 0x9d, 0xab, 0xb8,
3781 0xc4, 0xd1, 0xdd, 0xe9, 0xf4, 0xff};
3784 {0x08, 0x2b, 0x59, 0x79, 0x91, 0x9e, 0xa9, 0xb3,
3785 0xbd, 0xc6, 0xce, 0xd6, 0xdd, 0xe4, 0xea, 0xf1,
3789 {0x16, 0x00, 0x2d, 0x00, 0x08, 0x00, 0xdd, 0x0f,
3790 0xbc, 0x0f, 0x68, 0x00, 0x68, 0x00, 0xa9, 0x0f,
3791 0xf0, 0x0f, 0x00, 0x00, 0x00};
3794 {0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
3795 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
3796 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
3797 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
3798 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
3799 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
3800 0x4f, 0x53, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
3801 0x64, 0x5c, 0x53, 0x64, 0x4b, 0x53, 0x58, 0x53};
3804 {0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
3805 0x15, 0x26, 0x53, 0x36, 0x2e, 0x36, 0x53, 0x53,
3806 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3807 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3808 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3809 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3810 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3811 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53};
3813 __u8 first10c0
[20][2] = {
3814 {0x12, 0x80}, {0x12, 0x00}, {0x0c, 0x00}, {0x0f, 0x1f},
3815 {0x11, 0x80}, {0x38, 0x52}, {0x1e, 0x00}, {0x33, 0x08},
3816 {0x35, 0x8c}, {0x36, 0x0c}, {0x37, 0x04}, {0x45, 0x04},
3817 {0x47, 0xff}, {0x3e, 0x00}, {0x3f, 0x00}, {0x3b, 0x20},
3818 {0x3a, 0x96}, {0x3d, 0x0a}, {0x14, 0x4e}, {0x13, 0x88}};
3820 __u8 second10c0a
[2] =
3822 __u8 second10c0b
[5] =
3823 {0x17, 0x13, 0x63, 0x01, 0x79}; // length 4
3824 __u8 second10c0c
[2] =
3825 {0x1b, 0x00}; // length 0
3826 __u8 second10c0d
[2][2] = {
3830 __u8 third10c0a
[5][2] = {
3836 __u8 third10c0b
[3] =
3837 {0x01, 0x80, 0x80}; // length 2
3840 {0x0a, 0x0b, 0x1c, 0x1d}; // these are four addresses
3845 usb_microdia_control_write(dev
, 0x1066, buf
, 1); // URB 1
3852 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3855 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3858 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3860 buf
[0] = 0xa0; buf
[1] = 0xa0;
3861 usb_microdia_control_write(dev
, 0x1006, buf
, 2);
3864 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3867 usb_microdia_control_write(dev
, 0x1020, buf
, 1);
3869 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
3870 buf
[3] = 0x10; buf
[4] = 0x08;
3871 usb_microdia_control_write(dev
, 0x1067, buf
, 5);
3873 buf
[0] = 0x92; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x00;
3874 buf
[3] = 0x00; buf
[4] = 0x1d; buf
[5] = 0x00;
3875 buf
[6] = 0xa2; buf
[7] = 0x10; buf
[8] = 0x03;
3876 usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
3878 usb_microdia_control_write(dev
, 0x10e0, urb10
, 24); // URB 10
3880 buf
[0] = 0x00; buf
[1] = 0x00; buf
[3] = 0x00;
3881 usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
3883 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3884 buf
[3] = 0xf0; buf
[4] = 0x00;
3885 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
3887 buf
[0] = 0x8a; buf
[1] = 0xcc; buf
[2] = 0x08;
3888 usb_microdia_control_write(dev
, 0x1188, buf
, 3);
3890 usb_microdia_control_write(dev
, 0x118b, urb14
, 22);
3892 buf
[0] = 0x00; buf
[1] = 0x00;
3893 usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
3895 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00;
3896 buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x40;
3897 buf
[6] = 0x01; buf
[7] = 0xf0; buf
[8] = 0x00;
3898 usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
3901 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3904 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3906 for (i
= 0; i
< 20; i
++) // URB 9-48
3907 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3908 first10c0
[i
][0], dev
->sensor_flags
, &first10c0
[i
][1]);
3911 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3914 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 50
3917 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3920 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3923 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3926 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3929 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
3932 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
3935 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
3938 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
3941 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, // URB 59-60
3942 second10c0a
[0], dev
->sensor_flags
, &second10c0a
[1]);
3944 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3945 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
3947 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3948 second10c0c
[0], dev
->sensor_flags
, &second10c0c
[1]);
3950 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3951 second10c0d
[0][0], dev
->sensor_flags
, &second10c0d
[0][1]);
3953 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3954 second10c0d
[1][0], dev
->sensor_flags
, &second10c0d
[1][1]);
3956 buf
[0] = 0x3c; buf
[1] = 0x00; buf
[2] = 0x0b;
3957 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
3958 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
3960 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3961 buf
[3] = 0xf0; buf
[4] = 0x00;
3962 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 70
3965 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3967 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3968 usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
3970 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3971 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
3974 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3977 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3980 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3983 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3986 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
3989 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
3992 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 80
3993 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3996 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3997 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4000 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4001 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4004 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4005 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4008 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4009 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4012 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 90
4013 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4016 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4017 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4020 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4021 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4024 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4026 for (i
= 0; i
< 5; i
++) // URB 97-106
4027 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4028 third10c0a
[i
][0], dev
->sensor_flags
, &third10c0a
[i
][1]);
4030 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
4031 third10c0b
[0], dev
->sensor_flags
, &third10c0b
[1]);
4034 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
4037 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 110
4040 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
4043 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
4046 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4049 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
4052 usb_microdia_control_write(dev
, 0x118d, buf
, 1);
4055 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
4058 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
4061 usb_microdia_control_write(dev
, 0x118b, buf
, 1);
4063 usb_microdia_control_write(dev
, 0x1190, urb119
, 17);
4065 for (i
= 0; i
< 9; i
++) // URB 120-128
4066 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21);
4070 usb_microdia_control_write(dev
, 0x10f7, buf
, 1);
4073 usb_microdia_control_write(dev
, 0x10f6, buf
, 1); // URB 130
4075 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21);
4078 usb_microdia_control_write(dev
, 0x10f8, buf
, 1);
4081 usb_microdia_control_write(dev
, 0x10fa, buf
, 1);
4084 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
4087 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
4090 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4092 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
4093 usb_microdia_control_write(dev
, 0x11bc, buf
, 4);
4095 /* Set whole buf to 0x00 */
4097 usb_microdia_control_write(dev
, 0x11c0, buf
, 48);
4100 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
4103 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 140
4106 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
4109 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
4111 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a;
4112 buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
4113 usb_microdia_control_write(dev
, 0x11a5, buf
, 6);
4115 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
4116 usb_microdia_control_write(dev
, 0x11af, buf
, 4);
4118 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
4119 usb_microdia_control_write(dev
, 0x11b3, buf
, 4);
4122 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4125 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4128 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4130 usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
4132 usb_microdia_control_write(dev
, 0x1140, qtable2
, 64); // URB 150
4135 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4138 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4141 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4144 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
4147 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
4150 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
4153 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
4156 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
4158 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, // URB 159-160
4159 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
4161 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
4162 second10c0c
[0], dev
->sensor_flags
, &second10c0c
[1]);
4164 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4165 second10c0d
[0][0], dev
->sensor_flags
, &second10c0d
[0][1]);
4167 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4168 second10c0d
[1][0], dev
->sensor_flags
, &second10c0d
[1][1]);
4170 buf
[0] = 0x3c; buf
[1] = 0x00; buf
[2] = 0x0b;
4171 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
4172 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
4174 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
4175 buf
[3] = 0xf0; buf
[4] = 0x00;
4176 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
4179 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
4181 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
4182 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); // URB 170
4184 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
4185 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
4188 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4191 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4194 usb_microdia_control_write(dev
, 0x11b9, buf
, 1);
4197 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4200 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4203 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
4206 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
4209 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
4212 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 180
4215 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
4218 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
4221 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4222 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4225 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4226 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4229 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4230 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4233 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4234 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 190
4237 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4238 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4241 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4242 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4245 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4246 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4249 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4250 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4253 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4255 for (i
= 0; i
< 3; i
++) // URB 200-205
4256 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4257 third10c0a
[i
][0], dev
->sensor_flags
, &third10c0a
[i
][1]);
4259 for (i
= 0; i
< 4; i
++) // URB 206-225
4260 sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
,
4261 1, read10c0
[i
], dev
->sensor_flags
, buf
);
4264 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4267 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
4270 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
4275 int microdia_624f_start_stream(struct usb_microdia
*dev
)
4279 __u8 eeprom_slave_id
= 0x50;
4280 __u8 eeprom_flags
= SN9C20X_I2C_2WIRE
;
4283 __u8 unknown1
[9] = { dev
->sensor_flags
, dev
->sensor_slave_address
,
4284 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
4288 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4289 if(ret
< 0) goto err
;
4293 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4294 if(ret
< 0) goto err
;
4298 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4299 if(ret
< 0) goto err
;
4303 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4304 if(ret
< 0) goto err
;
4308 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4309 if(ret
< 0) goto err
;
4313 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4314 if(ret
< 0) goto err
;
4318 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4319 if(ret
< 0) goto err
;
4321 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
4322 buf
[3] = 0x10; buf
[4] = 0x08;
4324 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
4325 if(ret
< 0) goto err
;
4327 /* this is the same register as the I2C write, not sure why
4328 * we're writing 9 bytes -- the SN9C102 docs say all writes
4329 * must be 8 bytes, but we don't have docs for SN9C20x */
4331 ret
= usb_microdia_control_write(dev
, command
, unknown1
, 9);
4332 if(ret
< 0) goto err
;
4334 buf
[0] = 0x44; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
4335 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
4336 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
4337 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
4338 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
4339 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
4341 ret
= usb_microdia_control_write(dev
, command
, buf
, 24);
4342 if(ret
< 0) goto err
;
4344 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
4346 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
4347 if(ret
< 0) goto err
;
4349 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
4350 buf
[3] = 0xf0; buf
[4] = 0x00;
4352 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
4353 if(ret
< 0) goto err
;
4355 buf
[0] = 0x87; buf
[1] = 0xcc; buf
[2] = 0x08;
4357 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
4358 if(ret
< 0) goto err
;
4360 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
4361 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
4362 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
4363 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
4364 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
4365 buf
[20] = 0xf4; buf
[21] = 0xff;
4367 ret
= usb_microdia_control_write(dev
, command
, buf
, 22);
4368 if(ret
< 0) goto err
;
4370 buf
[0] = 0x00; buf
[1] = 0x00;
4372 ret
= usb_microdia_control_write(dev
, command
, buf
, 2);
4373 if(ret
< 0) goto err
;
4375 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00; buf
[3] = 0x08;
4376 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
4379 ret
= usb_microdia_control_write(dev
, command
, buf
, 9);
4380 if(ret
< 0) goto err
;
4384 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4385 if(ret
< 0) goto err
;
4389 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4390 if(ret
< 0) goto err
;
4392 /* reset all SCCB registers to their default values */
4393 buf
[0] = OV965X_COM7_SCCB_RESET
;
4394 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM7
,
4395 dev
->sensor_flags
, buf
);
4396 if(ret
< 0) goto err
;
4398 buf
[0] = 0x7f; //0x7f; /* AGC setting */
4399 buf
[1] = 0xe0; /* blue gain setting */
4400 buf
[2] = 0x90; /* red gain setting */
4401 buf
[3] = OV965X_VREF_VSTOP_LOW3(0x04) | OV965X_VREF_VSTART_LOW3(0x02);
4402 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_GAIN
,
4403 dev
->sensor_flags
, buf
);
4404 if(ret
< 0) goto err
;
4407 this write appears to be unnecessary since we issued
4408 the reset above and the spec says that 0x00 is the default
4409 for all 4 of the registers we're writing to here
4412 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_COM1
,
4413 dev
->sensor_flags
, buf
);
4414 if(ret
< 0) goto err
;
4416 /* first byte still 0, not sure why, RAVE default is 0x00 too */
4418 buf
[1] = OV965X_COM2_OUTPUT_DRIVE_CAP_2X
;
4419 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, OV965X_CTL_RAVE
,
4420 dev
->sensor_flags
, buf
);
4421 if(ret
< 0) goto err
;
4423 buf
[0] = 0x00; buf
[1] = 0x00;
4424 /* not sure why we're setting bit 5 below, spec says it's reserved */
4425 buf
[2] = OV965X_COM5_15FPS_48MHZ_RGB
| 0x20;
4426 /* likewise, spec says 4 & 6 are reserved */
4427 buf
[3] = OV965X_COM6_TIMING_RESET_ON_FMT_CHANGE
| 0x50;
4428 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_COM3
,
4429 dev
->sensor_flags
, buf
);
4430 if(ret
< 0) goto err
;
4432 buf
[0] = 0xff; /* AEC bits 2-9 */
4433 buf
[1] = OV965X_CLKRC_INPUT_CLK_NO_SCALE
;
4434 buf
[2] = OV965X_COM7_OUTPUT_RAW_RGB
;
4435 buf
[3] = OV965X_COM8_FAST_AGC_AEC
| OV965X_COM8_AEC_STEP_SIZE_NOLIMIT
|
4436 /*OV965X_COM8_AGC_ENABLE |*/ OV965X_COM8_AEC_ENABLE
| OV965X_COM8_AWB_ENABLE
;
4437 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_AECH
,
4438 dev
->sensor_flags
, buf
);
4439 if(ret
< 0) goto err
;
4441 buf
[0] = OV965X_COM9_MAX_AGC_8X
| OV965X_COM9_RELAX_EXPOSURE_TIMING
|
4442 OV965X_COM9_DROP_VSYNC_ON_FRAME_DROP
|
4443 OV965X_COM9_DROP_FRAME_ON_BIG_AEC
;
4445 buf
[2] = 0x07; /* hmm, spec says this is reserved */
4446 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3, OV965X_CTL_COM9
,
4447 dev
->sensor_flags
, buf
);
4448 if(ret
< 0) goto err
;
4450 /* this is supposed to be reserved too */
4451 buf
[0] = 0x04; buf
[1] = 0x00;
4452 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, OV965X_CTL_MVFP
,
4453 dev
->sensor_flags
, buf
);
4454 if(ret
< 0) goto err
;
4456 buf
[0] = 0x78; /* this is the default! */
4457 buf
[1] = 0x68; /* this is the default! */
4458 buf
[2] = 0xd4; /* this is the default! */
4459 buf
[3] = 0x80; /* this is the default! */
4460 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_AEW
,
4461 dev
->sensor_flags
, buf
);
4462 if(ret
< 0) goto err
;
4464 buf
[0] = OV965X_BIAS_SUBTRACT
;
4465 buf
[1] = OV965X_Gr_COM_BYPASS_ANALOG_BLC
| OV965X_Gr_COM_BYPASS_REGULATOR
;
4466 buf
[2] = 0x00; buf
[3] = 0x00;
4467 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_GbBIAS
,
4468 dev
->sensor_flags
, buf
);
4469 if(ret
< 0) goto err
;
4471 buf
[0] = OV965X_BIAS_SUBTRACT
;
4472 buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
4473 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_RBIAS
,
4474 dev
->sensor_flags
, buf
);
4475 if(ret
< 0) goto err
;
4477 buf
[0] = 0x08; /* HSYNC rising edge start */
4478 buf
[1] = 0x30; /* HSYNC rising edge end */
4479 buf
[2] = OV965X_HREF_EDGE_OFT_TO_DATA_OUT(2) | OV965X_HREF_HSTART_LOW3(6)
4480 | OV965X_HREF_HSTOP_LOW3(4);
4481 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3, OV965X_CTL_HSYST
,
4482 dev
->sensor_flags
, buf
);
4483 if(ret
< 0) goto err
;
4485 /* the docs say all 4 of these bytes are reserved */
4486 buf
[0] = 0xe2; buf
[1] = 0xbf; buf
[2] = 0x81; buf
[3] = 0xf9;
4487 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_CHLF
,
4488 dev
->sensor_flags
, buf
);
4489 if(ret
< 0) goto err
;
4491 /* the docs say these 2 bytes are reserved */
4492 buf
[0] = 0x00; buf
[1] = 0x93;
4493 buf
[2] = 0x50; /* bits 4 and 6 are supposedly reserved */
4494 buf
[3] = OV965X_TSLB_OUTPUT_SEQ_UYVY
| OV965X_TSLB_DIGITAL_BLC_ENABLE
;
4495 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_ADC
,
4496 dev
->sensor_flags
, buf
);
4497 if(ret
< 0) goto err
;
4499 buf
[0] = OV965X_COM11_MANUAL_BANDING_FILTER
;
4500 buf
[1] = 0x73; /* these bits all reserved */
4501 buf
[2] = OV965X_COM13_ENABLE_COLOR_MATRIX
| OV965X_COM13_DELAY_Y_CHANNEL
4502 | OV965X_COM13_OUTPUT_DELAY(1);
4503 buf
[3] = OV965X_COM14_YUV_EDGE_ENHANCE
4504 | OV965X_COM14_EDGE_ENHANCE_FACTOR_DBL
4505 | 0x0b; /* these last bits supposedly reserved */
4506 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_COM11
,
4507 dev
->sensor_flags
, buf
);
4508 if(ret
< 0) goto err
;
4510 buf
[0] = OV965X_EDGE_EDGE_ENHANCE_LOW4(8)
4511 | OV965X_EDGE_EDGE_ENHANCE_FACTOR(8);
4512 buf
[1] = OV965X_COM15_OUTPUT_RANGE_O0_TO_FF
| 0x01; /* bit reserved */
4513 buf
[2] = 0x00; buf
[3] = 0x08; /* this bit supposedly reserved */
4514 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_EDGE
,
4515 dev
->sensor_flags
, buf
);
4516 if(ret
< 0) goto err
;
4519 /* OV9653 control register 0x43 is reserved, according to the docs */
4520 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x43,
4521 dev
->sensor_flags
, buf
); // 'Dummy'-write
4522 if(ret
< 0) goto err
;
4524 buf
[0] = 0x80; buf
[1] = 0x80; buf
[2] = 0x40; buf
[3] = 0x00;
4525 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_MANU
,
4526 dev
->sensor_flags
, buf
);
4527 if(ret
< 0) goto err
;
4530 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DBLV
,
4531 dev
->sensor_flags
, buf
);
4532 if(ret
< 0) goto err
;
4534 buf
[0] = 0x06; buf
[1] = 0x20; buf
[2] = 0x00; buf
[3] = 0x00;
4535 /* OV9653 control register 0x8b is reserved, according to the docs */
4536 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x8b,
4537 dev
->sensor_flags
, buf
);
4538 if(ret
< 0) goto err
;
4541 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DBLC1
,
4542 dev
->sensor_flags
, buf
);
4543 if(ret
< 0) goto err
;
4545 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x88; buf
[3] = 0x88;
4546 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_DM_LNL
,
4547 dev
->sensor_flags
, buf
);
4548 if(ret
< 0) goto err
;
4551 /* control reg 0x96 reserved, according to docs */
4552 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x96,
4553 dev
->sensor_flags
, buf
);
4554 if(ret
< 0) goto err
;
4557 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM26
,
4558 dev
->sensor_flags
, buf
);
4559 if(ret
< 0) goto err
;
4561 buf
[0] = 0x80; buf
[1] = 0xb8; buf
[2] = 0x92; buf
[3] = 0x0a;
4562 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_ACOM2
,
4563 dev
->sensor_flags
, buf
);
4564 if(ret
< 0) goto err
;
4566 /* reserved, according to docs */
4567 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0xac,
4568 dev
->sensor_flags
, NULL
);
4569 if(ret
< 0) goto err
;
4571 buf
[0] = 0x1b; buf
[1] = 0xbb; buf
[2] = 0x05; buf
[3] = 0x7d;
4572 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_HSTART
,
4573 dev
->sensor_flags
, buf
);
4574 if(ret
< 0) goto err
;
4577 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_PSHIFT
,
4578 dev
->sensor_flags
, buf
);
4579 if(ret
< 0) goto err
;
4581 /* now for some reason it switches to these two reads and
4582 * then back to the long init sequence */
4584 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); /* reads 30 */
4585 if(ret
< 0) goto err
;
4586 //msg("Should read 0x30, read: %x", buf[0]);
4589 buf
[0] = eeprom_slave_id
;
4590 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4591 if(ret
< 0) goto err
;
4593 // TRY TO READ FROM EEPROM:
4594 ret
= sn9c20x_read_i2c_data(dev
, eeprom_slave_id
, 1, 0x00, eeprom_flags
, buf
);
4597 UDIA_INFO("No EEPROM found\n");
4601 UDIA_INFO("Read from EEPROM successful\n");
4602 /* returns 0xff -- don't know what we're supposed to do w/ that info */
4603 //msg("Read from eeprom, should read 0xff, read: %x", buf[0]);
4607 buf
[0] = dev
->sensor_slave_address
;
4608 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4609 if(ret
< 0) goto err
;
4613 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4614 if(ret
< 0) goto err
;
4618 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4619 if(ret
< 0) goto err
;
4623 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4624 if(ret
< 0) goto err
;
4628 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4629 if(ret
< 0) goto err
;
4633 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4634 if(ret
< 0) goto err
;
4638 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4639 if(ret
< 0) goto err
;
4643 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4644 if (ret
< 0) goto err
;
4648 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4649 if (ret
< 0) goto err
;
4653 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4654 if (ret
< 0) goto err
;
4658 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4659 if (ret
< 0) goto err
;
4662 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM7
,
4663 dev
->sensor_flags
, buf
);
4664 if(ret
< 0) goto err
;
4667 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_VREF
,
4668 dev
->sensor_flags
, buf
);
4669 if(ret
< 0) goto err
;
4671 buf
[0] = 0x24; buf
[1] = 0xc5; buf
[2] = 0x00; buf
[3] = 0x3c;
4672 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_HSTART
,
4673 dev
->sensor_flags
, buf
);
4674 if(ret
< 0) goto err
;
4676 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, OV965X_CTL_PSHIFT
,
4677 dev
->sensor_flags
, NULL
);
4678 if(ret
< 0) goto err
;
4681 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_HREF
,
4682 dev
->sensor_flags
, buf
);
4683 if(ret
< 0) goto err
;
4686 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x07; buf
[3] = 0x00;
4687 buf
[4] = 0x28; buf
[5] = 0x3c;
4688 ret
= usb_microdia_control_write(dev
, command
, buf
, 6);
4689 if(ret
< 0) goto err
;
4692 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
4694 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
4695 if(ret
< 0) goto err
;
4699 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4700 if(ret
< 0) goto err
;
4703 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
4704 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
4705 if(ret
< 0) goto err
;
4708 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
4709 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
4710 if(ret
< 0) goto err
;
4714 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4715 if(ret
< 0) goto err
;
4719 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4720 if(ret
< 0) goto err
;
4724 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4725 if(ret
< 0) goto err
;
4730 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4731 if(ret
< 0) goto err
;
4735 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4736 if(ret
< 0) goto err
;
4740 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4741 if(ret
< 0) goto err
;
4745 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4746 if(ret
< 0) goto err
;
4747 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x38
4748 if(ret
< 0) goto err
;
4751 else if (buf
[0] == 0xb8)
4753 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4754 if(ret
< 0) goto err
;
4755 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x39
4756 if(ret
< 0) goto err
;
4759 else if (buf
[0] == 0xb9)
4761 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4762 if(ret
< 0) goto err
;
4763 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3a
4764 if(ret
< 0) goto err
;
4767 else if (buf
[0] == 0xba)
4769 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4770 if(ret
< 0) goto err
;
4771 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3b
4772 if(ret
< 0) goto err
;
4775 else if (buf
[0] == 0xbb)
4777 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4778 if(ret
< 0) goto err
;
4779 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3c
4780 if(ret
< 0) goto err
;
4781 last_11b8
[0] = buf
[0];
4782 buf
[0] = last_11b8
[0] & 0xf0; // 0xf0 or 0x70
4783 buf
[0] = buf
[0] | 0x0a; // => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 5 READS/WRITES
4784 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4785 if(ret
< 0) goto err
;
4788 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_CLKRC
,
4789 dev
->sensor_flags
, buf
);
4790 if(ret
< 0) goto err
;
4794 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCH
,
4795 dev
->sensor_flags
, buf
);
4796 if(ret
< 0) goto err
;
4799 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCL
,
4800 dev
->sensor_flags
, buf
);
4801 if(ret
< 0) goto err
;
4804 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNL
,
4805 dev
->sensor_flags
, buf
);
4806 if(ret
< 0) goto err
;
4810 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNH
,
4811 dev
->sensor_flags
, buf
);
4812 if(ret
< 0) goto err
;
4815 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MVFP
,
4816 dev
->sensor_flags
, buf
);
4817 if(ret
< 0) goto err
;
4819 /* is it really necessary to do this same write again?; 627f does this, too */
4821 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MVFP
,
4822 dev
->sensor_flags
, buf
);
4823 if(ret
< 0) goto err
;
4828 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4829 if(ret
< 0) goto err
;
4832 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_AECH
,
4833 dev
->sensor_flags
, buf
);
4834 if(ret
< 0) goto err
;
4837 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM1
,
4838 dev
->sensor_flags
, buf
);
4839 if(ret
< 0) goto err
;
4843 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_AECHM
,
4844 dev
->sensor_flags
, buf
);
4845 if(ret
< 0) goto err
;
4848 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_ADVFL
,
4849 dev
->sensor_flags
, buf
);
4850 if(ret
< 0) goto err
;
4854 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_ADVFH
,
4855 dev
->sensor_flags
, buf
);
4856 if(ret
< 0) goto err
;
4860 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_GAIN
,
4861 dev
->sensor_flags
, buf
);
4862 if(ret
< 0) goto err
;
4865 buf
[0] = 0x78; /*buf[1] = 0x78;*/
4866 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_BLUE
,
4867 dev
->sensor_flags
, buf
);
4868 if(ret
< 0) goto err
;
4871 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_RED
,
4872 dev
->sensor_flags
, buf
);
4873 if(ret
< 0) goto err
;
4874 // 627f does the last two writes at once (2 byte write to OV965X_CTL_BLUE)
4878 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4879 if(ret
< 0) goto err
;
4883 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4884 if(ret
< 0) goto err
;
4888 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4889 if(ret
< 0) goto err
;
4893 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4894 if(ret
< 0) goto err
;
4899 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4900 if(ret
< 0) goto err
;
4904 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4905 if(ret
< 0) goto err
;
4910 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4911 if(ret
< 0) goto err
;
4915 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4916 if(ret
< 0) goto err
;
4920 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4921 if(ret
< 0) goto err
;
4923 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4928 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4929 if(ret
< 0) goto err
;
4932 /* Gamma control? */
4934 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4936 buf
[0] = 0x08; buf
[1] = 0x23; buf
[2] = 0x37; buf
[3] = 0x48;
4937 buf
[4] = 0x59; buf
[5] = 0x68; buf
[6] = 0x77; buf
[7] = 0x85;
4938 buf
[8] = 0x93; buf
[9] = 0xa1; buf
[10] = 0xae; buf
[11] = 0xba;
4939 buf
[12] = 0xc7; buf
[13] = 0xd3; buf
[14] = 0xe0; buf
[15] = 0xeb;
4944 /*buf[0] = 0x0a; buf[1] = 0x37; buf[2] = 0x58; buf[3] = 0x70;
4945 buf[4] = 0x81; buf[5] = 0x8f; buf[6] = 0x9c; buf[7] = 0xa9;
4946 buf[8] = 0xb5; buf[9] = 0xbe; buf[10] = 0xc8; buf[11] = 0xd1;
4947 buf[12] = 0xda; buf[13] = 0xe2; buf[14] = 0xec; buf[15] = 0xf0;
4951 buf
[0] = 0x00; buf
[1] = 0x2a; buf
[2] = 0x42; buf
[3] = 0x56;
4952 buf
[4] = 0x67; buf
[5] = 0x78; buf
[6] = 0x87; buf
[7] = 0x95;
4953 buf
[8] = 0xa2; buf
[9] = 0xaf; buf
[10] = 0xbc; buf
[11] = 0xc8;
4954 buf
[12] = 0xd4; buf
[13] = 0xdf; buf
[14] = 0xea; buf
[15] = 0xf5;
4957 ret
= usb_microdia_control_write(dev
, command
, buf
, 17);
4958 if(ret
< 0) goto err
;
4960 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4962 buf
[0] = 0xf3; buf
[1] = 0x0f; buf
[2] = 0xf3; buf
[3] = 0x0f;
4963 buf
[4] = 0x0f; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
4964 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
4965 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
4966 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0c; buf
[19] = 0x00;
4972 for(i
= 0; i
< 8; i
++)
4973 ret
= usb_microdia_control_write(dev
, command
, buf
, 21);
4975 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4977 buf
[0] = 0x0f; buf
[1] = 0x00; buf
[2] = 0x15; buf
[3] = 0x00;
4978 buf
[4] = 0x1a; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
4979 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
4980 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
4981 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0c; buf
[19] = 0x00;
4987 buf
[0] = 0x15; buf
[2] = 0x29;
4989 ret
= usb_microdia_control_write(dev
, command
, buf
, 21);
4990 if (ret
< 0) goto err
;
4994 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4995 if(ret
< 0) goto err
;
4997 command
= 0x10f6; // picture sharpness
4998 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5001 buf
[0] = 0x00; // 624f-log: 0xc0 !
5002 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5003 if(ret
< 0) goto err
;
5007 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5009 buf
[0] = 0x0f; buf
[1] = 0x00; buf
[2] = 0x15; buf
[3] = 0x00;
5010 buf
[4] = 0x1a; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5011 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5012 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5013 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0c; buf
[19] = 0x00;
5019 buf
[0] = 0x15; buf
[2] = 0x29; buf
[4] = 0x08;
5021 ret
= usb_microdia_control_write(dev
, command
, buf
, 21);
5022 if(ret
< 0) goto err
;
5026 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5027 if(ret
< 0) goto err
;
5032 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5033 if(ret
< 0) goto err
;
5037 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5038 if(ret
< 0) goto err
;
5043 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5044 if(ret
< 0) goto err
;
5048 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5049 if(ret
< 0) goto err
;
5051 //memset(buf, 0, 4);
5053 buf
[0] = 0x80; buf
[1] = 0x02; buf
[2] = 0xe0; buf
[3] = 0x01;
5054 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5055 if(ret
< 0) goto err
;
5058 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5060 buf
[0] = 0x19; buf
[1] = 0x31; buf
[2] = 0x44; buf
[3] = 0x50;
5061 buf
[4] = 0x52; buf
[5] = 0x56; buf
[6] = 0x5b; buf
[7] = 0x61;
5062 buf
[8] = 0x65; buf
[9] = 0x6a; buf
[10] = 0x6c; buf
[11] = 0x6e;
5063 buf
[12] = 0x70; buf
[13] = 0x72; buf
[14] = 0x74; buf
[15] = 0x76;
5064 buf
[16] = 0x1a; buf
[17] = 0x31; buf
[18] = 0x44; buf
[19] = 0x51;
5065 buf
[20] = 0x54; buf
[21] = 0x57; buf
[22] = 0x5c; buf
[23] = 0x61;
5066 buf
[24] = 0x66; buf
[25] = 0x6b; buf
[26] = 0x6d; buf
[27] = 0x6f;
5067 buf
[28] = 0x71; buf
[29] = 0x73; buf
[30] = 0x75; buf
[31] = 0x76;
5068 buf
[32] = 0x1b; buf
[33] = 0x32; buf
[34] = 0x44; buf
[35] = 0x50;
5069 buf
[36] = 0x50; buf
[37] = 0x54; buf
[38] = 0x59; buf
[39] = 0x5e;
5070 buf
[40] = 0x63; buf
[41] = 0x67; buf
[42] = 0x6a; buf
[43] = 0x6c;
5071 buf
[44] = 0x6e; buf
[45] = 0x70; buf
[46] = 0x72; buf
[47] = 0x73;
5075 buf
[0] = 0x10; buf
[1] = 0x21; buf
[2] = 0x34; buf
[3] = 0x40;
5076 buf
[4] =0x47; buf
[5] = 0x4F; buf
[6] = 0x57; buf
[7] = 0x5F;
5077 buf
[8] = 0x64; buf
[9] = 0x68; buf
[10] = 0x6D; buf
[11] = 0x73;
5078 buf
[12] = 0x79; buf
[13] = 0x80; buf
[14] = 0x89; buf
[15] = 0x97;
5079 buf
[16] = 0x0D; buf
[17] = 0x1C; buf
[18] = 0x2A; buf
[19] = 0x33;
5080 buf
[20] = 0x38; buf
[21] = 0x3D; buf
[22] = 0x44; buf
[23] = 0x4A;
5081 buf
[24] = 0x4E; buf
[25] = 0x52; buf
[26] = 0x56; buf
[27] = 0x5B;
5082 buf
[28] = 0x61; buf
[29] = 0x68; buf
[30] = 0x6F; buf
[31] = 0x7A;
5083 buf
[32] = 0x0D; buf
[33] = 0x1A; buf
[34] = 0x2A; buf
[35] = 0x31;
5084 buf
[36] = 0x36; buf
[37] = 0x3B; buf
[38] = 0x41; buf
[39] = 0x47;
5085 buf
[40] = 0x4A; buf
[41] = 0x4E; buf
[42] = 0x53; buf
[43] = 0x58;
5086 buf
[44] = 0x5D; buf
[45] = 0x64; buf
[46] = 0x6B; buf
[47] = 0x76;
5088 ret
= usb_microdia_control_write(dev
, command
, buf
, 48);
5092 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5093 if(ret
< 0) goto err
;
5098 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5099 if(ret
< 0) goto err
;
5103 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5104 if(ret
< 0) goto err
;
5108 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5109 if(ret
< 0) goto err
;
5113 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
5114 buf
[4] = 0x04; buf
[5] = 0x3f;
5115 ret
= usb_microdia_control_write(dev
, command
, buf
, 6);
5116 if(ret
< 0) goto err
;
5120 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
5121 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5122 if(ret
< 0) goto err
;
5125 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
5126 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5127 if(ret
< 0) goto err
;
5132 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5133 if(ret
< 0) goto err
;
5137 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5138 if(ret
< 0) goto err
;
5142 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5143 if(ret
< 0) goto err
;
5146 //////////////////////////////////////////////////////////////////////
5149 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
5150 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
5151 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
5152 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
5153 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
5154 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
5155 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
5156 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
5157 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
5158 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
5159 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
5160 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
5161 buf
[48] = 0x4f; buf
[49] = 0x54; buf
[50] = 0x58; buf
[51] = 0x58;
5162 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
5163 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x54; buf
[59] = 0x64;
5164 buf
[60] = 0x4b; buf
[61] = 0x54; buf
[62] = 0x58; buf
[63] = 0x54;
5165 ret
= usb_microdia_control_write(dev
, command
, buf
, 64);
5166 if(ret
< 0) goto err
;
5169 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
5170 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
5171 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x54; buf
[11] = 0x36;
5172 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x54; buf
[15] = 0x54;
5173 buf
[16] = 0x54; buf
[17] = 0x54; buf
[18] = 0x54; buf
[19] = 0x54;
5174 buf
[20] = 0x54; buf
[21] = 0x54; buf
[22] = 0x54; buf
[23] = 0x54;
5175 buf
[24] = 0x54; buf
[25] = 0x54; buf
[26] = 0x54; buf
[27] = 0x54;
5176 buf
[28] = 0x54; buf
[29] = 0x54; buf
[30] = 0x54; buf
[31] = 0x54;
5177 buf
[32] = 0x54; buf
[33] = 0x54; buf
[34] = 0x54; buf
[35] = 0x54;
5178 buf
[36] = 0x54; buf
[37] = 0x54; buf
[38] = 0x54; buf
[39] = 0x54;
5179 buf
[40] = 0x54; buf
[41] = 0x54; buf
[42] = 0x54; buf
[43] = 0x54;
5180 buf
[44] = 0x54; buf
[45] = 0x54; buf
[46] = 0x54; buf
[47] = 0x54;
5181 buf
[48] = 0x54; buf
[49] = 0x54; buf
[50] = 0x54; buf
[51] = 0x54;
5182 buf
[52] = 0x54; buf
[53] = 0x54; buf
[54] = 0x54; buf
[55] = 0x54;
5183 buf
[56] = 0x54; buf
[57] = 0x54; buf
[58] = 0x54; buf
[59] = 0x54;
5184 buf
[60] = 0x54; buf
[61] = 0x54; buf
[62] = 0x54; buf
[63] = 0x54;
5185 ret
= usb_microdia_control_write(dev
, command
, buf
, 64);
5186 if(ret
< 0) goto err
;
5191 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5192 if(ret
< 0) goto err
;
5196 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5197 if(ret
< 0) goto err
;
5202 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5203 if(ret
< 0) goto err
;
5207 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5208 if(ret
< 0) goto err
;
5212 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5213 if(ret
< 0) goto err
;
5217 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5218 if(ret
< 0) goto err
;
5222 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5223 if(ret
< 0) goto err
;
5227 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5228 if(ret
< 0) goto err
;
5232 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x07; buf
[3] = 0x00;
5233 buf
[4] = 0x28; buf
[5] = 0x3c;
5234 ret
= usb_microdia_control_write(dev
, command
, buf
, 6);
5235 if(ret
< 0) goto err
;
5238 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
5240 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
5241 if(ret
< 0) goto err
;
5245 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5246 if(ret
< 0) goto err
;
5249 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
5250 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5251 if(ret
< 0) goto err
;
5255 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
5256 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5257 if(ret
< 0) goto err
;
5261 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5262 if(ret
< 0) goto err
;
5266 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5267 if(ret
< 0) goto err
;
5271 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5272 if(ret
< 0) goto err
;
5276 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5277 if(ret
< 0) goto err
;
5281 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5282 if(ret
< 0) goto err
;
5286 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5287 if(ret
< 0) goto err
;
5291 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5292 if(ret
< 0) goto err
;
5297 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5298 if(ret
< 0) goto err
;
5302 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5303 if(ret
< 0) goto err
;
5307 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5308 if(ret
< 0) goto err
;
5313 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5314 if(ret
< 0) goto err
;
5317 if (last_11b8
[0] == 0x3c)
5319 else if (last_11b8
[0] == 0xbc)
5321 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5322 if(ret
< 0) goto err
;
5323 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0xb8 627f: 0x38
5324 if(ret
< 0) goto err
;
5327 else if (buf
[0] == 0xb8)
5329 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5330 if(ret
< 0) goto err
;
5331 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0xb9 627f: 0x39
5332 if(ret
< 0) goto err
;
5335 else if (buf
[0] == 0xb9)
5337 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5338 if(ret
< 0) goto err
;
5339 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3a
5340 if(ret
< 0) goto err
;
5343 else if (buf
[0] == 0xba)
5345 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5346 if(ret
< 0) goto err
;
5347 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0x3b 627f: 0xbb
5348 if(ret
< 0) goto err
;
5351 else if (buf
[0] == 0xbb)
5353 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5354 if(ret
< 0) goto err
;
5355 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0x3c 627f: 0xbc
5356 if(ret
< 0) goto err
;
5357 buf
[0] = buf
[0] & 0xf0; // 0xf0 or 0x70
5358 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5359 buf
[0] = buf
[0] | 0x09; // THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 5 READS/WRITES
5361 buf
[0] = buf
[0] | 0x08; // THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 5 READS/WRITES
5362 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5363 if(ret
< 0) goto err
;
5366 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_CLKRC
,
5367 dev
->sensor_flags
, buf
);
5368 if(ret
< 0) goto err
;
5371 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCH
,
5372 dev
->sensor_flags
, buf
);
5373 if(ret
< 0) goto err
;
5376 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCL
,
5377 dev
->sensor_flags
, buf
);
5378 if(ret
< 0) goto err
;
5381 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNL
,
5382 dev
->sensor_flags
, buf
);
5383 if(ret
< 0) goto err
;
5386 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNH
,
5387 dev
->sensor_flags
, buf
);
5388 if(ret
< 0) goto err
;
5390 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_PID
,
5391 dev
->sensor_flags
, buf
);
5392 /* returns 96, no idea what we're supposed to do with it */
5393 if(ret
< 0) goto err
;
5394 //msg("sensor pid, should be 0x96: %x", buf[0]);
5397 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_VER
,
5398 dev
->sensor_flags
, buf
);
5399 /* returns 52, no idea what we're supposed to do with it */
5400 if(ret
< 0) goto err
;
5401 //msg("sensor ver, should be 0x52: %x", buf[0]);
5404 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MIDH
,
5405 dev
->sensor_flags
, buf
);
5406 /* returns 7f, no idea what we're supposed to do with it */
5407 if(ret
< 0) goto err
;
5408 //msg("sensor midh, should be 0x7f: %x", buf[0]);
5411 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MIDL
,
5412 dev
->sensor_flags
, buf
);
5413 /* returns a2, no idea what we're supposed to do with it */
5414 if(ret
< 0) goto err
;
5415 //msg("sensor midl, should be 0xa2: %x", buf[0]);
5419 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5420 if(ret
< 0) goto err
;
5421 //////////////////////////////////////////////////////////////////////////////////
5423 //////////////////////////////////////////////////////////////////////////////////
5425 /* --- ADJUSTMENTS OF SHARPNESS, COLORS, CONTRAST, BRIGHTNESS ---
5426 * SHOULD BE REMOVED (writes to 0x10e1 and 0x10f6 are done again afterwards by dev_microdia_camera_settings() )
5427 * => NOT done by device 627f
5428 * => NOT in the 624f-log from 15-feb-08 at files.zenum.net
5433 ret = usb_microdia_control_write(dev, command, buf, 1);
5434 if(ret < 0) goto err;
5437 buf[0] = 0x15; buf[1] = 0x00; buf[2] = 0x29; buf[3] = 0x00;
5438 buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xF7; buf[7] = 0x0F;
5439 buf[8] = 0xC2; buf[9] = 0x0F; buf[10] = 0x47; buf[11] = 0x00;
5440 buf[12] = 0x36; buf[13] = 0x00; buf[14] = 0xDD ; buf[15] = 0x0F;
5441 buf[16] = 0xEE; buf[17] = 0x0F; buf[18] = 0x00; buf[19] = 0x00;
5443 ret = usb_microdia_control_write(dev, command, buf, 21);
5444 if(ret < 0) goto err;
5446 buf[0] = 0x7d; buf[1] = 0x00;
5447 ret = sn9c20x_read_i2c_data(dev, dev->sensor_slave_address, 1, 0x2d,
5448 dev->sensor_flags, buf);
5451 ret = sn9c20x_read_i2c_data(dev, dev->sensor_slave_address, 1, 0x00,
5452 dev->sensor_flags, buf);
5456 buf[0] = 0x15; buf[1] = 0x00; buf[2] = 0x29; buf[3] = 0x00;
5457 buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xF7; buf[7] = 0x0F;
5458 buf[8] = 0xC2; buf[9] = 0x0F; buf[10] = 0x47; buf[11] = 0x00;
5459 buf[12] = 0x36; buf[13] = 0x00; buf[14] = 0xDD ; buf[15] = 0x0F;
5460 buf[16] = 0xEE; buf[17] = 0x0F; buf[18] = 0x00; buf[19] = 0x00;
5462 ret = usb_microdia_control_write(dev, command, buf, 21);
5463 if(ret < 0) goto err;
5465 // These 2 regs controls brightness of image
5466 // (night mode or something like that)
5468 ret = sn9c20x_read_i2c_data(dev, dev->sensor_slave_address, 2, 0x2d,
5469 dev->sensor_flags, buf);
5470 //msg("Old brightness value: %x %x", buf[0], buf[1]);
5471 buf[0] = 0x00; buf[1] = 0x04;
5472 ret = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x2d,
5473 dev->sensor_flags, buf);
5478 ret = usb_microdia_control_write(dev, command, buf, 1);
5482 buf[0] = 0x15; buf[1] = 0x00; buf[2] = 0x29; buf[3] = 0x00;
5483 buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xF7; buf[7] = 0x0F;
5484 buf[8] = 0xC2; buf[9] = 0x0F; buf[10] = 0x47; buf[11] = 0x00;
5485 buf[12] = 0x36; buf[13] = 0x00; buf[14] = 0xdd ; buf[15] = 0x0F;
5486 buf[16] = 0xEE; buf[17] = 0x0F; buf[18] = 0x00; buf[19] = 0x00;
5488 ret = usb_microdia_control_write(dev, command, buf, 21);
5489 if(ret < 0) goto err;
5493 ret = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 1, 0x01,
5494 dev->sensor_flags, buf);
5495 // THIS WRITE WILL NEVER BE DONE, because function returned before
5500 UDIA_ERROR("start stream: command %x failed (%d)!\n", command
, ret
);
5504 int microdia_6260_start_stream(struct usb_microdia
*dev
)
5509 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
5511 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
5513 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
5515 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
5517 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
5519 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5521 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
5523 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5525 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5527 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
5529 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10;
5531 ret
= usb_microdia_control_write(dev
, 0x1067, buf
, 5);
5533 buf
[0] = 0x80; buf
[1] = 0x21; buf
[2] = 0x00; buf
[3] = 0x00;
5534 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5536 ret
= usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
5538 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
5539 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
5540 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
5541 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
5542 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
5543 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
5544 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 24);
5546 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
5547 ret
= usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
5549 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
5551 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
5553 buf
[0] = 0x8a; buf
[1] = 0x8c; buf
[2] = 0x08;
5554 ret
= usb_microdia_control_write(dev
, 0x1188, buf
, 3);
5556 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
5557 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
5558 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
5559 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
5560 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
5561 buf
[20] = 0xf4; buf
[21] = 0xff;
5562 ret
= usb_microdia_control_write(dev
, 0x118b, buf
, 22);
5564 buf
[0] = 0x00; buf
[1] = 0x00;
5565 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
5567 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x00;
5568 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
5570 ret
= usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
5573 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5576 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5578 ret
= ov7670_initialise(dev
);
5580 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x3b, dev
->sensor_flags
, buf
);
5581 ret
= usb_microdia_control_read(dev
, 0x10c1, buf
, 1);
5583 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
5585 /* TRY TO READ FROM EEPROM: */
5586 ret
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, dev
->sensor_flags
, buf
);
5588 UDIA_INFO("No EEPROM found\n");
5590 UDIA_INFO("Read from EEPROM successful\n");
5593 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
5595 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
5597 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
5599 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
5601 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
5602 buf
[4] = 0x50; buf
[5] = 0x3c;
5603 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
5605 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
5607 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
5610 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
5612 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
5613 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
5615 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
5616 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
5618 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5620 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5622 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5624 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5626 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
5628 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
5630 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5631 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5633 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5634 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5636 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5637 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5639 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5640 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5642 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5643 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5645 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5646 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5648 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5650 /* OV7670 Intialise Part 2 */
5651 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
5652 buf
[4] = 0x50; buf
[5] = 0x3c;
5653 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
5655 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
5657 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
5660 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
5662 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
5663 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
5665 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
5666 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
5669 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5671 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5673 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5675 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5677 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5679 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5681 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
5683 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
5685 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5686 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5688 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5689 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5691 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5692 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5694 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5695 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5697 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5698 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5700 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5701 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5703 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5705 /* OV7670 Initialisation Part 3 Goes Here */
5707 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5709 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5710 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5711 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5712 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5713 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5715 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5717 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5718 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5719 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5720 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5721 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5723 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5725 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5726 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5727 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5728 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5729 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5731 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5733 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5734 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5735 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5736 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5737 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5739 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5745 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
5749 * @returns 0 (ok) or -1 (error)
5753 * Windows driver versions: 5.7.23.000
5754 * Windows versions: 2000 and XP
5755 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
5756 * All logs were made using AMCAP with 640x480, RGB24
5758 int microdia_6270_start_stream(struct usb_microdia
*dev
)
5765 // Check if sensor slave address is valid:
5766 if ((dev
->sensor_slave_address
!= MT9V111_I2C_SLAVE_ADDRESS
) && (dev
->sensor_slave_address
!= MT9V011_I2C_SLAVE_ADDRESS
))
5768 UDIA_INFO("microdia_6270_start_stream(): Invalid sensor slave address !\n");
5772 // <= INTERRUPT COMING BACK (URB 1953)
5773 // SWITCH TO ALTERNATE SETTINGS 8 (URB 1954) // NOT IN ALEX'S LOG
5774 // => INTERRUPT GOING DOWN (URB 1955)
5777 usb_microdia_control_write(dev
, 0x1066, buf
, 1); // URB 1956
5779 // <= INTERRUPT COMING BACK (URB 1955)
5780 // => INTERRUPT GOING DOWN (URB 1957)
5783 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 1958
5785 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 1959
5787 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 1960
5789 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 1961
5791 usb_microdia_control_write(dev
, 0x1020, buf
, 1); // URB 1962
5792 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
5793 usb_microdia_control_write(dev
, 0x1067, buf
, 5); // URB 1963
5795 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5796 // STRANGE I2C MESSAGE:
5798 // - byte 8 = 0x00 at first start + first cycle
5799 // - procedure not complete: no wait/check for ack/error, no readout of 0x10c2
5800 // - dummy writes at first cycle and read at second cycle, but there are many I2C messages in the meantime, so this should not work
5802 // AT FIRST START + FIRST CYCLE:
5803 buf
[0] = 0x80; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x00; buf
[3] = 0x00;
5804 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x03;
5805 // AT ALL FURTHER STARTS + FIRST CYCLE:
5806 //MT9V111: I2C MESSAGE => IFP Register 0x33: Auto exposure
5807 //buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x33; buf[3] = 0x00;
5808 //buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03;
5809 //MT9V011: ?????????????????????????
5810 //buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x07; buf[3] = 0x00;
5811 //buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03;
5812 // ALWAYS AT 2nd AND FURTHER CYCLES:
5814 //buf[0] = 0xa2; buf[1] = 0x5c; buf[2] = 0x00; buf[3] = 0x36;
5815 //buf[4] = 0x00; buf[5] = 0x82; buf[6] = 0x3a; buf[7] = 0x10; buf[8] = 0x03;
5816 // => buf[3] to buf[6] simply contain bytes read with URB 2215
5818 //buf[0] = 0xb0; buf[1] = 0x5d; buf[2] = 0x07; buf[3] = 0x00;
5819 //buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03;
5820 usb_microdia_control_write(dev
, 0x10c0, buf
, 9); // URB 1964
5821 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5823 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
5824 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
5825 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
5826 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
5827 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
5828 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
5829 usb_microdia_control_write(dev
, 0x10e0, buf
, 24); // URB 1965
5830 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
5831 usb_microdia_control_write(dev
, 0x10f8, buf
, 3); // URB 1966
5832 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
5833 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 1967
5834 buf
[0] = 0x06; buf
[1] = 0x0c; buf
[2] = 0x08;
5835 usb_microdia_control_write(dev
, 0x1188, buf
, 3); // URB 1968
5836 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
5837 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
5838 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
5839 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
5840 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
5841 buf
[20] = 0xf4; buf
[21] = 0xff;
5842 usb_microdia_control_write(dev
, 0x118b, buf
, 22); // URB 1969
5843 buf
[0] = 0x00; buf
[1] = 0x00;
5844 usb_microdia_control_write(dev
, 0x11a1, buf
, 2); // URB 1970
5845 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x08;
5846 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5848 usb_microdia_control_write(dev
, 0x11b7, buf
, 9); // URB 1971
5850 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 1972
5852 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 1973
5854 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5857 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
5859 // Write to IFP register 0x0d: Color Correction Register 8
5860 buf
[0] = 0x00; buf
[1] = 0x01;
5861 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); // URBs 1974-1976
5862 // Write to IFP register 0x0d: Color Correction Register 8
5863 buf
[0] = 0x00; buf
[1] = 0x00; // ???
5864 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); // URBs 1977-1979
5865 // Writes to IFP registers 0x01: Register Address Space Selection
5866 // 0x02: Color Correction Register 1
5867 buf
[0] = 0x00; buf
[1] = 0x01; // select IFP address space
5868 buf
[2] = 0x00; buf
[3] = 0x16; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
5869 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); // URBs 1980-1982
5870 // Writes to IFP registers 0x03: Color Correction Register 3
5871 // 0x04: Color Correction Register 4
5872 buf
[0] = 0x01; buf
[1] = 0xe1; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
5873 buf
[2] = 0x02; buf
[3] = 0x81; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
5874 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); // URBs 1983-1985
5875 // Writes to IFP registers 0x05: Aperture Correction (Sharpening)
5876 // 0x06: Operating Mode Control
5877 buf
[0] = 0x00; buf
[1] = 0x04; // 100% sharpening, no automatic sharpness reduction at low light // AT FIRST START + FIRST CYCLE: 0x00 0x00: no sharpening
5878 buf
[2] = 0x00; buf
[3] = 0x00; // stop AWB at the current values, no on-the-fly defect correction, no auto exposure, + RESREVED option
5879 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); // URBs 1986-1988
5880 // Writes to IFP registers 0x07: Image Flow Processor Soft Reset
5881 // 0x08: Output Format Control
5882 buf
[0] = 0x30; buf
[1] = 0x02; // reset // AT FIRST START + FIRST CYCLE: 0x00 0x00
5883 buf
[2] = 0x04; buf
[3] = 0x80; // bypass entire image processing, raw 8+2 Bayer data output directly
5884 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); // URBs 1989-1991
5885 // "Dummy" write to IFP Register 0x11: Color Correction Register 12
5886 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); // URBs 1992-1993
5887 // Write to register 0x01: Register address space selection
5888 // Write to sensor register 0x02: Column Start
5889 buf
[0] = 0x00; buf
[1] = 0x04; // select sensor address space
5890 buf
[2] = 0x00; buf
[3] = 0x16; // start with column 22
5891 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); // URBs 1994-1996
5892 // Writes to sensor registers 0x03: Window Height
5893 // 0x04: Window Width
5894 buf
[0] = 0x01; buf
[1] = 0xe6; // 486
5895 buf
[2] = 0x02; buf
[3] = 0x86; // 646
5896 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); // URBs 1997-1999
5897 // Writes to sensor registers 0x05: Horizontal Blanking
5898 // 0x06: Vertical Blanking
5899 buf
[0] = 0x00; buf
[1] = 0x04; // 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00
5900 buf
[2] = 0x00; buf
[3] = 0x00; // 0 rows
5901 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); // URBs 2000-2002
5902 // Writes to sensor registers 0x07: Output Control
5904 buf
[0] = 0x30; buf
[1] = 0x02; // normal operation + chip enable + RESERVED options
5905 buf
[2] = 0x00; buf
[3] = 0x08; // row 8
5906 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); // URBs 2003-2005
5907 // "Dummy" write to sensor Register 0x11: UNDOCUMENTED
5908 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); // URBs 2006-2007
5909 // Writes to sensor registers 0x0c: Shutter Delay
5910 // 0x0d: Reset (Soft) (from MT9V011 datasheet)
5911 buf
[0] = 0x00; buf
[1] = 0x00; // 0 master clocks
5912 buf
[2] = 0x00; buf
[3] = 0x00; // return to normal operation
5913 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
); // URBs 2008-2010
5914 // Writes to sensor registers 0x0e: UNDOCUMENTED
5915 // 0x0f: UNDOCUMENTED
5916 buf
[0] = 0x00; buf
[1] = 0x00;
5917 buf
[2] = 0x00; buf
[3] = 0x00;
5918 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
); // URBs 2011-2013
5919 // Writes to sensor registers 0x10: UNDOCUMENTED
5920 // 0x11: UNDOCUMENTED
5921 buf
[0] = 0x00; buf
[1] = 0x00;
5922 buf
[2] = 0x00; buf
[3] = 0x00;
5923 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
); // URBs 2014-2016
5924 // Writes to sensor registers 0x12: 2X Zoom Col Start => 0x1e bit 0 must be set to activate zoom
5925 // 0x13: 2X Zoom Row Start => 0x1e bit 0 must be set to activate zoom
5926 buf
[0] = 0x00; buf
[1] = 0xb0; // column 176
5927 buf
[2] = 0x00; buf
[3] = 0x7c; // row 124
5928 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
); // URBs 2017-2018
5929 // Writes to sensor registers 0x14: UNDOCUMENTED
5930 // 0x15: UNDOCUMENTED
5931 buf
[0] = 0x00; buf
[1] = 0x00;
5932 buf
[2] = 0x00; buf
[3] = 0x00;
5933 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
); // URBs 2019-2021
5934 // Writes to sensor registers 0x16: UNDOCUMENTED
5935 // 0x17: UNDOCUMENTED
5936 buf
[0] = 0x00; buf
[1] = 0x00;
5937 buf
[2] = 0x00; buf
[3] = 0x00;
5938 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
); // URBs 2022-2024
5939 // Writes to sensor registers 0x18: UNDOCUMENTED
5940 // 0x19: UNDOCUMENTED
5941 buf
[0] = 0x00; buf
[1] = 0x00;
5942 buf
[2] = 0x00; buf
[3] = 0x00;
5943 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
); // URBs 2025-2027
5944 // Writes to sensor registers 0x1a: UNDOCUMENTED
5945 // 0x1b: UNDOCUMENTED
5946 buf
[0] = 0x00; buf
[1] = 0x00;
5947 buf
[2] = 0x00; buf
[3] = 0x00;
5948 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
); // URBs 2028-2030
5949 // Writes to sensor registers 0x1c: UNDOCUMENTED
5950 // 0x1d: UNDOCUMENTED
5951 buf
[0] = 0x00; buf
[1] = 0x00;
5952 buf
[2] = 0x00; buf
[3] = 0x00;
5953 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
); // URBs 2031-2033
5954 // Write to sensor register 0x30: RESERVED
5955 buf
[0] = 0x00; buf
[1] = 0x00;
5956 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x30, dev
->sensor_flags
, buf
); // URBs 2034-2036
5957 // Write to sensor register 0x20: Read Mode
5958 buf
[0] = 0x00; buf
[1] = 0x00; // normal readout
5959 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); // URBs 2037-2039
5960 // Writes to sensor registers 0x30: RESERVED
5962 buf
[0] = 0x00; buf
[1] = 0x05;
5963 buf
[2] = 0x00; buf
[3] = 0x00;
5964 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x30, dev
->sensor_flags
, buf
); // URBs 2040-2042
5965 // "Dummy" write to sensor Register 0x34: RESERVED
5966 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x34, dev
->sensor_flags
, NULL
); // URBs 2043-2044
5968 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
5970 // Write to sensor register 0x07: Output Control
5971 buf
[0] = 0x00; buf
[1] = 0x02; // chip enable, normal operation
5972 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
5973 // Write to sensor register 0x0d: Soft Reset
5974 buf
[0] = 0x00; buf
[1] = 0x01; // reset
5975 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
5976 // Write to sensor register 0x0d: Soft Reset
5977 buf
[0] = 0x00; buf
[1] = 0x00; // resume operation
5978 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
5979 // Writes to sensor registers 0x01: Row start
5980 // 0x02: Column Start
5981 buf
[0] = 0x00; buf
[1] = 0x08; // start with row 8
5982 buf
[2] = 0x00; buf
[3] = 0x16; // start with column 22
5983 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
);
5984 // Writes to sensor registers 0x03: Window Height
5985 // 0x04: Window Width
5986 buf
[0] = 0x01; buf
[1] = 0xe1; // 481
5987 buf
[2] = 0x02; buf
[3] = 0x81; // 641
5988 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
);
5989 // Writes to sensor registers 0x05: Horizontal Blanking
5990 // 0x06: Vertical Blanking
5991 buf
[0] = 0x00; buf
[1] = 0x83; // 131 columns (pixel clocks)
5992 buf
[2] = 0x00; buf
[3] = 0x06; // 6 rows
5993 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
);
5994 // Write to sensor register 0x0d: Soft Reset
5995 buf
[0] = 0x00; buf
[1] = 0x02; // UNKNOWN
5996 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
5997 // Writes to sensor registers 0x0a: Pixel Clock Speed
5998 // 0x0b: Frame Restart
5999 buf
[0] = 0x00; buf
[1] = 0x00; // default
6000 buf
[2] = 0x00; buf
[3] = 0x00; // (has no effect/no restart)
6001 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0a, dev
->sensor_flags
, buf
);
6002 // Writes to sensor registers 0x0c: Shutter Delay
6004 buf
[0] = 0x00; buf
[1] = 0x00; // 0 master clocks
6005 buf
[2] = 0x00; buf
[3] = 0x00; // resume operation
6006 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
);
6007 // Writes to sensor registers 0x0e: UNDOCUMENTED
6008 // 0x0f: UNDOCUMENTED
6009 buf
[0] = 0x00; buf
[1] = 0x00;
6010 buf
[2] = 0x00; buf
[3] = 0x00;
6011 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
);
6012 // Writes to sensor registers 0x10: UNDOCUMENTED
6013 // 0x11: UNDOCUMENTED
6014 buf
[0] = 0x00; buf
[1] = 0x00;
6015 buf
[2] = 0x00; buf
[3] = 0x00;
6016 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
);
6017 // Writes to sensor registers 0x12: 2X Zoom Column Start (from MT9V111 datasheet)
6018 // 0x13: 2X Zoom Row Start (from MT9V111 datasheet)
6019 buf
[0] = 0x00; buf
[1] = 0x00; // column 0 => bit0 of reg 0x1e must be set to activate zoom
6020 buf
[2] = 0x00; buf
[3] = 0x00; // row 0 => bit0 of reg 0x1e must be set to activate zoom
6021 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
);
6022 // Writes to sensor registers 0x14: UNDOCUMENTED
6023 // 0x15: UNDOCUMENTED
6024 buf
[0] = 0x00; buf
[1] = 0x00;
6025 buf
[2] = 0x00; buf
[3] = 0x00;
6026 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
);
6027 // Writes to sensor registers 0x16: UNDOCUMENTED
6028 // 0x17: UNDOCUMENTED
6029 buf
[0] = 0x00; buf
[1] = 0x00;
6030 buf
[2] = 0x00; buf
[3] = 0x00;
6031 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
);
6032 // Writes to sensor registers 0x18: UNDOCUMENTED
6033 // 0x19: UNDOCUMENTED
6034 buf
[0] = 0x00; buf
[1] = 0x00;
6035 buf
[2] = 0x00; buf
[3] = 0x00;
6036 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
);
6037 // Writes to sensor registers 0x1a: UNDOCUMENTED
6038 // 0x1b: UNDOCUMENTED
6039 buf
[0] = 0x00; buf
[1] = 0x00;
6040 buf
[2] = 0x00; buf
[3] = 0x00;
6041 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
);
6042 // Writes to sensor registers 0x1c: UNDOCUMENTED
6043 // 0x1d: UNDOCUMENTED
6044 buf
[0] = 0x00; buf
[1] = 0x00;
6045 buf
[2] = 0x00; buf
[3] = 0x00;
6046 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
);
6047 // Write to sensor register 0x32: RESERVED
6048 buf
[0] = 0x00; buf
[1] = 0x00;
6049 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x32, dev
->sensor_flags
, buf
);
6050 // Writes to sensor registers 0x20: Read Mode
6052 buf
[0] = 0x11; buf
[1] = 0x01; // output all frames (including bad frames) + UNDOCUMENTED
6053 buf
[2] = 0x00; buf
[3] = 0x00;
6054 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x20, dev
->sensor_flags
, buf
);
6055 // Writes to sensor registers 0x22: RESERVED
6056 // 0x23: UNDOCUMENTED
6057 buf
[0] = 0x00; buf
[1] = 0x00;
6058 buf
[2] = 0x00; buf
[3] = 0x00;
6059 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x22, dev
->sensor_flags
, buf
);
6060 // Writes to sensor registers 0x24: UNDOCUMENTED
6061 // 0x25: UNDOCUMENTED
6062 buf
[0] = 0x00; buf
[1] = 0x00;
6063 buf
[2] = 0x00; buf
[3] = 0x00;
6064 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x24, dev
->sensor_flags
, buf
);
6065 // Writes to sensor registers 0x26: UNDOCUMENTED
6067 buf
[0] = 0x00; buf
[1] = 0x00;
6068 buf
[2] = 0x00; buf
[3] = 0x24;
6069 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x26, dev
->sensor_flags
, buf
);
6070 // "Dummy" write to sensor Register 0x30: RESERVED
6071 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x30, dev
->sensor_flags
, NULL
);
6072 // Writes to sensor registers 0x2f: RESERVED
6074 buf
[0] = 0xf7; buf
[1] = 0xb0;
6075 buf
[2] = 0x00; buf
[3] = 0x05;
6076 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2f, dev
->sensor_flags
, buf
);
6077 // Writes to sensor registers 0x31: RESERVED
6079 buf
[0] = 0x00; buf
[1] = 0x00;
6080 buf
[2] = 0x00; buf
[3] = 0x00;
6081 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x31, dev
->sensor_flags
, buf
);
6082 // Writes to sensor registers 0x33: RESERVED
6084 buf
[0] = 0x00; buf
[1] = 0x00;
6085 buf
[2] = 0x01; buf
[3] = 0x00;
6086 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x33, dev
->sensor_flags
, buf
);
6087 // "Dummy" write to sensor Register 0x3b: RESERVED
6088 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x3b, dev
->sensor_flags
, NULL
);
6089 // Write to sensor register 0x3d: RESERVED
6090 buf
[0] = 0x06; buf
[1] = 0x8f;
6091 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x3d, dev
->sensor_flags
, buf
);
6092 // Writes to sensor registers 0x40: RESERVED
6094 buf
[0] = 0x01; buf
[1] = 0xe0;
6095 buf
[2] = 0x00; buf
[3] = 0xd1;
6096 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x40, dev
->sensor_flags
, buf
);
6097 // Write to sensor register 0x44: UNDOCUMENTED
6098 buf
[0] = 0x00; buf
[1] = 0x82;
6099 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x44, dev
->sensor_flags
, buf
);
6100 // Writes to sensor registers 0x5a: RESERVED
6102 buf
[0] = 0x00; buf
[1] = 0x00;
6103 buf
[2] = 0x00; buf
[3] = 0x00;
6104 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5a, dev
->sensor_flags
, buf
);
6105 // Writes to sensor registers 0x5c: RESERVED
6107 buf
[0] = 0x00; buf
[1] = 0x00;
6108 buf
[2] = 0x00; buf
[3] = 0x00;
6109 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5c, dev
->sensor_flags
, buf
);
6110 // Writes to sensor registers 0x5e: RESERVED
6112 buf
[0] = 0x00; buf
[1] = 0x00;
6113 buf
[2] = 0xa3; buf
[3] = 0x1d;
6114 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5e, dev
->sensor_flags
, buf
);
6115 // "Dummy" write to sensor Register 0x68: UNDOCUMENTED
6116 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x68, dev
->sensor_flags
, NULL
);
6117 // Write to sensor register 0x62: RESERVED
6118 buf
[0] = 0x06; buf
[1] = 0x11;
6119 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x62, dev
->sensor_flags
, buf
);
6123 UDIA_INFO("1 or more errors occured in I2C-message-block 1 !\n");
6126 // END OF I2C MESSAGES
6127 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6129 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6132 usb_microdia_control_write(dev
, 0x1007, buf
, 8);
6134 usb_microdia_control_write(dev
, 0x1006, buf
, 8);
6138 // *** TEMPORARY SWITCH TO SLAVE ADDRESS 0x50, I2C READ ATTEMPT:
6139 // - WE CURRENTLY KNOW NO 6270 CAM THAT IS SUCCESSFULLY READ HERE
6140 // - IF READ FAILS, THIS IS NEVER DONE AGAIN (IN NEXT CYCLE OR FURTHER STARTS)
6141 usb_microdia_control_read(dev
, 0x10c1, buf
, 1); // returns 0x5c
6143 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
6144 retI2C
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, SN9C20X_I2C_2WIRE
, buf
);
6146 UDIA_INFO("Read of address 0x00 from slave 0x50 successful:\n=> Please report this to microdia@googlegroups.com (http://groups.google.com/group/microdia) !\n");
6148 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
6151 buf
[0] = 0x47; // ALEX: 0x44
6152 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2045
6153 buf
[0] = 0x47; // ALEX: 0x04
6154 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2046
6156 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 2047
6158 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 2048
6159 buf
[0] = 0x84; // ALEX: 0xc0
6160 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 2049
6163 usb_microdia_control_write(dev, 0x1001, buf, 1);
6166 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6168 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6171 // Writes to sensor registers 0x02: Column Start
6172 // 0x03: Window Height
6173 buf
[0] = 0x00; buf
[1] = 0x16; // coulmn 22
6174 buf
[2] = 0x01; buf
[3] = 0xe1; // 481
6175 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); // URBs 2050-2052
6176 // Writes to sensor registers 0x04: Window Width
6177 // 0x05: Horizontal Blanking
6178 buf
[0] = 0x02; buf
[1] = 0x81; // 641
6179 buf
[2] = 0x00; buf
[3] = 0x04; // 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00
6180 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); // URBs 2053-2055
6181 // Writes to sensor registers 0x06: Vertical Blanking
6182 // 0x07: Output Control
6183 buf
[0] = 0x00; buf
[1] = 0x00; // 0 rows
6184 buf
[2] = 0x30; buf
[3] = 0x02; // normal operation + chip enable + RESERVED options
6185 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); // URBs 2056-2058
6186 // Write to sensor register 0x0e: UNDOCUMENTED
6187 buf
[0] = 0x00; buf
[1] = 0x08;
6188 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); // URBs 2059-2061
6191 UDIA_INFO("1 or more errors occured in I2C-message-block 2 !\n");
6194 // END OF I2C MESSAGES
6195 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6198 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
6199 buf
[4] = 0x28; buf
[5] = 0x3c;
6200 usb_microdia_control_write(dev
, 0x1180, buf
, 6); // URB 2062
6201 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
6202 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 2063
6204 usb_microdia_control_write(dev
, 0x1189, buf
, 1); // URB 2064
6205 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
6206 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); // URB 2065
6207 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
6208 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); // URB 2066
6209 buf
[0] = 0x78; // ALEX: 0x7c
6210 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 2067
6211 buf
[0] = 0x18; // ALEX: 0x1c
6212 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2068
6213 buf
[0] = 0x18; // ALEX: 0x1c
6214 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2069
6216 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2070
6218 usb_microdia_control_write(dev
, 0x118a, buf
, 1); // URB 2071
6220 usb_microdia_control_write(dev
, 0x0395, buf
, 1); // URB 2072
6223 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2073
6224 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2074 // 0x38
6227 else if (buf
[0] == 0xb8)
6229 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2075
6230 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2076 // 0xb9
6233 else if (buf
[0] == 0xb9)
6235 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2077
6236 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2078
6239 else if (buf
[0] == 0xba)
6241 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2079
6242 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2080 // 0x3b
6245 else if (buf
[0] == 0xbb)
6247 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2081
6248 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2082 // 0x3c
6251 else if (buf
[0] == 0xbc)
6253 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2083
6254 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2084 // 0x3d
6255 last_11b8
[0] = buf
[0];
6256 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6260 else if (buf
[0] == 0xbd)
6262 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2085
6263 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2086
6266 else if (buf
[0] == 0xbe)
6268 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2087
6269 usb_microdia_control_read(dev
, 0x11b8, last_11b8
, 1); // URB 2088
6271 buf
[0] = last_11b8
[0] & 0xf0; // 0xf0 or 0x70
6272 buf
[0] = buf
[0] | 0x0d; // 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES
6273 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2089
6276 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6279 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6281 // Write to sensor register 0x06: Vertical Blanking
6282 buf
[0] = 0x00; buf
[1] = 0x2d; // 45 rows
6283 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); // URBs 2090-2092
6284 // Write to sensor register 0x05: Horizontal Blanking
6285 buf
[0] = 0x00; buf
[1] = 0x04; // 4 columns (pixel clocks)
6286 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); // URBs 2093-2095
6287 // Write to sensor register 0x20: Read Mode
6288 buf
[0] = 0x00; buf
[1] = 0x00; // normal readout
6289 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); // URBs 2096-2098
6291 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6293 // Write to sensor register 0x0a: Pixel Clock Speed
6294 buf
[0] = 0x00; buf
[1] = 0x00; // default
6295 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0a, dev
->sensor_flags
, buf
);
6296 // Write to sensor register 0x06: Vertical Blanking
6297 buf
[0] = 0x00; buf
[1] = 0x29; // 41 rows
6298 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
6299 // Write to sensor register 0x05: Horizontal Blanking
6300 buf
[0] = 0x00; buf
[1] = 0x09; // 9 columns (pixel clocks)
6301 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
6302 // Write to sensor register 0x20: Read Mode
6303 buf
[0] = 0x11; buf
[1] = 0x01; // output all frames (including bad ones) + UNKNOWN
6304 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
6308 UDIA_INFO("1 or more errors occured in I2C-message-block 3 !\n");
6311 // END OF I2C MESSAGES
6312 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6316 usb_microdia_control_write(dev
, 0x1180, buf
, 1); // URB 2099
6318 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6321 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6323 // Write to sensor register 0x20: Read Mode
6324 buf
[0] = 0x00; buf
[1] = 0x00; // normal readout
6325 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); // URBs 2100-2102
6327 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6329 // Write to sensor register 0x20: Read Mode
6330 buf
[0] = 0x11; buf
[1] = 0x01; // output all frames (including bad ones) + UNKNOWN
6331 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
6335 UDIA_INFO("1 or more errors occured in I2C-message-block 4 !\n");
6338 // END OF I2C MESSAGES
6339 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6343 usb_microdia_control_write(dev
, 0x1182, buf
, 1); // URB 2103
6346 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6349 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6351 // Write to sensor register 0x09: Shutter Width
6352 buf
[0] = 0x00; buf
[1] = 0x64; // integration of 100 rows
6353 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
); // URBs 2104-2106
6354 // Write to sensor register 0x2b: Green 1 Gain
6356 buf
[0] = 0x00; buf
[1] = 0xa0; // 32*0.03125*2 = 2
6357 buf
[2] = 0x00; buf
[3] = 0xa0; // 32*0.03125*2 = 2
6358 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
); // URBs 2107-2109
6359 // Write to sensor register 0x2d: Red Gain
6360 // 0x2e: Green 2 Gain
6361 buf
[0] = 0x00; buf
[1] = 0xa0; // 32*0.03125*2 = 2
6362 buf
[2] = 0x00; buf
[3] = 0xa0; // 32*0.03125*2 = 2
6363 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
); // URBs 2110-2112
6364 // "Dummy" write to sensor Register 0x33: RESERVED
6365 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
); // URBs 2113-2114
6367 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6369 // Write to sensor register 0x09: Shutter Width
6370 buf
[0] = 0x00; buf
[1] = 0x64; // integration of 100 rows
6371 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
);
6372 // Write to sensor register 0x07: Output Control
6373 buf
[0] = 0x00; buf
[1] = 0x03; // dont update changes until bit0=0, chip enable, normal operation
6374 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
6375 // Write to sensor register 0x2b: Green 1 Gain
6377 buf
[0] = 0x00; buf
[1] = 0x33; // 51*0.03125*1 = 1.59375
6378 buf
[2] = 0x00; buf
[3] = 0xa0; // 32*0.03125*2 = 2
6379 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
);
6380 // Write to sensor register 0x2d: Red Gain
6381 // 0x2e: Green 2 Gain
6382 buf
[0] = 0x00; buf
[1] = 0xa0; // 32*0.03125*2 = 2
6383 buf
[2] = 0x00; buf
[3] = 0x33; // 51*0.03125*1 = 1.59375
6384 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
);
6385 // "Dummy" write to sensor Register 0x33: RESERVED
6386 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
);
6387 // Write to sensor register 0x07: Output Control
6388 buf
[0] = 0x00; buf
[1] = 0x02; // chip enable, normal operation
6389 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
6393 UDIA_INFO("1 or more errors occured in I2C-message-block 5 !\n");
6396 // END OF I2C MESSAGES
6397 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6401 usb_microdia_control_write(dev
, 0x118c, buf
, 1); // URB 2115
6403 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 2116
6405 usb_microdia_control_write(dev
, 0x118e, buf
, 1); // URB 2117
6407 usb_microdia_control_write(dev
, 0x118f, buf
, 1); // URB 2118
6409 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2119
6411 usb_microdia_control_write(dev
, 0x118c, buf
, 1); // URB 2120
6413 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 2121
6415 usb_microdia_control_write(dev
, 0x118e, buf
, 1); // URB 2122
6417 usb_microdia_control_write(dev
, 0x118f, buf
, 1); // URB 2123
6419 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6423 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6427 usb_microdia_control_write(dev
, 0x118b, buf
, 1); // URB 2124
6430 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6432 buf
[0] = 0x0a; buf
[1] = 0x36; buf
[2] = 0x56; buf
[3] = 0x6e;
6433 buf
[4] = 0x7f; buf
[5] = 0x8d; buf
[6] = 0x9b; buf
[7] = 0xa8;
6434 buf
[8] = 0xb4; buf
[9] = 0xbd; buf
[10] = 0xc7; buf
[11] = 0xd0;
6435 buf
[12] = 0xd9; buf
[13] = 0xe2; buf
[14] = 0xec; buf
[15] = 0xf0;
6438 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6440 buf
[0] = 0x08; buf
[1] = 0x35; buf
[2] = 0x5a; buf
[3] = 0x6d;
6441 buf
[4] = 0x7d; buf
[5] = 0x8b; buf
[6] = 0x97; buf
[7] = 0xa3;
6442 buf
[8] = 0xad; buf
[9] = 0xb7; buf
[10] = 0xc1; buf
[11] = 0xca;
6443 buf
[12] = 0xd3; buf
[13] = 0xdb; buf
[14] = 0xe3; buf
[15] = 0xeb;
6446 usb_microdia_control_write(dev
, 0x1190, buf
, 17); // URB 2125
6448 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6450 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6451 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf6; buf
[7] = 0x0f;
6452 buf
[8] = 0xd2; buf
[9] = 0x0f; buf
[10] = 0x38; buf
[11] = 0x00;
6453 buf
[12] = 0x34; buf
[13] = 0x00; buf
[14] = 0xcf; buf
[15] = 0x0f;
6454 buf
[16] = 0xfd; buf
[17] = 0x0f; buf
[18] = 0x00; buf
[19] = 0x00;
6457 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6459 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6460 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf0; buf
[7] = 0x0f;
6461 buf
[8] = 0xd0; buf
[9] = 0x0f; buf
[10] = 0x41; buf
[11] = 0x00;
6462 buf
[12] = 0x38; buf
[13] = 0x00; buf
[14] = 0xc7; buf
[15] = 0x0f;
6463 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
6466 for (k
=0; k
<9; k
++) // AT FIRST START + FIRST CYCLE: first 8 writes 21 bytes 0x00
6468 usb_microdia_control_write(dev
, 0x10e1, buf
, 21); // URB 2126 - 2134
6472 usb_microdia_control_write(dev
, 0x10f7, buf
, 1); // URB 2135
6473 buf
[0] = 0x18; // ALEX: 0x00
6474 usb_microdia_control_write(dev
, 0x10f6, buf
, 1); // URB 2136
6476 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6478 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6479 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf6; buf
[7] = 0x0f;
6480 buf
[8] = 0xd2; buf
[9] = 0x0f; buf
[10] = 0x38; buf
[11] = 0x00;
6481 buf
[12] = 0x34; buf
[13] = 0x00; buf
[14] = 0xcf; buf
[15] = 0x0f;
6482 buf
[16] = 0xfd; buf
[17] = 0x0f; buf
[18] = 0x00; buf
[19] = 0x00;
6485 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6487 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6488 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf0; buf
[7] = 0x0f;
6489 buf
[8] = 0xd0; buf
[9] = 0x0f; buf
[10] = 0x41; buf
[11] = 0x00;
6490 buf
[12] = 0x38; buf
[13] = 0x00; buf
[14] = 0xc7; buf
[15] = 0x0f;
6491 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
6494 usb_microdia_control_write(dev
, 0x10e1, buf
, 21); // URB 2137
6496 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6500 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6504 usb_microdia_control_write(dev
, 0x10f8, buf
, 1); // URB 2138
6506 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6510 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6514 usb_microdia_control_write(dev
, 0x10fa, buf
, 1); // URB 2139
6517 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); // URB 2140
6519 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); // URB 2141
6521 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2142
6522 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
6523 usb_microdia_control_write(dev
, 0x11bc, buf
, 4); // URB 2143
6524 for (k
=0; k
<48; k
++) buf
[k
] = 0x00;
6525 usb_microdia_control_write(dev
, 0x11c0, buf
, 48); // URB 2144
6527 usb_microdia_control_write(dev
, 0x118c, buf
, 1); // URB 2145
6529 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 2146
6531 usb_microdia_control_write(dev
, 0x118e, buf
, 1); // URB 2147
6533 usb_microdia_control_write(dev
, 0x118f, buf
, 1); // URB 2148
6534 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
6535 buf
[4] = 0x04; buf
[5] = 0x3f;
6536 usb_microdia_control_write(dev
, 0x11a5, buf
, 6); // URB 2149
6538 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6540 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
6542 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6544 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
6546 usb_microdia_control_write(dev
, 0x11af, buf
, 4); // URB 2150
6548 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
6549 usb_microdia_control_write(dev
, 0x11b3, buf
, 4); // URB 2151
6550 buf
[0] = 0x47; // ALEX: 0x04
6551 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2152
6553 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2153
6554 buf
[0] = 0x67; // ALEX: 0x24
6555 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2154
6556 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
6557 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
6558 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
6559 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
6560 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
6561 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
6562 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
6563 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
6564 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
6565 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
6566 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
6567 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
6568 buf
[48]= 0x4f; buf
[49] = 0x53; buf
[50] = 0x58; buf
[51] = 0x58;
6569 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
6570 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
6571 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
6572 usb_microdia_control_write(dev
, 0x1100, buf
, 64); // URB 2155
6573 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
6574 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
6575 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x53; buf
[11] = 0x36;
6576 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53; buf
[15] = 0x53;
6577 buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
6578 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53;
6579 buf
[24] = 0x53; buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53;
6580 buf
[28] = 0x53; buf
[29] = 0x53; buf
[30] = 0x53; buf
[31] = 0x53;
6581 buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53; buf
[35] = 0x53;
6582 buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
6583 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53;
6584 buf
[44] = 0x53; buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53;
6585 buf
[48] = 0x53; buf
[49] = 0x53; buf
[50] = 0x53; buf
[51] = 0x53;
6586 buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53; buf
[55] = 0x53;
6587 buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
6588 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
6589 usb_microdia_control_write(dev
, 0x1140, buf
, 64); // URB 2156
6590 buf
[0] = 0x47; // ALEX: 0x04
6591 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2157
6593 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2158
6594 buf
[0] = 0x4b; // ALEX: 0x08
6595 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2159
6597 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6599 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6602 // Writes to sensor registers 0x02: Column Start
6603 // 0x03: Window Hight
6604 buf
[0] = 0x00; buf
[1] = 0x16; // coulmn 22
6605 buf
[2] = 0x01; buf
[3] = 0xe1; // 481
6606 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); // URBs 2160-2162
6607 // Writes to sensor registers 0x04: Window Width
6608 // 0x05: Horizontal Blanking
6609 buf
[0] = 0x02; buf
[1] = 0x81; // 641
6610 buf
[2] = 0x00; buf
[3] = 0x04; // 4 columns (pixel clocks)
6611 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); // URBs 2163-2165
6612 // Writes to sensor registers 0x06: Vertical Blanking
6613 // 0x07: Output Control
6614 buf
[0] = 0x00; buf
[1] = 0x2d; // 45 rows
6615 buf
[2] = 0x30; buf
[3] = 0x02; // RESERVED options
6616 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); // URBs 2166-2167
6617 // Writes to sensor register 0x0e: UNDOCUMENTED
6618 buf
[0] = 0x00; buf
[1] = 0x08;
6619 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); // URBs 2168-2170
6622 UDIA_INFO("1 or more errors occured in I2C-message-block 6 !\n");
6625 // END OF I2C MESSAGES
6626 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6628 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6631 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6633 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6637 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
6638 buf
[4] = 0x28; buf
[5] = 0x3c;
6639 usb_microdia_control_write(dev
, 0x1180, buf
, 6); // URB 2171
6640 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
6641 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 2172
6643 usb_microdia_control_write(dev
, 0x1189, buf
, 1); // URB 2173
6644 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
6645 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); // URB 2174
6646 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
6647 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); // URB 2175
6649 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2176
6651 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2177
6653 usb_microdia_control_write(dev
, 0x11b9, buf
, 1); // URB 2178
6655 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2179
6657 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2180
6658 buf
[0] = 0x78; // ALEX: 0x7c
6659 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 2181
6660 buf
[0] = 0x18; // ALEX: 0x1c
6661 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2182
6662 buf
[0] = 0x18; // ALEX: 0x1c
6663 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2183
6664 buf
[0] = 0x7d; // ALEX: 0xfc
6665 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2184
6667 usb_microdia_control_write(dev
, 0x118a, buf
, 1); // URB 2185
6669 usb_microdia_control_write(dev
, 0x0395, buf
, 1); // URB 2186
6671 if ((last_11b8
[0] == 0x3d) || (last_11b8
[0] == 0x3f))
6673 else if ((last_11b8
[0] == 0xbd) || (last_11b8
[0] == 0xbf))
6675 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2187
6676 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2188 // 0x38
6679 else if (buf
[0] == 0xb8)
6681 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2189
6682 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2190 // 0xb9
6685 else if (buf
[0] == 0xb9)
6687 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2191
6688 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2192 // 0xba
6691 else if (buf
[0] == 0xba)
6693 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2193
6694 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2194 // 0x3b
6697 else if (buf
[0] == 0xbb)
6699 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2195
6700 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2196 // 0x3c
6703 else if (buf
[0] == 0xbc)
6705 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2197
6706 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2198 // 0x3d
6707 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6711 else if (buf
[0] == 0xbd)
6713 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2199
6714 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2200
6717 else if (buf
[0] == 0xbe)
6719 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2201
6720 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2202
6722 buf
[0] = buf
[0] & 0xf0; // 0xf0 or 0x70
6723 buf
[0] = buf
[0] | 0x0d; // 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES
6724 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2089
6726 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6729 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6731 // Write to sensor register 0x06: Vertical Blanking
6732 buf
[0] = 0x00; buf
[1] = 0x2d; // 45 rows
6733 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); // URBs 2204-2206
6734 // Write to sensor register 0x05: Horizontal Blanking
6735 buf
[0] = 0x00; buf
[1] = 0x04; // 4 columns (pixel clocks)
6736 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); // URBs 2207-2209
6737 // Read of sensor register 0x36: Chip Version (mirror of reg0xff)
6738 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x36, dev
->sensor_flags
, buf
); // URBs 2211-2215 // 0x82 0x3a
6740 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6742 // Write to sensor register 0x0a: Pixel Clock Speed
6743 buf
[0] = 0x00; buf
[1] = 0x00; // default
6744 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
6745 // Write to sensor register 0x06: Vertical Blanking
6746 buf
[0] = 0x00; buf
[1] = 0x29; // 41 rows
6747 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
6748 // Write to sensor register 0x05: Horizontal Blanking
6749 buf
[0] = 0x00; buf
[1] = 0x09; // 9 columns (pixel clocks)
6750 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
6751 // Read of sensor register 0x00: Chip Version (=reg0xff)
6752 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x00, dev
->sensor_flags
, buf
); // 0x82 0x43
6756 UDIA_INFO("1 or more errors occured in I2C-message-block 7 !\n");
6759 // END OF I2C MESSAGES
6760 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6764 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2216
6767 /*** NOW DRIVER DOES STOP-SEQUENCE
6768 - WITHOUT WRITES TO 0x1007 AND 0x1006 (URBs 3544-3550) => MT9V111
6769 - WRITING 0x40 INSTEAD OF 0x60 TO 0x1007 AND 0x1006 => MT9V011
6771 /*** 2nd, 3rd, ... CYCLE: ALL MESSAGES (URBs 1953 - URBs 2216) ARE REPEATED ***/
6772 /*** ----- WE DON'T DO THIS, IT SEEMS TO BE UNNECESSARY ----- ***/
6774 // Setup IFP registers for AE and AWB (new, not in the logs):
6775 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6777 mt9v111_setup_autoexposure(dev
);
6778 mt9v111_setup_autowhitebalance(dev
);
6779 mt9v111_set_autocorrections(dev
, 1);
6782 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6786 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6790 usb_microdia_control_write(dev
, 0x1007, buf
, 1); // URB 2489
6791 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6795 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6799 usb_microdia_control_write(dev
, 0x1006, buf
, 1); // URB 2490
6800 // => These two writes seem to cause the cam to start sending isochronus USB messages
6805 int microdia_627b_start_stream(struct usb_microdia
*dev
)
6812 buf
[0] = 0x00; /** Will have to be set for every single interrupt. */
6814 ret = usb_interrupt_msg(dev->udev, 0x00000083, buf, 0x0000001, &actual, 1000); // URB 43
6819 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 44 */
6824 //ret = usb_set_interface(dev->udev, 0, 8);
6825 //if(ret < 0) goto err;
6827 //buf[0] = 0x00; // Will have to be set for every single interrupt
6828 //ret = usb_interrupt_msg(dev->udev, 0x00000083, buf, 0x0000001, &actual, 1000); // URB 45
6833 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 46 */
6839 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 47 */
6845 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 48 */
6851 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 49 */
6857 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 50 */
6862 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
6863 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5); /* URB 51 */
6868 buf
[0] = 0x80; buf
[1] = 0x21; buf
[2] = 0x00; buf
[3] = 0x00;
6869 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
6871 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9); /* URB 52 */
6875 /* transferbufferlength is 18, but data is 24 bytes long, what to do ? */
6877 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30; buf
[4] = 0x00;
6878 buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed; buf
[8] = 0x0f; buf
[9] = 0xda;
6879 buf
[10] = 0x0f; buf
[11] = 0x3a; buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00;
6880 buf
[15] = 0xd0; buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
6881 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
6882 ret
= usb_microdia_control_write(dev
, reg
, buf
, 24); /* URB 53 */
6887 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
6888 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3); /* URB 54 */
6893 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
6894 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5); /* URB 55 */
6899 buf
[0] = 0x86; buf
[1] = 0x8c; buf
[2] = 0x08;
6900 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3); /* URB 56 */
6905 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20; buf
[4] = 0x20;
6906 buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b; buf
[8] = 0x4f; buf
[9] = 0x61;
6907 buf
[10] = 0x71; buf
[11] = 0x80; buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab;
6908 buf
[15] = 0xb8; buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
6909 buf
[20] = 0xf4; buf
[21] = 0xff;
6910 ret
= usb_microdia_control_write(dev
, reg
, buf
, 22); /* URB 57 */
6915 buf
[0] = 0x00; buf
[1] = 0x00;
6916 ret
= usb_microdia_control_write(dev
, reg
, buf
, 2); /* URB 58 */
6921 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x08; buf
[4] = 0x00;
6922 buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0; buf
[8] = 0x00;
6923 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9); /* URB 59 */
6929 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 60 */
6935 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6940 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
6941 OV7660_CTL_COM7
, dev
->sensor_flags
, buf
);
6945 buf
[0] = 0x01; buf
[1] = 0x74; buf
[2] = 0x92; buf
[3] = 0x00;
6946 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6947 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
6951 buf
[0] = 0x00; buf
[1] = 0x7d; buf
[2] = 0x62; buf
[3] = 0x00;
6952 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6953 OV7660_CTL_COM1
, dev
->sensor_flags
, buf
);
6957 buf
[0] = 0x83; buf
[1] = 0x01;
6958 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
6959 OV7660_CTL_RAVE
, dev
->sensor_flags
, buf
);
6963 buf
[0] = 0x00; buf
[1] = 0x08; buf
[2] = 0x04; buf
[3] = 0x62;
6964 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6965 OV7660_CTL_COM3
, dev
->sensor_flags
, buf
);
6969 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x05; buf
[3] = 0xf8;
6970 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6971 OV7660_CTL_AECH
, dev
->sensor_flags
, buf
);
6975 buf
[0] = 0x2e; buf
[1] = 0x00; buf
[2] = 0x02;
6976 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3,
6977 OV7660_CTL_COM9
, dev
->sensor_flags
, buf
);
6981 buf
[0] = 0x10; buf
[1] = 0x60; buf
[2] = 0x02; buf
[3] = 0x7b;
6982 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6983 OV7660_CTL_HSTART
, dev
->sensor_flags
, buf
);
6988 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
6989 OV7660_CTL_PSHFT
, dev
->sensor_flags
, buf
);
6993 buf
[0] = 0x01; buf
[1] = 0x0e;
6994 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
6995 OV7660_CTL_MVFP
, dev
->sensor_flags
, buf
);
6999 buf
[0] = 0x07; buf
[1] = 0x07; buf
[2] = 0x07; buf
[3] = 0x07;
7000 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7001 OV7660_CTL_BOS
, dev
->sensor_flags
, buf
);
7005 buf
[0] = 0x68; buf
[1] = 0x58; buf
[2] = 0xd4; buf
[3] = 0x80;
7006 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7007 OV7660_CTL_AEW
, dev
->sensor_flags
, buf
);
7011 buf
[0] = 0x80; buf
[1] = 0x3c; buf
[2] = 0x00; buf
[3] = 0x00;
7012 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7013 OV7660_CTL_GbBIAS
, dev
->sensor_flags
, buf
);
7017 buf
[0] = 0x80; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x62;
7018 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7019 OV7660_CTL_RBIAS
, dev
->sensor_flags
, buf
);
7023 buf
[0] = 0x08; buf
[1] = 0x30; buf
[2] = 0xb4;
7024 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3,
7025 OV7660_CTL_HSYST
, dev
->sensor_flags
, buf
);
7029 buf
[0] = 0x00; buf
[1] = 0x07; buf
[2] = 0x84; buf
[3] = 0x00;
7030 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7031 OV7660_CTL_CHLF
, dev
->sensor_flags
, buf
);
7035 buf
[0] = 0x0c; buf
[1] = 0x02; buf
[2] = 0x43; buf
[3] = 0x00;
7036 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7037 OV7660_CTL_ADC
, dev
->sensor_flags
, buf
);
7041 buf
[0] = 0x02; buf
[1] = 0x6c; buf
[2] = 0x19; buf
[3] = 0x0e;
7042 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7043 OV7660_CTL_COM11
, dev
->sensor_flags
, buf
);
7047 buf
[0] = 0x41; buf
[1] = 0xc1; buf
[2] = 0x22; buf
[3] = 0x08;
7048 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7049 OV7660_CTL_EDGE
, dev
->sensor_flags
, buf
);
7054 reg
= 0x43; /* RSVD 0x43 is Reserved */
7055 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
7056 reg
, dev
->sensor_flags
, NULL
);
7060 reg
= 0x43; /* RSVD 0x43 is Reserved */
7061 buf
[0] = 0xf0; buf
[1] = 0x10; buf
[2] = 0x78; buf
[3] = 0xa8;
7062 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, reg
,
7063 dev
->sensor_flags
, buf
);
7067 reg
= 0x47; /* RSVD 0x47 is Reserved */
7068 buf
[0] = 0x60; buf
[1] = 0x80; buf
[2] = 0x00; buf
[3] = 0x00;
7069 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, reg
,
7070 dev
->sensor_flags
, buf
);
7074 reg
= 0x4b; /* RSVD 0x4b is Reserved */
7075 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
7076 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, reg
,
7077 dev
->sensor_flags
, buf
);
7082 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
7083 OV7660_CTL_MTX1
, dev
->sensor_flags
, NULL
);
7087 reg
= 0x59; /* RSVD 0x59 is Reserved */
7088 buf
[0] = 0xba; buf
[1] = 0x9a; buf
[2] = 0x22; buf
[3] = 0xb9;
7089 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7090 reg
, dev
->sensor_flags
, buf
);
7094 reg
= 0x5d; /* RSVD 0x5d is Reserved */
7095 buf
[0] = 0x9b; buf
[1] = 0x10; buf
[2] = 0xf0; buf
[3] = 0x05;
7096 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7097 reg
, dev
->sensor_flags
, buf
);
7101 reg
= 0x61; /* RSVD 0x61 is Reserved */
7103 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7104 reg
, dev
->sensor_flags
, buf
);
7108 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x30;
7109 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7110 OV7660_CTL_LCC1
, dev
->sensor_flags
, buf
);
7115 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7116 OV7660_CTL_LCC5
, dev
->sensor_flags
, buf
);
7120 buf
[0] = 0x80; buf
[1] = 0x7a; buf
[2] = 0x90; buf
[3] = 0x80;
7121 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7122 OV7660_CTL_MANU
, dev
->sensor_flags
, buf
);
7127 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7128 OV7660_CTL_DBLV
, dev
->sensor_flags
, buf
);
7132 reg
= 0x8b; /* RSVD 0x8b is Reserved */
7133 buf
[0] = 0x99; buf
[1] = 0x99; buf
[2] = 0xcf;
7134 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3, reg
,
7135 dev
->sensor_flags
, buf
);
7139 buf
[0] = 0x00; buf
[1] = 0x00;
7140 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
7141 OV7660_CTL_DM_LNL
, dev
->sensor_flags
, buf
);
7147 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7153 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7158 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7164 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7168 /* TRY TO READ FROM EEPROM: */
7170 ret
= sn9c20x_read_i2c_data(dev
, 0x50, 1, reg
, SN9C20X_I2C_2WIRE
, buf
);
7172 UDIA_INFO("No EEPROM found\n");
7174 UDIA_INFO("Read from EEPROM successful\n");
7178 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7184 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7190 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7196 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7202 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7208 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7213 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7214 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7218 buf
[0] = 0x10; buf
[1] = 0x61; buf
[2] = 0x02; buf
[3] = 0x7a;
7219 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7220 OV7660_CTL_HSTART
, dev
->sensor_flags
, buf
);
7224 /* "Dummy" write: */
7225 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
7226 OV7660_CTL_PSHFT
, dev
->sensor_flags
, NULL
);
7231 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7232 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7237 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7238 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7243 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7244 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7249 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7250 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7255 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7256 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7261 buf
[0] = 0x01; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x28;
7263 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
7268 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
7269 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
7275 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7280 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
7281 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7286 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
7287 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7293 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7299 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7305 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7311 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7317 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7323 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7329 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7332 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7338 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7341 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7347 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7350 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7356 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7359 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7365 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7368 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7374 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7377 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7383 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7388 //ret = usb_microdia_control_read(dev, reg, buf, 1);
7389 //if(ret < 0) goto err;
7393 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7394 OV7660_CTL_CLKRC
, dev
->sensor_flags
, buf
);
7399 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7400 OV7660_CTL_EXHCH
, dev
->sensor_flags
, buf
);
7405 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7406 OV7660_CTL_EXHCL
, dev
->sensor_flags
, buf
);
7411 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7412 OV7660_CTL_DM_LNL
, dev
->sensor_flags
, buf
);
7417 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7418 OV7660_CTL_DM_LNH
, dev
->sensor_flags
, buf
);
7423 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7424 OV7660_CTL_MVFP
, dev
->sensor_flags
, buf
);
7429 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7430 OV7660_CTL_MVFP
, dev
->sensor_flags
, buf
);
7435 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7436 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7441 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7442 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7447 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7448 OV7660_CTL_AECH
, dev
->sensor_flags
, buf
);
7453 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7454 OV7660_CTL_COM1
, dev
->sensor_flags
, buf
);
7459 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7460 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
7465 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7466 OV7660_CTL_ADVFH
, dev
->sensor_flags
, buf
);
7471 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7472 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
7476 buf
[0] = 0x78; buf
[1] = 0x78;
7477 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
7478 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
7484 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7490 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7496 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7502 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7508 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7514 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7520 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7526 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7532 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7538 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7543 buf
[0] = 0x00; buf
[1] = 0x33; buf
[2] = 0x53; buf
[3] = 0x6b; buf
[4] = 0x7c;
7544 buf
[5] = 0x8b; buf
[6] = 0x99; buf
[7] = 0xa6; buf
[8] = 0xb2; buf
[9] = 0xbd;
7545 buf
[10] = 0xc8; buf
[11] = 0xd2; buf
[12] = 0xdc; buf
[13] = 0xe5; buf
[14] = 0xee;
7546 buf
[15] = 0xf7; buf
[16] = 0xff;
7547 ret
= usb_microdia_control_write(dev
, reg
, buf
, 17);
7550 /* transferbufferlength was only 11 ? */
7553 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7554 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7555 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7556 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7558 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7561 /* transferbufferlength was only 15 ? */
7564 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7565 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7566 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7567 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7569 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7572 /* transferbufferlength was only 15 ? */
7575 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7576 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7577 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7578 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7580 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7583 /* transferbufferlength was only 15 ? */
7586 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7587 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7588 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7589 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7591 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7594 /* transferbufferlength was only 15 ? */
7597 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7598 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7599 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7600 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7602 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7605 /* transferbufferlength was only 15 ? */
7608 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7609 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7610 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7611 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7613 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7616 /* transferbufferlength was only 15 ? */
7619 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7620 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7621 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7622 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7624 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7627 /* transferbufferlength was only 15 ? */
7630 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7631 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7632 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7633 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7635 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7638 /* transferbufferlength was only 15 ? */
7641 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
7642 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7643 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7644 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7646 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7649 /* transferbufferlength was only 15 ? */
7653 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7659 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7664 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
7665 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7666 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7667 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7669 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7672 /* transferbufferlength was only 15 ? */
7676 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7682 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7688 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7694 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7700 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7705 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
7706 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7711 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7712 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7713 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7714 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
7715 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x00; buf
[23] = 0x00; buf
[24] = 0x00;
7716 buf
[25] = 0x00; buf
[26] = 0x00; buf
[27] = 0x00; buf
[28] = 0x00; buf
[29] = 0x00;
7717 buf
[30] = 0x00; buf
[31] = 0x00; buf
[32] = 0x00;
7718 ret
= usb_microdia_control_write(dev
, reg
, buf
, 33);
7721 /* transferbufferlength was only 30 ? */
7725 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7731 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7737 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7743 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7748 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05; buf
[4] = 0x04;
7750 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
7755 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
7756 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7761 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
7762 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7768 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7774 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7780 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7785 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d; buf
[4] = 0x08;
7786 buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d; buf
[8] = 0x0d; buf
[9] = 0x0d;
7787 buf
[10] = 0x11; buf
[11] = 0x0d; buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15;
7788 buf
[15] = 0x21; buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
7789 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d; buf
[24] = 0x19;
7790 buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a; buf
[28] = 0x32; buf
[29] = 0x32;
7791 buf
[30] = 0x2e; buf
[31] = 0x2a; buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36;
7792 buf
[35] = 0x3a; buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
7793 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e; buf
[44] = 0x43;
7794 buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47; buf
[48] = 0x4f; buf
[49] = 0x53;
7795 buf
[50] = 0x58; buf
[51] = 0x58; buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f;
7796 buf
[55] = 0x60; buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
7797 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
7798 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
7801 /* transferbufferlength is only 40 ? */
7804 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15; buf
[4] = 0x11;
7805 buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15; buf
[8] = 0x15; buf
[9] = 0x26;
7806 buf
[10] = 0x53; buf
[11] = 0x36; buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53;
7807 buf
[15] = 0x53; buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
7808 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53; buf
[24] = 0x53;
7809 buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53; buf
[28] = 0x53; buf
[29] = 0x53;
7810 buf
[30] = 0x53; buf
[31] = 0x53; buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53;
7811 buf
[35] = 0x53; buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
7812 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53; buf
[44] = 0x53;
7813 buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53; buf
[48] = 0x53; buf
[49] = 0x53;
7814 buf
[50] = 0x53; buf
[51] = 0x53; buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53;
7815 buf
[55] = 0x53; buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
7816 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
7817 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
7820 /* transferbufferlength is only 40 ? */
7824 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7830 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7836 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7841 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7842 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7847 buf
[0] = 0x01; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x28;
7849 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
7854 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
7855 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
7861 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7866 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
7867 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7872 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
7873 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7879 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7885 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7891 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7897 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7903 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7909 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7915 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7921 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7927 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7933 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7939 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7945 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7948 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7954 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7957 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7963 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7966 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7972 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7975 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7981 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7984 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7990 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7993 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7999 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8004 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8005 OV7660_CTL_CLKRC
, dev
->sensor_flags
, buf
);
8010 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8011 OV7660_CTL_EXHCH
, dev
->sensor_flags
, buf
);
8016 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8017 OV7660_CTL_EXHCL
, dev
->sensor_flags
, buf
);
8022 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8023 OV7660_CTL_DM_LNL
, dev
->sensor_flags
, buf
);
8028 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8029 OV7660_CTL_DM_LNH
, dev
->sensor_flags
, buf
);
8033 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8034 OV7660_CTL_PID
, dev
->sensor_flags
, buf
);
8038 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8039 OV7660_CTL_VER
, dev
->sensor_flags
, buf
);
8043 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8044 OV7660_CTL_MIDH
, dev
->sensor_flags
, buf
);
8048 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8049 OV7660_CTL_MIDL
, dev
->sensor_flags
, buf
);
8055 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8061 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8067 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8073 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8079 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8084 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8085 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc4; buf
[9] = 0x0f;
8086 buf
[10] = 0x44; buf
[11] = 0x00; buf
[12] = 0x3f; buf
[13] = 0x00; buf
[14] = 0xd8;
8087 buf
[15] = 0x0f; buf
[16] = 0xe9; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8089 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8092 /* transferbufferlength is only 15 ? */
8095 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8096 OV7660_CTL_AECH
, dev
->sensor_flags
, buf
);
8101 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8102 OV7660_CTL_COM1
, dev
->sensor_flags
, buf
);
8107 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8108 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc4; buf
[9] = 0x0f;
8109 buf
[10] = 0x44; buf
[11] = 0x00; buf
[12] = 0x3f; buf
[13] = 0x00; buf
[14] = 0xd8;
8110 buf
[15] = 0x0f; buf
[16] = 0xe9; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8112 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8115 /* transferbufferlength is only 15 ? */
8118 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8119 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
8124 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8125 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc4; buf
[9] = 0x0f;
8126 buf
[10] = 0x44; buf
[11] = 0x00; buf
[12] = 0x3f; buf
[13] = 0x00; buf
[14] = 0xd8;
8127 buf
[15] = 0x0f; buf
[16] = 0xe9; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8129 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8132 /* transferbufferlength is only 15 ? */
8134 buf
[0] = 0x00; buf
[1] = 0x01;
8135 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8136 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
8141 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8142 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
8146 buf
[0] = 0x50; buf
[1] = 0x60;
8147 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8148 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
8154 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8160 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8166 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8172 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8176 buf
[0] = 0xfc; buf
[1] = 0x04;
8177 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8178 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
8183 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8184 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc8; buf
[9] = 0x0f;
8185 buf
[10] = 0x3f; buf
[11] = 0x00; buf
[12] = 0x3b; buf
[13] = 0x00; buf
[14] = 0xdb;
8186 buf
[15] = 0x0f; buf
[16] = 0xeb; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8188 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8191 /* transferbufferlength is only 15 ? */
8193 buf
[0] = 0x1f; buf
[1] = 0x00;
8194 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8195 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
8199 buf
[0] = 0x48; buf
[1] = 0x58;
8200 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8201 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
8207 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8213 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8219 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8225 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8229 buf
[0] = 0xf6; buf
[1] = 0x0b;
8230 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8231 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
8236 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8237 buf
[5] = 0x00; buf
[6] = 0xfc; buf
[7] = 0x0f; buf
[8] = 0xdc; buf
[9] = 0x0f;
8238 buf
[10] = 0x29; buf
[11] = 0x00; buf
[12] = 0x26; buf
[13] = 0x00; buf
[14] = 0xe8;
8239 buf
[15] = 0x0f; buf
[16] = 0xf3; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8241 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8244 /* transferbufferlength is only 15 ? */
8248 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8254 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8260 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8266 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8272 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8276 buf
[0] = 0x50; buf
[1] = 0x60;
8277 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8278 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
8284 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8290 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8296 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8302 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8308 UDIA_ERROR("r/w in bridge register %x failed (%d)!\n", reg
, ret
);
8312 UDIA_ERROR("r/w in sensor register %x failed (%d)!\n", reg
, ret
);
8318 * @brief From UsbSnoop-plugin-parsed.log
8322 * @returns 0 (OK) or <0 (Error)
8324 * @author Vincent, Kuzja
8326 int microdia_6288_start_stream(struct usb_microdia
*dev
)
8336 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8337 if(ret
< 0) goto err
;
8341 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8342 if(ret
< 0) goto err
;
8346 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8347 if(ret
< 0) goto err
;
8351 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8352 if(ret
< 0) goto err
;
8356 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8357 if(ret
< 0) goto err
;
8361 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8362 if(ret
< 0) goto err
;
8365 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
8366 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
8367 if(ret
< 0) goto err
;
8370 buf
[0] = 0x80; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x03;
8371 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
8372 if(ret
< 0) goto err
;
8375 buf
[0] = 0x44; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30; buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed; buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a; buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0; buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00; buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
8376 ret
= usb_microdia_control_write(dev
, reg
, buf
, 24);
8377 if(ret
< 0) goto err
;
8380 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
8381 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
8382 if(ret
< 0) goto err
;
8385 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
8386 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
8387 if(ret
< 0) goto err
;
8390 buf
[0] = 0x86; buf
[1] = 0xcc; buf
[2] = 0x08;
8391 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
8392 if(ret
< 0) goto err
;
8395 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20; buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b; buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80; buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8; buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9; buf
[20] = 0xf4; buf
[21] = 0xff;
8396 ret
= usb_microdia_control_write(dev
, reg
, buf
, 22);
8397 if(ret
< 0) goto err
;
8400 buf
[0] = 0x00; buf
[1] = 0x00;
8401 ret
= usb_microdia_control_write(dev
, reg
, buf
, 2);
8402 if(ret
< 0) goto err
;
8405 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0; buf
[8] = 0x00;
8406 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
8407 if(ret
< 0) goto err
;
8411 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8412 if(ret
< 0) goto err
;
8416 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8417 if(ret
< 0) goto err
;
8420 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8421 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8422 if(ret
< 0) goto err
;
8425 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8426 if(ret
< 0) goto err
;
8429 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8430 if(ret
< 0) goto err
;
8433 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8434 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8435 if(ret
< 0) goto err
;
8438 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8439 if(ret
< 0) goto err
;
8442 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8443 if(ret
< 0) goto err
;
8446 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8447 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8448 if(ret
< 0) goto err
;
8451 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8452 if(ret
< 0) goto err
;
8455 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8456 if(ret
< 0) goto err
;
8459 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0e; buf
[3] = 0x61; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8460 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8461 if(ret
< 0) goto err
;
8464 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8465 if(ret
< 0) goto err
;
8468 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8469 if(ret
< 0) goto err
;
8472 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8473 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8474 if(ret
< 0) goto err
;
8477 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8478 if(ret
< 0) goto err
;
8481 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8482 if(ret
< 0) goto err
;
8485 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x13; buf
[3] = 0xb8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8486 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8487 if(ret
< 0) goto err
;
8490 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8491 if(ret
< 0) goto err
;
8494 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8495 if(ret
< 0) goto err
;
8498 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x14; buf
[3] = 0x3e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8499 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8500 if(ret
< 0) goto err
;
8503 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8504 if(ret
< 0) goto err
;
8507 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8508 if(ret
< 0) goto err
;
8511 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x16; buf
[3] = 0x24; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8512 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8513 if(ret
< 0) goto err
;
8516 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8517 if(ret
< 0) goto err
;
8520 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8521 if(ret
< 0) goto err
;
8524 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8525 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8526 if(ret
< 0) goto err
;
8529 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8530 if(ret
< 0) goto err
;
8533 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8534 if(ret
< 0) goto err
;
8537 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8538 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8539 if(ret
< 0) goto err
;
8542 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8543 if(ret
< 0) goto err
;
8546 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8547 if(ret
< 0) goto err
;
8550 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8551 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8552 if(ret
< 0) goto err
;
8555 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8556 if(ret
< 0) goto err
;
8559 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8560 if(ret
< 0) goto err
;
8563 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x27; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8564 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8565 if(ret
< 0) goto err
;
8568 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8569 if(ret
< 0) goto err
;
8572 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8573 if(ret
< 0) goto err
;
8576 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x28; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8577 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8578 if(ret
< 0) goto err
;
8581 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8582 if(ret
< 0) goto err
;
8585 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8586 if(ret
< 0) goto err
;
8589 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x29; buf
[3] = 0x15; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8590 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8591 if(ret
< 0) goto err
;
8594 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8595 if(ret
< 0) goto err
;
8598 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8599 if(ret
< 0) goto err
;
8602 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2c; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8603 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8604 if(ret
< 0) goto err
;
8607 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8608 if(ret
< 0) goto err
;
8611 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8612 if(ret
< 0) goto err
;
8615 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8616 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8617 if(ret
< 0) goto err
;
8620 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8621 if(ret
< 0) goto err
;
8624 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8625 if(ret
< 0) goto err
;
8628 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x34; buf
[3] = 0x3d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8629 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8630 if(ret
< 0) goto err
;
8633 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8634 if(ret
< 0) goto err
;
8637 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8638 if(ret
< 0) goto err
;
8641 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x35; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8642 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8643 if(ret
< 0) goto err
;
8646 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8647 if(ret
< 0) goto err
;
8650 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8651 if(ret
< 0) goto err
;
8654 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x36; buf
[3] = 0xf8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8655 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8656 if(ret
< 0) goto err
;
8659 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8660 if(ret
< 0) goto err
;
8663 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8664 if(ret
< 0) goto err
;
8667 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x38; buf
[3] = 0x12; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8668 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8669 if(ret
< 0) goto err
;
8672 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8673 if(ret
< 0) goto err
;
8676 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8677 if(ret
< 0) goto err
;
8680 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x39; buf
[3] = 0x57; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8681 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8682 if(ret
< 0) goto err
;
8685 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8686 if(ret
< 0) goto err
;
8689 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8690 if(ret
< 0) goto err
;
8693 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8694 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8695 if(ret
< 0) goto err
;
8698 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8699 if(ret
< 0) goto err
;
8702 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8703 if(ret
< 0) goto err
;
8706 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3b; buf
[3] = 0xcc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8707 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8708 if(ret
< 0) goto err
;
8711 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8712 if(ret
< 0) goto err
;
8715 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8716 if(ret
< 0) goto err
;
8719 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3c; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8720 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8721 if(ret
< 0) goto err
;
8724 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8725 if(ret
< 0) goto err
;
8728 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8729 if(ret
< 0) goto err
;
8732 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3d; buf
[3] = 0x19; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8733 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8734 if(ret
< 0) goto err
;
8737 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8738 if(ret
< 0) goto err
;
8741 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8742 if(ret
< 0) goto err
;
8745 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3e; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8746 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8747 if(ret
< 0) goto err
;
8750 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8751 if(ret
< 0) goto err
;
8754 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8755 if(ret
< 0) goto err
;
8758 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3f; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8759 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8760 if(ret
< 0) goto err
;
8763 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8764 if(ret
< 0) goto err
;
8767 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8768 if(ret
< 0) goto err
;
8771 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x41; buf
[3] = 0x40; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8772 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8773 if(ret
< 0) goto err
;
8776 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8777 if(ret
< 0) goto err
;
8780 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8781 if(ret
< 0) goto err
;
8784 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x42; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8785 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8786 if(ret
< 0) goto err
;
8789 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8790 if(ret
< 0) goto err
;
8793 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8794 if(ret
< 0) goto err
;
8797 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x45; buf
[3] = 0x46; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8798 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8799 if(ret
< 0) goto err
;
8802 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8803 if(ret
< 0) goto err
;
8806 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8807 if(ret
< 0) goto err
;
8810 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x46; buf
[3] = 0x62; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8811 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8812 if(ret
< 0) goto err
;
8815 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8816 if(ret
< 0) goto err
;
8819 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8820 if(ret
< 0) goto err
;
8823 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x47; buf
[3] = 0x2a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8824 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8825 if(ret
< 0) goto err
;
8828 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8829 if(ret
< 0) goto err
;
8832 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8833 if(ret
< 0) goto err
;
8836 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x48; buf
[3] = 0x3c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8837 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8838 if(ret
< 0) goto err
;
8841 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8842 if(ret
< 0) goto err
;
8845 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8846 if(ret
< 0) goto err
;
8849 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4a; buf
[3] = 0xf0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8850 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8851 if(ret
< 0) goto err
;
8854 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8855 if(ret
< 0) goto err
;
8858 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8859 if(ret
< 0) goto err
;
8862 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4b; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8863 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8864 if(ret
< 0) goto err
;
8867 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8868 if(ret
< 0) goto err
;
8871 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8872 if(ret
< 0) goto err
;
8875 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4c; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8876 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8877 if(ret
< 0) goto err
;
8880 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8881 if(ret
< 0) goto err
;
8884 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8885 if(ret
< 0) goto err
;
8888 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4d; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8889 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8890 if(ret
< 0) goto err
;
8893 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8894 if(ret
< 0) goto err
;
8897 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8898 if(ret
< 0) goto err
;
8901 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4e; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8902 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8903 if(ret
< 0) goto err
;
8906 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8907 if(ret
< 0) goto err
;
8910 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8911 if(ret
< 0) goto err
;
8914 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x69; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8915 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8916 if(ret
< 0) goto err
;
8919 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8920 if(ret
< 0) goto err
;
8923 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8924 if(ret
< 0) goto err
;
8927 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6c; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8928 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8929 if(ret
< 0) goto err
;
8932 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8933 if(ret
< 0) goto err
;
8936 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8937 if(ret
< 0) goto err
;
8940 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6f; buf
[3] = 0x9e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8941 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8942 if(ret
< 0) goto err
;
8945 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8946 if(ret
< 0) goto err
;
8949 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8950 if(ret
< 0) goto err
;
8953 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x70; buf
[3] = 0x05; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8954 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8955 if(ret
< 0) goto err
;
8958 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8959 if(ret
< 0) goto err
;
8962 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8963 if(ret
< 0) goto err
;
8966 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x71; buf
[3] = 0x78; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8967 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8968 if(ret
< 0) goto err
;
8971 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8972 if(ret
< 0) goto err
;
8975 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8976 if(ret
< 0) goto err
;
8979 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x77; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8980 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8981 if(ret
< 0) goto err
;
8984 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8985 if(ret
< 0) goto err
;
8988 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8989 if(ret
< 0) goto err
;
8992 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8a; buf
[3] = 0x23; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8993 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8994 if(ret
< 0) goto err
;
8997 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8998 if(ret
< 0) goto err
;
9001 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9002 if(ret
< 0) goto err
;
9005 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8c; buf
[3] = 0x0d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9006 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9007 if(ret
< 0) goto err
;
9010 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9011 if(ret
< 0) goto err
;
9014 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9015 if(ret
< 0) goto err
;
9018 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x90; buf
[3] = 0x7e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9019 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9020 if(ret
< 0) goto err
;
9023 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9024 if(ret
< 0) goto err
;
9027 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9028 if(ret
< 0) goto err
;
9031 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x91; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9032 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9033 if(ret
< 0) goto err
;
9036 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9037 if(ret
< 0) goto err
;
9040 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9041 if(ret
< 0) goto err
;
9044 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x9f; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9045 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9046 if(ret
< 0) goto err
;
9049 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9050 if(ret
< 0) goto err
;
9053 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9054 if(ret
< 0) goto err
;
9057 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa0; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9058 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9059 if(ret
< 0) goto err
;
9062 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9063 if(ret
< 0) goto err
;
9066 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9067 if(ret
< 0) goto err
;
9070 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa4; buf
[3] = 0x50; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9071 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9072 if(ret
< 0) goto err
;
9075 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9076 if(ret
< 0) goto err
;
9079 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9080 if(ret
< 0) goto err
;
9083 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa5; buf
[3] = 0x68; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9084 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9085 if(ret
< 0) goto err
;
9088 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9089 if(ret
< 0) goto err
;
9092 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9093 if(ret
< 0) goto err
;
9096 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa6; buf
[3] = 0x60; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9097 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9098 if(ret
< 0) goto err
;
9101 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9102 if(ret
< 0) goto err
;
9105 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9106 if(ret
< 0) goto err
;
9109 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa8; buf
[3] = 0xc1; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9110 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9111 if(ret
< 0) goto err
;
9114 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9115 if(ret
< 0) goto err
;
9118 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9119 if(ret
< 0) goto err
;
9122 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa9; buf
[3] = 0xfa; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9123 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9124 if(ret
< 0) goto err
;
9127 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9128 if(ret
< 0) goto err
;
9131 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9132 if(ret
< 0) goto err
;
9135 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaa; buf
[3] = 0x92; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9136 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9137 if(ret
< 0) goto err
;
9140 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9141 if(ret
< 0) goto err
;
9144 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9145 if(ret
< 0) goto err
;
9148 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xab; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9149 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9150 if(ret
< 0) goto err
;
9153 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9154 if(ret
< 0) goto err
;
9157 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9158 if(ret
< 0) goto err
;
9161 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xac; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9162 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9163 if(ret
< 0) goto err
;
9166 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9167 if(ret
< 0) goto err
;
9170 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9171 if(ret
< 0) goto err
;
9174 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xad; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9175 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9176 if(ret
< 0) goto err
;
9179 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9180 if(ret
< 0) goto err
;
9183 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9184 if(ret
< 0) goto err
;
9187 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xae; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9188 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9189 if(ret
< 0) goto err
;
9192 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9193 if(ret
< 0) goto err
;
9196 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9197 if(ret
< 0) goto err
;
9200 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaf; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9201 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9202 if(ret
< 0) goto err
;
9205 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9206 if(ret
< 0) goto err
;
9209 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9210 if(ret
< 0) goto err
;
9213 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb2; buf
[3] = 0xf2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9214 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9215 if(ret
< 0) goto err
;
9218 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9219 if(ret
< 0) goto err
;
9222 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9223 if(ret
< 0) goto err
;
9226 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb3; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9227 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9228 if(ret
< 0) goto err
;
9231 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9232 if(ret
< 0) goto err
;
9235 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9236 if(ret
< 0) goto err
;
9239 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb4; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9240 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9241 if(ret
< 0) goto err
;
9244 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9245 if(ret
< 0) goto err
;
9248 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9249 if(ret
< 0) goto err
;
9252 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb5; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9253 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9254 if(ret
< 0) goto err
;
9257 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9258 if(ret
< 0) goto err
;
9261 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9262 if(ret
< 0) goto err
;
9265 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb6; buf
[3] = 0xaf; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9266 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9267 if(ret
< 0) goto err
;
9270 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9271 if(ret
< 0) goto err
;
9274 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9275 if(ret
< 0) goto err
;
9278 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbb; buf
[3] = 0xae; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9279 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9280 if(ret
< 0) goto err
;
9283 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9284 if(ret
< 0) goto err
;
9287 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9288 if(ret
< 0) goto err
;
9291 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbc; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9292 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9293 if(ret
< 0) goto err
;
9296 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9297 if(ret
< 0) goto err
;
9300 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9301 if(ret
< 0) goto err
;
9304 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbd; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9305 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9306 if(ret
< 0) goto err
;
9309 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9310 if(ret
< 0) goto err
;
9313 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9314 if(ret
< 0) goto err
;
9317 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbe; buf
[3] = 0x3b; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9318 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9319 if(ret
< 0) goto err
;
9322 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9323 if(ret
< 0) goto err
;
9326 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9327 if(ret
< 0) goto err
;
9330 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbf; buf
[3] = 0x3a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9331 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9332 if(ret
< 0) goto err
;
9335 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9336 if(ret
< 0) goto err
;
9339 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9340 if(ret
< 0) goto err
;
9343 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc0; buf
[3] = 0xe2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9344 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9345 if(ret
< 0) goto err
;
9348 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9349 if(ret
< 0) goto err
;
9352 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9353 if(ret
< 0) goto err
;
9356 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc1; buf
[3] = 0xc8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9357 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9358 if(ret
< 0) goto err
;
9361 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9362 if(ret
< 0) goto err
;
9365 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9366 if(ret
< 0) goto err
;
9369 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc2; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9370 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9371 if(ret
< 0) goto err
;
9374 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9375 if(ret
< 0) goto err
;
9378 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9379 if(ret
< 0) goto err
;
9382 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc4; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9383 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9384 if(ret
< 0) goto err
;
9387 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9388 if(ret
< 0) goto err
;
9391 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9392 if(ret
< 0) goto err
;
9395 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc6; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9396 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9397 if(ret
< 0) goto err
;
9400 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9401 if(ret
< 0) goto err
;
9404 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9405 if(ret
< 0) goto err
;
9408 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc7; buf
[3] = 0x81; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9409 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9410 if(ret
< 0) goto err
;
9413 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9414 if(ret
< 0) goto err
;
9417 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9418 if(ret
< 0) goto err
;
9421 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc9; buf
[3] = 0xe0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9422 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9423 if(ret
< 0) goto err
;
9426 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9427 if(ret
< 0) goto err
;
9430 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9431 if(ret
< 0) goto err
;
9434 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xca; buf
[3] = 0xe8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9435 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9436 if(ret
< 0) goto err
;
9439 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9440 if(ret
< 0) goto err
;
9443 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9444 if(ret
< 0) goto err
;
9447 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcc; buf
[3] = 0xd8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9448 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9449 if(ret
< 0) goto err
;
9452 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9453 if(ret
< 0) goto err
;
9456 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9457 if(ret
< 0) goto err
;
9460 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcd; buf
[3] = 0x93; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9461 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9462 if(ret
< 0) goto err
;
9465 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9466 if(ret
< 0) goto err
;
9469 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9470 if(ret
< 0) goto err
;
9473 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9474 if(ret
< 0) goto err
;
9478 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9479 if(ret
< 0) goto err
;
9482 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9483 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9484 if(ret
< 0) goto err
;
9487 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9488 if(ret
< 0) goto err
;
9491 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9492 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9493 if(ret
< 0) goto err
;
9496 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9497 if(ret
< 0) goto err
;
9500 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9501 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9502 if(ret
< 0) goto err
;
9505 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9506 if(ret
< 0) goto err
;
9509 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9510 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9511 if(ret
< 0) goto err
;
9514 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9515 if(ret
< 0) goto err
;
9518 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9519 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9520 if(ret
< 0) goto err
;
9523 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9524 if(ret
< 0) goto err
;
9527 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9528 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9529 if(ret
< 0) goto err
;
9532 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9533 if(ret
< 0) goto err
;
9536 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9537 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9538 if(ret
< 0) goto err
;
9541 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9542 if(ret
< 0) goto err
;
9545 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9546 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9547 if(ret
< 0) goto err
;
9550 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9551 if(ret
< 0) goto err
;
9554 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9555 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9556 if(ret
< 0) goto err
;
9559 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9560 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9561 if(ret
< 0) goto err
;
9564 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9565 if(ret
< 0) goto err
;
9568 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9569 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9570 if(ret
< 0) goto err
;
9573 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9574 if(ret
< 0) goto err
;
9577 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9578 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9579 if(ret
< 0) goto err
;
9582 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9583 if(ret
< 0) goto err
;
9586 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9587 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9588 if(ret
< 0) goto err
;
9591 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9592 if(ret
< 0) goto err
;
9595 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9596 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9597 if(ret
< 0) goto err
;
9600 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9601 if(ret
< 0) goto err
;
9604 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9605 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9606 if(ret
< 0) goto err
;
9609 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9610 if(ret
< 0) goto err
;
9613 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9614 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9615 if(ret
< 0) goto err
;
9618 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9619 if(ret
< 0) goto err
;
9622 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9623 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9624 if(ret
< 0) goto err
;
9627 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9628 if(ret
< 0) goto err
;
9631 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9632 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9633 if(ret
< 0) goto err
;
9636 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
9637 if(ret
< 0) goto err
;
9641 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9642 if(ret
< 0) goto err
;
9646 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9647 if(ret
< 0) goto err
;
9651 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9652 if(ret
< 0) goto err
;
9656 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9657 if(ret
< 0) goto err
;
9661 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9662 if(ret
< 0) goto err
;
9666 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9667 if(ret
< 0) goto err
;
9671 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9672 if(ret
< 0) goto err
;
9676 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9677 if(ret
< 0) goto err
;
9681 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9682 if(ret
< 0) goto err
;
9686 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9687 if(ret
< 0) goto err
;
9691 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9692 if(ret
< 0) goto err
;
9695 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9696 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9697 if(ret
< 0) goto err
;
9700 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9701 if(ret
< 0) goto err
;
9704 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9705 if(ret
< 0) goto err
;
9708 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
9709 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9710 if(ret
< 0) goto err
;
9713 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9714 if(ret
< 0) goto err
;
9717 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9718 if(ret
< 0) goto err
;
9721 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9722 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9723 if(ret
< 0) goto err
;
9726 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9727 if(ret
< 0) goto err
;
9730 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9731 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9732 if(ret
< 0) goto err
;
9735 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9736 if(ret
< 0) goto err
;
9739 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9740 if(ret
< 0) goto err
;
9743 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x50; buf
[5] = 0x78;
9744 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
9745 if(ret
< 0) goto err
;
9748 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
9749 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
9750 if(ret
< 0) goto err
;
9754 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9755 if(ret
< 0) goto err
;
9759 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9760 if(ret
< 0) goto err
;
9763 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
9764 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
9765 if(ret
< 0) goto err
;
9768 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
9769 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
9770 if(ret
< 0) goto err
;
9774 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9775 if(ret
< 0) goto err
;
9779 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9780 if(ret
< 0) goto err
;
9784 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9785 if(ret
< 0) goto err
;
9789 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9790 if(ret
< 0) goto err
;
9794 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9795 if(ret
< 0) goto err
;
9799 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9800 if(ret
< 0) goto err
;
9804 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9805 if(ret
< 0) goto err
;
9808 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9809 if(ret
< 0) goto err
;
9813 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9814 if(ret
< 0) goto err
;
9817 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9818 if(ret
< 0) goto err
;
9822 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9823 if(ret
< 0) goto err
;
9826 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9827 if(ret
< 0) goto err
;
9831 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9832 if(ret
< 0) goto err
;
9835 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9836 if(ret
< 0) goto err
;
9840 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9841 if(ret
< 0) goto err
;
9844 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9845 if(ret
< 0) goto err
;
9849 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9850 if(ret
< 0) goto err
;
9853 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9854 if(ret
< 0) goto err
;
9858 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9859 if(ret
< 0) goto err
;
9862 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9863 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9864 if(ret
< 0) goto err
;
9867 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9868 if(ret
< 0) goto err
;
9871 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9872 if(ret
< 0) goto err
;
9875 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9876 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9877 if(ret
< 0) goto err
;
9880 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9881 if(ret
< 0) goto err
;
9884 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9885 if(ret
< 0) goto err
;
9888 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9889 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9890 if(ret
< 0) goto err
;
9893 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9894 if(ret
< 0) goto err
;
9897 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9898 if(ret
< 0) goto err
;
9901 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9902 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9903 if(ret
< 0) goto err
;
9906 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9907 if(ret
< 0) goto err
;
9910 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9911 if(ret
< 0) goto err
;
9914 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9915 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9916 if(ret
< 0) goto err
;
9919 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9920 if(ret
< 0) goto err
;
9923 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9924 if(ret
< 0) goto err
;
9927 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9928 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9929 if(ret
< 0) goto err
;
9932 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9933 if(ret
< 0) goto err
;
9936 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9937 if(ret
< 0) goto err
;
9940 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9941 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9942 if(ret
< 0) goto err
;
9945 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9946 if(ret
< 0) goto err
;
9949 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9950 if(ret
< 0) goto err
;
9954 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9955 if(ret
< 0) goto err
;
9958 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x7d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9959 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9960 if(ret
< 0) goto err
;
9963 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9964 if(ret
< 0) goto err
;
9967 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9968 if(ret
< 0) goto err
;
9971 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9972 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9973 if(ret
< 0) goto err
;
9976 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9977 if(ret
< 0) goto err
;
9980 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9981 if(ret
< 0) goto err
;
9984 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9985 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9986 if(ret
< 0) goto err
;
9989 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9990 if(ret
< 0) goto err
;
9993 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9994 if(ret
< 0) goto err
;
9997 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9998 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9999 if(ret
< 0) goto err
;
10002 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10003 if(ret
< 0) goto err
;
10006 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10007 if(ret
< 0) goto err
;
10010 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10011 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10012 if(ret
< 0) goto err
;
10015 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10016 if(ret
< 0) goto err
;
10019 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10020 if(ret
< 0) goto err
;
10023 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10024 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10025 if(ret
< 0) goto err
;
10028 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10029 if(ret
< 0) goto err
;
10032 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10033 if(ret
< 0) goto err
;
10036 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10037 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10038 if(ret
< 0) goto err
;
10041 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10042 if(ret
< 0) goto err
;
10045 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10046 if(ret
< 0) goto err
;
10049 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10050 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10051 if(ret
< 0) goto err
;
10054 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10055 if(ret
< 0) goto err
;
10058 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10059 if(ret
< 0) goto err
;
10063 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10064 if(ret
< 0) goto err
;
10068 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10069 if(ret
< 0) goto err
;
10073 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10074 if(ret
< 0) goto err
;
10078 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10079 if(ret
< 0) goto err
;
10083 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10084 if(ret
< 0) goto err
;
10088 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10089 if(ret
< 0) goto err
;
10093 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10094 if(ret
< 0) goto err
;
10098 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10099 if(ret
< 0) goto err
;
10103 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10104 if(ret
< 0) goto err
;
10108 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10109 if(ret
< 0) goto err
;
10112 buf
[0] = 0x08; buf
[1] = 0x2f; buf
[2] = 0x46; buf
[3] = 0x58; buf
[4] = 0x69; buf
[5] = 0x78; buf
[6] = 0x86; buf
[7] = 0x94; buf
[8] = 0xa0; buf
[9] = 0xac; buf
[10] = 0xb8; buf
[11] = 0xc3; buf
[12] = 0xce; buf
[13] = 0xd9; buf
[14] = 0xe3; buf
[15] = 0xed; buf
[16] = 0xf7;
10113 ret
= usb_microdia_control_write(dev
, reg
, buf
, 17);
10114 if(ret
< 0) goto err
;
10117 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10118 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10119 if(ret
< 0) goto err
;
10122 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10123 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10124 if(ret
< 0) goto err
;
10127 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10128 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10129 if(ret
< 0) goto err
;
10132 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10133 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10134 if(ret
< 0) goto err
;
10137 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10138 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10139 if(ret
< 0) goto err
;
10142 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10143 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10144 if(ret
< 0) goto err
;
10147 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10148 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10149 if(ret
< 0) goto err
;
10152 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10153 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10154 if(ret
< 0) goto err
;
10157 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10158 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10159 if(ret
< 0) goto err
;
10163 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10164 if(ret
< 0) goto err
;
10168 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10169 if(ret
< 0) goto err
;
10172 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10173 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10174 if(ret
< 0) goto err
;
10178 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10179 if(ret
< 0) goto err
;
10183 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10184 if(ret
< 0) goto err
;
10188 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10189 if(ret
< 0) goto err
;
10193 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10194 if(ret
< 0) goto err
;
10198 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10199 if(ret
< 0) goto err
;
10202 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
10203 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10204 if(ret
< 0) goto err
;
10207 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x00; buf
[23] = 0x00; buf
[24] = 0x00; buf
[25] = 0x00; buf
[26] = 0x00; buf
[27] = 0x00; buf
[28] = 0x00; buf
[29] = 0x00; buf
[30] = 0x00; buf
[31] = 0x00; buf
[32] = 0x00; buf
[33] = 0x00; buf
[34] = 0x00; buf
[35] = 0x00; buf
[36] = 0x00; buf
[37] = 0x00; buf
[38] = 0x00; buf
[39] = 0x00; buf
[40] = 0x00; buf
[41] = 0x00; buf
[42] = 0x00; buf
[43] = 0x00; buf
[44] = 0x00; buf
[45] = 0x00; buf
[46] = 0x00; buf
[47] = 0x00;
10208 ret
= usb_microdia_control_write(dev
, reg
, buf
, 48);
10209 if(ret
< 0) goto err
;
10213 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10214 if(ret
< 0) goto err
;
10218 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10219 if(ret
< 0) goto err
;
10223 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10224 if(ret
< 0) goto err
;
10228 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10229 if(ret
< 0) goto err
;
10232 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
10233 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
10234 if(ret
< 0) goto err
;
10237 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
10238 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10239 if(ret
< 0) goto err
;
10242 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
10243 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10244 if(ret
< 0) goto err
;
10248 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10249 if(ret
< 0) goto err
;
10253 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10254 if(ret
< 0) goto err
;
10258 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10259 if(ret
< 0) goto err
;
10262 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d; buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d; buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d; buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21; buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11; buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d; buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a; buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a; buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a; buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a; buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e; buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47; buf
[48] = 0x4f; buf
[49] = 0x53; buf
[50] = 0x58; buf
[51] = 0x58; buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60; buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64; buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
10263 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
10264 if(ret
< 0) goto err
;
10267 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15; buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15; buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x53; buf
[11] = 0x36; buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53; buf
[15] = 0x53; buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53; buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53; buf
[24] = 0x53; buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53; buf
[28] = 0x53; buf
[29] = 0x53; buf
[30] = 0x53; buf
[31] = 0x53; buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53; buf
[35] = 0x53; buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53; buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53; buf
[44] = 0x53; buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53; buf
[48] = 0x53; buf
[49] = 0x53; buf
[50] = 0x53; buf
[51] = 0x53; buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53; buf
[55] = 0x53; buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53; buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
10268 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
10269 if(ret
< 0) goto err
;
10273 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10274 if(ret
< 0) goto err
;
10278 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10279 if(ret
< 0) goto err
;
10283 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10284 if(ret
< 0) goto err
;
10288 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10289 if(ret
< 0) goto err
;
10293 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10294 if(ret
< 0) goto err
;
10298 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10299 if(ret
< 0) goto err
;
10303 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10304 if(ret
< 0) goto err
;
10308 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10309 if(ret
< 0) goto err
;
10312 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10313 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10314 if(ret
< 0) goto err
;
10317 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10318 if(ret
< 0) goto err
;
10321 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10322 if(ret
< 0) goto err
;
10325 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
10326 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10327 if(ret
< 0) goto err
;
10330 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10331 if(ret
< 0) goto err
;
10334 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10335 if(ret
< 0) goto err
;
10338 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10339 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10340 if(ret
< 0) goto err
;
10343 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10344 if(ret
< 0) goto err
;
10347 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10348 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10349 if(ret
< 0) goto err
;
10352 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10353 if(ret
< 0) goto err
;
10356 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10357 if(ret
< 0) goto err
;
10360 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x50; buf
[5] = 0x78;
10361 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
10362 if(ret
< 0) goto err
;
10365 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
10366 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
10367 if(ret
< 0) goto err
;
10371 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10372 if(ret
< 0) goto err
;
10375 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
10376 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10377 if(ret
< 0) goto err
;
10380 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
10381 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10382 if(ret
< 0) goto err
;
10386 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10387 if(ret
< 0) goto err
;
10391 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10392 if(ret
< 0) goto err
;
10396 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10397 if(ret
< 0) goto err
;
10401 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10402 if(ret
< 0) goto err
;
10406 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10407 if(ret
< 0) goto err
;
10411 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10412 if(ret
< 0) goto err
;
10416 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10417 if(ret
< 0) goto err
;
10421 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10422 if(ret
< 0) goto err
;
10426 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10427 if(ret
< 0) goto err
;
10431 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10432 if(ret
< 0) goto err
;
10436 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10437 if(ret
< 0) goto err
;
10441 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10442 if(ret
< 0) goto err
;
10445 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10446 if(ret
< 0) goto err
;
10450 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10451 if(ret
< 0) goto err
;
10454 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10455 if(ret
< 0) goto err
;
10459 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10460 if(ret
< 0) goto err
;
10463 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10464 if(ret
< 0) goto err
;
10468 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10469 if(ret
< 0) goto err
;
10472 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10473 if(ret
< 0) goto err
;
10477 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10478 if(ret
< 0) goto err
;
10481 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10482 if(ret
< 0) goto err
;
10486 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10487 if(ret
< 0) goto err
;
10490 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10491 if(ret
< 0) goto err
;
10495 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10496 if(ret
< 0) goto err
;
10499 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10500 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10501 if(ret
< 0) goto err
;
10504 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10505 if(ret
< 0) goto err
;
10508 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10509 if(ret
< 0) goto err
;
10512 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10513 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10514 if(ret
< 0) goto err
;
10517 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10518 if(ret
< 0) goto err
;
10521 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10522 if(ret
< 0) goto err
;
10525 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x70; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10526 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10527 if(ret
< 0) goto err
;
10530 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10531 if(ret
< 0) goto err
;
10534 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10535 if(ret
< 0) goto err
;
10538 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10539 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10540 if(ret
< 0) goto err
;
10543 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10544 if(ret
< 0) goto err
;
10547 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10548 if(ret
< 0) goto err
;
10551 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10552 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10553 if(ret
< 0) goto err
;
10556 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10557 if(ret
< 0) goto err
;
10560 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10561 if(ret
< 0) goto err
;
10564 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10565 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10566 if(ret
< 0) goto err
;
10569 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10570 if(ret
< 0) goto err
;
10573 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10574 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10575 if(ret
< 0) goto err
;
10578 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10579 if(ret
< 0) goto err
;
10582 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10583 if(ret
< 0) goto err
;
10586 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10587 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10588 if(ret
< 0) goto err
;
10591 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10592 if(ret
< 0) goto err
;
10595 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10596 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10597 if(ret
< 0) goto err
;
10600 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10601 if(ret
< 0) goto err
;
10604 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10605 if(ret
< 0) goto err
;
10608 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1c; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10609 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10610 if(ret
< 0) goto err
;
10613 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10614 if(ret
< 0) goto err
;
10617 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10618 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10619 if(ret
< 0) goto err
;
10622 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10623 if(ret
< 0) goto err
;
10626 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10627 if(ret
< 0) goto err
;
10630 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10631 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10632 if(ret
< 0) goto err
;
10635 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10636 if(ret
< 0) goto err
;
10639 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10640 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10641 if(ret
< 0) goto err
;
10644 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10645 if(ret
< 0) goto err
;
10648 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10649 if(ret
< 0) goto err
;
10653 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10654 if(ret
< 0) goto err
;
10658 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10659 if(ret
< 0) goto err
;
10663 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10664 if(ret
< 0) goto err
;
10667 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xdd; buf
[7] = 0x0f; buf
[8] = 0xcc; buf
[9] = 0x0f; buf
[10] = 0x58; buf
[11] = 0x00; buf
[12] = 0x4b; buf
[13] = 0x00; buf
[14] = 0xb5; buf
[15] = 0x0f; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10668 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10669 if(ret
< 0) goto err
;
10672 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10673 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10674 if(ret
< 0) goto err
;
10677 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10678 if(ret
< 0) goto err
;
10681 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10682 if(ret
< 0) goto err
;
10685 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10686 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10687 if(ret
< 0) goto err
;
10690 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10691 if(ret
< 0) goto err
;
10694 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10695 if(ret
< 0) goto err
;
10698 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10699 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10700 if(ret
< 0) goto err
;
10703 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10704 if(ret
< 0) goto err
;
10707 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10708 if(ret
< 0) goto err
;
10711 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x36; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10712 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10713 if(ret
< 0) goto err
;
10716 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10717 if(ret
< 0) goto err
;
10720 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10721 if(ret
< 0) goto err
;
10724 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10725 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10726 if(ret
< 0) goto err
;
10729 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10730 if(ret
< 0) goto err
;
10733 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10734 if(ret
< 0) goto err
;
10737 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xdd; buf
[7] = 0x0f; buf
[8] = 0xcc; buf
[9] = 0x0f; buf
[10] = 0x58; buf
[11] = 0x00; buf
[12] = 0x4b; buf
[13] = 0x00; buf
[14] = 0xb5; buf
[15] = 0x0f; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10738 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10739 if(ret
< 0) goto err
;
10742 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10743 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10744 if(ret
< 0) goto err
;
10747 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10748 if(ret
< 0) goto err
;
10751 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10752 if(ret
< 0) goto err
;
10755 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xdd; buf
[7] = 0x0f; buf
[8] = 0xcc; buf
[9] = 0x0f; buf
[10] = 0x58; buf
[11] = 0x00; buf
[12] = 0x4b; buf
[13] = 0x00; buf
[14] = 0xb5; buf
[15] = 0x0f; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00; buf
[20] = 0x00;
10756 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10757 if(ret
< 0) goto err
;
10760 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10761 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10762 if(ret
< 0) goto err
;
10765 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10766 if(ret
< 0) goto err
;
10769 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10770 if(ret
< 0) goto err
;
10773 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x94; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10774 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10775 if(ret
< 0) goto err
;
10778 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10779 if(ret
< 0) goto err
;
10782 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10783 if(ret
< 0) goto err
;
10786 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x8d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10787 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10788 if(ret
< 0) goto err
;
10791 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10792 if(ret
< 0) goto err
;
10795 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10796 if(ret
< 0) goto err
;
10800 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10801 if(ret
< 0) goto err
;
10805 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10806 if(ret
< 0) goto err
;
10810 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10811 if(ret
< 0) goto err
;
10815 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10816 if(ret
< 0) goto err
;
10819 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x09; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10820 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10821 if(ret
< 0) goto err
;
10824 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10825 if(ret
< 0) goto err
;
10828 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10829 if(ret
< 0) goto err
;
10832 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x95; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10833 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10834 if(ret
< 0) goto err
;
10837 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10838 if(ret
< 0) goto err
;
10841 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10842 if(ret
< 0) goto err
;
10845 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10846 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10847 if(ret
< 0) goto err
;
10850 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10851 if(ret
< 0) goto err
;
10854 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10855 if(ret
< 0) goto err
;
10859 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10860 if(ret
< 0) goto err
;
10864 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10865 if(ret
< 0) goto err
;
10869 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10870 if(ret
< 0) goto err
;
10874 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10875 if(ret
< 0) goto err
;
10878 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10879 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10880 if(ret
< 0) goto err
;
10883 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10884 if(ret
< 0) goto err
;
10887 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10888 if(ret
< 0) goto err
;
10891 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x96; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10892 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10893 if(ret
< 0) goto err
;
10896 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10897 if(ret
< 0) goto err
;
10900 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10901 if(ret
< 0) goto err
;
10904 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10905 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10906 if(ret
< 0) goto err
;
10909 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10910 if(ret
< 0) goto err
;
10913 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10914 if(ret
< 0) goto err
;
10918 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10919 if(ret
< 0) goto err
;
10923 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10924 if(ret
< 0) goto err
;
10928 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10929 if(ret
< 0) goto err
;
10933 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10934 if(ret
< 0) goto err
;
10937 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10938 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10939 if(ret
< 0) goto err
;
10942 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10943 if(ret
< 0) goto err
;
10946 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10947 if(ret
< 0) goto err
;
10951 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10952 if(ret
< 0) goto err
;
10956 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10957 if(ret
< 0) goto err
;
10961 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10962 if(ret
< 0) goto err
;
10966 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10967 if(ret
< 0) goto err
;
10971 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10972 if(ret
< 0) goto err
;
10976 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10977 if(ret
< 0) goto err
;
10982 /* END OF MICRODIA 6288 START STREAM */
10986 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
10991 * @brief From UsbSnoop-plugin-parsed.log
10995 * @returns 0 if all OK
10997 * this function starts video stream Microdia 6128 webcam
10998 * Bridge SN9C325 + OM6802 CMOS sensor
10999 * note: comments are my observations so they could be wrong
11001 int microdia_6128_start_stream(struct usb_microdia
*dev
)
11008 0x00, 0x1a, 0x34, 0x27, 0x20, 0xa0, 0x34, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00
11012 0x08, 0x22, 0x44, 0x63, 0x7d, 0x92, 0xa3, 0xaf, 0xbc, 0xc4, 0xcd, 0xd5, 0xdc, 0xe1, 0xe8, 0xef,
11017 0x15, 0x00, 0x2b, 0x00, 0x08, 0x00, 0xeb, 0x0f, 0xd7, 0x0f, 0x43, 0x00, 0x3d, 0x00, 0xca, 0x0f,
11018 0xf7, 0x0f, 0x0c, 0x00, 0x00
11021 __u8 qtable_1
[] = {
11022 0x06, 0x04, 0x04, 0x06, 0x04, 0x04, 0x06, 0x06, 0x06, 0x06, 0x08, 0x06, 0x06, 0x08, 0x0a, 0x10,
11023 0x0a, 0x0a, 0x08, 0x08, 0x0a, 0x13, 0x0e, 0x0e, 0x0c, 0x10, 0x17, 0x13, 0x17, 0x17, 0x15, 0x13,
11024 0x15, 0x15, 0x19, 0x1b, 0x23, 0x1f, 0x19, 0x1b, 0x21, 0x1b, 0x15, 0x15, 0x1f, 0x2b, 0x1f, 0x21,
11025 0x25, 0x27, 0x29, 0x29, 0x29, 0x17, 0x1d, 0x2d, 0x2f, 0x2b, 0x27, 0x2f, 0x23, 0x27, 0x29, 0x27
11029 __u8 qtable_2
[] = {
11030 0x06, 0x08, 0x08, 0x0a, 0x08, 0x0a, 0x12, 0x0a, 0x0a, 0x12, 0x27, 0x19, 0x15, 0x19, 0x27, 0x27,
11031 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27,
11032 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27,
11033 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27,
11036 __u8 om6802_sensor
[][8] = {
11037 {0xa0, dev
->sensor_slave_address
, 0xd6, 0x02, 0x00, 0x00, 0x00, 0x10},
11038 {0xa0, dev
->sensor_slave_address
, 0xae, 0xe2, 0x00, 0x00, 0x00, 0x10},
11039 {0xa0, dev
->sensor_slave_address
, 0xdf, 0x6d, 0x00, 0x00, 0x00, 0x10}, // Enter factory mode
11040 {0xa0, dev
->sensor_slave_address
, 0xdd, 0x18, 0x00, 0x00, 0x00, 0x10}, // RGB, uyvy1,Raw RGB, n/1/2, n/clp
11041 {0xa0, dev
->sensor_slave_address
, 0x5a, 0xc0, 0x00, 0x00, 0x00, 0x10},
11042 {0xa0, dev
->sensor_slave_address
, 0xfb, 0x11, 0x00, 0x00, 0x00, 0x10},
11043 {0xa0, dev
->sensor_slave_address
, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x10},
11044 {0xa0, dev
->sensor_slave_address
, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x10},
11045 {0xa0, dev
->sensor_slave_address
, 0xe4, 0xff, 0x00, 0x00, 0x00, 0x10},
11046 {0xa0, dev
->sensor_slave_address
, 0xfb, 0xee, 0x00, 0x00, 0x00, 0x10},
11047 {0xa0, dev
->sensor_slave_address
, 0x5d, 0x80, 0x00, 0x00, 0x00, 0x10},
11048 {0xa0, dev
->sensor_slave_address
, 0x71, 0x84, 0x00, 0x00, 0x00, 0x10},
11049 {0xa0, dev
->sensor_slave_address
, 0x72, 0x00, 0x00, 0x00, 0x00, 0x10},
11050 {0xa0, dev
->sensor_slave_address
, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10},
11051 {0xa0, dev
->sensor_slave_address
, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10},
11052 {0xa0, dev
->sensor_slave_address
, 0x71, 0x18, 0x00, 0x00, 0x00, 0x10},
11053 {0xa0, dev
->sensor_slave_address
, 0x72, 0x04, 0x00, 0x00, 0x00, 0x10},
11054 {0xa0, dev
->sensor_slave_address
, 0x68, 0xde, 0x00, 0x00, 0x00, 0x10},
11055 {0xa0, dev
->sensor_slave_address
, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10}, // 18
11056 {0xa0, dev
->sensor_slave_address
, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10},
11057 {0xa0, dev
->sensor_slave_address
, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10},
11058 {0, 0, 0, 0, 0, 0, 0, 0} // Terminating string
11062 ret
+= usb_microdia_control_write(dev
, 0xf1, buf
, 1); // Reset cam
11065 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1); // Sensor off, video off, clk 12MHz
11067 ret
+= usb_microdia_control_read(dev
, 0x00, buf
, 1); // Check if cam is working, must write 0x12 in buf[0]
11069 if(buf
[0] != 0x12){
11070 UDIA_ERROR("Microdia 6128 webcam not connected or working !!!\n");
11074 ret
+= usb_microdia_control_read(dev
, 0x01, buf
, 1); // Must read 23
11076 if(buf
[0] != 0x23){
11077 UDIA_ERROR("Microdia 6128 webcam is not initialized !!!\n");
11081 buf
[0] = 0x23; buf
[1] = 0x72;
11082 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 2); // Configure GPIO
11084 buf
[0] = 0x34; buf
[1] = 0x27; buf
[2] = 0x20; buf
[3] = 0xa0; buf
[4] = 0x34;
11085 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 5);
11087 buf
[0] = 0x44; buf
[1] = 0x45; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
11088 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 5);
11090 buf
[0] = 0x08; buf
[1] = 0x40; buf
[2] = 0x20; buf
[3] = 0x00; buf
[4] = 0x00;
11091 ret
+= usb_microdia_control_write(dev
, 0x9a, buf
, 5);
11093 buf
[0] = 0x60; buf
[1] = 0x00; buf
[2] = 0x00;
11094 ret
+= usb_microdia_control_write(dev
, 0xd4, buf
, 3);
11095 ret
+= usb_microdia_control_write(dev
, 0x03, data_15
, 15);
11098 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11101 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11103 buf
[0] = 0x22; buf
[1] = 0x62;
11104 ret
+= usb_microdia_control_write(dev
, 0x01, &buf
[0], 1);
11105 ret
+= usb_microdia_control_write(dev
, 0x01, &buf
[1], 1);
11108 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11109 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11111 buf
[0] = 0x42; // Sensor on, clk 24MHz, video off
11112 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11113 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11116 for (i
= 0; i
< 2; i
++){
11117 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11122 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11125 for (i
= 2; i
< 11; i
++){
11126 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11131 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11132 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1); // URB 1780
11135 ret
+= usb_microdia_control_write(dev
, 0x15, buf
, 1);
11138 ret
+= usb_microdia_control_write(dev
, 0x16, buf
, 1);
11141 ret
+= usb_microdia_control_write(dev
, 0x12, buf
, 1);
11144 ret
+= usb_microdia_control_write(dev
, 0x13, buf
, 1);
11147 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11150 ret
+= usb_microdia_control_write(dev
, 0xd2, buf
, 1);
11153 ret
+= usb_microdia_control_write(dev
, 0xd3, buf
, 1);
11156 ret
+= usb_microdia_control_write(dev
, 0xc6, buf
, 1);
11157 ret
+= usb_microdia_control_write(dev
, 0xc7, buf
, 1);
11160 ret
+= usb_microdia_control_write(dev
, 0xc8, buf
, 1);
11163 ret
+= usb_microdia_control_write(dev
, 0xc9, buf
, 1);
11166 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11169 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11172 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11173 ret
+= usb_microdia_control_write(dev
, 0x07, buf
, 1);
11174 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11177 ret
+= usb_microdia_control_write(dev
, 0x14, buf
, 1);
11179 ret
+= usb_microdia_control_write(dev
, 0x20, data_17
, 17);
11180 ret
+= usb_microdia_control_write(dev
, 0x20, data_17
, 17);
11182 for (i
= 0; i
< 8; ++i
) // writing the same buffer 8 times, why ??
11183 ret
+= usb_microdia_control_write(dev
, 0x84, data_21
, 21);
11185 data_21
[0] = 0x16; data_21
[10] = 40; data_21
[12] = 0x3f;
11186 ret
+= usb_microdia_control_write(dev
, 0x84, data_21
, 21);
11189 ret
+= usb_microdia_control_write(dev
, 0x9a, buf
, 1);
11192 ret
+= usb_microdia_control_write(dev
, 0x99, buf
, 1);
11194 ret
+= usb_microdia_control_write(dev
, 0x84, data_21
, 21); // URB 1811
11197 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11198 ret
+= usb_microdia_control_write(dev
, 0x07, buf
, 1);
11199 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11202 for (i
= 11; i
< 15; i
++){
11203 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11208 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11210 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11212 buf
[0] = buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
11213 ret
+= usb_microdia_control_write(dev
, 0xc0, buf
, 6);
11215 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
11216 ret
+= usb_microdia_control_write(dev
, 0xca, buf
, 4);
11218 buf
[0] = 0x1e; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xe7;
11219 ret
+= usb_microdia_control_write(dev
, 0xce, buf
, 4);
11222 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11225 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11228 for (i
= 15; i
< 19; i
++){
11229 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11234 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11237 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11239 // This changes the mode (VGA = 0 , CIF = 1)
11240 // buf = 0x40 | 0x05 | (mode << 4) 45 or 55
11242 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11244 // This is the Q table
11245 ret
+= usb_microdia_control_write(dev
, 0x0100, qtable_1
, 64); // first time
11246 ret
+= usb_microdia_control_write(dev
, 0x0140, qtable_2
, 64); // second time
11248 // mode: VGA = 0, CIF = 1
11249 // buf = 0x05 | (mode << 4) 05 or 15
11251 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11254 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11255 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11257 buf
[0] = 0x42; // Sensor on, Video disabled, clk 24MHz
11258 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11261 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11263 // Command to start streaming
11264 // Sensor on, clk 24MHz, video enabled
11266 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11268 // When the device reads 46 from reg 0x01 it means that
11269 // camera is streaming
11270 ret
+= usb_microdia_control_read(dev
, 0x01, buf
, 1); // Must read 0x46
11273 UDIA_DEBUG("Some read or write were not successful in Start Stream\n");
11279 int dev_microdia_stop_stream(struct usb_microdia
*dev
)
11282 if(dev
&& dev
->stop_stream
)
11283 ret
= dev
->stop_stream(dev
);
11289 * @brief From stop.htm
11297 * For SN9C201 with MI1310.
11298 * This function has not been tested yet.
11300 int microdia_6242_stop_stream(struct usb_microdia
*dev
)
11304 __u8 only10c0
[3] = {0x0d, 0x00, 0x00};
11307 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
11310 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11313 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11315 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
11316 only10c0
[0], dev
->sensor_flags
, &only10c0
[1]);
11319 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
11322 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
11325 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11328 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11331 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
11332 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
11335 * After the select alternate setting 0 is actually another transfer:
11337 * usb_microdia_control_write(dev, 0x1066, buf, 1);
11344 * @brief From stopstream.log
11352 * For SN9C201 with SOI968.
11353 * I don't whether the function really stops the stream.
11354 * Nevertheless the LED on the webcam now stops glowing.
11355 * The function is very similar to "microdia_624f_stop_stream".
11357 int microdia_624e_stop_stream(struct usb_microdia
*dev
)
11362 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
11364 /* Next two writes added because it works better.
11365 * The LED stops glowing and I think the stream does too.
11366 * 0x20 = 0b00100000 which is the minimal of what the other stopstreams have in common.
11369 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11372 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11375 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
11378 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
11380 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
11381 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
11383 usb_microdia_control_read(dev
, 0x1066, buf
, 1);
11388 int microdia_624f_stop_stream(struct usb_microdia
*dev
)
11396 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11397 if(ret
< 0) goto err
;
11401 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11402 if(ret
< 0) goto err
;
11406 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11407 if(ret
< 0) goto err
;
11411 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11412 if(ret
< 0) goto err
;
11416 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11417 if(ret
< 0) goto err
;
11421 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11422 if(ret
< 0) goto err
;
11428 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
11429 if(ret
< 0) goto err
;
11432 ret
= usb_microdia_control_read(dev
, command
, buf
, 1);
11433 if(ret
< 0) goto err
;
11436 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11437 if(ret
< 0) goto err
;
11442 UDIA_ERROR("command %x failed (%d)!\n", command
, ret
);
11446 int microdia_6260_stop_stream(struct usb_microdia
*dev
)
11452 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
11454 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
11456 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
11458 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11460 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11462 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
11463 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 3);
11466 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
11467 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
11469 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
11471 ret
= usb_microdia_control_write(dev
, 0x10c8, buf
, 1);
11473 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
11479 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
11483 * @returns 0 (ok) or -1 (error)
11485 * @author Comer352l
11487 * Windows driver version: 5.7.23.000
11488 * Windows versions: 2000 and XP
11489 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
11490 * All logs were made using AMCAP with 640x480, RGB24
11492 int microdia_6270_stop_stream(struct usb_microdia
*dev
)
11498 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
11501 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); // URB 3541
11503 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); // URB 3542
11504 // => These two writes seem to cause the cam to stop sending isochronus USB messages
11507 ret
+= usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 3544
11508 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
11511 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); // URB 3541
11513 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); // URB 3542
11515 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
11517 // Write to sensor register 0x07: Output Control
11518 buf
[0] = 0x00; buf
[1] = 0x00; // stop sensor readout, normal operation
11519 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
11521 buf
[0] = 0x38; // ALEX: 0x3c
11522 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 3545
11523 buf
[0] = 0x6d; // ALEX: 0xec; FRANK: also 0x6c
11524 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 3546
11525 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
11526 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 3); // URB 3547
11528 // INTERRUPT COMMING BACK (URB 2227)
11529 // SELECT ALTERNATE SETTINGS (URB 3548)
11530 // INTERRUPT GOING DOWN (URB 3549)
11533 ret
+= usb_microdia_control_write(dev
, 0x1066, buf
, 1); // URB 3550
11537 UDIA_INFO("One ore more errors occured while stopping stream !\n");
11544 int microdia_627b_stop_stream(struct usb_microdia
*dev
)
11552 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11558 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11565 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11566 //if(ret < 0) goto err;
11570 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11571 //if(ret < 0) goto err;
11576 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11583 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11584 //if(ret < 0) goto err;
11588 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11589 //if(ret < 0) goto err;
11594 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11600 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11605 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
11606 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
11612 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11618 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
11623 * @brief From UsbSnoop-plugin-parsed.log
11627 * @returns 0 (OK) or <0 (Error)
11629 * @author Vincent, Kuzja
11631 int microdia_6288_stop_stream(struct usb_microdia
*dev
)
11639 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11640 if(ret
< 0) goto err
;
11644 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11645 if(ret
< 0) goto err
;
11649 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11650 if(ret
< 0) goto err
;
11654 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11655 if(ret
< 0) goto err
;
11659 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11660 if(ret
< 0) goto err
;
11663 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
11664 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
11665 if(ret
< 0) goto err
;
11669 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11670 if(ret
< 0) goto err
;
11674 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
11679 * @brief From UsbSnoop-plugin-parsed.log
11683 * @returns 0 if all OK
11685 * This function stops the video stream for microdia 6128
11686 * Bridge SN9C325 + OM6802 CMOS sensor
11687 * note: comments are my observations so they could be wrong
11689 int microdia_6128_stop_stream(struct usb_microdia
*dev
)
11694 ret
+= usb_microdia_control_read(dev
, 0x00, &data
, 1);
11696 // Stop stream command
11698 ret
+= usb_microdia_control_write(dev
, 0x01, &data
, 1);
11701 ret
+= usb_microdia_control_write(dev
, 0xf1, &data
, 1);
11704 ret
+= usb_microdia_control_write(dev
, 0xf1, &data
, 1);
11707 UDIA_DEBUG("Some read or write were not successful in Stop Stream\n");
11714 int microdia_624f_set_exposure(struct usb_microdia
*dev
)
11717 __u8 v1
= (dev
->vsettings
.exposure
>> 4) & 0xff;
11718 __u8 v2
= dev
->vsettings
.exposure
>> 12;
11720 ret
|= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x2d,
11721 dev
->sensor_flags
, &v1
);
11723 ret
|= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x2e,
11724 dev
->sensor_flags
, &v2
);
11729 int microdia_624f_flip_detect(struct usb_microdia
*dev
)
11734 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
11735 if (ret
< 0) return -EAGAIN
;
11737 dev
->vsettings
.vflip
= 1;
11740 dev
->vsettings
.vflip
= 0;
11746 int microdia_6260_flip_detect(struct usb_microdia
*dev
)
11748 const __u8 flip_bit
= 0x01;
11751 static __u8 flip_reg
= flip_bit
;
11754 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
11757 if (flip_reg
!= (val
& flip_bit
)) {
11758 if (val
& flip_bit
)
11762 ret
= ov7670_auto_flip(dev
, vflip
);
11763 flip_reg
= (val
& flip_bit
);