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] = {
3312 __u8 second10c0a
[2][5] = {
3313 {0x01, 0x00, 0x0e, 0x00, 0x14},
3314 {0x03, 0x03, 0xc4, 0x05, 0x14}
3317 __u8 second10c0b
[3] =
3320 __u8 third10c0
[4][3] = {
3327 __u8 fourth10c0a
[3][3] = {
3333 __u8 fourth10c0b
[2][5] = {
3334 {0x2b, 0x01, 0x88, 0x01, 0x88},
3335 {0x2d, 0x01, 0x88, 0x01, 0x88}
3338 __u8 fifth10c0
[4][3] = {
3344 /* interrupt down */
3347 usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 1 */
3350 /* interrupt down */
3353 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
3356 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
3359 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3362 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3365 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3368 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3371 usb_microdia_control_write(dev
, 0x1020, buf
, 1);
3373 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
3374 buf
[3] = 0x10; buf
[4] = 0x08;
3375 usb_microdia_control_write(dev
, 0x1067, buf
, 5);
3377 buf
[0] = 0xb0; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x0d;
3378 buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00;
3379 buf
[6] = 0x00; buf
[7] = 0x10; buf
[8] = 0x03;
3380 usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
3382 usb_microdia_control_write(dev
, 0x10e0, urb10
, 24); /* URB 10 */
3384 buf
[0] = 0x00; buf
[1] = 0x00; buf
[3] = 0x00;
3385 usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
3387 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00;
3388 buf
[3] = 0xe0; buf
[4] = 0x03;
3389 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
3391 usb_microdia_control_write(dev
, 0x1180, urb13
, 11);
3393 usb_microdia_control_write(dev
, 0x118b, urb14
, 22);
3395 buf
[0] = 0x00; buf
[1] = 0x00;
3396 usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
3398 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00;
3399 buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00;
3400 buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00;
3401 usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
3404 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3407 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3409 for (i
= 0; i
< 7; i
++)
3410 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3411 first10c0
[i
][0], dev
->sensor_flags
, &first10c0
[i
][1]); /* URB 9-48 */
3414 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
3417 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
3420 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 50 */
3423 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3426 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3429 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3432 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3435 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3438 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
3441 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
3444 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
3447 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
3449 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3450 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
3452 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3453 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
3455 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3456 0x09, dev
->sensor_flags
, NULL
);
3458 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3459 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
3461 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
3462 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
3463 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
3465 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3466 buf
[3] = 0xf0; buf
[4] = 0x00;
3467 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 70 */
3470 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3472 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3473 usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
3475 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3476 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
3479 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3482 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3485 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3488 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3491 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
3494 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
3497 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 80 */
3498 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3501 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3502 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3505 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3506 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3509 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3510 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3513 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3514 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3517 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 90 */
3519 for (i
= 0; i
< 4; i
++)
3520 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3521 third10c0
[i
][0], dev
->sensor_flags
, &third10c0
[i
][1]); /* URB 97-106 */
3524 usb_microdia_control_write(dev
, 0x1180, buf
, 1);
3526 for (i
= 0; i
< 3; i
++)
3527 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3528 fourth10c0a
[i
][0], dev
->sensor_flags
, &fourth10c0a
[i
][1]);
3530 for (i
= 0; i
< 2; i
++)
3531 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3532 fourth10c0b
[i
][0], dev
->sensor_flags
, &fourth10c0b
[i
][1]);
3534 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3535 0x33, dev
->sensor_flags
, NULL
);
3537 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3538 first10c0
[0][0], dev
->sensor_flags
, &first10c0
[0][1]);
3541 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
3544 usb_microdia_control_write(dev
, 0x118d, buf
, 1); /* URB 110 */
3547 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
3550 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
3553 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3556 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
3559 usb_microdia_control_write(dev
, 0x118d, buf
, 1);
3562 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
3565 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
3568 usb_microdia_control_write(dev
, 0x118b, buf
, 1);
3570 usb_microdia_control_write(dev
, 0x1190, urb119
, 17);
3572 for (i
= 0; i
< 9; i
++)
3573 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21); /* URB 120-128 */
3576 usb_microdia_control_write(dev
, 0x10f7, buf
, 1);
3579 usb_microdia_control_write(dev
, 0x10f6, buf
, 1); /* URB 130 */
3581 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21);
3584 usb_microdia_control_write(dev
, 0x10f8, buf
, 1);
3587 usb_microdia_control_write(dev
, 0x10fa, buf
, 1);
3590 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
3593 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
3596 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3598 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
3599 usb_microdia_control_write(dev
, 0x11bc, buf
, 4);
3601 /* Set whole array buf to 0x00 */
3602 memset(buf
, 0x00, 48);
3603 usb_microdia_control_write(dev
, 0x11c0, buf
, 48);
3606 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
3609 usb_microdia_control_write(dev
, 0x118d, buf
, 1); /* URB 140 */
3612 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
3615 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
3617 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a;
3618 buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
3619 usb_microdia_control_write(dev
, 0x11a5, buf
, 6);
3621 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
3622 usb_microdia_control_write(dev
, 0x11af, buf
, 4);
3624 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
3625 usb_microdia_control_write(dev
, 0x11b3, buf
, 4);
3628 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3631 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3634 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3636 usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
3638 usb_microdia_control_write(dev
, 0x1140, qtable2
, 64); /* URB 150 */
3641 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3644 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3647 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3650 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3653 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
3656 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
3659 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
3662 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
3664 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3665 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
3667 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3668 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
3670 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3671 0x09, dev
->sensor_flags
, NULL
);
3673 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3674 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
3676 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
3677 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
3678 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
3680 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3681 buf
[3] = 0xf0; buf
[4] = 0x00;
3682 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
3685 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3687 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3688 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); /* URB 170 */
3690 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3691 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
3694 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3697 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3700 usb_microdia_control_write(dev
, 0x11b9, buf
, 1);
3703 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
3706 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3709 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3712 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3715 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3718 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 180 */
3721 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
3724 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
3727 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3728 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3731 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3732 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3735 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3736 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3739 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3740 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 190 */
3743 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3744 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
3747 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3749 for (i
= 0; i
< 3; i
++)
3750 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3751 fifth10c0
[i
][0], dev
->sensor_flags
, &fifth10c0
[i
][1]); /* URB 200-205 */
3753 sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2,
3754 0x00, dev
->sensor_flags
, buf
);
3755 /* __u8 result[2] = {buf[3], buf[4]}; */
3758 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3764 * @brief From startstream.log
3772 * For SN9C201 with SOI968.
3773 * This is function triggers a working stream of image data and a glowing LED.
3775 int microdia_624e_start_stream(struct usb_microdia
*dev
)
3781 {0x47, 0x18, 0x00, 0x30, 0x00, 0x09, 0x00, 0xed,
3782 0x0f, 0xda, 0x0f, 0x3a, 0x00, 0x3a, 0x00, 0xd0,
3783 0x0f, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x60, 0x0a};
3786 {0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0x24, 0x3b,
3787 0x4f, 0x61, 0x71, 0x80, 0x8f, 0x9d, 0xab, 0xb8,
3788 0xc4, 0xd1, 0xdd, 0xe9, 0xf4, 0xff};
3791 {0x08, 0x2b, 0x59, 0x79, 0x91, 0x9e, 0xa9, 0xb3,
3792 0xbd, 0xc6, 0xce, 0xd6, 0xdd, 0xe4, 0xea, 0xf1,
3796 {0x16, 0x00, 0x2d, 0x00, 0x08, 0x00, 0xdd, 0x0f,
3797 0xbc, 0x0f, 0x68, 0x00, 0x68, 0x00, 0xa9, 0x0f,
3798 0xf0, 0x0f, 0x00, 0x00, 0x00};
3801 {0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
3802 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
3803 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
3804 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
3805 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
3806 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
3807 0x4f, 0x53, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
3808 0x64, 0x5c, 0x53, 0x64, 0x4b, 0x53, 0x58, 0x53};
3811 {0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
3812 0x15, 0x26, 0x53, 0x36, 0x2e, 0x36, 0x53, 0x53,
3813 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3814 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3815 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3816 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3817 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
3818 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53};
3820 __u8 first10c0
[20][2] = {
3821 {0x12, 0x80}, {0x12, 0x00}, {0x0c, 0x00}, {0x0f, 0x1f},
3822 {0x11, 0x80}, {0x38, 0x52}, {0x1e, 0x00}, {0x33, 0x08},
3823 {0x35, 0x8c}, {0x36, 0x0c}, {0x37, 0x04}, {0x45, 0x04},
3824 {0x47, 0xff}, {0x3e, 0x00}, {0x3f, 0x00}, {0x3b, 0x20},
3825 {0x3a, 0x96}, {0x3d, 0x0a}, {0x14, 0x4e}, {0x13, 0x88}};
3827 __u8 second10c0a
[2] =
3829 __u8 second10c0b
[5] =
3830 {0x17, 0x13, 0x63, 0x01, 0x79}; // length 4
3831 __u8 second10c0c
[2] =
3832 {0x1b, 0x00}; // length 0
3833 __u8 second10c0d
[2][2] = {
3837 __u8 third10c0a
[5][2] = {
3843 __u8 third10c0b
[3] =
3844 {0x01, 0x80, 0x80}; // length 2
3847 {0x0a, 0x0b, 0x1c, 0x1d}; // these are four addresses
3852 usb_microdia_control_write(dev
, 0x1066, buf
, 1); // URB 1
3859 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3862 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3865 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3867 buf
[0] = 0xa0; buf
[1] = 0xa0;
3868 usb_microdia_control_write(dev
, 0x1006, buf
, 2);
3871 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
3874 usb_microdia_control_write(dev
, 0x1020, buf
, 1);
3876 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
3877 buf
[3] = 0x10; buf
[4] = 0x08;
3878 usb_microdia_control_write(dev
, 0x1067, buf
, 5);
3880 buf
[0] = 0x92; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x00;
3881 buf
[3] = 0x00; buf
[4] = 0x1d; buf
[5] = 0x00;
3882 buf
[6] = 0xa2; buf
[7] = 0x10; buf
[8] = 0x03;
3883 usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
3885 usb_microdia_control_write(dev
, 0x10e0, urb10
, 24); // URB 10
3887 buf
[0] = 0x00; buf
[1] = 0x00; buf
[3] = 0x00;
3888 usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
3890 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3891 buf
[3] = 0xf0; buf
[4] = 0x00;
3892 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
3894 buf
[0] = 0x8a; buf
[1] = 0xcc; buf
[2] = 0x08;
3895 usb_microdia_control_write(dev
, 0x1188, buf
, 3);
3897 usb_microdia_control_write(dev
, 0x118b, urb14
, 22);
3899 buf
[0] = 0x00; buf
[1] = 0x00;
3900 usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
3902 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00;
3903 buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x40;
3904 buf
[6] = 0x01; buf
[7] = 0xf0; buf
[8] = 0x00;
3905 usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
3908 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3911 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3913 for (i
= 0; i
< 20; i
++) // URB 9-48
3914 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3915 first10c0
[i
][0], dev
->sensor_flags
, &first10c0
[i
][1]);
3918 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
3921 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 50
3924 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3927 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3930 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
3933 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3936 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
3939 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
3942 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
3945 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
3948 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, // URB 59-60
3949 second10c0a
[0], dev
->sensor_flags
, &second10c0a
[1]);
3951 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
3952 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
3954 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
3955 second10c0c
[0], dev
->sensor_flags
, &second10c0c
[1]);
3957 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3958 second10c0d
[0][0], dev
->sensor_flags
, &second10c0d
[0][1]);
3960 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
3961 second10c0d
[1][0], dev
->sensor_flags
, &second10c0d
[1][1]);
3963 buf
[0] = 0x3c; buf
[1] = 0x00; buf
[2] = 0x0b;
3964 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
3965 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
3967 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
3968 buf
[3] = 0xf0; buf
[4] = 0x00;
3969 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 70
3972 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
3974 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3975 usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
3977 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3978 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
3981 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
3984 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3987 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
3990 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
3993 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
3996 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
3999 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 80
4000 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4003 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4004 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4007 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4008 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4011 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4012 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4015 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4016 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4019 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 90
4020 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4023 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4024 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4027 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4028 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4031 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4033 for (i
= 0; i
< 5; i
++) // URB 97-106
4034 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4035 third10c0a
[i
][0], dev
->sensor_flags
, &third10c0a
[i
][1]);
4037 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
4038 third10c0b
[0], dev
->sensor_flags
, &third10c0b
[1]);
4041 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
4044 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 110
4047 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
4050 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
4053 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4056 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
4059 usb_microdia_control_write(dev
, 0x118d, buf
, 1);
4062 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
4065 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
4068 usb_microdia_control_write(dev
, 0x118b, buf
, 1);
4070 usb_microdia_control_write(dev
, 0x1190, urb119
, 17);
4072 for (i
= 0; i
< 9; i
++) // URB 120-128
4073 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21);
4077 usb_microdia_control_write(dev
, 0x10f7, buf
, 1);
4080 usb_microdia_control_write(dev
, 0x10f6, buf
, 1); // URB 130
4082 usb_microdia_control_write(dev
, 0x10e1, urb120
, 21);
4085 usb_microdia_control_write(dev
, 0x10f8, buf
, 1);
4088 usb_microdia_control_write(dev
, 0x10fa, buf
, 1);
4091 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
4094 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
4097 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4099 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
4100 usb_microdia_control_write(dev
, 0x11bc, buf
, 4);
4102 /* Set whole buf to 0x00 */
4104 usb_microdia_control_write(dev
, 0x11c0, buf
, 48);
4107 usb_microdia_control_write(dev
, 0x118c, buf
, 1);
4110 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 140
4113 usb_microdia_control_write(dev
, 0x118e, buf
, 1);
4116 usb_microdia_control_write(dev
, 0x118f, buf
, 1);
4118 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a;
4119 buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
4120 usb_microdia_control_write(dev
, 0x11a5, buf
, 6);
4122 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
4123 usb_microdia_control_write(dev
, 0x11af, buf
, 4);
4125 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
4126 usb_microdia_control_write(dev
, 0x11b3, buf
, 4);
4129 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4132 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4135 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4137 usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
4139 usb_microdia_control_write(dev
, 0x1140, qtable2
, 64); // URB 150
4142 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4145 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4148 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
4151 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
4154 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
4157 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
4160 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
4163 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
4165 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, // URB 159-160
4166 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
4168 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
4169 second10c0c
[0], dev
->sensor_flags
, &second10c0c
[1]);
4171 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4172 second10c0d
[0][0], dev
->sensor_flags
, &second10c0d
[0][1]);
4174 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4175 second10c0d
[1][0], dev
->sensor_flags
, &second10c0d
[1][1]);
4177 buf
[0] = 0x3c; buf
[1] = 0x00; buf
[2] = 0x0b;
4178 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
4179 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
4181 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
4182 buf
[3] = 0xf0; buf
[4] = 0x00;
4183 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
4186 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
4188 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
4189 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); // URB 170
4191 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
4192 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
4195 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4198 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4201 usb_microdia_control_write(dev
, 0x11b9, buf
, 1);
4204 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
4207 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4210 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
4213 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
4216 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
4219 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 180
4222 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
4225 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
4228 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4229 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4232 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4233 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4236 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4237 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4240 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4241 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 190
4244 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4245 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4248 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4249 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4252 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4253 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4256 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4257 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
4260 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
4262 for (i
= 0; i
< 3; i
++) // URB 200-205
4263 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
4264 third10c0a
[i
][0], dev
->sensor_flags
, &third10c0a
[i
][1]);
4266 for (i
= 0; i
< 4; i
++) // URB 206-225
4267 sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
,
4268 1, read10c0
[i
], dev
->sensor_flags
, buf
);
4271 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
4274 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
4277 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
4282 int microdia_624f_start_stream(struct usb_microdia
*dev
)
4286 __u8 eeprom_slave_id
= 0x50;
4287 __u8 eeprom_flags
= SN9C20X_I2C_2WIRE
;
4290 __u8 unknown1
[9] = { dev
->sensor_flags
, dev
->sensor_slave_address
,
4291 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
4295 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4296 if(ret
< 0) goto err
;
4300 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4301 if(ret
< 0) goto err
;
4305 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4306 if(ret
< 0) goto err
;
4310 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4311 if(ret
< 0) goto err
;
4315 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4316 if(ret
< 0) goto err
;
4320 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4321 if(ret
< 0) goto err
;
4325 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4326 if(ret
< 0) goto err
;
4328 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
4329 buf
[3] = 0x10; buf
[4] = 0x08;
4331 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
4332 if(ret
< 0) goto err
;
4334 /* this is the same register as the I2C write, not sure why
4335 * we're writing 9 bytes -- the SN9C102 docs say all writes
4336 * must be 8 bytes, but we don't have docs for SN9C20x */
4338 ret
= usb_microdia_control_write(dev
, command
, unknown1
, 9);
4339 if(ret
< 0) goto err
;
4341 buf
[0] = 0x44; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
4342 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
4343 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
4344 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
4345 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
4346 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
4348 ret
= usb_microdia_control_write(dev
, command
, buf
, 24);
4349 if(ret
< 0) goto err
;
4351 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
4353 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
4354 if(ret
< 0) goto err
;
4356 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
4357 buf
[3] = 0xf0; buf
[4] = 0x00;
4359 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
4360 if(ret
< 0) goto err
;
4362 buf
[0] = 0x87; buf
[1] = 0xcc; buf
[2] = 0x08;
4364 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
4365 if(ret
< 0) goto err
;
4367 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
4368 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
4369 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
4370 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
4371 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
4372 buf
[20] = 0xf4; buf
[21] = 0xff;
4374 ret
= usb_microdia_control_write(dev
, command
, buf
, 22);
4375 if(ret
< 0) goto err
;
4377 buf
[0] = 0x00; buf
[1] = 0x00;
4379 ret
= usb_microdia_control_write(dev
, command
, buf
, 2);
4380 if(ret
< 0) goto err
;
4382 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00; buf
[3] = 0x08;
4383 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
4386 ret
= usb_microdia_control_write(dev
, command
, buf
, 9);
4387 if(ret
< 0) goto err
;
4391 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4392 if(ret
< 0) goto err
;
4396 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4397 if(ret
< 0) goto err
;
4399 /* reset all SCCB registers to their default values */
4400 buf
[0] = OV965X_COM7_SCCB_RESET
;
4401 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM7
,
4402 dev
->sensor_flags
, buf
);
4403 if(ret
< 0) goto err
;
4405 buf
[0] = 0x7f; //0x7f; /* AGC setting */
4406 buf
[1] = 0xe0; /* blue gain setting */
4407 buf
[2] = 0x90; /* red gain setting */
4408 buf
[3] = OV965X_VREF_VSTOP_LOW3(0x04) | OV965X_VREF_VSTART_LOW3(0x02);
4409 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_GAIN
,
4410 dev
->sensor_flags
, buf
);
4411 if(ret
< 0) goto err
;
4414 this write appears to be unnecessary since we issued
4415 the reset above and the spec says that 0x00 is the default
4416 for all 4 of the registers we're writing to here
4419 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_COM1
,
4420 dev
->sensor_flags
, buf
);
4421 if(ret
< 0) goto err
;
4423 /* first byte still 0, not sure why, RAVE default is 0x00 too */
4425 buf
[1] = OV965X_COM2_OUTPUT_DRIVE_CAP_2X
;
4426 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, OV965X_CTL_RAVE
,
4427 dev
->sensor_flags
, buf
);
4428 if(ret
< 0) goto err
;
4430 buf
[0] = 0x00; buf
[1] = 0x00;
4431 /* not sure why we're setting bit 5 below, spec says it's reserved */
4432 buf
[2] = OV965X_COM5_15FPS_48MHZ_RGB
| 0x20;
4433 /* likewise, spec says 4 & 6 are reserved */
4434 buf
[3] = OV965X_COM6_TIMING_RESET_ON_FMT_CHANGE
| 0x50;
4435 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_COM3
,
4436 dev
->sensor_flags
, buf
);
4437 if(ret
< 0) goto err
;
4439 buf
[0] = 0xff; /* AEC bits 2-9 */
4440 buf
[1] = OV965X_CLKRC_INPUT_CLK_NO_SCALE
;
4441 buf
[2] = OV965X_COM7_OUTPUT_RAW_RGB
;
4442 buf
[3] = OV965X_COM8_FAST_AGC_AEC
| OV965X_COM8_AEC_STEP_SIZE_NOLIMIT
|
4443 /*OV965X_COM8_AGC_ENABLE |*/ OV965X_COM8_AEC_ENABLE
| OV965X_COM8_AWB_ENABLE
;
4444 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_AECH
,
4445 dev
->sensor_flags
, buf
);
4446 if(ret
< 0) goto err
;
4448 buf
[0] = OV965X_COM9_MAX_AGC_8X
| OV965X_COM9_RELAX_EXPOSURE_TIMING
|
4449 OV965X_COM9_DROP_VSYNC_ON_FRAME_DROP
|
4450 OV965X_COM9_DROP_FRAME_ON_BIG_AEC
;
4452 buf
[2] = 0x07; /* hmm, spec says this is reserved */
4453 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3, OV965X_CTL_COM9
,
4454 dev
->sensor_flags
, buf
);
4455 if(ret
< 0) goto err
;
4457 /* this is supposed to be reserved too */
4458 buf
[0] = 0x04; buf
[1] = 0x00;
4459 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, OV965X_CTL_MVFP
,
4460 dev
->sensor_flags
, buf
);
4461 if(ret
< 0) goto err
;
4463 buf
[0] = 0x78; /* this is the default! */
4464 buf
[1] = 0x68; /* this is the default! */
4465 buf
[2] = 0xd4; /* this is the default! */
4466 buf
[3] = 0x80; /* this is the default! */
4467 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_AEW
,
4468 dev
->sensor_flags
, buf
);
4469 if(ret
< 0) goto err
;
4471 buf
[0] = OV965X_BIAS_SUBTRACT
;
4472 buf
[1] = OV965X_Gr_COM_BYPASS_ANALOG_BLC
| OV965X_Gr_COM_BYPASS_REGULATOR
;
4473 buf
[2] = 0x00; buf
[3] = 0x00;
4474 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_GbBIAS
,
4475 dev
->sensor_flags
, buf
);
4476 if(ret
< 0) goto err
;
4478 buf
[0] = OV965X_BIAS_SUBTRACT
;
4479 buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
4480 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_RBIAS
,
4481 dev
->sensor_flags
, buf
);
4482 if(ret
< 0) goto err
;
4484 buf
[0] = 0x08; /* HSYNC rising edge start */
4485 buf
[1] = 0x30; /* HSYNC rising edge end */
4486 buf
[2] = OV965X_HREF_EDGE_OFT_TO_DATA_OUT(2) | OV965X_HREF_HSTART_LOW3(6)
4487 | OV965X_HREF_HSTOP_LOW3(4);
4488 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3, OV965X_CTL_HSYST
,
4489 dev
->sensor_flags
, buf
);
4490 if(ret
< 0) goto err
;
4492 /* the docs say all 4 of these bytes are reserved */
4493 buf
[0] = 0xe2; buf
[1] = 0xbf; buf
[2] = 0x81; buf
[3] = 0xf9;
4494 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_CHLF
,
4495 dev
->sensor_flags
, buf
);
4496 if(ret
< 0) goto err
;
4498 /* the docs say these 2 bytes are reserved */
4499 buf
[0] = 0x00; buf
[1] = 0x93;
4500 buf
[2] = 0x50; /* bits 4 and 6 are supposedly reserved */
4501 buf
[3] = OV965X_TSLB_OUTPUT_SEQ_UYVY
| OV965X_TSLB_DIGITAL_BLC_ENABLE
;
4502 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_ADC
,
4503 dev
->sensor_flags
, buf
);
4504 if(ret
< 0) goto err
;
4506 buf
[0] = OV965X_COM11_MANUAL_BANDING_FILTER
;
4507 buf
[1] = 0x73; /* these bits all reserved */
4508 buf
[2] = OV965X_COM13_ENABLE_COLOR_MATRIX
| OV965X_COM13_DELAY_Y_CHANNEL
4509 | OV965X_COM13_OUTPUT_DELAY(1);
4510 buf
[3] = OV965X_COM14_YUV_EDGE_ENHANCE
4511 | OV965X_COM14_EDGE_ENHANCE_FACTOR_DBL
4512 | 0x0b; /* these last bits supposedly reserved */
4513 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_COM11
,
4514 dev
->sensor_flags
, buf
);
4515 if(ret
< 0) goto err
;
4517 buf
[0] = OV965X_EDGE_EDGE_ENHANCE_LOW4(8)
4518 | OV965X_EDGE_EDGE_ENHANCE_FACTOR(8);
4519 buf
[1] = OV965X_COM15_OUTPUT_RANGE_O0_TO_FF
| 0x01; /* bit reserved */
4520 buf
[2] = 0x00; buf
[3] = 0x08; /* this bit supposedly reserved */
4521 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_EDGE
,
4522 dev
->sensor_flags
, buf
);
4523 if(ret
< 0) goto err
;
4526 /* OV9653 control register 0x43 is reserved, according to the docs */
4527 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x43,
4528 dev
->sensor_flags
, buf
); // 'Dummy'-write
4529 if(ret
< 0) goto err
;
4531 buf
[0] = 0x80; buf
[1] = 0x80; buf
[2] = 0x40; buf
[3] = 0x00;
4532 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_MANU
,
4533 dev
->sensor_flags
, buf
);
4534 if(ret
< 0) goto err
;
4537 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DBLV
,
4538 dev
->sensor_flags
, buf
);
4539 if(ret
< 0) goto err
;
4541 buf
[0] = 0x06; buf
[1] = 0x20; buf
[2] = 0x00; buf
[3] = 0x00;
4542 /* OV9653 control register 0x8b is reserved, according to the docs */
4543 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x8b,
4544 dev
->sensor_flags
, buf
);
4545 if(ret
< 0) goto err
;
4548 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DBLC1
,
4549 dev
->sensor_flags
, buf
);
4550 if(ret
< 0) goto err
;
4552 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x88; buf
[3] = 0x88;
4553 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_DM_LNL
,
4554 dev
->sensor_flags
, buf
);
4555 if(ret
< 0) goto err
;
4558 /* control reg 0x96 reserved, according to docs */
4559 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x96,
4560 dev
->sensor_flags
, buf
);
4561 if(ret
< 0) goto err
;
4564 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM26
,
4565 dev
->sensor_flags
, buf
);
4566 if(ret
< 0) goto err
;
4568 buf
[0] = 0x80; buf
[1] = 0xb8; buf
[2] = 0x92; buf
[3] = 0x0a;
4569 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_ACOM2
,
4570 dev
->sensor_flags
, buf
);
4571 if(ret
< 0) goto err
;
4573 /* reserved, according to docs */
4574 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0xac,
4575 dev
->sensor_flags
, NULL
);
4576 if(ret
< 0) goto err
;
4578 buf
[0] = 0x1b; buf
[1] = 0xbb; buf
[2] = 0x05; buf
[3] = 0x7d;
4579 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_HSTART
,
4580 dev
->sensor_flags
, buf
);
4581 if(ret
< 0) goto err
;
4584 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_PSHIFT
,
4585 dev
->sensor_flags
, buf
);
4586 if(ret
< 0) goto err
;
4588 /* now for some reason it switches to these two reads and
4589 * then back to the long init sequence */
4591 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); /* reads 30 */
4592 if(ret
< 0) goto err
;
4593 //msg("Should read 0x30, read: %x", buf[0]);
4596 buf
[0] = eeprom_slave_id
;
4597 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4598 if(ret
< 0) goto err
;
4600 // TRY TO READ FROM EEPROM:
4601 ret
= sn9c20x_read_i2c_data(dev
, eeprom_slave_id
, 1, 0x00, eeprom_flags
, buf
);
4604 UDIA_INFO("No EEPROM found\n");
4608 UDIA_INFO("Read from EEPROM successful\n");
4609 /* returns 0xff -- don't know what we're supposed to do w/ that info */
4610 //msg("Read from eeprom, should read 0xff, read: %x", buf[0]);
4614 buf
[0] = dev
->sensor_slave_address
;
4615 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4616 if(ret
< 0) goto err
;
4620 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4621 if(ret
< 0) goto err
;
4625 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4626 if(ret
< 0) goto err
;
4630 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4631 if(ret
< 0) goto err
;
4635 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4636 if(ret
< 0) goto err
;
4640 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4641 if(ret
< 0) goto err
;
4645 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4646 if(ret
< 0) goto err
;
4650 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4651 if (ret
< 0) goto err
;
4655 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4656 if (ret
< 0) goto err
;
4660 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4661 if (ret
< 0) goto err
;
4665 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4666 if (ret
< 0) goto err
;
4669 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM7
,
4670 dev
->sensor_flags
, buf
);
4671 if(ret
< 0) goto err
;
4674 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_VREF
,
4675 dev
->sensor_flags
, buf
);
4676 if(ret
< 0) goto err
;
4678 buf
[0] = 0x24; buf
[1] = 0xc5; buf
[2] = 0x00; buf
[3] = 0x3c;
4679 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, OV965X_CTL_HSTART
,
4680 dev
->sensor_flags
, buf
);
4681 if(ret
< 0) goto err
;
4683 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, OV965X_CTL_PSHIFT
,
4684 dev
->sensor_flags
, NULL
);
4685 if(ret
< 0) goto err
;
4688 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_HREF
,
4689 dev
->sensor_flags
, buf
);
4690 if(ret
< 0) goto err
;
4693 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x07; buf
[3] = 0x00;
4694 buf
[4] = 0x28; buf
[5] = 0x3c;
4695 ret
= usb_microdia_control_write(dev
, command
, buf
, 6);
4696 if(ret
< 0) goto err
;
4699 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
4701 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
4702 if(ret
< 0) goto err
;
4706 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4707 if(ret
< 0) goto err
;
4710 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
4711 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
4712 if(ret
< 0) goto err
;
4715 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
4716 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
4717 if(ret
< 0) goto err
;
4721 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4722 if(ret
< 0) goto err
;
4726 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4727 if(ret
< 0) goto err
;
4731 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4732 if(ret
< 0) goto err
;
4737 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4738 if(ret
< 0) goto err
;
4742 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4743 if(ret
< 0) goto err
;
4747 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4748 if(ret
< 0) goto err
;
4752 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4753 if(ret
< 0) goto err
;
4754 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x38
4755 if(ret
< 0) goto err
;
4758 else if (buf
[0] == 0xb8)
4760 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4761 if(ret
< 0) goto err
;
4762 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x39
4763 if(ret
< 0) goto err
;
4766 else if (buf
[0] == 0xb9)
4768 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4769 if(ret
< 0) goto err
;
4770 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3a
4771 if(ret
< 0) goto err
;
4774 else if (buf
[0] == 0xba)
4776 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4777 if(ret
< 0) goto err
;
4778 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3b
4779 if(ret
< 0) goto err
;
4782 else if (buf
[0] == 0xbb)
4784 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4785 if(ret
< 0) goto err
;
4786 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3c
4787 if(ret
< 0) goto err
;
4788 last_11b8
[0] = buf
[0];
4789 buf
[0] = last_11b8
[0] & 0xf0; // 0xf0 or 0x70
4790 buf
[0] = buf
[0] | 0x0a; // => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 5 READS/WRITES
4791 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4792 if(ret
< 0) goto err
;
4795 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_CLKRC
,
4796 dev
->sensor_flags
, buf
);
4797 if(ret
< 0) goto err
;
4801 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCH
,
4802 dev
->sensor_flags
, buf
);
4803 if(ret
< 0) goto err
;
4806 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCL
,
4807 dev
->sensor_flags
, buf
);
4808 if(ret
< 0) goto err
;
4811 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNL
,
4812 dev
->sensor_flags
, buf
);
4813 if(ret
< 0) goto err
;
4817 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNH
,
4818 dev
->sensor_flags
, buf
);
4819 if(ret
< 0) goto err
;
4822 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MVFP
,
4823 dev
->sensor_flags
, buf
);
4824 if(ret
< 0) goto err
;
4826 /* is it really necessary to do this same write again?; 627f does this, too */
4828 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MVFP
,
4829 dev
->sensor_flags
, buf
);
4830 if(ret
< 0) goto err
;
4835 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4836 if(ret
< 0) goto err
;
4839 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_AECH
,
4840 dev
->sensor_flags
, buf
);
4841 if(ret
< 0) goto err
;
4844 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_COM1
,
4845 dev
->sensor_flags
, buf
);
4846 if(ret
< 0) goto err
;
4850 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_AECHM
,
4851 dev
->sensor_flags
, buf
);
4852 if(ret
< 0) goto err
;
4855 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_ADVFL
,
4856 dev
->sensor_flags
, buf
);
4857 if(ret
< 0) goto err
;
4861 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_ADVFH
,
4862 dev
->sensor_flags
, buf
);
4863 if(ret
< 0) goto err
;
4867 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_GAIN
,
4868 dev
->sensor_flags
, buf
);
4869 if(ret
< 0) goto err
;
4872 buf
[0] = 0x78; /*buf[1] = 0x78;*/
4873 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_BLUE
,
4874 dev
->sensor_flags
, buf
);
4875 if(ret
< 0) goto err
;
4878 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_RED
,
4879 dev
->sensor_flags
, buf
);
4880 if(ret
< 0) goto err
;
4881 // 627f does the last two writes at once (2 byte write to OV965X_CTL_BLUE)
4885 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4886 if(ret
< 0) goto err
;
4890 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4891 if(ret
< 0) goto err
;
4895 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4896 if(ret
< 0) goto err
;
4900 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4901 if(ret
< 0) goto err
;
4906 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4907 if(ret
< 0) goto err
;
4911 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4912 if(ret
< 0) goto err
;
4917 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4918 if(ret
< 0) goto err
;
4922 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4923 if(ret
< 0) goto err
;
4927 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4928 if(ret
< 0) goto err
;
4930 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4935 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
4936 if(ret
< 0) goto err
;
4939 /* Gamma control? */
4941 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4943 buf
[0] = 0x08; buf
[1] = 0x23; buf
[2] = 0x37; buf
[3] = 0x48;
4944 buf
[4] = 0x59; buf
[5] = 0x68; buf
[6] = 0x77; buf
[7] = 0x85;
4945 buf
[8] = 0x93; buf
[9] = 0xa1; buf
[10] = 0xae; buf
[11] = 0xba;
4946 buf
[12] = 0xc7; buf
[13] = 0xd3; buf
[14] = 0xe0; buf
[15] = 0xeb;
4951 /*buf[0] = 0x0a; buf[1] = 0x37; buf[2] = 0x58; buf[3] = 0x70;
4952 buf[4] = 0x81; buf[5] = 0x8f; buf[6] = 0x9c; buf[7] = 0xa9;
4953 buf[8] = 0xb5; buf[9] = 0xbe; buf[10] = 0xc8; buf[11] = 0xd1;
4954 buf[12] = 0xda; buf[13] = 0xe2; buf[14] = 0xec; buf[15] = 0xf0;
4958 buf
[0] = 0x00; buf
[1] = 0x2a; buf
[2] = 0x42; buf
[3] = 0x56;
4959 buf
[4] = 0x67; buf
[5] = 0x78; buf
[6] = 0x87; buf
[7] = 0x95;
4960 buf
[8] = 0xa2; buf
[9] = 0xaf; buf
[10] = 0xbc; buf
[11] = 0xc8;
4961 buf
[12] = 0xd4; buf
[13] = 0xdf; buf
[14] = 0xea; buf
[15] = 0xf5;
4964 ret
= usb_microdia_control_write(dev
, command
, buf
, 17);
4965 if(ret
< 0) goto err
;
4967 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4969 buf
[0] = 0xf3; buf
[1] = 0x0f; buf
[2] = 0xf3; buf
[3] = 0x0f;
4970 buf
[4] = 0x0f; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
4971 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
4972 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
4973 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0c; buf
[19] = 0x00;
4979 for(i
= 0; i
< 8; i
++)
4980 ret
= usb_microdia_control_write(dev
, command
, buf
, 21);
4982 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
4984 buf
[0] = 0x0f; buf
[1] = 0x00; buf
[2] = 0x15; buf
[3] = 0x00;
4985 buf
[4] = 0x1a; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
4986 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
4987 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
4988 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0c; buf
[19] = 0x00;
4994 buf
[0] = 0x15; buf
[2] = 0x29;
4996 ret
= usb_microdia_control_write(dev
, command
, buf
, 21);
4997 if (ret
< 0) goto err
;
5001 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5002 if(ret
< 0) goto err
;
5004 command
= 0x10f6; // picture sharpness
5005 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5008 buf
[0] = 0x00; // 624f-log: 0xc0 !
5009 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5010 if(ret
< 0) goto err
;
5014 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5016 buf
[0] = 0x0f; buf
[1] = 0x00; buf
[2] = 0x15; buf
[3] = 0x00;
5017 buf
[4] = 0x1a; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5018 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5019 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5020 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0c; buf
[19] = 0x00;
5026 buf
[0] = 0x15; buf
[2] = 0x29; buf
[4] = 0x08;
5028 ret
= usb_microdia_control_write(dev
, command
, buf
, 21);
5029 if(ret
< 0) goto err
;
5033 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5034 if(ret
< 0) goto err
;
5039 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5040 if(ret
< 0) goto err
;
5044 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5045 if(ret
< 0) goto err
;
5050 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5051 if(ret
< 0) goto err
;
5055 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5056 if(ret
< 0) goto err
;
5058 //memset(buf, 0, 4);
5060 buf
[0] = 0x80; buf
[1] = 0x02; buf
[2] = 0xe0; buf
[3] = 0x01;
5061 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5062 if(ret
< 0) goto err
;
5065 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5067 buf
[0] = 0x19; buf
[1] = 0x31; buf
[2] = 0x44; buf
[3] = 0x50;
5068 buf
[4] = 0x52; buf
[5] = 0x56; buf
[6] = 0x5b; buf
[7] = 0x61;
5069 buf
[8] = 0x65; buf
[9] = 0x6a; buf
[10] = 0x6c; buf
[11] = 0x6e;
5070 buf
[12] = 0x70; buf
[13] = 0x72; buf
[14] = 0x74; buf
[15] = 0x76;
5071 buf
[16] = 0x1a; buf
[17] = 0x31; buf
[18] = 0x44; buf
[19] = 0x51;
5072 buf
[20] = 0x54; buf
[21] = 0x57; buf
[22] = 0x5c; buf
[23] = 0x61;
5073 buf
[24] = 0x66; buf
[25] = 0x6b; buf
[26] = 0x6d; buf
[27] = 0x6f;
5074 buf
[28] = 0x71; buf
[29] = 0x73; buf
[30] = 0x75; buf
[31] = 0x76;
5075 buf
[32] = 0x1b; buf
[33] = 0x32; buf
[34] = 0x44; buf
[35] = 0x50;
5076 buf
[36] = 0x50; buf
[37] = 0x54; buf
[38] = 0x59; buf
[39] = 0x5e;
5077 buf
[40] = 0x63; buf
[41] = 0x67; buf
[42] = 0x6a; buf
[43] = 0x6c;
5078 buf
[44] = 0x6e; buf
[45] = 0x70; buf
[46] = 0x72; buf
[47] = 0x73;
5082 buf
[0] = 0x10; buf
[1] = 0x21; buf
[2] = 0x34; buf
[3] = 0x40;
5083 buf
[4] =0x47; buf
[5] = 0x4F; buf
[6] = 0x57; buf
[7] = 0x5F;
5084 buf
[8] = 0x64; buf
[9] = 0x68; buf
[10] = 0x6D; buf
[11] = 0x73;
5085 buf
[12] = 0x79; buf
[13] = 0x80; buf
[14] = 0x89; buf
[15] = 0x97;
5086 buf
[16] = 0x0D; buf
[17] = 0x1C; buf
[18] = 0x2A; buf
[19] = 0x33;
5087 buf
[20] = 0x38; buf
[21] = 0x3D; buf
[22] = 0x44; buf
[23] = 0x4A;
5088 buf
[24] = 0x4E; buf
[25] = 0x52; buf
[26] = 0x56; buf
[27] = 0x5B;
5089 buf
[28] = 0x61; buf
[29] = 0x68; buf
[30] = 0x6F; buf
[31] = 0x7A;
5090 buf
[32] = 0x0D; buf
[33] = 0x1A; buf
[34] = 0x2A; buf
[35] = 0x31;
5091 buf
[36] = 0x36; buf
[37] = 0x3B; buf
[38] = 0x41; buf
[39] = 0x47;
5092 buf
[40] = 0x4A; buf
[41] = 0x4E; buf
[42] = 0x53; buf
[43] = 0x58;
5093 buf
[44] = 0x5D; buf
[45] = 0x64; buf
[46] = 0x6B; buf
[47] = 0x76;
5095 ret
= usb_microdia_control_write(dev
, command
, buf
, 48);
5099 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5100 if(ret
< 0) goto err
;
5105 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5106 if(ret
< 0) goto err
;
5110 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5111 if(ret
< 0) goto err
;
5115 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5116 if(ret
< 0) goto err
;
5120 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
5121 buf
[4] = 0x04; buf
[5] = 0x3f;
5122 ret
= usb_microdia_control_write(dev
, command
, buf
, 6);
5123 if(ret
< 0) goto err
;
5127 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
5128 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5129 if(ret
< 0) goto err
;
5132 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
5133 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5134 if(ret
< 0) goto err
;
5139 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5140 if(ret
< 0) goto err
;
5144 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5145 if(ret
< 0) goto err
;
5149 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5150 if(ret
< 0) goto err
;
5153 //////////////////////////////////////////////////////////////////////
5156 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
5157 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
5158 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
5159 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
5160 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
5161 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
5162 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
5163 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
5164 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
5165 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
5166 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
5167 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
5168 buf
[48] = 0x4f; buf
[49] = 0x54; buf
[50] = 0x58; buf
[51] = 0x58;
5169 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
5170 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x54; buf
[59] = 0x64;
5171 buf
[60] = 0x4b; buf
[61] = 0x54; buf
[62] = 0x58; buf
[63] = 0x54;
5172 ret
= usb_microdia_control_write(dev
, command
, buf
, 64);
5173 if(ret
< 0) goto err
;
5176 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
5177 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
5178 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x54; buf
[11] = 0x36;
5179 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x54; buf
[15] = 0x54;
5180 buf
[16] = 0x54; buf
[17] = 0x54; buf
[18] = 0x54; buf
[19] = 0x54;
5181 buf
[20] = 0x54; buf
[21] = 0x54; buf
[22] = 0x54; buf
[23] = 0x54;
5182 buf
[24] = 0x54; buf
[25] = 0x54; buf
[26] = 0x54; buf
[27] = 0x54;
5183 buf
[28] = 0x54; buf
[29] = 0x54; buf
[30] = 0x54; buf
[31] = 0x54;
5184 buf
[32] = 0x54; buf
[33] = 0x54; buf
[34] = 0x54; buf
[35] = 0x54;
5185 buf
[36] = 0x54; buf
[37] = 0x54; buf
[38] = 0x54; buf
[39] = 0x54;
5186 buf
[40] = 0x54; buf
[41] = 0x54; buf
[42] = 0x54; buf
[43] = 0x54;
5187 buf
[44] = 0x54; buf
[45] = 0x54; buf
[46] = 0x54; buf
[47] = 0x54;
5188 buf
[48] = 0x54; buf
[49] = 0x54; buf
[50] = 0x54; buf
[51] = 0x54;
5189 buf
[52] = 0x54; buf
[53] = 0x54; buf
[54] = 0x54; buf
[55] = 0x54;
5190 buf
[56] = 0x54; buf
[57] = 0x54; buf
[58] = 0x54; buf
[59] = 0x54;
5191 buf
[60] = 0x54; buf
[61] = 0x54; buf
[62] = 0x54; buf
[63] = 0x54;
5192 ret
= usb_microdia_control_write(dev
, command
, buf
, 64);
5193 if(ret
< 0) goto err
;
5198 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5199 if(ret
< 0) goto err
;
5203 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5204 if(ret
< 0) goto err
;
5209 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5210 if(ret
< 0) goto err
;
5214 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5215 if(ret
< 0) goto err
;
5219 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5220 if(ret
< 0) goto err
;
5224 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5225 if(ret
< 0) goto err
;
5229 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5230 if(ret
< 0) goto err
;
5234 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5235 if(ret
< 0) goto err
;
5239 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x07; buf
[3] = 0x00;
5240 buf
[4] = 0x28; buf
[5] = 0x3c;
5241 ret
= usb_microdia_control_write(dev
, command
, buf
, 6);
5242 if(ret
< 0) goto err
;
5245 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
5247 ret
= usb_microdia_control_write(dev
, command
, buf
, 5);
5248 if(ret
< 0) goto err
;
5252 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5253 if(ret
< 0) goto err
;
5256 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
5257 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5258 if(ret
< 0) goto err
;
5262 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
5263 ret
= usb_microdia_control_write(dev
, command
, buf
, 4);
5264 if(ret
< 0) goto err
;
5268 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5269 if(ret
< 0) goto err
;
5273 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5274 if(ret
< 0) goto err
;
5278 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5279 if(ret
< 0) goto err
;
5283 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5284 if(ret
< 0) goto err
;
5288 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5289 if(ret
< 0) goto err
;
5293 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5294 if(ret
< 0) goto err
;
5298 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5299 if(ret
< 0) goto err
;
5304 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5305 if(ret
< 0) goto err
;
5309 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5310 if(ret
< 0) goto err
;
5314 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5315 if(ret
< 0) goto err
;
5320 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5321 if(ret
< 0) goto err
;
5324 if (last_11b8
[0] == 0x3c)
5326 else if (last_11b8
[0] == 0xbc)
5328 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5329 if(ret
< 0) goto err
;
5330 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0xb8 627f: 0x38
5331 if(ret
< 0) goto err
;
5334 else if (buf
[0] == 0xb8)
5336 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5337 if(ret
< 0) goto err
;
5338 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0xb9 627f: 0x39
5339 if(ret
< 0) goto err
;
5342 else if (buf
[0] == 0xb9)
5344 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5345 if(ret
< 0) goto err
;
5346 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 0x3a
5347 if(ret
< 0) goto err
;
5350 else if (buf
[0] == 0xba)
5352 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5353 if(ret
< 0) goto err
;
5354 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0x3b 627f: 0xbb
5355 if(ret
< 0) goto err
;
5358 else if (buf
[0] == 0xbb)
5360 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5361 if(ret
< 0) goto err
;
5362 ret
= usb_microdia_control_read(dev
, command
, buf
, 1); // 624f: 0x3c 627f: 0xbc
5363 if(ret
< 0) goto err
;
5364 buf
[0] = buf
[0] & 0xf0; // 0xf0 or 0x70
5365 if (dev
->webcam_model
== CAMERA_MODEL(USB_0C45_VID
, USB_627F_PID
))
5366 buf
[0] = buf
[0] | 0x09; // THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 5 READS/WRITES
5368 buf
[0] = buf
[0] | 0x08; // THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 5 READS/WRITES
5369 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5370 if(ret
< 0) goto err
;
5373 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_CLKRC
,
5374 dev
->sensor_flags
, buf
);
5375 if(ret
< 0) goto err
;
5378 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCH
,
5379 dev
->sensor_flags
, buf
);
5380 if(ret
< 0) goto err
;
5383 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_EXHCL
,
5384 dev
->sensor_flags
, buf
);
5385 if(ret
< 0) goto err
;
5388 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNL
,
5389 dev
->sensor_flags
, buf
);
5390 if(ret
< 0) goto err
;
5393 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_DM_LNH
,
5394 dev
->sensor_flags
, buf
);
5395 if(ret
< 0) goto err
;
5397 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_PID
,
5398 dev
->sensor_flags
, buf
);
5399 /* returns 96, no idea what we're supposed to do with it */
5400 if(ret
< 0) goto err
;
5401 //msg("sensor pid, should be 0x96: %x", buf[0]);
5404 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_VER
,
5405 dev
->sensor_flags
, buf
);
5406 /* returns 52, no idea what we're supposed to do with it */
5407 if(ret
< 0) goto err
;
5408 //msg("sensor ver, should be 0x52: %x", buf[0]);
5411 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MIDH
,
5412 dev
->sensor_flags
, buf
);
5413 /* returns 7f, no idea what we're supposed to do with it */
5414 if(ret
< 0) goto err
;
5415 //msg("sensor midh, should be 0x7f: %x", buf[0]);
5418 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, OV965X_CTL_MIDL
,
5419 dev
->sensor_flags
, buf
);
5420 /* returns a2, no idea what we're supposed to do with it */
5421 if(ret
< 0) goto err
;
5422 //msg("sensor midl, should be 0xa2: %x", buf[0]);
5426 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
5427 if(ret
< 0) goto err
;
5428 //////////////////////////////////////////////////////////////////////////////////
5430 //////////////////////////////////////////////////////////////////////////////////
5432 /* --- ADJUSTMENTS OF SHARPNESS, COLORS, CONTRAST, BRIGHTNESS ---
5433 * SHOULD BE REMOVED (writes to 0x10e1 and 0x10f6 are done again afterwards by dev_microdia_camera_settings() )
5434 * => NOT done by device 627f
5435 * => NOT in the 624f-log from 15-feb-08 at files.zenum.net
5440 ret = usb_microdia_control_write(dev, command, buf, 1);
5441 if(ret < 0) goto err;
5444 buf[0] = 0x15; buf[1] = 0x00; buf[2] = 0x29; buf[3] = 0x00;
5445 buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xF7; buf[7] = 0x0F;
5446 buf[8] = 0xC2; buf[9] = 0x0F; buf[10] = 0x47; buf[11] = 0x00;
5447 buf[12] = 0x36; buf[13] = 0x00; buf[14] = 0xDD ; buf[15] = 0x0F;
5448 buf[16] = 0xEE; buf[17] = 0x0F; buf[18] = 0x00; buf[19] = 0x00;
5450 ret = usb_microdia_control_write(dev, command, buf, 21);
5451 if(ret < 0) goto err;
5453 buf[0] = 0x7d; buf[1] = 0x00;
5454 ret = sn9c20x_read_i2c_data(dev, dev->sensor_slave_address, 1, 0x2d,
5455 dev->sensor_flags, buf);
5458 ret = sn9c20x_read_i2c_data(dev, dev->sensor_slave_address, 1, 0x00,
5459 dev->sensor_flags, buf);
5463 buf[0] = 0x15; buf[1] = 0x00; buf[2] = 0x29; buf[3] = 0x00;
5464 buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xF7; buf[7] = 0x0F;
5465 buf[8] = 0xC2; buf[9] = 0x0F; buf[10] = 0x47; buf[11] = 0x00;
5466 buf[12] = 0x36; buf[13] = 0x00; buf[14] = 0xDD ; buf[15] = 0x0F;
5467 buf[16] = 0xEE; buf[17] = 0x0F; buf[18] = 0x00; buf[19] = 0x00;
5469 ret = usb_microdia_control_write(dev, command, buf, 21);
5470 if(ret < 0) goto err;
5472 // These 2 regs controls brightness of image
5473 // (night mode or something like that)
5475 ret = sn9c20x_read_i2c_data(dev, dev->sensor_slave_address, 2, 0x2d,
5476 dev->sensor_flags, buf);
5477 //msg("Old brightness value: %x %x", buf[0], buf[1]);
5478 buf[0] = 0x00; buf[1] = 0x04;
5479 ret = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 2, 0x2d,
5480 dev->sensor_flags, buf);
5485 ret = usb_microdia_control_write(dev, command, buf, 1);
5489 buf[0] = 0x15; buf[1] = 0x00; buf[2] = 0x29; buf[3] = 0x00;
5490 buf[4] = 0x08; buf[5] = 0x00; buf[6] = 0xF7; buf[7] = 0x0F;
5491 buf[8] = 0xC2; buf[9] = 0x0F; buf[10] = 0x47; buf[11] = 0x00;
5492 buf[12] = 0x36; buf[13] = 0x00; buf[14] = 0xdd ; buf[15] = 0x0F;
5493 buf[16] = 0xEE; buf[17] = 0x0F; buf[18] = 0x00; buf[19] = 0x00;
5495 ret = usb_microdia_control_write(dev, command, buf, 21);
5496 if(ret < 0) goto err;
5500 ret = sn9c20x_write_i2c_data(dev, dev->sensor_slave_address, 1, 0x01,
5501 dev->sensor_flags, buf);
5502 // THIS WRITE WILL NEVER BE DONE, because function returned before
5507 UDIA_ERROR("start stream: command %x failed (%d)!\n", command
, ret
);
5511 int microdia_6260_start_stream(struct usb_microdia
*dev
)
5516 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
5518 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
5520 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
5522 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
5524 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
5526 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5528 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
5530 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5532 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5534 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
5536 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10;
5538 ret
= usb_microdia_control_write(dev
, 0x1067, buf
, 5);
5540 buf
[0] = 0x80; buf
[1] = 0x21; buf
[2] = 0x00; buf
[3] = 0x00;
5541 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5543 ret
= usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
5545 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
5546 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
5547 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
5548 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
5549 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
5550 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
5551 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 24);
5553 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
5554 ret
= usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
5556 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
5558 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
5560 buf
[0] = 0x8a; buf
[1] = 0x8c; buf
[2] = 0x08;
5561 ret
= usb_microdia_control_write(dev
, 0x1188, buf
, 3);
5563 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
5564 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
5565 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
5566 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
5567 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
5568 buf
[20] = 0xf4; buf
[21] = 0xff;
5569 ret
= usb_microdia_control_write(dev
, 0x118b, buf
, 22);
5571 buf
[0] = 0x00; buf
[1] = 0x00;
5572 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
5574 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x00;
5575 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
5577 ret
= usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
5580 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5583 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5585 ret
= ov7670_initialise(dev
);
5587 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x3b, dev
->sensor_flags
, buf
);
5588 ret
= usb_microdia_control_read(dev
, 0x10c1, buf
, 1);
5590 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
5592 /* TRY TO READ FROM EEPROM: */
5593 ret
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, dev
->sensor_flags
, buf
);
5595 UDIA_INFO("No EEPROM found\n");
5597 UDIA_INFO("Read from EEPROM successful\n");
5600 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
5602 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
5604 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
5606 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
5608 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
5609 buf
[4] = 0x50; buf
[5] = 0x3c;
5610 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
5612 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
5614 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
5617 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
5619 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
5620 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
5622 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
5623 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
5625 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5627 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5629 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5631 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5633 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
5635 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
5637 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5638 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5640 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5641 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5643 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5644 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5646 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5647 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5649 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5650 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5652 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5653 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5655 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5657 /* OV7670 Intialise Part 2 */
5658 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
5659 buf
[4] = 0x50; buf
[5] = 0x3c;
5660 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
5662 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
5664 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
5667 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
5669 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
5670 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
5672 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
5673 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
5676 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5678 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5680 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
5682 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5684 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
5686 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5688 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
5690 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
5692 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5693 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5695 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5696 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5698 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5699 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5701 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5702 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5704 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5705 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5707 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5708 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
5710 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
5712 /* OV7670 Initialisation Part 3 Goes Here */
5714 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
5716 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5717 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5718 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5719 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5720 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5722 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5724 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5725 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5726 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5727 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5728 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5730 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5732 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5733 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5734 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5735 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5736 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5738 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5740 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5741 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5742 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5743 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5744 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x0a; buf
[19] = 0x00;
5746 ret
= usb_microdia_control_write(dev
, 0x10e1, buf
, 21);
5752 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
5756 * @returns 0 (ok) or -1 (error)
5760 * Windows driver versions: 5.7.23.000
5761 * Windows versions: 2000 and XP
5762 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
5763 * All logs were made using AMCAP with 640x480, RGB24
5765 int microdia_6270_start_stream(struct usb_microdia
*dev
)
5772 // Check if sensor slave address is valid:
5773 if ((dev
->sensor_slave_address
!= MT9V111_I2C_SLAVE_ADDRESS
) && (dev
->sensor_slave_address
!= MT9V011_I2C_SLAVE_ADDRESS
))
5775 UDIA_INFO("microdia_6270_start_stream(): Invalid sensor slave address !\n");
5779 // <= INTERRUPT COMING BACK (URB 1953)
5780 // SWITCH TO ALTERNATE SETTINGS 8 (URB 1954) // NOT IN ALEX'S LOG
5781 // => INTERRUPT GOING DOWN (URB 1955)
5784 usb_microdia_control_write(dev
, 0x1066, buf
, 1); // URB 1956
5786 // <= INTERRUPT COMING BACK (URB 1955)
5787 // => INTERRUPT GOING DOWN (URB 1957)
5790 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 1958
5792 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 1959
5794 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 1960
5796 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 1961
5798 usb_microdia_control_write(dev
, 0x1020, buf
, 1); // URB 1962
5799 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
5800 usb_microdia_control_write(dev
, 0x1067, buf
, 5); // URB 1963
5802 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5803 // STRANGE I2C MESSAGE:
5805 // - byte 8 = 0x00 at first start + first cycle
5806 // - procedure not complete: no wait/check for ack/error, no readout of 0x10c2
5807 // - dummy writes at first cycle and read at second cycle, but there are many I2C messages in the meantime, so this should not work
5809 // AT FIRST START + FIRST CYCLE:
5810 buf
[0] = 0x80; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x00; buf
[3] = 0x00;
5811 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x03;
5812 // AT ALL FURTHER STARTS + FIRST CYCLE:
5813 //MT9V111: I2C MESSAGE => IFP Register 0x33: Auto exposure
5814 //buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x33; buf[3] = 0x00;
5815 //buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03;
5816 //MT9V011: ?????????????????????????
5817 //buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x07; buf[3] = 0x00;
5818 //buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03;
5819 // ALWAYS AT 2nd AND FURTHER CYCLES:
5821 //buf[0] = 0xa2; buf[1] = 0x5c; buf[2] = 0x00; buf[3] = 0x36;
5822 //buf[4] = 0x00; buf[5] = 0x82; buf[6] = 0x3a; buf[7] = 0x10; buf[8] = 0x03;
5823 // => buf[3] to buf[6] simply contain bytes read with URB 2215
5825 //buf[0] = 0xb0; buf[1] = 0x5d; buf[2] = 0x07; buf[3] = 0x00;
5826 //buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03;
5827 usb_microdia_control_write(dev
, 0x10c0, buf
, 9); // URB 1964
5828 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5830 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
5831 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
5832 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
5833 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
5834 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
5835 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
5836 usb_microdia_control_write(dev
, 0x10e0, buf
, 24); // URB 1965
5837 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
5838 usb_microdia_control_write(dev
, 0x10f8, buf
, 3); // URB 1966
5839 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
5840 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 1967
5841 buf
[0] = 0x06; buf
[1] = 0x0c; buf
[2] = 0x08;
5842 usb_microdia_control_write(dev
, 0x1188, buf
, 3); // URB 1968
5843 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
5844 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
5845 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
5846 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
5847 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
5848 buf
[20] = 0xf4; buf
[21] = 0xff;
5849 usb_microdia_control_write(dev
, 0x118b, buf
, 22); // URB 1969
5850 buf
[0] = 0x00; buf
[1] = 0x00;
5851 usb_microdia_control_write(dev
, 0x11a1, buf
, 2); // URB 1970
5852 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x08;
5853 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5855 usb_microdia_control_write(dev
, 0x11b7, buf
, 9); // URB 1971
5857 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 1972
5859 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 1973
5861 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
5864 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
5866 // Write to IFP register 0x0d: Color Correction Register 8
5867 buf
[0] = 0x00; buf
[1] = 0x01;
5868 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); // URBs 1974-1976
5869 // Write to IFP register 0x0d: Color Correction Register 8
5870 buf
[0] = 0x00; buf
[1] = 0x00; // ???
5871 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); // URBs 1977-1979
5872 // Writes to IFP registers 0x01: Register Address Space Selection
5873 // 0x02: Color Correction Register 1
5874 buf
[0] = 0x00; buf
[1] = 0x01; // select IFP address space
5875 buf
[2] = 0x00; buf
[3] = 0x16; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
5876 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); // URBs 1980-1982
5877 // Writes to IFP registers 0x03: Color Correction Register 3
5878 // 0x04: Color Correction Register 4
5879 buf
[0] = 0x01; buf
[1] = 0xe1; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
5880 buf
[2] = 0x02; buf
[3] = 0x81; // ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00
5881 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); // URBs 1983-1985
5882 // Writes to IFP registers 0x05: Aperture Correction (Sharpening)
5883 // 0x06: Operating Mode Control
5884 buf
[0] = 0x00; buf
[1] = 0x04; // 100% sharpening, no automatic sharpness reduction at low light // AT FIRST START + FIRST CYCLE: 0x00 0x00: no sharpening
5885 buf
[2] = 0x00; buf
[3] = 0x00; // stop AWB at the current values, no on-the-fly defect correction, no auto exposure, + RESREVED option
5886 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); // URBs 1986-1988
5887 // Writes to IFP registers 0x07: Image Flow Processor Soft Reset
5888 // 0x08: Output Format Control
5889 buf
[0] = 0x30; buf
[1] = 0x02; // reset // AT FIRST START + FIRST CYCLE: 0x00 0x00
5890 buf
[2] = 0x04; buf
[3] = 0x80; // bypass entire image processing, raw 8+2 Bayer data output directly
5891 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); // URBs 1989-1991
5892 // "Dummy" write to IFP Register 0x11: Color Correction Register 12
5893 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); // URBs 1992-1993
5894 // Write to register 0x01: Register address space selection
5895 // Write to sensor register 0x02: Column Start
5896 buf
[0] = 0x00; buf
[1] = 0x04; // select sensor address space
5897 buf
[2] = 0x00; buf
[3] = 0x16; // start with column 22
5898 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); // URBs 1994-1996
5899 // Writes to sensor registers 0x03: Window Height
5900 // 0x04: Window Width
5901 buf
[0] = 0x01; buf
[1] = 0xe6; // 486
5902 buf
[2] = 0x02; buf
[3] = 0x86; // 646
5903 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); // URBs 1997-1999
5904 // Writes to sensor registers 0x05: Horizontal Blanking
5905 // 0x06: Vertical Blanking
5906 buf
[0] = 0x00; buf
[1] = 0x04; // 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00
5907 buf
[2] = 0x00; buf
[3] = 0x00; // 0 rows
5908 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); // URBs 2000-2002
5909 // Writes to sensor registers 0x07: Output Control
5911 buf
[0] = 0x30; buf
[1] = 0x02; // normal operation + chip enable + RESERVED options
5912 buf
[2] = 0x00; buf
[3] = 0x08; // row 8
5913 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); // URBs 2003-2005
5914 // "Dummy" write to sensor Register 0x11: UNDOCUMENTED
5915 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); // URBs 2006-2007
5916 // Writes to sensor registers 0x0c: Shutter Delay
5917 // 0x0d: Reset (Soft) (from MT9V011 datasheet)
5918 buf
[0] = 0x00; buf
[1] = 0x00; // 0 master clocks
5919 buf
[2] = 0x00; buf
[3] = 0x00; // return to normal operation
5920 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
); // URBs 2008-2010
5921 // Writes to sensor registers 0x0e: UNDOCUMENTED
5922 // 0x0f: UNDOCUMENTED
5923 buf
[0] = 0x00; buf
[1] = 0x00;
5924 buf
[2] = 0x00; buf
[3] = 0x00;
5925 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
); // URBs 2011-2013
5926 // Writes to sensor registers 0x10: UNDOCUMENTED
5927 // 0x11: UNDOCUMENTED
5928 buf
[0] = 0x00; buf
[1] = 0x00;
5929 buf
[2] = 0x00; buf
[3] = 0x00;
5930 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
); // URBs 2014-2016
5931 // Writes to sensor registers 0x12: 2X Zoom Col Start => 0x1e bit 0 must be set to activate zoom
5932 // 0x13: 2X Zoom Row Start => 0x1e bit 0 must be set to activate zoom
5933 buf
[0] = 0x00; buf
[1] = 0xb0; // column 176
5934 buf
[2] = 0x00; buf
[3] = 0x7c; // row 124
5935 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
); // URBs 2017-2018
5936 // Writes to sensor registers 0x14: UNDOCUMENTED
5937 // 0x15: UNDOCUMENTED
5938 buf
[0] = 0x00; buf
[1] = 0x00;
5939 buf
[2] = 0x00; buf
[3] = 0x00;
5940 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
); // URBs 2019-2021
5941 // Writes to sensor registers 0x16: UNDOCUMENTED
5942 // 0x17: UNDOCUMENTED
5943 buf
[0] = 0x00; buf
[1] = 0x00;
5944 buf
[2] = 0x00; buf
[3] = 0x00;
5945 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
); // URBs 2022-2024
5946 // Writes to sensor registers 0x18: UNDOCUMENTED
5947 // 0x19: UNDOCUMENTED
5948 buf
[0] = 0x00; buf
[1] = 0x00;
5949 buf
[2] = 0x00; buf
[3] = 0x00;
5950 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
); // URBs 2025-2027
5951 // Writes to sensor registers 0x1a: UNDOCUMENTED
5952 // 0x1b: UNDOCUMENTED
5953 buf
[0] = 0x00; buf
[1] = 0x00;
5954 buf
[2] = 0x00; buf
[3] = 0x00;
5955 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
); // URBs 2028-2030
5956 // Writes to sensor registers 0x1c: UNDOCUMENTED
5957 // 0x1d: UNDOCUMENTED
5958 buf
[0] = 0x00; buf
[1] = 0x00;
5959 buf
[2] = 0x00; buf
[3] = 0x00;
5960 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
); // URBs 2031-2033
5961 // Write to sensor register 0x30: RESERVED
5962 buf
[0] = 0x00; buf
[1] = 0x00;
5963 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x30, dev
->sensor_flags
, buf
); // URBs 2034-2036
5964 // Write to sensor register 0x20: Read Mode
5965 buf
[0] = 0x00; buf
[1] = 0x00; // normal readout
5966 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); // URBs 2037-2039
5967 // Writes to sensor registers 0x30: RESERVED
5969 buf
[0] = 0x00; buf
[1] = 0x05;
5970 buf
[2] = 0x00; buf
[3] = 0x00;
5971 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x30, dev
->sensor_flags
, buf
); // URBs 2040-2042
5972 // "Dummy" write to sensor Register 0x34: RESERVED
5973 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x34, dev
->sensor_flags
, NULL
); // URBs 2043-2044
5975 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
5977 // Write to sensor register 0x07: Output Control
5978 buf
[0] = 0x00; buf
[1] = 0x02; // chip enable, normal operation
5979 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
5980 // Write to sensor register 0x0d: Soft Reset
5981 buf
[0] = 0x00; buf
[1] = 0x01; // reset
5982 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
5983 // Write to sensor register 0x0d: Soft Reset
5984 buf
[0] = 0x00; buf
[1] = 0x00; // resume operation
5985 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
5986 // Writes to sensor registers 0x01: Row start
5987 // 0x02: Column Start
5988 buf
[0] = 0x00; buf
[1] = 0x08; // start with row 8
5989 buf
[2] = 0x00; buf
[3] = 0x16; // start with column 22
5990 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
);
5991 // Writes to sensor registers 0x03: Window Height
5992 // 0x04: Window Width
5993 buf
[0] = 0x01; buf
[1] = 0xe1; // 481
5994 buf
[2] = 0x02; buf
[3] = 0x81; // 641
5995 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
);
5996 // Writes to sensor registers 0x05: Horizontal Blanking
5997 // 0x06: Vertical Blanking
5998 buf
[0] = 0x00; buf
[1] = 0x83; // 131 columns (pixel clocks)
5999 buf
[2] = 0x00; buf
[3] = 0x06; // 6 rows
6000 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
);
6001 // Write to sensor register 0x0d: Soft Reset
6002 buf
[0] = 0x00; buf
[1] = 0x02; // UNKNOWN
6003 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
6004 // Writes to sensor registers 0x0a: Pixel Clock Speed
6005 // 0x0b: Frame Restart
6006 buf
[0] = 0x00; buf
[1] = 0x00; // default
6007 buf
[2] = 0x00; buf
[3] = 0x00; // (has no effect/no restart)
6008 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0a, dev
->sensor_flags
, buf
);
6009 // Writes to sensor registers 0x0c: Shutter Delay
6011 buf
[0] = 0x00; buf
[1] = 0x00; // 0 master clocks
6012 buf
[2] = 0x00; buf
[3] = 0x00; // resume operation
6013 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
);
6014 // Writes to sensor registers 0x0e: UNDOCUMENTED
6015 // 0x0f: UNDOCUMENTED
6016 buf
[0] = 0x00; buf
[1] = 0x00;
6017 buf
[2] = 0x00; buf
[3] = 0x00;
6018 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
);
6019 // Writes to sensor registers 0x10: UNDOCUMENTED
6020 // 0x11: UNDOCUMENTED
6021 buf
[0] = 0x00; buf
[1] = 0x00;
6022 buf
[2] = 0x00; buf
[3] = 0x00;
6023 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
);
6024 // Writes to sensor registers 0x12: 2X Zoom Column Start (from MT9V111 datasheet)
6025 // 0x13: 2X Zoom Row Start (from MT9V111 datasheet)
6026 buf
[0] = 0x00; buf
[1] = 0x00; // column 0 => bit0 of reg 0x1e must be set to activate zoom
6027 buf
[2] = 0x00; buf
[3] = 0x00; // row 0 => bit0 of reg 0x1e must be set to activate zoom
6028 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
);
6029 // Writes to sensor registers 0x14: UNDOCUMENTED
6030 // 0x15: UNDOCUMENTED
6031 buf
[0] = 0x00; buf
[1] = 0x00;
6032 buf
[2] = 0x00; buf
[3] = 0x00;
6033 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
);
6034 // Writes to sensor registers 0x16: UNDOCUMENTED
6035 // 0x17: UNDOCUMENTED
6036 buf
[0] = 0x00; buf
[1] = 0x00;
6037 buf
[2] = 0x00; buf
[3] = 0x00;
6038 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
);
6039 // Writes to sensor registers 0x18: UNDOCUMENTED
6040 // 0x19: UNDOCUMENTED
6041 buf
[0] = 0x00; buf
[1] = 0x00;
6042 buf
[2] = 0x00; buf
[3] = 0x00;
6043 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
);
6044 // Writes to sensor registers 0x1a: UNDOCUMENTED
6045 // 0x1b: UNDOCUMENTED
6046 buf
[0] = 0x00; buf
[1] = 0x00;
6047 buf
[2] = 0x00; buf
[3] = 0x00;
6048 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
);
6049 // Writes to sensor registers 0x1c: UNDOCUMENTED
6050 // 0x1d: UNDOCUMENTED
6051 buf
[0] = 0x00; buf
[1] = 0x00;
6052 buf
[2] = 0x00; buf
[3] = 0x00;
6053 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
);
6054 // Write to sensor register 0x32: RESERVED
6055 buf
[0] = 0x00; buf
[1] = 0x00;
6056 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x32, dev
->sensor_flags
, buf
);
6057 // Writes to sensor registers 0x20: Read Mode
6059 buf
[0] = 0x11; buf
[1] = 0x01; // output all frames (including bad frames) + UNDOCUMENTED
6060 buf
[2] = 0x00; buf
[3] = 0x00;
6061 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x20, dev
->sensor_flags
, buf
);
6062 // Writes to sensor registers 0x22: RESERVED
6063 // 0x23: UNDOCUMENTED
6064 buf
[0] = 0x00; buf
[1] = 0x00;
6065 buf
[2] = 0x00; buf
[3] = 0x00;
6066 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x22, dev
->sensor_flags
, buf
);
6067 // Writes to sensor registers 0x24: UNDOCUMENTED
6068 // 0x25: UNDOCUMENTED
6069 buf
[0] = 0x00; buf
[1] = 0x00;
6070 buf
[2] = 0x00; buf
[3] = 0x00;
6071 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x24, dev
->sensor_flags
, buf
);
6072 // Writes to sensor registers 0x26: UNDOCUMENTED
6074 buf
[0] = 0x00; buf
[1] = 0x00;
6075 buf
[2] = 0x00; buf
[3] = 0x24;
6076 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x26, dev
->sensor_flags
, buf
);
6077 // "Dummy" write to sensor Register 0x30: RESERVED
6078 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x30, dev
->sensor_flags
, NULL
);
6079 // Writes to sensor registers 0x2f: RESERVED
6081 buf
[0] = 0xf7; buf
[1] = 0xb0;
6082 buf
[2] = 0x00; buf
[3] = 0x05;
6083 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2f, dev
->sensor_flags
, buf
);
6084 // Writes to sensor registers 0x31: RESERVED
6086 buf
[0] = 0x00; buf
[1] = 0x00;
6087 buf
[2] = 0x00; buf
[3] = 0x00;
6088 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x31, dev
->sensor_flags
, buf
);
6089 // Writes to sensor registers 0x33: RESERVED
6091 buf
[0] = 0x00; buf
[1] = 0x00;
6092 buf
[2] = 0x01; buf
[3] = 0x00;
6093 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x33, dev
->sensor_flags
, buf
);
6094 // "Dummy" write to sensor Register 0x3b: RESERVED
6095 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x3b, dev
->sensor_flags
, NULL
);
6096 // Write to sensor register 0x3d: RESERVED
6097 buf
[0] = 0x06; buf
[1] = 0x8f;
6098 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x3d, dev
->sensor_flags
, buf
);
6099 // Writes to sensor registers 0x40: RESERVED
6101 buf
[0] = 0x01; buf
[1] = 0xe0;
6102 buf
[2] = 0x00; buf
[3] = 0xd1;
6103 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x40, dev
->sensor_flags
, buf
);
6104 // Write to sensor register 0x44: UNDOCUMENTED
6105 buf
[0] = 0x00; buf
[1] = 0x82;
6106 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x44, dev
->sensor_flags
, buf
);
6107 // Writes to sensor registers 0x5a: RESERVED
6109 buf
[0] = 0x00; buf
[1] = 0x00;
6110 buf
[2] = 0x00; buf
[3] = 0x00;
6111 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5a, dev
->sensor_flags
, buf
);
6112 // Writes to sensor registers 0x5c: RESERVED
6114 buf
[0] = 0x00; buf
[1] = 0x00;
6115 buf
[2] = 0x00; buf
[3] = 0x00;
6116 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5c, dev
->sensor_flags
, buf
);
6117 // Writes to sensor registers 0x5e: RESERVED
6119 buf
[0] = 0x00; buf
[1] = 0x00;
6120 buf
[2] = 0xa3; buf
[3] = 0x1d;
6121 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5e, dev
->sensor_flags
, buf
);
6122 // "Dummy" write to sensor Register 0x68: UNDOCUMENTED
6123 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x68, dev
->sensor_flags
, NULL
);
6124 // Write to sensor register 0x62: RESERVED
6125 buf
[0] = 0x06; buf
[1] = 0x11;
6126 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x62, dev
->sensor_flags
, buf
);
6130 UDIA_INFO("1 or more errors occured in I2C-message-block 1 !\n");
6133 // END OF I2C MESSAGES
6134 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6136 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6139 usb_microdia_control_write(dev
, 0x1007, buf
, 8);
6141 usb_microdia_control_write(dev
, 0x1006, buf
, 8);
6145 // *** TEMPORARY SWITCH TO SLAVE ADDRESS 0x50, I2C READ ATTEMPT:
6146 // - WE CURRENTLY KNOW NO 6270 CAM THAT IS SUCCESSFULLY READ HERE
6147 // - IF READ FAILS, THIS IS NEVER DONE AGAIN (IN NEXT CYCLE OR FURTHER STARTS)
6148 usb_microdia_control_read(dev
, 0x10c1, buf
, 1); // returns 0x5c
6150 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
6151 retI2C
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, SN9C20X_I2C_2WIRE
, buf
);
6153 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");
6155 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
6158 buf
[0] = 0x47; // ALEX: 0x44
6159 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2045
6160 buf
[0] = 0x47; // ALEX: 0x04
6161 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2046
6163 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 2047
6165 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 2048
6166 buf
[0] = 0x84; // ALEX: 0xc0
6167 usb_microdia_control_write(dev
, 0x1001, buf
, 1); // URB 2049
6170 usb_microdia_control_write(dev, 0x1001, buf, 1);
6173 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6175 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6178 // Writes to sensor registers 0x02: Column Start
6179 // 0x03: Window Height
6180 buf
[0] = 0x00; buf
[1] = 0x16; // coulmn 22
6181 buf
[2] = 0x01; buf
[3] = 0xe1; // 481
6182 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); // URBs 2050-2052
6183 // Writes to sensor registers 0x04: Window Width
6184 // 0x05: Horizontal Blanking
6185 buf
[0] = 0x02; buf
[1] = 0x81; // 641
6186 buf
[2] = 0x00; buf
[3] = 0x04; // 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00
6187 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); // URBs 2053-2055
6188 // Writes to sensor registers 0x06: Vertical Blanking
6189 // 0x07: Output Control
6190 buf
[0] = 0x00; buf
[1] = 0x00; // 0 rows
6191 buf
[2] = 0x30; buf
[3] = 0x02; // normal operation + chip enable + RESERVED options
6192 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); // URBs 2056-2058
6193 // Write to sensor register 0x0e: UNDOCUMENTED
6194 buf
[0] = 0x00; buf
[1] = 0x08;
6195 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); // URBs 2059-2061
6198 UDIA_INFO("1 or more errors occured in I2C-message-block 2 !\n");
6201 // END OF I2C MESSAGES
6202 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6205 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
6206 buf
[4] = 0x28; buf
[5] = 0x3c;
6207 usb_microdia_control_write(dev
, 0x1180, buf
, 6); // URB 2062
6208 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
6209 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 2063
6211 usb_microdia_control_write(dev
, 0x1189, buf
, 1); // URB 2064
6212 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
6213 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); // URB 2065
6214 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
6215 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); // URB 2066
6216 buf
[0] = 0x78; // ALEX: 0x7c
6217 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 2067
6218 buf
[0] = 0x18; // ALEX: 0x1c
6219 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2068
6220 buf
[0] = 0x18; // ALEX: 0x1c
6221 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2069
6223 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2070
6225 usb_microdia_control_write(dev
, 0x118a, buf
, 1); // URB 2071
6227 usb_microdia_control_write(dev
, 0x0395, buf
, 1); // URB 2072
6230 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2073
6231 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2074 // 0x38
6234 else if (buf
[0] == 0xb8)
6236 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2075
6237 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2076 // 0xb9
6240 else if (buf
[0] == 0xb9)
6242 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2077
6243 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2078
6246 else if (buf
[0] == 0xba)
6248 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2079
6249 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2080 // 0x3b
6252 else if (buf
[0] == 0xbb)
6254 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2081
6255 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2082 // 0x3c
6258 else if (buf
[0] == 0xbc)
6260 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2083
6261 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2084 // 0x3d
6262 last_11b8
[0] = buf
[0];
6263 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6267 else if (buf
[0] == 0xbd)
6269 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2085
6270 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2086
6273 else if (buf
[0] == 0xbe)
6275 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2087
6276 usb_microdia_control_read(dev
, 0x11b8, last_11b8
, 1); // URB 2088
6278 buf
[0] = last_11b8
[0] & 0xf0; // 0xf0 or 0x70
6279 buf
[0] = buf
[0] | 0x0d; // 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES
6280 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2089
6283 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6286 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6288 // Write to sensor register 0x06: Vertical Blanking
6289 buf
[0] = 0x00; buf
[1] = 0x2d; // 45 rows
6290 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); // URBs 2090-2092
6291 // Write to sensor register 0x05: Horizontal Blanking
6292 buf
[0] = 0x00; buf
[1] = 0x04; // 4 columns (pixel clocks)
6293 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); // URBs 2093-2095
6294 // Write to sensor register 0x20: Read Mode
6295 buf
[0] = 0x00; buf
[1] = 0x00; // normal readout
6296 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); // URBs 2096-2098
6298 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6300 // Write to sensor register 0x0a: Pixel Clock Speed
6301 buf
[0] = 0x00; buf
[1] = 0x00; // default
6302 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0a, dev
->sensor_flags
, buf
);
6303 // Write to sensor register 0x06: Vertical Blanking
6304 buf
[0] = 0x00; buf
[1] = 0x29; // 41 rows
6305 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
6306 // Write to sensor register 0x05: Horizontal Blanking
6307 buf
[0] = 0x00; buf
[1] = 0x09; // 9 columns (pixel clocks)
6308 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
6309 // Write to sensor register 0x20: Read Mode
6310 buf
[0] = 0x11; buf
[1] = 0x01; // output all frames (including bad ones) + UNKNOWN
6311 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
6315 UDIA_INFO("1 or more errors occured in I2C-message-block 3 !\n");
6318 // END OF I2C MESSAGES
6319 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6323 usb_microdia_control_write(dev
, 0x1180, buf
, 1); // URB 2099
6325 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6328 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6330 // Write to sensor register 0x20: Read Mode
6331 buf
[0] = 0x00; buf
[1] = 0x00; // normal readout
6332 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); // URBs 2100-2102
6334 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6336 // Write to sensor register 0x20: Read Mode
6337 buf
[0] = 0x11; buf
[1] = 0x01; // output all frames (including bad ones) + UNKNOWN
6338 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
6342 UDIA_INFO("1 or more errors occured in I2C-message-block 4 !\n");
6345 // END OF I2C MESSAGES
6346 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6350 usb_microdia_control_write(dev
, 0x1182, buf
, 1); // URB 2103
6353 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6356 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6358 // Write to sensor register 0x09: Shutter Width
6359 buf
[0] = 0x00; buf
[1] = 0x64; // integration of 100 rows
6360 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
); // URBs 2104-2106
6361 // Write to sensor register 0x2b: Green 1 Gain
6363 buf
[0] = 0x00; buf
[1] = 0xa0; // 32*0.03125*2 = 2
6364 buf
[2] = 0x00; buf
[3] = 0xa0; // 32*0.03125*2 = 2
6365 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
); // URBs 2107-2109
6366 // Write to sensor register 0x2d: Red Gain
6367 // 0x2e: Green 2 Gain
6368 buf
[0] = 0x00; buf
[1] = 0xa0; // 32*0.03125*2 = 2
6369 buf
[2] = 0x00; buf
[3] = 0xa0; // 32*0.03125*2 = 2
6370 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
); // URBs 2110-2112
6371 // "Dummy" write to sensor Register 0x33: RESERVED
6372 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
); // URBs 2113-2114
6374 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6376 // Write to sensor register 0x09: Shutter Width
6377 buf
[0] = 0x00; buf
[1] = 0x64; // integration of 100 rows
6378 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
);
6379 // Write to sensor register 0x07: Output Control
6380 buf
[0] = 0x00; buf
[1] = 0x03; // dont update changes until bit0=0, chip enable, normal operation
6381 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
6382 // Write to sensor register 0x2b: Green 1 Gain
6384 buf
[0] = 0x00; buf
[1] = 0x33; // 51*0.03125*1 = 1.59375
6385 buf
[2] = 0x00; buf
[3] = 0xa0; // 32*0.03125*2 = 2
6386 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
);
6387 // Write to sensor register 0x2d: Red Gain
6388 // 0x2e: Green 2 Gain
6389 buf
[0] = 0x00; buf
[1] = 0xa0; // 32*0.03125*2 = 2
6390 buf
[2] = 0x00; buf
[3] = 0x33; // 51*0.03125*1 = 1.59375
6391 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
);
6392 // "Dummy" write to sensor Register 0x33: RESERVED
6393 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
);
6394 // Write to sensor register 0x07: Output Control
6395 buf
[0] = 0x00; buf
[1] = 0x02; // chip enable, normal operation
6396 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
6400 UDIA_INFO("1 or more errors occured in I2C-message-block 5 !\n");
6403 // END OF I2C MESSAGES
6404 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6408 usb_microdia_control_write(dev
, 0x118c, buf
, 1); // URB 2115
6410 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 2116
6412 usb_microdia_control_write(dev
, 0x118e, buf
, 1); // URB 2117
6414 usb_microdia_control_write(dev
, 0x118f, buf
, 1); // URB 2118
6416 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2119
6418 usb_microdia_control_write(dev
, 0x118c, buf
, 1); // URB 2120
6420 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 2121
6422 usb_microdia_control_write(dev
, 0x118e, buf
, 1); // URB 2122
6424 usb_microdia_control_write(dev
, 0x118f, buf
, 1); // URB 2123
6426 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6430 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6434 usb_microdia_control_write(dev
, 0x118b, buf
, 1); // URB 2124
6437 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6439 buf
[0] = 0x0a; buf
[1] = 0x36; buf
[2] = 0x56; buf
[3] = 0x6e;
6440 buf
[4] = 0x7f; buf
[5] = 0x8d; buf
[6] = 0x9b; buf
[7] = 0xa8;
6441 buf
[8] = 0xb4; buf
[9] = 0xbd; buf
[10] = 0xc7; buf
[11] = 0xd0;
6442 buf
[12] = 0xd9; buf
[13] = 0xe2; buf
[14] = 0xec; buf
[15] = 0xf0;
6445 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6447 buf
[0] = 0x08; buf
[1] = 0x35; buf
[2] = 0x5a; buf
[3] = 0x6d;
6448 buf
[4] = 0x7d; buf
[5] = 0x8b; buf
[6] = 0x97; buf
[7] = 0xa3;
6449 buf
[8] = 0xad; buf
[9] = 0xb7; buf
[10] = 0xc1; buf
[11] = 0xca;
6450 buf
[12] = 0xd3; buf
[13] = 0xdb; buf
[14] = 0xe3; buf
[15] = 0xeb;
6453 usb_microdia_control_write(dev
, 0x1190, buf
, 17); // URB 2125
6455 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6457 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6458 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf6; buf
[7] = 0x0f;
6459 buf
[8] = 0xd2; buf
[9] = 0x0f; buf
[10] = 0x38; buf
[11] = 0x00;
6460 buf
[12] = 0x34; buf
[13] = 0x00; buf
[14] = 0xcf; buf
[15] = 0x0f;
6461 buf
[16] = 0xfd; buf
[17] = 0x0f; buf
[18] = 0x00; buf
[19] = 0x00;
6464 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6466 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6467 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf0; buf
[7] = 0x0f;
6468 buf
[8] = 0xd0; buf
[9] = 0x0f; buf
[10] = 0x41; buf
[11] = 0x00;
6469 buf
[12] = 0x38; buf
[13] = 0x00; buf
[14] = 0xc7; buf
[15] = 0x0f;
6470 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
6473 for (k
=0; k
<9; k
++) // AT FIRST START + FIRST CYCLE: first 8 writes 21 bytes 0x00
6475 usb_microdia_control_write(dev
, 0x10e1, buf
, 21); // URB 2126 - 2134
6479 usb_microdia_control_write(dev
, 0x10f7, buf
, 1); // URB 2135
6480 buf
[0] = 0x18; // ALEX: 0x00
6481 usb_microdia_control_write(dev
, 0x10f6, buf
, 1); // URB 2136
6483 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6485 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6486 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf6; buf
[7] = 0x0f;
6487 buf
[8] = 0xd2; buf
[9] = 0x0f; buf
[10] = 0x38; buf
[11] = 0x00;
6488 buf
[12] = 0x34; buf
[13] = 0x00; buf
[14] = 0xcf; buf
[15] = 0x0f;
6489 buf
[16] = 0xfd; buf
[17] = 0x0f; buf
[18] = 0x00; buf
[19] = 0x00;
6492 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6494 buf
[0] = 0x16; buf
[1] = 0x00; buf
[2] = 0x2b; buf
[3] = 0x00;
6495 buf
[4] = 0x08; buf
[5] = 0x00; buf
[6] = 0xf0; buf
[7] = 0x0f;
6496 buf
[8] = 0xd0; buf
[9] = 0x0f; buf
[10] = 0x41; buf
[11] = 0x00;
6497 buf
[12] = 0x38; buf
[13] = 0x00; buf
[14] = 0xc7; buf
[15] = 0x0f;
6498 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
6501 usb_microdia_control_write(dev
, 0x10e1, buf
, 21); // URB 2137
6503 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6507 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6511 usb_microdia_control_write(dev
, 0x10f8, buf
, 1); // URB 2138
6513 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6517 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6521 usb_microdia_control_write(dev
, 0x10fa, buf
, 1); // URB 2139
6524 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); // URB 2140
6526 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); // URB 2141
6528 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2142
6529 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
6530 usb_microdia_control_write(dev
, 0x11bc, buf
, 4); // URB 2143
6531 for (k
=0; k
<48; k
++) buf
[k
] = 0x00;
6532 usb_microdia_control_write(dev
, 0x11c0, buf
, 48); // URB 2144
6534 usb_microdia_control_write(dev
, 0x118c, buf
, 1); // URB 2145
6536 usb_microdia_control_write(dev
, 0x118d, buf
, 1); // URB 2146
6538 usb_microdia_control_write(dev
, 0x118e, buf
, 1); // URB 2147
6540 usb_microdia_control_write(dev
, 0x118f, buf
, 1); // URB 2148
6541 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
6542 buf
[4] = 0x04; buf
[5] = 0x3f;
6543 usb_microdia_control_write(dev
, 0x11a5, buf
, 6); // URB 2149
6545 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6547 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
6549 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6551 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
6553 usb_microdia_control_write(dev
, 0x11af, buf
, 4); // URB 2150
6555 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
6556 usb_microdia_control_write(dev
, 0x11b3, buf
, 4); // URB 2151
6557 buf
[0] = 0x47; // ALEX: 0x04
6558 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2152
6560 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2153
6561 buf
[0] = 0x67; // ALEX: 0x24
6562 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2154
6563 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
6564 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
6565 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
6566 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
6567 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
6568 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
6569 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
6570 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
6571 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
6572 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
6573 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
6574 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
6575 buf
[48]= 0x4f; buf
[49] = 0x53; buf
[50] = 0x58; buf
[51] = 0x58;
6576 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
6577 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
6578 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
6579 usb_microdia_control_write(dev
, 0x1100, buf
, 64); // URB 2155
6580 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
6581 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
6582 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x53; buf
[11] = 0x36;
6583 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53; buf
[15] = 0x53;
6584 buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
6585 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53;
6586 buf
[24] = 0x53; buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53;
6587 buf
[28] = 0x53; buf
[29] = 0x53; buf
[30] = 0x53; buf
[31] = 0x53;
6588 buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53; buf
[35] = 0x53;
6589 buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
6590 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53;
6591 buf
[44] = 0x53; buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53;
6592 buf
[48] = 0x53; buf
[49] = 0x53; buf
[50] = 0x53; buf
[51] = 0x53;
6593 buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53; buf
[55] = 0x53;
6594 buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
6595 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
6596 usb_microdia_control_write(dev
, 0x1140, buf
, 64); // URB 2156
6597 buf
[0] = 0x47; // ALEX: 0x04
6598 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2157
6600 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2158
6601 buf
[0] = 0x4b; // ALEX: 0x08
6602 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); // URB 2159
6604 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6606 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6609 // Writes to sensor registers 0x02: Column Start
6610 // 0x03: Window Hight
6611 buf
[0] = 0x00; buf
[1] = 0x16; // coulmn 22
6612 buf
[2] = 0x01; buf
[3] = 0xe1; // 481
6613 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); // URBs 2160-2162
6614 // Writes to sensor registers 0x04: Window Width
6615 // 0x05: Horizontal Blanking
6616 buf
[0] = 0x02; buf
[1] = 0x81; // 641
6617 buf
[2] = 0x00; buf
[3] = 0x04; // 4 columns (pixel clocks)
6618 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); // URBs 2163-2165
6619 // Writes to sensor registers 0x06: Vertical Blanking
6620 // 0x07: Output Control
6621 buf
[0] = 0x00; buf
[1] = 0x2d; // 45 rows
6622 buf
[2] = 0x30; buf
[3] = 0x02; // RESERVED options
6623 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); // URBs 2166-2167
6624 // Writes to sensor register 0x0e: UNDOCUMENTED
6625 buf
[0] = 0x00; buf
[1] = 0x08;
6626 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); // URBs 2168-2170
6629 UDIA_INFO("1 or more errors occured in I2C-message-block 6 !\n");
6632 // END OF I2C MESSAGES
6633 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6635 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6638 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6640 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6644 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
6645 buf
[4] = 0x28; buf
[5] = 0x3c;
6646 usb_microdia_control_write(dev
, 0x1180, buf
, 6); // URB 2171
6647 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
6648 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); // URB 2172
6650 usb_microdia_control_write(dev
, 0x1189, buf
, 1); // URB 2173
6651 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
6652 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); // URB 2174
6653 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
6654 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); // URB 2175
6656 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2176
6658 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2177
6660 usb_microdia_control_write(dev
, 0x11b9, buf
, 1); // URB 2178
6662 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); // URB 2179
6664 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2180
6665 buf
[0] = 0x78; // ALEX: 0x7c
6666 usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 2181
6667 buf
[0] = 0x18; // ALEX: 0x1c
6668 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2182
6669 buf
[0] = 0x18; // ALEX: 0x1c
6670 usb_microdia_control_write(dev
, 0x1002, buf
, 1); // URB 2183
6671 buf
[0] = 0x7d; // ALEX: 0xfc
6672 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2184
6674 usb_microdia_control_write(dev
, 0x118a, buf
, 1); // URB 2185
6676 usb_microdia_control_write(dev
, 0x0395, buf
, 1); // URB 2186
6678 if ((last_11b8
[0] == 0x3d) || (last_11b8
[0] == 0x3f))
6680 else if ((last_11b8
[0] == 0xbd) || (last_11b8
[0] == 0xbf))
6682 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2187
6683 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2188 // 0x38
6686 else if (buf
[0] == 0xb8)
6688 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2189
6689 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2190 // 0xb9
6692 else if (buf
[0] == 0xb9)
6694 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2191
6695 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2192 // 0xba
6698 else if (buf
[0] == 0xba)
6700 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2193
6701 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2194 // 0x3b
6704 else if (buf
[0] == 0xbb)
6706 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2195
6707 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2196 // 0x3c
6710 else if (buf
[0] == 0xbc)
6712 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2197
6713 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2198 // 0x3d
6714 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6718 else if (buf
[0] == 0xbd)
6720 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2199
6721 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2200
6724 else if (buf
[0] == 0xbe)
6726 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2201
6727 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); // URB 2202
6729 buf
[0] = buf
[0] & 0xf0; // 0xf0 or 0x70
6730 buf
[0] = buf
[0] | 0x0d; // 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES
6731 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 2089
6733 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6736 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6738 // Write to sensor register 0x06: Vertical Blanking
6739 buf
[0] = 0x00; buf
[1] = 0x2d; // 45 rows
6740 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); // URBs 2204-2206
6741 // Write to sensor register 0x05: Horizontal Blanking
6742 buf
[0] = 0x00; buf
[1] = 0x04; // 4 columns (pixel clocks)
6743 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); // URBs 2207-2209
6744 // Read of sensor register 0x36: Chip Version (mirror of reg0xff)
6745 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x36, dev
->sensor_flags
, buf
); // URBs 2211-2215 // 0x82 0x3a
6747 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6749 // Write to sensor register 0x0a: Pixel Clock Speed
6750 buf
[0] = 0x00; buf
[1] = 0x00; // default
6751 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
6752 // Write to sensor register 0x06: Vertical Blanking
6753 buf
[0] = 0x00; buf
[1] = 0x29; // 41 rows
6754 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
6755 // Write to sensor register 0x05: Horizontal Blanking
6756 buf
[0] = 0x00; buf
[1] = 0x09; // 9 columns (pixel clocks)
6757 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
6758 // Read of sensor register 0x00: Chip Version (=reg0xff)
6759 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x00, dev
->sensor_flags
, buf
); // 0x82 0x43
6763 UDIA_INFO("1 or more errors occured in I2C-message-block 7 !\n");
6766 // END OF I2C MESSAGES
6767 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6771 usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 2216
6774 /*** NOW DRIVER DOES STOP-SEQUENCE
6775 - WITHOUT WRITES TO 0x1007 AND 0x1006 (URBs 3544-3550) => MT9V111
6776 - WRITING 0x40 INSTEAD OF 0x60 TO 0x1007 AND 0x1006 => MT9V011
6778 /*** 2nd, 3rd, ... CYCLE: ALL MESSAGES (URBs 1953 - URBs 2216) ARE REPEATED ***/
6779 /*** ----- WE DON'T DO THIS, IT SEEMS TO BE UNNECESSARY ----- ***/
6781 // Setup IFP registers for AE and AWB (new, not in the logs):
6782 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6784 mt9v111_setup_autoexposure(dev
);
6785 mt9v111_setup_autowhitebalance(dev
);
6786 mt9v111_set_autocorrections(dev
, 1);
6789 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6793 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6797 usb_microdia_control_write(dev
, 0x1007, buf
, 1); // URB 2489
6798 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
6802 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
6806 usb_microdia_control_write(dev
, 0x1006, buf
, 1); // URB 2490
6807 // => These two writes seem to cause the cam to start sending isochronus USB messages
6812 int microdia_627b_start_stream(struct usb_microdia
*dev
)
6819 buf
[0] = 0x00; /** Will have to be set for every single interrupt. */
6821 ret = usb_interrupt_msg(dev->udev, 0x00000083, buf, 0x0000001, &actual, 1000); // URB 43
6826 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 44 */
6831 //ret = usb_set_interface(dev->udev, 0, 8);
6832 //if(ret < 0) goto err;
6834 //buf[0] = 0x00; // Will have to be set for every single interrupt
6835 //ret = usb_interrupt_msg(dev->udev, 0x00000083, buf, 0x0000001, &actual, 1000); // URB 45
6840 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 46 */
6846 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 47 */
6852 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 48 */
6858 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 49 */
6864 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 50 */
6869 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
6870 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5); /* URB 51 */
6875 buf
[0] = 0x80; buf
[1] = 0x21; buf
[2] = 0x00; buf
[3] = 0x00;
6876 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
6878 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9); /* URB 52 */
6882 /* transferbufferlength is 18, but data is 24 bytes long, what to do ? */
6884 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30; buf
[4] = 0x00;
6885 buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed; buf
[8] = 0x0f; buf
[9] = 0xda;
6886 buf
[10] = 0x0f; buf
[11] = 0x3a; buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00;
6887 buf
[15] = 0xd0; buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
6888 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
6889 ret
= usb_microdia_control_write(dev
, reg
, buf
, 24); /* URB 53 */
6894 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
6895 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3); /* URB 54 */
6900 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
6901 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5); /* URB 55 */
6906 buf
[0] = 0x86; buf
[1] = 0x8c; buf
[2] = 0x08;
6907 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3); /* URB 56 */
6912 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20; buf
[4] = 0x20;
6913 buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b; buf
[8] = 0x4f; buf
[9] = 0x61;
6914 buf
[10] = 0x71; buf
[11] = 0x80; buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab;
6915 buf
[15] = 0xb8; buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
6916 buf
[20] = 0xf4; buf
[21] = 0xff;
6917 ret
= usb_microdia_control_write(dev
, reg
, buf
, 22); /* URB 57 */
6922 buf
[0] = 0x00; buf
[1] = 0x00;
6923 ret
= usb_microdia_control_write(dev
, reg
, buf
, 2); /* URB 58 */
6928 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x08; buf
[4] = 0x00;
6929 buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0; buf
[8] = 0x00;
6930 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9); /* URB 59 */
6936 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1); /* URB 60 */
6942 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6947 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
6948 OV7660_CTL_COM7
, dev
->sensor_flags
, buf
);
6952 buf
[0] = 0x01; buf
[1] = 0x74; buf
[2] = 0x92; buf
[3] = 0x00;
6953 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6954 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
6958 buf
[0] = 0x00; buf
[1] = 0x7d; buf
[2] = 0x62; buf
[3] = 0x00;
6959 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6960 OV7660_CTL_COM1
, dev
->sensor_flags
, buf
);
6964 buf
[0] = 0x83; buf
[1] = 0x01;
6965 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
6966 OV7660_CTL_RAVE
, dev
->sensor_flags
, buf
);
6970 buf
[0] = 0x00; buf
[1] = 0x08; buf
[2] = 0x04; buf
[3] = 0x62;
6971 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6972 OV7660_CTL_COM3
, dev
->sensor_flags
, buf
);
6976 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x05; buf
[3] = 0xf8;
6977 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6978 OV7660_CTL_AECH
, dev
->sensor_flags
, buf
);
6982 buf
[0] = 0x2e; buf
[1] = 0x00; buf
[2] = 0x02;
6983 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3,
6984 OV7660_CTL_COM9
, dev
->sensor_flags
, buf
);
6988 buf
[0] = 0x10; buf
[1] = 0x60; buf
[2] = 0x02; buf
[3] = 0x7b;
6989 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
6990 OV7660_CTL_HSTART
, dev
->sensor_flags
, buf
);
6995 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
6996 OV7660_CTL_PSHFT
, dev
->sensor_flags
, buf
);
7000 buf
[0] = 0x01; buf
[1] = 0x0e;
7001 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
7002 OV7660_CTL_MVFP
, dev
->sensor_flags
, buf
);
7006 buf
[0] = 0x07; buf
[1] = 0x07; buf
[2] = 0x07; buf
[3] = 0x07;
7007 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7008 OV7660_CTL_BOS
, dev
->sensor_flags
, buf
);
7012 buf
[0] = 0x68; buf
[1] = 0x58; buf
[2] = 0xd4; buf
[3] = 0x80;
7013 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7014 OV7660_CTL_AEW
, dev
->sensor_flags
, buf
);
7018 buf
[0] = 0x80; buf
[1] = 0x3c; buf
[2] = 0x00; buf
[3] = 0x00;
7019 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7020 OV7660_CTL_GbBIAS
, dev
->sensor_flags
, buf
);
7024 buf
[0] = 0x80; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x62;
7025 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7026 OV7660_CTL_RBIAS
, dev
->sensor_flags
, buf
);
7030 buf
[0] = 0x08; buf
[1] = 0x30; buf
[2] = 0xb4;
7031 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3,
7032 OV7660_CTL_HSYST
, dev
->sensor_flags
, buf
);
7036 buf
[0] = 0x00; buf
[1] = 0x07; buf
[2] = 0x84; buf
[3] = 0x00;
7037 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7038 OV7660_CTL_CHLF
, dev
->sensor_flags
, buf
);
7042 buf
[0] = 0x0c; buf
[1] = 0x02; buf
[2] = 0x43; buf
[3] = 0x00;
7043 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7044 OV7660_CTL_ADC
, dev
->sensor_flags
, buf
);
7048 buf
[0] = 0x02; buf
[1] = 0x6c; buf
[2] = 0x19; buf
[3] = 0x0e;
7049 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7050 OV7660_CTL_COM11
, dev
->sensor_flags
, buf
);
7054 buf
[0] = 0x41; buf
[1] = 0xc1; buf
[2] = 0x22; buf
[3] = 0x08;
7055 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7056 OV7660_CTL_EDGE
, dev
->sensor_flags
, buf
);
7061 reg
= 0x43; /* RSVD 0x43 is Reserved */
7062 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
7063 reg
, dev
->sensor_flags
, NULL
);
7067 reg
= 0x43; /* RSVD 0x43 is Reserved */
7068 buf
[0] = 0xf0; buf
[1] = 0x10; buf
[2] = 0x78; buf
[3] = 0xa8;
7069 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, reg
,
7070 dev
->sensor_flags
, buf
);
7074 reg
= 0x47; /* RSVD 0x47 is Reserved */
7075 buf
[0] = 0x60; buf
[1] = 0x80; buf
[2] = 0x00; buf
[3] = 0x00;
7076 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, reg
,
7077 dev
->sensor_flags
, buf
);
7081 reg
= 0x4b; /* RSVD 0x4b is Reserved */
7082 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
7083 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, reg
,
7084 dev
->sensor_flags
, buf
);
7089 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
7090 OV7660_CTL_MTX1
, dev
->sensor_flags
, NULL
);
7094 reg
= 0x59; /* RSVD 0x59 is Reserved */
7095 buf
[0] = 0xba; buf
[1] = 0x9a; buf
[2] = 0x22; buf
[3] = 0xb9;
7096 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7097 reg
, dev
->sensor_flags
, buf
);
7101 reg
= 0x5d; /* RSVD 0x5d is Reserved */
7102 buf
[0] = 0x9b; buf
[1] = 0x10; buf
[2] = 0xf0; buf
[3] = 0x05;
7103 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7104 reg
, dev
->sensor_flags
, buf
);
7108 reg
= 0x61; /* RSVD 0x61 is Reserved */
7110 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7111 reg
, dev
->sensor_flags
, buf
);
7115 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x30;
7116 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7117 OV7660_CTL_LCC1
, dev
->sensor_flags
, buf
);
7122 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7123 OV7660_CTL_LCC5
, dev
->sensor_flags
, buf
);
7127 buf
[0] = 0x80; buf
[1] = 0x7a; buf
[2] = 0x90; buf
[3] = 0x80;
7128 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7129 OV7660_CTL_MANU
, dev
->sensor_flags
, buf
);
7134 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7135 OV7660_CTL_DBLV
, dev
->sensor_flags
, buf
);
7139 reg
= 0x8b; /* RSVD 0x8b is Reserved */
7140 buf
[0] = 0x99; buf
[1] = 0x99; buf
[2] = 0xcf;
7141 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 3, reg
,
7142 dev
->sensor_flags
, buf
);
7146 buf
[0] = 0x00; buf
[1] = 0x00;
7147 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
7148 OV7660_CTL_DM_LNL
, dev
->sensor_flags
, buf
);
7154 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7160 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7165 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7171 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7175 /* TRY TO READ FROM EEPROM: */
7177 ret
= sn9c20x_read_i2c_data(dev
, 0x50, 1, reg
, SN9C20X_I2C_2WIRE
, buf
);
7179 UDIA_INFO("No EEPROM found\n");
7181 UDIA_INFO("Read from EEPROM successful\n");
7185 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7191 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7197 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7203 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7209 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7215 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7220 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7221 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7225 buf
[0] = 0x10; buf
[1] = 0x61; buf
[2] = 0x02; buf
[3] = 0x7a;
7226 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
7227 OV7660_CTL_HSTART
, dev
->sensor_flags
, buf
);
7231 /* "Dummy" write: */
7232 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
7233 OV7660_CTL_PSHFT
, dev
->sensor_flags
, NULL
);
7238 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7239 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7244 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7245 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7250 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7251 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7256 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7257 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7262 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7263 OV7660_CTL_HREF
, dev
->sensor_flags
, buf
);
7268 buf
[0] = 0x01; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x28;
7270 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
7275 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
7276 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
7282 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7287 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
7288 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7293 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
7294 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7300 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7306 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7312 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7318 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7324 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7330 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7336 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7339 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7345 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7348 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7354 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7357 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7363 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7366 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7372 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7375 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7381 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7384 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7390 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7395 //ret = usb_microdia_control_read(dev, reg, buf, 1);
7396 //if(ret < 0) goto err;
7400 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7401 OV7660_CTL_CLKRC
, dev
->sensor_flags
, buf
);
7406 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7407 OV7660_CTL_EXHCH
, dev
->sensor_flags
, buf
);
7412 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7413 OV7660_CTL_EXHCL
, dev
->sensor_flags
, buf
);
7418 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7419 OV7660_CTL_DM_LNL
, dev
->sensor_flags
, buf
);
7424 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7425 OV7660_CTL_DM_LNH
, dev
->sensor_flags
, buf
);
7430 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7431 OV7660_CTL_MVFP
, dev
->sensor_flags
, buf
);
7436 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7437 OV7660_CTL_MVFP
, dev
->sensor_flags
, buf
);
7442 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7443 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7448 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7449 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7454 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7455 OV7660_CTL_AECH
, dev
->sensor_flags
, buf
);
7460 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7461 OV7660_CTL_COM1
, dev
->sensor_flags
, buf
);
7466 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7467 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
7472 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7473 OV7660_CTL_ADVFH
, dev
->sensor_flags
, buf
);
7478 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7479 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
7483 buf
[0] = 0x78; buf
[1] = 0x78;
7484 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
7485 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
7491 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7497 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7503 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7509 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7515 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7521 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7527 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7533 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7539 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7545 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7550 buf
[0] = 0x00; buf
[1] = 0x33; buf
[2] = 0x53; buf
[3] = 0x6b; buf
[4] = 0x7c;
7551 buf
[5] = 0x8b; buf
[6] = 0x99; buf
[7] = 0xa6; buf
[8] = 0xb2; buf
[9] = 0xbd;
7552 buf
[10] = 0xc8; buf
[11] = 0xd2; buf
[12] = 0xdc; buf
[13] = 0xe5; buf
[14] = 0xee;
7553 buf
[15] = 0xf7; buf
[16] = 0xff;
7554 ret
= usb_microdia_control_write(dev
, reg
, buf
, 17);
7557 /* transferbufferlength was only 11 ? */
7560 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7561 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7562 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7563 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7565 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7568 /* transferbufferlength was only 15 ? */
7571 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7572 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7573 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7574 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7576 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7579 /* transferbufferlength was only 15 ? */
7582 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7583 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7584 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7585 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7587 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7590 /* transferbufferlength was only 15 ? */
7593 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7594 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7595 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7596 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7598 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7601 /* transferbufferlength was only 15 ? */
7604 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7605 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7606 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7607 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7609 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7612 /* transferbufferlength was only 15 ? */
7615 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7616 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7617 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7618 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7620 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7623 /* transferbufferlength was only 15 ? */
7626 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7627 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7628 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7629 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7631 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7634 /* transferbufferlength was only 15 ? */
7637 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7638 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7639 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7640 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7642 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7645 /* transferbufferlength was only 15 ? */
7648 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
7649 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7650 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7651 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7653 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7656 /* transferbufferlength was only 15 ? */
7660 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7666 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7671 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
7672 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7673 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7674 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0xee; buf
[19] = 0x00;
7676 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
7679 /* transferbufferlength was only 15 ? */
7683 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7689 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7695 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7701 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7707 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7712 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
7713 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7718 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
7719 buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00; buf
[9] = 0x00;
7720 buf
[10] = 0x00; buf
[11] = 0x00; buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00;
7721 buf
[15] = 0x00; buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
7722 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x00; buf
[23] = 0x00; buf
[24] = 0x00;
7723 buf
[25] = 0x00; buf
[26] = 0x00; buf
[27] = 0x00; buf
[28] = 0x00; buf
[29] = 0x00;
7724 buf
[30] = 0x00; buf
[31] = 0x00; buf
[32] = 0x00;
7725 ret
= usb_microdia_control_write(dev
, reg
, buf
, 33);
7728 /* transferbufferlength was only 30 ? */
7732 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7738 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7744 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7750 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7755 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05; buf
[4] = 0x04;
7757 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
7762 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
7763 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7768 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
7769 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7775 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7781 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7787 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7792 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d; buf
[4] = 0x08;
7793 buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d; buf
[8] = 0x0d; buf
[9] = 0x0d;
7794 buf
[10] = 0x11; buf
[11] = 0x0d; buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15;
7795 buf
[15] = 0x21; buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
7796 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d; buf
[24] = 0x19;
7797 buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a; buf
[28] = 0x32; buf
[29] = 0x32;
7798 buf
[30] = 0x2e; buf
[31] = 0x2a; buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36;
7799 buf
[35] = 0x3a; buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
7800 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e; buf
[44] = 0x43;
7801 buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47; buf
[48] = 0x4f; buf
[49] = 0x53;
7802 buf
[50] = 0x58; buf
[51] = 0x58; buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f;
7803 buf
[55] = 0x60; buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
7804 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
7805 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
7808 /* transferbufferlength is only 40 ? */
7811 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15; buf
[4] = 0x11;
7812 buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15; buf
[8] = 0x15; buf
[9] = 0x26;
7813 buf
[10] = 0x53; buf
[11] = 0x36; buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53;
7814 buf
[15] = 0x53; buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
7815 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53; buf
[24] = 0x53;
7816 buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53; buf
[28] = 0x53; buf
[29] = 0x53;
7817 buf
[30] = 0x53; buf
[31] = 0x53; buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53;
7818 buf
[35] = 0x53; buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
7819 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53; buf
[44] = 0x53;
7820 buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53; buf
[48] = 0x53; buf
[49] = 0x53;
7821 buf
[50] = 0x53; buf
[51] = 0x53; buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53;
7822 buf
[55] = 0x53; buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
7823 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
7824 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
7827 /* transferbufferlength is only 40 ? */
7831 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7837 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7843 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7848 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
7849 OV7660_CTL_VREF
, dev
->sensor_flags
, buf
);
7854 buf
[0] = 0x01; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x28;
7856 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
7861 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
7862 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
7868 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7873 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
7874 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7879 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
7880 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
7886 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7892 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7898 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7904 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7910 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7916 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7922 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7928 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7934 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7940 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7946 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7952 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7955 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7961 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7964 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7970 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7973 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7979 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7982 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7988 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7991 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
7997 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8000 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8006 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8011 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8012 OV7660_CTL_CLKRC
, dev
->sensor_flags
, buf
);
8017 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8018 OV7660_CTL_EXHCH
, dev
->sensor_flags
, buf
);
8023 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8024 OV7660_CTL_EXHCL
, dev
->sensor_flags
, buf
);
8029 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8030 OV7660_CTL_DM_LNL
, dev
->sensor_flags
, buf
);
8035 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8036 OV7660_CTL_DM_LNH
, dev
->sensor_flags
, buf
);
8040 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8041 OV7660_CTL_PID
, dev
->sensor_flags
, buf
);
8045 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8046 OV7660_CTL_VER
, dev
->sensor_flags
, buf
);
8050 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8051 OV7660_CTL_MIDH
, dev
->sensor_flags
, buf
);
8055 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8056 OV7660_CTL_MIDL
, dev
->sensor_flags
, buf
);
8062 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8068 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8074 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8080 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8086 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8091 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8092 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc4; buf
[9] = 0x0f;
8093 buf
[10] = 0x44; buf
[11] = 0x00; buf
[12] = 0x3f; buf
[13] = 0x00; buf
[14] = 0xd8;
8094 buf
[15] = 0x0f; buf
[16] = 0xe9; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8096 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8099 /* transferbufferlength is only 15 ? */
8102 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8103 OV7660_CTL_AECH
, dev
->sensor_flags
, buf
);
8108 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8109 OV7660_CTL_COM1
, dev
->sensor_flags
, buf
);
8114 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8115 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc4; buf
[9] = 0x0f;
8116 buf
[10] = 0x44; buf
[11] = 0x00; buf
[12] = 0x3f; buf
[13] = 0x00; buf
[14] = 0xd8;
8117 buf
[15] = 0x0f; buf
[16] = 0xe9; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8119 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8122 /* transferbufferlength is only 15 ? */
8125 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8126 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
8131 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8132 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc4; buf
[9] = 0x0f;
8133 buf
[10] = 0x44; buf
[11] = 0x00; buf
[12] = 0x3f; buf
[13] = 0x00; buf
[14] = 0xd8;
8134 buf
[15] = 0x0f; buf
[16] = 0xe9; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8136 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8139 /* transferbufferlength is only 15 ? */
8141 buf
[0] = 0x00; buf
[1] = 0x01;
8142 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8143 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
8148 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
8149 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
8153 buf
[0] = 0x50; buf
[1] = 0x60;
8154 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8155 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
8161 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8167 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8173 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8179 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8183 buf
[0] = 0xfc; buf
[1] = 0x04;
8184 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8185 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
8190 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8191 buf
[5] = 0x00; buf
[6] = 0xf9; buf
[7] = 0x0f; buf
[8] = 0xc8; buf
[9] = 0x0f;
8192 buf
[10] = 0x3f; buf
[11] = 0x00; buf
[12] = 0x3b; buf
[13] = 0x00; buf
[14] = 0xdb;
8193 buf
[15] = 0x0f; buf
[16] = 0xeb; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8195 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8198 /* transferbufferlength is only 15 ? */
8200 buf
[0] = 0x1f; buf
[1] = 0x00;
8201 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8202 OV7660_CTL_GAIN
, dev
->sensor_flags
, buf
);
8206 buf
[0] = 0x48; buf
[1] = 0x58;
8207 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8208 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
8214 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8220 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8226 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8232 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8236 buf
[0] = 0xf6; buf
[1] = 0x0b;
8237 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8238 OV7660_CTL_ADVFL
, dev
->sensor_flags
, buf
);
8243 buf
[0] = 0x15; buf
[1] = 0x00; buf
[2] = 0x29; buf
[3] = 0x00; buf
[4] = 0x08;
8244 buf
[5] = 0x00; buf
[6] = 0xfc; buf
[7] = 0x0f; buf
[8] = 0xdc; buf
[9] = 0x0f;
8245 buf
[10] = 0x29; buf
[11] = 0x00; buf
[12] = 0x26; buf
[13] = 0x00; buf
[14] = 0xe8;
8246 buf
[15] = 0x0f; buf
[16] = 0xf3; buf
[17] = 0x0f; buf
[18] = 0xeb; buf
[19] = 0x00;
8248 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
8251 /* transferbufferlength is only 15 ? */
8255 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8261 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8267 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8273 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8279 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8283 buf
[0] = 0x50; buf
[1] = 0x60;
8284 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
8285 OV7660_CTL_BLUE
, dev
->sensor_flags
, buf
);
8291 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8297 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8303 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8309 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8315 UDIA_ERROR("r/w in bridge register %x failed (%d)!\n", reg
, ret
);
8319 UDIA_ERROR("r/w in sensor register %x failed (%d)!\n", reg
, ret
);
8325 * @brief From UsbSnoop-plugin-parsed.log
8329 * @returns 0 (OK) or <0 (Error)
8331 * @author Vincent, Kuzja
8333 int microdia_6288_start_stream(struct usb_microdia
*dev
)
8343 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8344 if(ret
< 0) goto err
;
8348 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8349 if(ret
< 0) goto err
;
8353 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8354 if(ret
< 0) goto err
;
8358 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8359 if(ret
< 0) goto err
;
8363 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8364 if(ret
< 0) goto err
;
8368 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8369 if(ret
< 0) goto err
;
8372 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
8373 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
8374 if(ret
< 0) goto err
;
8377 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;
8378 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
8379 if(ret
< 0) goto err
;
8382 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;
8383 ret
= usb_microdia_control_write(dev
, reg
, buf
, 24);
8384 if(ret
< 0) goto err
;
8387 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
8388 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
8389 if(ret
< 0) goto err
;
8392 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
8393 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
8394 if(ret
< 0) goto err
;
8397 buf
[0] = 0x86; buf
[1] = 0xcc; buf
[2] = 0x08;
8398 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
8399 if(ret
< 0) goto err
;
8402 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;
8403 ret
= usb_microdia_control_write(dev
, reg
, buf
, 22);
8404 if(ret
< 0) goto err
;
8407 buf
[0] = 0x00; buf
[1] = 0x00;
8408 ret
= usb_microdia_control_write(dev
, reg
, buf
, 2);
8409 if(ret
< 0) goto err
;
8412 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;
8413 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
8414 if(ret
< 0) goto err
;
8418 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8419 if(ret
< 0) goto err
;
8423 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
8424 if(ret
< 0) goto err
;
8427 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8428 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8429 if(ret
< 0) goto err
;
8432 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8433 if(ret
< 0) goto err
;
8436 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8437 if(ret
< 0) goto err
;
8440 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8441 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8442 if(ret
< 0) goto err
;
8445 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8446 if(ret
< 0) goto err
;
8449 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8450 if(ret
< 0) goto err
;
8453 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8454 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8455 if(ret
< 0) goto err
;
8458 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8459 if(ret
< 0) goto err
;
8462 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8463 if(ret
< 0) goto err
;
8466 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0e; buf
[3] = 0x61; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8467 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8468 if(ret
< 0) goto err
;
8471 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8472 if(ret
< 0) goto err
;
8475 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8476 if(ret
< 0) goto err
;
8479 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8480 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8481 if(ret
< 0) goto err
;
8484 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8485 if(ret
< 0) goto err
;
8488 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8489 if(ret
< 0) goto err
;
8492 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x13; buf
[3] = 0xb8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8493 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8494 if(ret
< 0) goto err
;
8497 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8498 if(ret
< 0) goto err
;
8501 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8502 if(ret
< 0) goto err
;
8505 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x14; buf
[3] = 0x3e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8506 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8507 if(ret
< 0) goto err
;
8510 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8511 if(ret
< 0) goto err
;
8514 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8515 if(ret
< 0) goto err
;
8518 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x16; buf
[3] = 0x24; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8519 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8520 if(ret
< 0) goto err
;
8523 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8524 if(ret
< 0) goto err
;
8527 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8528 if(ret
< 0) goto err
;
8531 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8532 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8533 if(ret
< 0) goto err
;
8536 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8537 if(ret
< 0) goto err
;
8540 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8541 if(ret
< 0) goto err
;
8544 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8545 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8546 if(ret
< 0) goto err
;
8549 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8550 if(ret
< 0) goto err
;
8553 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8554 if(ret
< 0) goto err
;
8557 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8558 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8559 if(ret
< 0) goto err
;
8562 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8563 if(ret
< 0) goto err
;
8566 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8567 if(ret
< 0) goto err
;
8570 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x27; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8571 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8572 if(ret
< 0) goto err
;
8575 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8576 if(ret
< 0) goto err
;
8579 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8580 if(ret
< 0) goto err
;
8583 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x28; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8584 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8585 if(ret
< 0) goto err
;
8588 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8589 if(ret
< 0) goto err
;
8592 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8593 if(ret
< 0) goto err
;
8596 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x29; buf
[3] = 0x15; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8597 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8598 if(ret
< 0) goto err
;
8601 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8602 if(ret
< 0) goto err
;
8605 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8606 if(ret
< 0) goto err
;
8609 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2c; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8610 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8611 if(ret
< 0) goto err
;
8614 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8615 if(ret
< 0) goto err
;
8618 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8619 if(ret
< 0) goto err
;
8622 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8623 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8624 if(ret
< 0) goto err
;
8627 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8628 if(ret
< 0) goto err
;
8631 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8632 if(ret
< 0) goto err
;
8635 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x34; buf
[3] = 0x3d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8636 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8637 if(ret
< 0) goto err
;
8640 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8641 if(ret
< 0) goto err
;
8644 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8645 if(ret
< 0) goto err
;
8648 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x35; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8649 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8650 if(ret
< 0) goto err
;
8653 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8654 if(ret
< 0) goto err
;
8657 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8658 if(ret
< 0) goto err
;
8661 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x36; buf
[3] = 0xf8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8662 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8663 if(ret
< 0) goto err
;
8666 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8667 if(ret
< 0) goto err
;
8670 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8671 if(ret
< 0) goto err
;
8674 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x38; buf
[3] = 0x12; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8675 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8676 if(ret
< 0) goto err
;
8679 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8680 if(ret
< 0) goto err
;
8683 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8684 if(ret
< 0) goto err
;
8687 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x39; buf
[3] = 0x57; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8688 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8689 if(ret
< 0) goto err
;
8692 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8693 if(ret
< 0) goto err
;
8696 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8697 if(ret
< 0) goto err
;
8700 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8701 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8702 if(ret
< 0) goto err
;
8705 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8706 if(ret
< 0) goto err
;
8709 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8710 if(ret
< 0) goto err
;
8713 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3b; buf
[3] = 0xcc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8714 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8715 if(ret
< 0) goto err
;
8718 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8719 if(ret
< 0) goto err
;
8722 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8723 if(ret
< 0) goto err
;
8726 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3c; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8727 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8728 if(ret
< 0) goto err
;
8731 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8732 if(ret
< 0) goto err
;
8735 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8736 if(ret
< 0) goto err
;
8739 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3d; buf
[3] = 0x19; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8740 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8741 if(ret
< 0) goto err
;
8744 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8745 if(ret
< 0) goto err
;
8748 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8749 if(ret
< 0) goto err
;
8752 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3e; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8753 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8754 if(ret
< 0) goto err
;
8757 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8758 if(ret
< 0) goto err
;
8761 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8762 if(ret
< 0) goto err
;
8765 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3f; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8766 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8767 if(ret
< 0) goto err
;
8770 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8771 if(ret
< 0) goto err
;
8774 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8775 if(ret
< 0) goto err
;
8778 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x41; buf
[3] = 0x40; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8779 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8780 if(ret
< 0) goto err
;
8783 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8784 if(ret
< 0) goto err
;
8787 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8788 if(ret
< 0) goto err
;
8791 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x42; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8792 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8793 if(ret
< 0) goto err
;
8796 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8797 if(ret
< 0) goto err
;
8800 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8801 if(ret
< 0) goto err
;
8804 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x45; buf
[3] = 0x46; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8805 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8806 if(ret
< 0) goto err
;
8809 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8810 if(ret
< 0) goto err
;
8813 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8814 if(ret
< 0) goto err
;
8817 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x46; buf
[3] = 0x62; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8818 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8819 if(ret
< 0) goto err
;
8822 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8823 if(ret
< 0) goto err
;
8826 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8827 if(ret
< 0) goto err
;
8830 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x47; buf
[3] = 0x2a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8831 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8832 if(ret
< 0) goto err
;
8835 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8836 if(ret
< 0) goto err
;
8839 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8840 if(ret
< 0) goto err
;
8843 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x48; buf
[3] = 0x3c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8844 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8845 if(ret
< 0) goto err
;
8848 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8849 if(ret
< 0) goto err
;
8852 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8853 if(ret
< 0) goto err
;
8856 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4a; buf
[3] = 0xf0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8857 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8858 if(ret
< 0) goto err
;
8861 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8862 if(ret
< 0) goto err
;
8865 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8866 if(ret
< 0) goto err
;
8869 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4b; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8870 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8871 if(ret
< 0) goto err
;
8874 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8875 if(ret
< 0) goto err
;
8878 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8879 if(ret
< 0) goto err
;
8882 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4c; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8883 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8884 if(ret
< 0) goto err
;
8887 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8888 if(ret
< 0) goto err
;
8891 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8892 if(ret
< 0) goto err
;
8895 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4d; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8896 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8897 if(ret
< 0) goto err
;
8900 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8901 if(ret
< 0) goto err
;
8904 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8905 if(ret
< 0) goto err
;
8908 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4e; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8909 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8910 if(ret
< 0) goto err
;
8913 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8914 if(ret
< 0) goto err
;
8917 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8918 if(ret
< 0) goto err
;
8921 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x69; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8922 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8923 if(ret
< 0) goto err
;
8926 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8927 if(ret
< 0) goto err
;
8930 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8931 if(ret
< 0) goto err
;
8934 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6c; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8935 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8936 if(ret
< 0) goto err
;
8939 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8940 if(ret
< 0) goto err
;
8943 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8944 if(ret
< 0) goto err
;
8947 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6f; buf
[3] = 0x9e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8948 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8949 if(ret
< 0) goto err
;
8952 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8953 if(ret
< 0) goto err
;
8956 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8957 if(ret
< 0) goto err
;
8960 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x70; buf
[3] = 0x05; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8961 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8962 if(ret
< 0) goto err
;
8965 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8966 if(ret
< 0) goto err
;
8969 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8970 if(ret
< 0) goto err
;
8973 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x71; buf
[3] = 0x78; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8974 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8975 if(ret
< 0) goto err
;
8978 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8979 if(ret
< 0) goto err
;
8982 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8983 if(ret
< 0) goto err
;
8986 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x77; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
8987 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
8988 if(ret
< 0) goto err
;
8991 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8992 if(ret
< 0) goto err
;
8995 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
8996 if(ret
< 0) goto err
;
8999 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8a; buf
[3] = 0x23; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9000 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9001 if(ret
< 0) goto err
;
9004 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9005 if(ret
< 0) goto err
;
9008 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9009 if(ret
< 0) goto err
;
9012 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8c; buf
[3] = 0x0d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9013 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9014 if(ret
< 0) goto err
;
9017 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9018 if(ret
< 0) goto err
;
9021 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9022 if(ret
< 0) goto err
;
9025 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x90; buf
[3] = 0x7e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9026 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9027 if(ret
< 0) goto err
;
9030 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9031 if(ret
< 0) goto err
;
9034 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9035 if(ret
< 0) goto err
;
9038 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x91; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9039 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9040 if(ret
< 0) goto err
;
9043 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9044 if(ret
< 0) goto err
;
9047 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9048 if(ret
< 0) goto err
;
9051 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x9f; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9052 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9053 if(ret
< 0) goto err
;
9056 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9057 if(ret
< 0) goto err
;
9060 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9061 if(ret
< 0) goto err
;
9064 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa0; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9065 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9066 if(ret
< 0) goto err
;
9069 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9070 if(ret
< 0) goto err
;
9073 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9074 if(ret
< 0) goto err
;
9077 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa4; buf
[3] = 0x50; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9078 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9079 if(ret
< 0) goto err
;
9082 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9083 if(ret
< 0) goto err
;
9086 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9087 if(ret
< 0) goto err
;
9090 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa5; buf
[3] = 0x68; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9091 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9092 if(ret
< 0) goto err
;
9095 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9096 if(ret
< 0) goto err
;
9099 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9100 if(ret
< 0) goto err
;
9103 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa6; buf
[3] = 0x60; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9104 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9105 if(ret
< 0) goto err
;
9108 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9109 if(ret
< 0) goto err
;
9112 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9113 if(ret
< 0) goto err
;
9116 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa8; buf
[3] = 0xc1; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9117 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9118 if(ret
< 0) goto err
;
9121 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9122 if(ret
< 0) goto err
;
9125 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9126 if(ret
< 0) goto err
;
9129 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa9; buf
[3] = 0xfa; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9130 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9131 if(ret
< 0) goto err
;
9134 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9135 if(ret
< 0) goto err
;
9138 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9139 if(ret
< 0) goto err
;
9142 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaa; buf
[3] = 0x92; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9143 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9144 if(ret
< 0) goto err
;
9147 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9148 if(ret
< 0) goto err
;
9151 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9152 if(ret
< 0) goto err
;
9155 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xab; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9156 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9157 if(ret
< 0) goto err
;
9160 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9161 if(ret
< 0) goto err
;
9164 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9165 if(ret
< 0) goto err
;
9168 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xac; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9169 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9170 if(ret
< 0) goto err
;
9173 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9174 if(ret
< 0) goto err
;
9177 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9178 if(ret
< 0) goto err
;
9181 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xad; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9182 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9183 if(ret
< 0) goto err
;
9186 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9187 if(ret
< 0) goto err
;
9190 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9191 if(ret
< 0) goto err
;
9194 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xae; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9195 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9196 if(ret
< 0) goto err
;
9199 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9200 if(ret
< 0) goto err
;
9203 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9204 if(ret
< 0) goto err
;
9207 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaf; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9208 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9209 if(ret
< 0) goto err
;
9212 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9213 if(ret
< 0) goto err
;
9216 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9217 if(ret
< 0) goto err
;
9220 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb2; buf
[3] = 0xf2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9221 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9222 if(ret
< 0) goto err
;
9225 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9226 if(ret
< 0) goto err
;
9229 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9230 if(ret
< 0) goto err
;
9233 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb3; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9234 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9235 if(ret
< 0) goto err
;
9238 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9239 if(ret
< 0) goto err
;
9242 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9243 if(ret
< 0) goto err
;
9246 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb4; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9247 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9248 if(ret
< 0) goto err
;
9251 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9252 if(ret
< 0) goto err
;
9255 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9256 if(ret
< 0) goto err
;
9259 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb5; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9260 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9261 if(ret
< 0) goto err
;
9264 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9265 if(ret
< 0) goto err
;
9268 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9269 if(ret
< 0) goto err
;
9272 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb6; buf
[3] = 0xaf; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9273 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9274 if(ret
< 0) goto err
;
9277 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9278 if(ret
< 0) goto err
;
9281 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9282 if(ret
< 0) goto err
;
9285 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbb; buf
[3] = 0xae; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9286 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9287 if(ret
< 0) goto err
;
9290 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9291 if(ret
< 0) goto err
;
9294 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9295 if(ret
< 0) goto err
;
9298 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbc; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9299 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9300 if(ret
< 0) goto err
;
9303 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9304 if(ret
< 0) goto err
;
9307 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9308 if(ret
< 0) goto err
;
9311 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbd; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9312 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9313 if(ret
< 0) goto err
;
9316 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9317 if(ret
< 0) goto err
;
9320 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9321 if(ret
< 0) goto err
;
9324 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbe; buf
[3] = 0x3b; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9325 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9326 if(ret
< 0) goto err
;
9329 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9330 if(ret
< 0) goto err
;
9333 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9334 if(ret
< 0) goto err
;
9337 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbf; buf
[3] = 0x3a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9338 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9339 if(ret
< 0) goto err
;
9342 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9343 if(ret
< 0) goto err
;
9346 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9347 if(ret
< 0) goto err
;
9350 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc0; buf
[3] = 0xe2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9351 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9352 if(ret
< 0) goto err
;
9355 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9356 if(ret
< 0) goto err
;
9359 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9360 if(ret
< 0) goto err
;
9363 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc1; buf
[3] = 0xc8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9364 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9365 if(ret
< 0) goto err
;
9368 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9369 if(ret
< 0) goto err
;
9372 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9373 if(ret
< 0) goto err
;
9376 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc2; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9377 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9378 if(ret
< 0) goto err
;
9381 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9382 if(ret
< 0) goto err
;
9385 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9386 if(ret
< 0) goto err
;
9389 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc4; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9390 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9391 if(ret
< 0) goto err
;
9394 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9395 if(ret
< 0) goto err
;
9398 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9399 if(ret
< 0) goto err
;
9402 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc6; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9403 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9404 if(ret
< 0) goto err
;
9407 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9408 if(ret
< 0) goto err
;
9411 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9412 if(ret
< 0) goto err
;
9415 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc7; buf
[3] = 0x81; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9416 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9417 if(ret
< 0) goto err
;
9420 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9421 if(ret
< 0) goto err
;
9424 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9425 if(ret
< 0) goto err
;
9428 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc9; buf
[3] = 0xe0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9429 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9430 if(ret
< 0) goto err
;
9433 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9434 if(ret
< 0) goto err
;
9437 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9438 if(ret
< 0) goto err
;
9441 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xca; buf
[3] = 0xe8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9442 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9443 if(ret
< 0) goto err
;
9446 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9447 if(ret
< 0) goto err
;
9450 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9451 if(ret
< 0) goto err
;
9454 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcc; buf
[3] = 0xd8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9455 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9456 if(ret
< 0) goto err
;
9459 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9460 if(ret
< 0) goto err
;
9463 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9464 if(ret
< 0) goto err
;
9467 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcd; buf
[3] = 0x93; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9468 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9469 if(ret
< 0) goto err
;
9472 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9473 if(ret
< 0) goto err
;
9476 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9477 if(ret
< 0) goto err
;
9480 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9481 if(ret
< 0) goto err
;
9485 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9486 if(ret
< 0) goto err
;
9489 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9490 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9491 if(ret
< 0) goto err
;
9494 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9495 if(ret
< 0) goto err
;
9498 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9499 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9500 if(ret
< 0) goto err
;
9503 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9504 if(ret
< 0) goto err
;
9507 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9508 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9509 if(ret
< 0) goto err
;
9512 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9513 if(ret
< 0) goto err
;
9516 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9517 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9518 if(ret
< 0) goto err
;
9521 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9522 if(ret
< 0) goto err
;
9525 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9526 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9527 if(ret
< 0) goto err
;
9530 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9531 if(ret
< 0) goto err
;
9534 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9535 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9536 if(ret
< 0) goto err
;
9539 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9540 if(ret
< 0) goto err
;
9543 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9544 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9545 if(ret
< 0) goto err
;
9548 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9549 if(ret
< 0) goto err
;
9552 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9553 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9554 if(ret
< 0) goto err
;
9557 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9558 if(ret
< 0) goto err
;
9561 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9562 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9563 if(ret
< 0) goto err
;
9566 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9567 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9568 if(ret
< 0) goto err
;
9571 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9572 if(ret
< 0) goto err
;
9575 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9576 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9577 if(ret
< 0) goto err
;
9580 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9581 if(ret
< 0) goto err
;
9584 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9585 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9586 if(ret
< 0) goto err
;
9589 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9590 if(ret
< 0) goto err
;
9593 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9594 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9595 if(ret
< 0) goto err
;
9598 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9599 if(ret
< 0) goto err
;
9602 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9603 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9604 if(ret
< 0) goto err
;
9607 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9608 if(ret
< 0) goto err
;
9611 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9612 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9613 if(ret
< 0) goto err
;
9616 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9617 if(ret
< 0) goto err
;
9620 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9621 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9622 if(ret
< 0) goto err
;
9625 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9626 if(ret
< 0) goto err
;
9629 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9630 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9631 if(ret
< 0) goto err
;
9634 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9635 if(ret
< 0) goto err
;
9638 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9639 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9640 if(ret
< 0) goto err
;
9643 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
9644 if(ret
< 0) goto err
;
9648 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9649 if(ret
< 0) goto err
;
9653 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9654 if(ret
< 0) goto err
;
9658 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9659 if(ret
< 0) goto err
;
9663 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9664 if(ret
< 0) goto err
;
9668 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9669 if(ret
< 0) goto err
;
9673 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9674 if(ret
< 0) goto err
;
9678 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9679 if(ret
< 0) goto err
;
9683 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9684 if(ret
< 0) goto err
;
9688 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9689 if(ret
< 0) goto err
;
9693 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9694 if(ret
< 0) goto err
;
9698 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9699 if(ret
< 0) goto err
;
9702 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9703 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9704 if(ret
< 0) goto err
;
9707 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9708 if(ret
< 0) goto err
;
9711 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9712 if(ret
< 0) goto err
;
9715 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
9716 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9717 if(ret
< 0) goto err
;
9720 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9721 if(ret
< 0) goto err
;
9724 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9725 if(ret
< 0) goto err
;
9728 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9729 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9730 if(ret
< 0) goto err
;
9733 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9734 if(ret
< 0) goto err
;
9737 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9738 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9739 if(ret
< 0) goto err
;
9742 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9743 if(ret
< 0) goto err
;
9746 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9747 if(ret
< 0) goto err
;
9750 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x50; buf
[5] = 0x78;
9751 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
9752 if(ret
< 0) goto err
;
9755 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
9756 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
9757 if(ret
< 0) goto err
;
9761 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9762 if(ret
< 0) goto err
;
9766 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9767 if(ret
< 0) goto err
;
9770 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
9771 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
9772 if(ret
< 0) goto err
;
9775 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
9776 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
9777 if(ret
< 0) goto err
;
9781 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9782 if(ret
< 0) goto err
;
9786 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9787 if(ret
< 0) goto err
;
9791 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9792 if(ret
< 0) goto err
;
9796 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9797 if(ret
< 0) goto err
;
9801 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9802 if(ret
< 0) goto err
;
9806 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9807 if(ret
< 0) goto err
;
9811 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9812 if(ret
< 0) goto err
;
9815 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9816 if(ret
< 0) goto err
;
9820 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9821 if(ret
< 0) goto err
;
9824 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9825 if(ret
< 0) goto err
;
9829 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9830 if(ret
< 0) goto err
;
9833 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9834 if(ret
< 0) goto err
;
9838 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9839 if(ret
< 0) goto err
;
9842 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9843 if(ret
< 0) goto err
;
9847 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9848 if(ret
< 0) goto err
;
9851 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9852 if(ret
< 0) goto err
;
9856 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9857 if(ret
< 0) goto err
;
9860 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9861 if(ret
< 0) goto err
;
9865 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9866 if(ret
< 0) goto err
;
9869 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9870 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9871 if(ret
< 0) goto err
;
9874 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9875 if(ret
< 0) goto err
;
9878 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9879 if(ret
< 0) goto err
;
9882 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9883 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9884 if(ret
< 0) goto err
;
9887 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9888 if(ret
< 0) goto err
;
9891 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9892 if(ret
< 0) goto err
;
9895 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9896 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9897 if(ret
< 0) goto err
;
9900 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9901 if(ret
< 0) goto err
;
9904 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9905 if(ret
< 0) goto err
;
9908 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9909 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9910 if(ret
< 0) goto err
;
9913 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9914 if(ret
< 0) goto err
;
9917 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9918 if(ret
< 0) goto err
;
9921 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9922 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9923 if(ret
< 0) goto err
;
9926 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9927 if(ret
< 0) goto err
;
9930 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9931 if(ret
< 0) goto err
;
9934 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9935 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9936 if(ret
< 0) goto err
;
9939 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9940 if(ret
< 0) goto err
;
9943 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9944 if(ret
< 0) goto err
;
9947 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9948 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9949 if(ret
< 0) goto err
;
9952 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9953 if(ret
< 0) goto err
;
9956 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9957 if(ret
< 0) goto err
;
9961 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
9962 if(ret
< 0) goto err
;
9965 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x7d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9966 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9967 if(ret
< 0) goto err
;
9970 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9971 if(ret
< 0) goto err
;
9974 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9975 if(ret
< 0) goto err
;
9978 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9979 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9980 if(ret
< 0) goto err
;
9983 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9984 if(ret
< 0) goto err
;
9987 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9988 if(ret
< 0) goto err
;
9991 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
9992 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
9993 if(ret
< 0) goto err
;
9996 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
9997 if(ret
< 0) goto err
;
10000 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10001 if(ret
< 0) goto err
;
10004 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10005 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10006 if(ret
< 0) goto err
;
10009 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10010 if(ret
< 0) goto err
;
10013 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10014 if(ret
< 0) goto err
;
10017 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10018 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10019 if(ret
< 0) goto err
;
10022 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10023 if(ret
< 0) goto err
;
10026 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10027 if(ret
< 0) goto err
;
10030 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10031 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10032 if(ret
< 0) goto err
;
10035 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10036 if(ret
< 0) goto err
;
10039 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10040 if(ret
< 0) goto err
;
10043 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10044 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10045 if(ret
< 0) goto err
;
10048 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10049 if(ret
< 0) goto err
;
10052 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10053 if(ret
< 0) goto err
;
10056 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10057 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10058 if(ret
< 0) goto err
;
10061 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10062 if(ret
< 0) goto err
;
10065 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10066 if(ret
< 0) goto err
;
10070 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10071 if(ret
< 0) goto err
;
10075 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10076 if(ret
< 0) goto err
;
10080 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10081 if(ret
< 0) goto err
;
10085 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10086 if(ret
< 0) goto err
;
10090 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10091 if(ret
< 0) goto err
;
10095 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10096 if(ret
< 0) goto err
;
10100 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10101 if(ret
< 0) goto err
;
10105 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10106 if(ret
< 0) goto err
;
10110 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10111 if(ret
< 0) goto err
;
10115 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10116 if(ret
< 0) goto err
;
10119 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;
10120 ret
= usb_microdia_control_write(dev
, reg
, buf
, 17);
10121 if(ret
< 0) goto err
;
10124 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;
10125 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10126 if(ret
< 0) goto err
;
10129 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;
10130 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10131 if(ret
< 0) goto err
;
10134 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;
10135 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10136 if(ret
< 0) goto err
;
10139 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;
10140 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10141 if(ret
< 0) goto err
;
10144 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;
10145 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10146 if(ret
< 0) goto err
;
10149 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;
10150 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10151 if(ret
< 0) goto err
;
10154 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;
10155 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10156 if(ret
< 0) goto err
;
10159 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;
10160 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10161 if(ret
< 0) goto err
;
10164 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;
10165 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10166 if(ret
< 0) goto err
;
10170 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10171 if(ret
< 0) goto err
;
10175 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10176 if(ret
< 0) goto err
;
10179 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;
10180 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10181 if(ret
< 0) goto err
;
10185 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10186 if(ret
< 0) goto err
;
10190 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10191 if(ret
< 0) goto err
;
10195 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10196 if(ret
< 0) goto err
;
10200 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10201 if(ret
< 0) goto err
;
10205 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10206 if(ret
< 0) goto err
;
10209 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
10210 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10211 if(ret
< 0) goto err
;
10214 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;
10215 ret
= usb_microdia_control_write(dev
, reg
, buf
, 48);
10216 if(ret
< 0) goto err
;
10220 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10221 if(ret
< 0) goto err
;
10225 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10226 if(ret
< 0) goto err
;
10230 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10231 if(ret
< 0) goto err
;
10235 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10236 if(ret
< 0) goto err
;
10239 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
10240 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
10241 if(ret
< 0) goto err
;
10244 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
10245 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10246 if(ret
< 0) goto err
;
10249 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
10250 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10251 if(ret
< 0) goto err
;
10255 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10256 if(ret
< 0) goto err
;
10260 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10261 if(ret
< 0) goto err
;
10265 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10266 if(ret
< 0) goto err
;
10269 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;
10270 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
10271 if(ret
< 0) goto err
;
10274 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;
10275 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
10276 if(ret
< 0) goto err
;
10280 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10281 if(ret
< 0) goto err
;
10285 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10286 if(ret
< 0) goto err
;
10290 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10291 if(ret
< 0) goto err
;
10295 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10296 if(ret
< 0) goto err
;
10300 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10301 if(ret
< 0) goto err
;
10305 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10306 if(ret
< 0) goto err
;
10310 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10311 if(ret
< 0) goto err
;
10315 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10316 if(ret
< 0) goto err
;
10319 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10320 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10321 if(ret
< 0) goto err
;
10324 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10325 if(ret
< 0) goto err
;
10328 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10329 if(ret
< 0) goto err
;
10332 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
10333 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10334 if(ret
< 0) goto err
;
10337 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10338 if(ret
< 0) goto err
;
10341 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10342 if(ret
< 0) goto err
;
10345 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10346 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10347 if(ret
< 0) goto err
;
10350 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10351 if(ret
< 0) goto err
;
10354 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10355 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10356 if(ret
< 0) goto err
;
10359 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10360 if(ret
< 0) goto err
;
10363 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10364 if(ret
< 0) goto err
;
10367 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x50; buf
[5] = 0x78;
10368 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
10369 if(ret
< 0) goto err
;
10372 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
10373 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
10374 if(ret
< 0) goto err
;
10378 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10379 if(ret
< 0) goto err
;
10382 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
10383 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10384 if(ret
< 0) goto err
;
10387 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
10388 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
10389 if(ret
< 0) goto err
;
10393 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10394 if(ret
< 0) goto err
;
10398 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10399 if(ret
< 0) goto err
;
10403 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10404 if(ret
< 0) goto err
;
10408 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10409 if(ret
< 0) goto err
;
10413 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10414 if(ret
< 0) goto err
;
10418 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10419 if(ret
< 0) goto err
;
10423 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10424 if(ret
< 0) goto err
;
10428 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10429 if(ret
< 0) goto err
;
10433 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10434 if(ret
< 0) goto err
;
10438 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10439 if(ret
< 0) goto err
;
10443 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10444 if(ret
< 0) goto err
;
10448 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10449 if(ret
< 0) goto err
;
10452 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10453 if(ret
< 0) goto err
;
10457 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10458 if(ret
< 0) goto err
;
10461 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10462 if(ret
< 0) goto err
;
10466 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10467 if(ret
< 0) goto err
;
10470 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10471 if(ret
< 0) goto err
;
10475 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10476 if(ret
< 0) goto err
;
10479 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10480 if(ret
< 0) goto err
;
10484 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10485 if(ret
< 0) goto err
;
10488 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10489 if(ret
< 0) goto err
;
10493 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10494 if(ret
< 0) goto err
;
10497 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10498 if(ret
< 0) goto err
;
10502 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10503 if(ret
< 0) goto err
;
10506 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10507 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10508 if(ret
< 0) goto err
;
10511 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10512 if(ret
< 0) goto err
;
10515 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10516 if(ret
< 0) goto err
;
10519 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10520 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10521 if(ret
< 0) goto err
;
10524 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10525 if(ret
< 0) goto err
;
10528 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10529 if(ret
< 0) goto err
;
10532 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x70; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10533 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10534 if(ret
< 0) goto err
;
10537 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10538 if(ret
< 0) goto err
;
10541 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10542 if(ret
< 0) goto err
;
10545 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10546 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10547 if(ret
< 0) goto err
;
10550 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10551 if(ret
< 0) goto err
;
10554 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10555 if(ret
< 0) goto err
;
10558 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10559 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10560 if(ret
< 0) goto err
;
10563 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10564 if(ret
< 0) goto err
;
10567 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10568 if(ret
< 0) goto err
;
10571 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10572 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10573 if(ret
< 0) goto err
;
10576 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10577 if(ret
< 0) goto err
;
10580 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10581 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10582 if(ret
< 0) goto err
;
10585 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10586 if(ret
< 0) goto err
;
10589 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10590 if(ret
< 0) goto err
;
10593 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10594 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10595 if(ret
< 0) goto err
;
10598 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10599 if(ret
< 0) goto err
;
10602 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10603 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10604 if(ret
< 0) goto err
;
10607 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10608 if(ret
< 0) goto err
;
10611 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10612 if(ret
< 0) goto err
;
10615 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1c; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10616 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10617 if(ret
< 0) goto err
;
10620 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10621 if(ret
< 0) goto err
;
10624 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10625 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10626 if(ret
< 0) goto err
;
10629 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10630 if(ret
< 0) goto err
;
10633 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10634 if(ret
< 0) goto err
;
10637 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10638 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10639 if(ret
< 0) goto err
;
10642 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10643 if(ret
< 0) goto err
;
10646 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10647 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10648 if(ret
< 0) goto err
;
10651 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10652 if(ret
< 0) goto err
;
10655 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
10656 if(ret
< 0) goto err
;
10660 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10661 if(ret
< 0) goto err
;
10665 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10666 if(ret
< 0) goto err
;
10670 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10671 if(ret
< 0) goto err
;
10674 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;
10675 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10676 if(ret
< 0) goto err
;
10679 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10680 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10681 if(ret
< 0) goto err
;
10684 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10685 if(ret
< 0) goto err
;
10688 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10689 if(ret
< 0) goto err
;
10692 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10693 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10694 if(ret
< 0) goto err
;
10697 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10698 if(ret
< 0) goto err
;
10701 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10702 if(ret
< 0) goto err
;
10705 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10706 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10707 if(ret
< 0) goto err
;
10710 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10711 if(ret
< 0) goto err
;
10714 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10715 if(ret
< 0) goto err
;
10718 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x36; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10719 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10720 if(ret
< 0) goto err
;
10723 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10724 if(ret
< 0) goto err
;
10727 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10728 if(ret
< 0) goto err
;
10731 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10732 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10733 if(ret
< 0) goto err
;
10736 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10737 if(ret
< 0) goto err
;
10740 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10741 if(ret
< 0) goto err
;
10744 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;
10745 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10746 if(ret
< 0) goto err
;
10749 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10750 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10751 if(ret
< 0) goto err
;
10754 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10755 if(ret
< 0) goto err
;
10758 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10759 if(ret
< 0) goto err
;
10762 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;
10763 ret
= usb_microdia_control_write(dev
, reg
, buf
, 21);
10764 if(ret
< 0) goto err
;
10767 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10768 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10769 if(ret
< 0) goto err
;
10772 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10773 if(ret
< 0) goto err
;
10776 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10777 if(ret
< 0) goto err
;
10780 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x94; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10781 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10782 if(ret
< 0) goto err
;
10785 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10786 if(ret
< 0) goto err
;
10789 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10790 if(ret
< 0) goto err
;
10793 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x8d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10794 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10795 if(ret
< 0) goto err
;
10798 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10799 if(ret
< 0) goto err
;
10802 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10803 if(ret
< 0) goto err
;
10807 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10808 if(ret
< 0) goto err
;
10812 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10813 if(ret
< 0) goto err
;
10817 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10818 if(ret
< 0) goto err
;
10822 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10823 if(ret
< 0) goto err
;
10826 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x09; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10827 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10828 if(ret
< 0) goto err
;
10831 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10832 if(ret
< 0) goto err
;
10835 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10836 if(ret
< 0) goto err
;
10839 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x95; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10840 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10841 if(ret
< 0) goto err
;
10844 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10845 if(ret
< 0) goto err
;
10848 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10849 if(ret
< 0) goto err
;
10852 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10853 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10854 if(ret
< 0) goto err
;
10857 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10858 if(ret
< 0) goto err
;
10861 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10862 if(ret
< 0) goto err
;
10866 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10867 if(ret
< 0) goto err
;
10871 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10872 if(ret
< 0) goto err
;
10876 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10877 if(ret
< 0) goto err
;
10881 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10882 if(ret
< 0) goto err
;
10885 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
10886 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10887 if(ret
< 0) goto err
;
10890 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10891 if(ret
< 0) goto err
;
10894 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10895 if(ret
< 0) goto err
;
10898 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x96; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10899 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10900 if(ret
< 0) goto err
;
10903 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10904 if(ret
< 0) goto err
;
10907 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10908 if(ret
< 0) goto err
;
10911 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10912 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10913 if(ret
< 0) goto err
;
10916 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10917 if(ret
< 0) goto err
;
10920 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10921 if(ret
< 0) goto err
;
10925 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10926 if(ret
< 0) goto err
;
10930 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10931 if(ret
< 0) goto err
;
10935 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10936 if(ret
< 0) goto err
;
10940 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10941 if(ret
< 0) goto err
;
10944 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
10945 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
10946 if(ret
< 0) goto err
;
10949 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10950 if(ret
< 0) goto err
;
10953 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
10954 if(ret
< 0) goto err
;
10958 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10959 if(ret
< 0) goto err
;
10963 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10964 if(ret
< 0) goto err
;
10968 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10969 if(ret
< 0) goto err
;
10973 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10974 if(ret
< 0) goto err
;
10978 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10979 if(ret
< 0) goto err
;
10983 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
10984 if(ret
< 0) goto err
;
10989 /* END OF MICRODIA 6288 START STREAM */
10993 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
10998 * @brief From UsbSnoop-plugin-parsed.log
11002 * @returns 0 if all OK
11004 * this function starts video stream Microdia 6128 webcam
11005 * Bridge SN9C325 + OM6802 CMOS sensor
11006 * note: comments are my observations so they could be wrong
11008 int microdia_6128_start_stream(struct usb_microdia
*dev
)
11015 0x00, 0x1a, 0x34, 0x27, 0x20, 0xa0, 0x34, 0x69, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00
11019 0x08, 0x22, 0x44, 0x63, 0x7d, 0x92, 0xa3, 0xaf, 0xbc, 0xc4, 0xcd, 0xd5, 0xdc, 0xe1, 0xe8, 0xef,
11024 0x15, 0x00, 0x2b, 0x00, 0x08, 0x00, 0xeb, 0x0f, 0xd7, 0x0f, 0x43, 0x00, 0x3d, 0x00, 0xca, 0x0f,
11025 0xf7, 0x0f, 0x0c, 0x00, 0x00
11028 __u8 qtable_1
[] = {
11029 0x06, 0x04, 0x04, 0x06, 0x04, 0x04, 0x06, 0x06, 0x06, 0x06, 0x08, 0x06, 0x06, 0x08, 0x0a, 0x10,
11030 0x0a, 0x0a, 0x08, 0x08, 0x0a, 0x13, 0x0e, 0x0e, 0x0c, 0x10, 0x17, 0x13, 0x17, 0x17, 0x15, 0x13,
11031 0x15, 0x15, 0x19, 0x1b, 0x23, 0x1f, 0x19, 0x1b, 0x21, 0x1b, 0x15, 0x15, 0x1f, 0x2b, 0x1f, 0x21,
11032 0x25, 0x27, 0x29, 0x29, 0x29, 0x17, 0x1d, 0x2d, 0x2f, 0x2b, 0x27, 0x2f, 0x23, 0x27, 0x29, 0x27
11036 __u8 qtable_2
[] = {
11037 0x06, 0x08, 0x08, 0x0a, 0x08, 0x0a, 0x12, 0x0a, 0x0a, 0x12, 0x27, 0x19, 0x15, 0x19, 0x27, 0x27,
11038 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27,
11039 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27,
11040 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27, 0x27,
11043 __u8 om6802_sensor
[][8] = {
11044 {0xa0, dev
->sensor_slave_address
, 0xd6, 0x02, 0x00, 0x00, 0x00, 0x10},
11045 {0xa0, dev
->sensor_slave_address
, 0xae, 0xe2, 0x00, 0x00, 0x00, 0x10},
11046 {0xa0, dev
->sensor_slave_address
, 0xdf, 0x6d, 0x00, 0x00, 0x00, 0x10}, // Enter factory mode
11047 {0xa0, dev
->sensor_slave_address
, 0xdd, 0x18, 0x00, 0x00, 0x00, 0x10}, // RGB, uyvy1,Raw RGB, n/1/2, n/clp
11048 {0xa0, dev
->sensor_slave_address
, 0x5a, 0xc0, 0x00, 0x00, 0x00, 0x10},
11049 {0xa0, dev
->sensor_slave_address
, 0xfb, 0x11, 0x00, 0x00, 0x00, 0x10},
11050 {0xa0, dev
->sensor_slave_address
, 0xf0, 0x03, 0x00, 0x00, 0x00, 0x10},
11051 {0xa0, dev
->sensor_slave_address
, 0xe9, 0x00, 0x00, 0x00, 0x00, 0x10},
11052 {0xa0, dev
->sensor_slave_address
, 0xe4, 0xff, 0x00, 0x00, 0x00, 0x10},
11053 {0xa0, dev
->sensor_slave_address
, 0xfb, 0xee, 0x00, 0x00, 0x00, 0x10},
11054 {0xa0, dev
->sensor_slave_address
, 0x5d, 0x80, 0x00, 0x00, 0x00, 0x10},
11055 {0xa0, dev
->sensor_slave_address
, 0x71, 0x84, 0x00, 0x00, 0x00, 0x10},
11056 {0xa0, dev
->sensor_slave_address
, 0x72, 0x00, 0x00, 0x00, 0x00, 0x10},
11057 {0xa0, dev
->sensor_slave_address
, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10},
11058 {0xa0, dev
->sensor_slave_address
, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10},
11059 {0xa0, dev
->sensor_slave_address
, 0x71, 0x18, 0x00, 0x00, 0x00, 0x10},
11060 {0xa0, dev
->sensor_slave_address
, 0x72, 0x04, 0x00, 0x00, 0x00, 0x10},
11061 {0xa0, dev
->sensor_slave_address
, 0x68, 0xde, 0x00, 0x00, 0x00, 0x10},
11062 {0xa0, dev
->sensor_slave_address
, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10}, // 18
11063 {0xa0, dev
->sensor_slave_address
, 0x68, 0x80, 0x00, 0x00, 0x00, 0x10},
11064 {0xa0, dev
->sensor_slave_address
, 0x69, 0x00, 0x00, 0x00, 0x00, 0x10},
11065 {0, 0, 0, 0, 0, 0, 0, 0} // Terminating string
11069 ret
+= usb_microdia_control_write(dev
, 0xf1, buf
, 1); // Reset cam
11072 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1); // Sensor off, video off, clk 12MHz
11074 ret
+= usb_microdia_control_read(dev
, 0x00, buf
, 1); // Check if cam is working, must write 0x12 in buf[0]
11076 if(buf
[0] != 0x12){
11077 UDIA_ERROR("Microdia 6128 webcam not connected or working !!!\n");
11081 ret
+= usb_microdia_control_read(dev
, 0x01, buf
, 1); // Must read 23
11083 if(buf
[0] != 0x23){
11084 UDIA_ERROR("Microdia 6128 webcam is not initialized !!!\n");
11088 buf
[0] = 0x23; buf
[1] = 0x72;
11089 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 2); // Configure GPIO
11091 buf
[0] = 0x34; buf
[1] = 0x27; buf
[2] = 0x20; buf
[3] = 0xa0; buf
[4] = 0x34;
11092 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 5);
11094 buf
[0] = 0x44; buf
[1] = 0x45; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00;
11095 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 5);
11097 buf
[0] = 0x08; buf
[1] = 0x40; buf
[2] = 0x20; buf
[3] = 0x00; buf
[4] = 0x00;
11098 ret
+= usb_microdia_control_write(dev
, 0x9a, buf
, 5);
11100 buf
[0] = 0x60; buf
[1] = 0x00; buf
[2] = 0x00;
11101 ret
+= usb_microdia_control_write(dev
, 0xd4, buf
, 3);
11102 ret
+= usb_microdia_control_write(dev
, 0x03, data_15
, 15);
11105 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11108 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11110 buf
[0] = 0x22; buf
[1] = 0x62;
11111 ret
+= usb_microdia_control_write(dev
, 0x01, &buf
[0], 1);
11112 ret
+= usb_microdia_control_write(dev
, 0x01, &buf
[1], 1);
11115 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11116 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11118 buf
[0] = 0x42; // Sensor on, clk 24MHz, video off
11119 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11120 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11123 for (i
= 0; i
< 2; i
++){
11124 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11129 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11132 for (i
= 2; i
< 11; i
++){
11133 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11138 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11139 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1); // URB 1780
11142 ret
+= usb_microdia_control_write(dev
, 0x15, buf
, 1);
11145 ret
+= usb_microdia_control_write(dev
, 0x16, buf
, 1);
11148 ret
+= usb_microdia_control_write(dev
, 0x12, buf
, 1);
11151 ret
+= usb_microdia_control_write(dev
, 0x13, buf
, 1);
11154 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11157 ret
+= usb_microdia_control_write(dev
, 0xd2, buf
, 1);
11160 ret
+= usb_microdia_control_write(dev
, 0xd3, buf
, 1);
11163 ret
+= usb_microdia_control_write(dev
, 0xc6, buf
, 1);
11164 ret
+= usb_microdia_control_write(dev
, 0xc7, buf
, 1);
11167 ret
+= usb_microdia_control_write(dev
, 0xc8, buf
, 1);
11170 ret
+= usb_microdia_control_write(dev
, 0xc9, buf
, 1);
11173 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11176 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11179 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11180 ret
+= usb_microdia_control_write(dev
, 0x07, buf
, 1);
11181 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11184 ret
+= usb_microdia_control_write(dev
, 0x14, buf
, 1);
11186 ret
+= usb_microdia_control_write(dev
, 0x20, data_17
, 17);
11187 ret
+= usb_microdia_control_write(dev
, 0x20, data_17
, 17);
11189 for (i
= 0; i
< 8; ++i
) // writing the same buffer 8 times, why ??
11190 ret
+= usb_microdia_control_write(dev
, 0x84, data_21
, 21);
11192 data_21
[0] = 0x16; data_21
[10] = 40; data_21
[12] = 0x3f;
11193 ret
+= usb_microdia_control_write(dev
, 0x84, data_21
, 21);
11196 ret
+= usb_microdia_control_write(dev
, 0x9a, buf
, 1);
11199 ret
+= usb_microdia_control_write(dev
, 0x99, buf
, 1);
11201 ret
+= usb_microdia_control_write(dev
, 0x84, data_21
, 21); // URB 1811
11204 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11205 ret
+= usb_microdia_control_write(dev
, 0x07, buf
, 1);
11206 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11209 for (i
= 11; i
< 15; i
++){
11210 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11215 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11217 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11219 buf
[0] = buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
11220 ret
+= usb_microdia_control_write(dev
, 0xc0, buf
, 6);
11222 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
11223 ret
+= usb_microdia_control_write(dev
, 0xca, buf
, 4);
11225 buf
[0] = 0x1e; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xe7;
11226 ret
+= usb_microdia_control_write(dev
, 0xce, buf
, 4);
11229 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11232 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11235 for (i
= 15; i
< 19; i
++){
11236 ret
+= usb_microdia_control_write(dev
, 0x08, om6802_sensor
[i
], 8);
11241 ret
+= usb_microdia_control_write(dev
, 0x05, buf
, 1);
11244 ret
+= usb_microdia_control_write(dev
, 0x06, buf
, 1);
11246 // This changes the mode (VGA = 0 , CIF = 1)
11247 // buf = 0x40 | 0x05 | (mode << 4) 45 or 55
11249 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11251 // This is the Q table
11252 ret
+= usb_microdia_control_write(dev
, 0x0100, qtable_1
, 64); // first time
11253 ret
+= usb_microdia_control_write(dev
, 0x0140, qtable_2
, 64); // second time
11255 // mode: VGA = 0, CIF = 1
11256 // buf = 0x05 | (mode << 4) 05 or 15
11258 ret
+= usb_microdia_control_write(dev
, 0x18, buf
, 1);
11261 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11262 ret
+= usb_microdia_control_write(dev
, 0x02, buf
, 1);
11264 buf
[0] = 0x42; // Sensor on, Video disabled, clk 24MHz
11265 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11268 ret
+= usb_microdia_control_write(dev
, 0x17, buf
, 1);
11270 // Command to start streaming
11271 // Sensor on, clk 24MHz, video enabled
11273 ret
+= usb_microdia_control_write(dev
, 0x01, buf
, 1);
11275 // When the device reads 46 from reg 0x01 it means that
11276 // camera is streaming
11277 ret
+= usb_microdia_control_read(dev
, 0x01, buf
, 1); // Must read 0x46
11280 UDIA_DEBUG("Some read or write were not successful in Start Stream\n");
11286 int dev_microdia_stop_stream(struct usb_microdia
*dev
)
11289 if(dev
&& dev
->stop_stream
)
11290 ret
= dev
->stop_stream(dev
);
11296 * @brief From stop.htm
11304 * For SN9C201 with MI1310.
11305 * This function has not been tested yet.
11307 int microdia_6242_stop_stream(struct usb_microdia
*dev
)
11311 __u8 only10c0
[3] = {0x0d, 0x00, 0x00};
11314 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
11317 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11320 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11322 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
11323 only10c0
[0], dev
->sensor_flags
, &only10c0
[1]);
11326 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
11329 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
11332 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11335 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11338 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
11339 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
11342 * After the select alternate setting 0 is actually another transfer:
11344 * usb_microdia_control_write(dev, 0x1066, buf, 1);
11351 * @brief From stopstream.log
11359 * For SN9C201 with SOI968.
11360 * I don't whether the function really stops the stream.
11361 * Nevertheless the LED on the webcam now stops glowing.
11362 * The function is very similar to "microdia_624f_stop_stream".
11364 int microdia_624e_stop_stream(struct usb_microdia
*dev
)
11369 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
11371 /* Next two writes added because it works better.
11372 * The LED stops glowing and I think the stream does too.
11373 * 0x20 = 0b00100000 which is the minimal of what the other stopstreams have in common.
11376 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11379 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11382 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
11385 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
11387 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
11388 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
11390 usb_microdia_control_read(dev
, 0x1066, buf
, 1);
11395 int microdia_624f_stop_stream(struct usb_microdia
*dev
)
11403 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11404 if(ret
< 0) goto err
;
11408 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11409 if(ret
< 0) goto err
;
11413 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11414 if(ret
< 0) goto err
;
11418 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11419 if(ret
< 0) goto err
;
11423 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11424 if(ret
< 0) goto err
;
11428 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11429 if(ret
< 0) goto err
;
11435 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
11436 if(ret
< 0) goto err
;
11439 ret
= usb_microdia_control_read(dev
, command
, buf
, 1);
11440 if(ret
< 0) goto err
;
11443 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
11444 if(ret
< 0) goto err
;
11449 UDIA_ERROR("command %x failed (%d)!\n", command
, ret
);
11453 int microdia_6260_stop_stream(struct usb_microdia
*dev
)
11459 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
11461 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
11463 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
11465 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
11467 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
11469 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
11470 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 3);
11473 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
11474 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
11476 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
11478 ret
= usb_microdia_control_write(dev
, 0x10c8, buf
, 1);
11480 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
11486 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
11490 * @returns 0 (ok) or -1 (error)
11492 * @author Comer352l
11494 * Windows driver version: 5.7.23.000
11495 * Windows versions: 2000 and XP
11496 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
11497 * All logs were made using AMCAP with 640x480, RGB24
11499 int microdia_6270_stop_stream(struct usb_microdia
*dev
)
11505 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
11508 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); // URB 3541
11510 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); // URB 3542
11511 // => These two writes seem to cause the cam to stop sending isochronus USB messages
11514 ret
+= usb_microdia_control_write(dev
, 0x1061, buf
, 1); // URB 3544
11515 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
11518 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); // URB 3541
11520 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); // URB 3542
11522 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
11524 // Write to sensor register 0x07: Output Control
11525 buf
[0] = 0x00; buf
[1] = 0x00; // stop sensor readout, normal operation
11526 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
11528 buf
[0] = 0x38; // ALEX: 0x3c
11529 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 1); // URB 3545
11530 buf
[0] = 0x6d; // ALEX: 0xec; FRANK: also 0x6c
11531 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); // URB 3546
11532 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
11533 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 3); // URB 3547
11535 // INTERRUPT COMMING BACK (URB 2227)
11536 // SELECT ALTERNATE SETTINGS (URB 3548)
11537 // INTERRUPT GOING DOWN (URB 3549)
11540 ret
+= usb_microdia_control_write(dev
, 0x1066, buf
, 1); // URB 3550
11544 UDIA_INFO("One ore more errors occured while stopping stream !\n");
11551 int microdia_627b_stop_stream(struct usb_microdia
*dev
)
11559 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11565 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11572 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11573 //if(ret < 0) goto err;
11577 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11578 //if(ret < 0) goto err;
11583 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11590 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11591 //if(ret < 0) goto err;
11595 //ret = usb_microdia_control_write(dev, reg, buf, 1);
11596 //if(ret < 0) goto err;
11601 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11607 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11612 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
11613 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
11619 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11625 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
11630 * @brief From UsbSnoop-plugin-parsed.log
11634 * @returns 0 (OK) or <0 (Error)
11636 * @author Vincent, Kuzja
11638 int microdia_6288_stop_stream(struct usb_microdia
*dev
)
11646 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11647 if(ret
< 0) goto err
;
11651 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11652 if(ret
< 0) goto err
;
11656 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11657 if(ret
< 0) goto err
;
11661 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11662 if(ret
< 0) goto err
;
11666 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11667 if(ret
< 0) goto err
;
11670 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
11671 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
11672 if(ret
< 0) goto err
;
11676 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
11677 if(ret
< 0) goto err
;
11681 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
11686 * @brief From UsbSnoop-plugin-parsed.log
11690 * @returns 0 if all OK
11692 * This function stops the video stream for microdia 6128
11693 * Bridge SN9C325 + OM6802 CMOS sensor
11694 * note: comments are my observations so they could be wrong
11696 int microdia_6128_stop_stream(struct usb_microdia
*dev
)
11701 ret
+= usb_microdia_control_read(dev
, 0x00, &data
, 1);
11703 // Stop stream command
11705 ret
+= usb_microdia_control_write(dev
, 0x01, &data
, 1);
11708 ret
+= usb_microdia_control_write(dev
, 0xf1, &data
, 1);
11711 ret
+= usb_microdia_control_write(dev
, 0xf1, &data
, 1);
11714 UDIA_DEBUG("Some read or write were not successful in Stop Stream\n");
11721 int microdia_624f_set_exposure(struct usb_microdia
*dev
)
11724 __u8 v1
= (dev
->vsettings
.exposure
>> 4) & 0xff;
11725 __u8 v2
= dev
->vsettings
.exposure
>> 12;
11727 ret
|= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x2d,
11728 dev
->sensor_flags
, &v1
);
11730 ret
|= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x2e,
11731 dev
->sensor_flags
, &v2
);
11736 int microdia_624f_flip_detect(struct usb_microdia
*dev
)
11741 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
11742 if (ret
< 0) return -EAGAIN
;
11744 dev
->vsettings
.vflip
= 1;
11747 dev
->vsettings
.vflip
= 0;
11753 int microdia_6260_flip_detect(struct usb_microdia
*dev
)
11755 const __u8 flip_bit
= 0x01;
11758 static __u8 flip_reg
= flip_bit
;
11761 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
11764 if (flip_reg
!= (val
& flip_bit
)) {
11765 if (val
& flip_bit
)
11769 ret
= ov7670_auto_flip(dev
, vflip
);
11770 flip_reg
= (val
& flip_bit
);