3 * @author Nicolas VIVIEN
6 * @brief Device specific functions
8 * @note Copyright (C) Nicolas VIVIEN
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
27 #include <linux/errno.h>
28 #include <linux/string.h>
39 * @brief Set USB-bandwidth to maximum
41 * @param dev Pointer to device structure
43 * @returns 0 or negative error value
45 int dev_microdia_camera_on(struct usb_microdia
*dev
)
48 struct usb_device
*udev
= dev
->udev
;
50 ret
= usb_set_interface(udev
, 0, 8);
53 UDIA_ERROR("usb_set_interface failed !\n");
59 * @brief Set USB-bandwidth to minimum
61 * @param dev Pointer to device structure
63 * @returns 0 or negative error value
65 int dev_microdia_camera_off(struct usb_microdia
*dev
)
68 struct usb_device
*udev
= dev
->udev
;
70 ret
= usb_set_interface(udev
, 0, 0);
73 UDIA_ERROR("usb_set_interface failed !\n");
79 * @brief Wrapper function for camera-setting functions
81 * @param dev Pointer to device structure
85 int dev_microdia_camera_settings(struct usb_microdia
*dev
)
87 dev_microdia_camera_set_contrast(dev
);
88 dev_microdia_camera_set_brightness(dev
);
89 dev_microdia_camera_set_gamma(dev
);
90 dev_microdia_camera_set_exposure(dev
);
91 dev_microdia_camera_set_hvflip(dev
);
92 dev_microdia_camera_set_sharpness(dev
);
93 dev_microdia_camera_set_rgb_gain(dev
);
94 dev_microdia_camera_set_auto_exposure(dev
);
95 dev_microdia_camera_set_auto_whitebalance(dev
);
100 * @brief Wrapper function for device-specific contrast functions
102 * @param dev Pointer to device structure
104 * @returns 0 or negative error value
106 int dev_microdia_camera_set_contrast(struct usb_microdia
*dev
)
109 if (dev
&& dev
->set_contrast
)
110 ret
= dev
->set_contrast(dev
);
115 * @brief Wrapper function for device-specific brightness functions
117 * @param dev Pointer to device structure
119 * @returns 0 or negative error value
121 int dev_microdia_camera_set_brightness(struct usb_microdia
*dev
)
124 if (dev
&& dev
->set_brightness
)
125 ret
= dev
->set_brightness(dev
);
130 * @brief Wrapper function for device-specific gamma functions
132 * @param dev Pointer to device structure
134 * @returns 0 or negative error value
136 int dev_microdia_camera_set_gamma(struct usb_microdia
*dev
)
139 if (dev
&& dev
->set_gamma
)
140 ret
= dev
->set_gamma(dev
);
145 * @brief Wrapper function for device-specific exposure functions
147 * @param dev Pointer to device structure
149 * @returns 0 or negative error value
151 int dev_microdia_camera_set_exposure(struct usb_microdia
*dev
)
153 if (dev
->set_exposure
!= NULL
)
154 return dev
->set_exposure(dev
);
160 * @brief Wrapper function for device-specific hvflip functions
162 * @param dev Pointer to device structure
164 * @returns 0 or negative error value
166 int dev_microdia_camera_set_hvflip(struct usb_microdia
*dev
)
169 if (dev
&& dev
->set_hvflip
)
170 ret
= dev
->set_hvflip(dev
);
176 * @brief Wrapper function for device-specific sharpness functions
178 * @param dev Pointer to device structure
180 * @returns 0 or negative error value
182 int dev_microdia_camera_set_sharpness(struct usb_microdia
*dev
)
185 if (dev
&& dev
->set_sharpness
)
186 ret
= dev
->set_sharpness(dev
);
192 * @brief Wrapper function for device-specific rgb-gain functions
194 * @param dev Pointer to device structure
196 * @returns 0 or negative error value
198 int dev_microdia_camera_set_rgb_gain(struct usb_microdia
*dev
)
201 if (dev
&& dev
->set_rgb_gain
)
202 ret
= dev
->set_rgb_gain(dev
);
208 * @brief Wrapper function for device-specific auto-exposure functions
210 * @param dev Pointer to device structure
212 * @returns 0 or negative error value
214 int dev_microdia_camera_set_auto_exposure(struct usb_microdia
*dev
)
217 if (dev
&& dev
->set_auto_exposure
)
218 ret
= dev
->set_auto_exposure(dev
);
224 * @brief Wrapper function for device-specific auto-whitebalance functions
226 * @param dev Pointer to device structure
228 * @returns 0 or negative error value
230 int dev_microdia_camera_set_auto_whitebalance(struct usb_microdia
*dev
)
233 if (dev
&& dev
->set_auto_whitebalance
)
234 ret
= dev
->set_auto_whitebalance(dev
);
241 * @brief Wrapper function for device-specific initialization functions
243 * @param dev Pointer to device structure
245 * @returns 0 or negative error value
247 int dev_microdia_initialize_device(struct usb_microdia
*dev
)
251 if (dev
&& dev
->initialize
)
252 ret
= dev
->initialize(dev
);
258 * @brief From init-physical-replug.log
266 * For SN9C201 with MI1300.
269 int microdia_6240_initialize(struct usb_microdia
*dev
)
275 * @brief From start.log (14 jun 2008)
283 * For SN9C201 with MI1300.
286 int microdia_6240_start_stream(struct usb_microdia
*dev
)
293 /* Setup the bridge registers */
294 static __u16 bridge6240_init
[][2] = {
1019 static __u8 mi1300_init
[][2] = {
1206 /* initialize SN9C201 for 6240 */
1207 for (i
= 0; i
< ARRAY_SIZE(bridge6240_init
); i
++) {
1208 reg
= bridge6240_init
[i
][0];
1209 value
[0] = bridge6240_init
[i
][1];
1210 ret
= usb_microdia_control_write(dev
, reg
, value
, 1);
1212 UDIA_INFO("6240 Bridge: Inititialization Error (%d) on array line %d\n", ret
, i
);
1217 /* initialize the Bridge to I2C interface */
1218 ret
= sn9c20x_i2c_initialize(dev
);
1220 /* initialize the Sensor MI 1300 */
1221 for (i
= 0; i
< ARRAY_SIZE(mi1300_init
); i
++) {
1222 reg
= mi1300_init
[i
][0];
1223 value
[0] = mi1300_init
[i
][1];
1224 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
1225 reg
, dev
->sensor_flags
, value
);
1227 UDIA_INFO("Sensor MI 1300: Inititialization Error (%d) on array line %d\n", ret
, i
);
1232 UDIA_INFO("...start function completed without errors.\n");
1237 * @brief From stop-close-amcap.log
1245 * For SN9C201 with MI1300. Comments from parser-usbsnoop(updated_13Mar2008).pl output
1248 int microdia_6240_stop_stream(struct usb_microdia
*dev
)
1255 static __u8 mi1300_stop
[][2] = {
1260 static __u16 bridge6240_stop
[][2] = {
1272 UDIA_INFO("Stopping camera...\n");
1274 for (i
= 0; i
< ARRAY_SIZE(mi1300_stop
); i
++) {
1275 reg
= mi1300_stop
[i
][0];
1276 value
[0] = mi1300_stop
[i
][1];
1277 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
1278 reg
, dev
->sensor_flags
, value
);
1280 UDIA_INFO("Sensor MI 1300: Stop Sequence Error (%d) on array line %d\n", ret
, i
);
1285 for (i
= 0; i
< ARRAY_SIZE(bridge6240_stop
); i
++) {
1286 reg
= bridge6240_stop
[i
][0];
1287 value
[0] = bridge6240_stop
[i
][1];
1288 ret
= usb_microdia_control_write(dev
, reg
, value
, 1);
1290 UDIA_INFO("6240 Bridge: Stop Sequence Error (%d) on array line %d\n", ret
, i
);
1299 * @brief From init.sequence.log
1307 * For SN9C201 with SOI968.
1308 * Tests showed this function is actually unnecessary.
1309 * Nevertheless the reads may give us valuable values we don't know about yet.
1311 int microdia_624e_initialize(struct usb_microdia
*dev
)
1315 usb_microdia_control_read(dev
, 0x130d, &buf
, 1);
1316 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
1322 * @brief From UsbSnoop-plugin-parsed.log
1328 int microdia_624f_initialize(struct usb_microdia
*dev
)
1330 /* Do nothing here */
1335 * @brief From UsbSnoop-plugin-parsed.log
1341 int microdia_6260_initialize(struct usb_microdia
*dev
)
1345 usb_microdia_control_read(dev
, 0x130d, &buf
, 1);
1346 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
1348 usb_microdia_control_write(dev
, 0x10c8, &buf
, 1);
1349 usb_microdia_control_read(dev
, 0x100a, &buf
, 1);
1351 usb_microdia_control_write(dev
, 0x100a, &buf
, 1);
1352 usb_microdia_control_read(dev
, 0x100b, &buf
, 1);
1354 usb_microdia_control_write(dev
, 0x100b, &buf
, 1);
1355 usb_microdia_control_read(dev
, 0x1001, &buf
, 1);
1357 usb_microdia_control_write(dev
, 0x1001, &buf
, 1);
1358 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
1360 usb_microdia_control_write(dev
, 0x1040, &buf
, 1);
1361 usb_microdia_control_read(dev
, 0x1045, &buf
, 1);
1363 usb_microdia_control_write(dev
, 0x1045, &buf
, 1);
1364 usb_microdia_control_read(dev
, 0x1046, &buf
, 1);
1366 usb_microdia_control_write(dev
, 0x1046, &buf
, 1);
1368 usb_microdia_control_write(dev
, 0x1045, &buf
, 1);
1370 usb_microdia_control_write(dev
, 0x1040, &buf
, 1);
1372 usb_microdia_control_write(dev
, 0x1020, &buf
, 1);
1378 * @brief From 6 init-logs
1382 * @returns 0 (ok) or -1 (error)
1386 * Windows driver versions: 5.5.8.12 and 5.7.23.000
1387 * Windows versions: 2000 and XP
1388 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
1390 * Comments behind read oprations contain HEX-values that appeared in the logs
1392 int microdia_6270_initialize(struct usb_microdia
*dev
)
1404 ret
+= usb_microdia_control_read(dev
, 0x130d, buf
, 1); /* URB 5 0x81,0x85,0x04,0x8b,0x02,... */
1406 ret
+= usb_microdia_control_read(dev
, 0x1040, buf
, 1); /* URB 6 0xe4,0xc4,0xa4,0x44,... */
1409 * THE OLD DRIVER 5.5.8.12 DOES AN ADDITIONAL WRITE HERE:
1411 * usb_microdia_control_write(dev, 0x10c8, buf, 1);
1414 ret
+= usb_microdia_control_read(dev
, 0x118a, buf
, 1); /* URB 7 0x05,0x7b,0x01,0x04,... */
1416 ret
+= usb_microdia_control_read(dev
, 0x0395, buf_0395
, 1); /* URB 8 0xc2,0x82,0x38,0x98,0x04,... */
1417 /* => this value will be rewritten to 0x118a and 0x0395 later (URBs 81+82) */
1420 ret
+= usb_microdia_control_write(dev
, 0x118a, buf
, 1); /* URB 9 */
1422 ret
+= usb_microdia_control_write(dev
, 0x0395, buf
, 1); /* URB 10 */
1424 ret
+= usb_microdia_control_read(dev
, 0x11b8, buf_11b8
, 1); /* URB 11 0xa0,0x00,0x24,... */
1425 /* => this value will be rewritten to 0x11b8 later (URB 83) */
1428 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 12 */
1430 ret
+= usb_microdia_control_read(dev
, 0x1000, buf_1000
, 5); /* URB 13 0x30 0xCF 0x00 0x03 (0x02 or 0x00) */
1431 /* => these values will be rewritten to 0x1000 later (URB 84) */
1433 buf
[0] = 0x70; buf
[1] = 0x00; buf
[2] = 0x18; buf
[3] = 0x00; buf
[4] = 0x00;
1434 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 5); /* URB 14 */
1436 ret
+= usb_microdia_control_read(dev
, 0x1060, buf_1060
, 2); /* URB 15 0x08 0x00 (always ???) */
1437 /* => this value will be rewritten to 0x1060 later (URB 85) */
1439 buf
[0] = 0x00; buf
[1] = 0x03;
1440 ret
+= usb_microdia_control_write(dev
, 0x1060, buf
, 2); /* URB 16 */
1442 /* initialize I2C registers to avoid getting no ACK at first I2C operation: */
1443 ret
+= sn9c20x_i2c_initialize(dev
);
1445 /* enable I2C communication (bit 0) */
1446 buf
[0] = 0x21; /* THE OLD DRIVER 5.5.8.12 WRITES 0x5d */
1447 ret
+= usb_microdia_control_write(dev
, 0x10c8, buf
, 1); /* URB 17 */
1449 /* probe sensor model: */
1450 retSP
= mt9vx11_sensor_probe(dev
); /* substitutes URBs 18-48 */
1451 if ((retSP
== 0) && (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
))
1452 /* switch (back) to IFP address space: */
1453 retASS
= mt9v111_select_address_space(dev
, MT9V111_ADDRESSSPACE_IFP
);
1455 ret
+= usb_microdia_control_write(dev
, 0x118a, buf_0395
, 1); /* URB 81 => write value read with URB 8 */
1457 ret
+= usb_microdia_control_write(dev
, 0x0395, buf_0395
, 1); /* URB 82 => write value read with URB 8 */
1459 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf_11b8
, 1); /* URB 83 => write value read with URB 11 */
1461 ret
+= usb_microdia_control_write(dev
, 0x1000, buf_1000
, 5); /* URB 84 => write value read with URB 13 */
1463 ret
+= usb_microdia_control_write(dev
, 0x1060, buf_1060
, 2); /* URB 85 => write value read with URB 15; (always 08 00 ???) */
1465 /* USB-interrupt-message: doesn't work yet (returns error -110) */
1466 /* 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 */
1469 * THE OLD DRIVER 5.5.8.12 DOES AN ADDITIONAL WRITE HERE:
1471 * usb_microdia_control_write(dev, 0x1020, wbuf, 1);
1474 if ((retSP
!= 0) || (retASS
!= 0) || (ret
< 33)) {
1476 UDIA_INFO("One ore more errors occured during initialization !\n");
1485 * @brief From UsbSnoop-plugin-parsed.log
1491 int microdia_627b_initialize(struct usb_microdia
*dev
)
1493 /* Apparently we don't need to write anything here */
1498 * @brief From init-start-stop-log (made by VÃctor M. Hernández Rocamora)
1502 * @returns 0 (ok) or -1 (error)
1506 * USB-Logger: SniffUSB 2.0
1508 * Comments behind read oprations contain HEX-values that appeared in the log
1510 int microdia_627f_initialize(struct usb_microdia
*dev
)
1515 ret
+= usb_microdia_control_read(dev
, 0x130d, buf
, 1); /* URB 5 0x81 */
1517 ret
+= usb_microdia_control_read(dev
, 0x1040, buf
, 1); /* URB 6 0xe4 */
1520 ret
+= usb_microdia_control_write(dev
, 0x10c8, buf
, 1); /* URB 7 */
1523 ret
+= usb_microdia_control_write(dev
, 0x1020, buf
, 1); /* URB 8 */
1525 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); /* URB 9 0x0f */
1528 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); /* URB 10 */
1530 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); /* URB 11 0x1f */
1533 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); /* URB 12 */
1535 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); /* URB 13 0x0f */
1538 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); /* URB 14 */
1541 UDIA_INFO("One ore more errors occured during initialization !\n");
1548 * @brief From UsbSnoop-plugin-parsed.log
1552 * @returns 0 (OK) or <0 (Error)
1554 * @author Vincent, Kuzja
1556 int microdia_6288_initialize(struct usb_microdia
*dev
)
1564 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
1569 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
1578 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
1583 * @brief Wrapper function for device-specific startstream functions
1585 * @param dev Pointer to device structure
1589 int dev_microdia_start_stream(struct usb_microdia
*dev
)
1592 if (dev
&& dev
->start_stream
)
1593 ret
= dev
->start_stream(dev
);
1599 * @brief From start.htm
1607 * For SN9C201 with MI1310.
1608 * This function has not been tested yet.
1610 int microdia_6242_start_stream(struct usb_microdia
*dev
)
1616 0x01, 0x18, 0x00, 0x30, 0x00, 0x09, 0x00, 0xed,
1617 0x0f, 0xda, 0x0f, 0x3a, 0x00, 0x3a, 0x00, 0xd0,
1618 0x0f, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x60, 0x0a};
1621 0x02, 0x00, 0x02, 0x00, 0x50, 0x78, 0x00, 0x00,
1625 0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0x24, 0x3b,
1626 0x4f, 0x61, 0x71, 0x80, 0x8f, 0x9d, 0xab, 0xb8,
1627 0xc4, 0xd1, 0xdd, 0xe9, 0xf4, 0xff};
1629 __u8 qtable1
[64] = {
1630 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
1631 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
1632 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
1633 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
1634 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
1635 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
1636 0x4f, 0x54, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
1637 0x64, 0x5c, 0x54, 0x64, 0x4b, 0x54, 0x58, 0x54};
1639 __u8 qtable2
[64] = {
1640 0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
1641 0x15, 0x26, 0x54, 0x36, 0x2e, 0x36, 0x54, 0x54,
1642 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1643 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1644 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1645 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1646 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1647 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54};
1649 __u8 first10c0
[7][3] = {
1659 __u8 second10c0a
[2][5] = {
1660 {0x01, 0x00, 0x0e, 0x00, 0x14},
1661 {0x03, 0x03, 0xc4, 0x05, 0x14}
1664 __u8 second10c0b
[3] =
1667 __u8 third10c0
[4][3] = {
1674 __u8 fourth10c0a
[3][3] = {
1680 __u8 fourth10c0b
[2][5] = {
1681 {0x2b, 0x01, 0x88, 0x01, 0x88},
1682 {0x2d, 0x01, 0x88, 0x01, 0x88}
1685 __u8 fifth10c0
[4][3] = {
1691 /* interrupt down */
1694 usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 1 */
1697 /* interrupt down */
1700 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
1703 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
1706 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
1709 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1712 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
1715 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
1718 usb_microdia_control_write(dev
, 0x1020, buf
, 1);
1720 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
1721 buf
[3] = 0x10; buf
[4] = 0x08;
1722 usb_microdia_control_write(dev
, 0x1067, buf
, 5);
1724 buf
[0] = 0xb0; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x0d;
1725 buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00;
1726 buf
[6] = 0x00; buf
[7] = 0x10; buf
[8] = 0x03;
1727 usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
1729 usb_microdia_control_write(dev
, 0x10e0, urb10
, 24); /* URB 10 */
1731 buf
[0] = 0x00; buf
[1] = 0x00; buf
[3] = 0x00;
1732 usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
1734 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00;
1735 buf
[3] = 0xe0; buf
[4] = 0x03;
1736 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
1738 usb_microdia_control_write(dev
, 0x1180, urb13
, 11);
1740 usb_microdia_control_write(dev
, 0x118b, urb14
, 22);
1742 buf
[0] = 0x00; buf
[1] = 0x00;
1743 usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
1745 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00;
1746 buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00;
1747 buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00;
1748 usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
1751 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1754 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
1756 for (i
= 0; i
< 7; i
++)
1757 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1758 first10c0
[i
][0], dev
->sensor_flags
, &first10c0
[i
][1]); /* URB 9-48 */
1761 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
1764 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
1767 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 50 */
1770 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1773 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1776 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1779 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1782 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
1785 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
1788 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
1791 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
1794 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
1796 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1797 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
1799 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1800 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
1802 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
1803 0x09, dev
->sensor_flags
, NULL
);
1805 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1806 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
1808 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
1809 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
1810 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
1812 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
1813 buf
[3] = 0xf0; buf
[4] = 0x00;
1814 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 70 */
1817 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
1819 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
1820 usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
1822 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
1823 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
1826 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
1829 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
1832 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
1835 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1838 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
1841 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
1844 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 80 */
1845 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1848 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1849 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1852 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1853 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1856 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1857 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1860 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1861 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1864 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 90 */
1866 for (i
= 0; i
< 4; i
++)
1867 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1868 third10c0
[i
][0], dev
->sensor_flags
, &third10c0
[i
][1]); /* URB 97-106 */
1871 usb_microdia_control_write(dev
, 0x1180, buf
, 1);
1873 for (i
= 0; i
< 3; i
++)
1874 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1875 fourth10c0a
[i
][0], dev
->sensor_flags
, &fourth10c0a
[i
][1]);
1877 for (i
= 0; i
< 2; i
++)
1878 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1879 fourth10c0b
[i
][0], dev
->sensor_flags
, &fourth10c0b
[i
][1]);
1881 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
1882 0x33, dev
->sensor_flags
, NULL
);
1884 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1885 first10c0
[0][0], dev
->sensor_flags
, &first10c0
[0][1]);
1888 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
1891 usb_microdia_control_write(dev
, 0x118b, buf
, 1);
1894 usb_microdia_control_write(dev
, 0x10f7, buf
, 1);
1897 usb_microdia_control_write(dev
, 0x10f8, buf
, 1);
1900 usb_microdia_control_write(dev
, 0x10fa, buf
, 1);
1903 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
1906 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
1909 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
1911 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
1912 usb_microdia_control_write(dev
, 0x11bc, buf
, 4);
1914 /* Set whole array buf to 0x00 */
1915 memset(buf
, 0x00, 48);
1916 usb_microdia_control_write(dev
, 0x11c0, buf
, 48);
1918 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a;
1919 buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
1920 usb_microdia_control_write(dev
, 0x11a5, buf
, 6);
1922 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
1923 usb_microdia_control_write(dev
, 0x11af, buf
, 4);
1925 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
1926 usb_microdia_control_write(dev
, 0x11b3, buf
, 4);
1929 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1932 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
1935 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1937 usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
1939 usb_microdia_control_write(dev
, 0x1140, qtable2
, 64); /* URB 150 */
1942 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1945 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
1948 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1951 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
1954 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
1957 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
1960 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
1963 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
1965 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1966 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
1968 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1969 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
1971 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
1972 0x09, dev
->sensor_flags
, NULL
);
1974 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1975 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
1977 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
1978 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
1979 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
1981 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
1982 buf
[3] = 0xf0; buf
[4] = 0x00;
1983 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
1986 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
1988 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
1989 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); /* URB 170 */
1991 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
1992 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
1995 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
1998 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
2001 usb_microdia_control_write(dev
, 0x11b9, buf
, 1);
2004 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
2007 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2010 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2013 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2016 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2019 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 180 */
2022 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
2025 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
2028 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2029 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2032 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2033 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2036 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2037 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2040 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2041 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 190 */
2044 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2045 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2048 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2050 for (i
= 0; i
< 3; i
++)
2051 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
2052 fifth10c0
[i
][0], dev
->sensor_flags
, &fifth10c0
[i
][1]); /* URB 200-205 */
2054 sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2,
2055 0x00, dev
->sensor_flags
, buf
);
2056 /* __u8 result[2] = {buf[3], buf[4]}; */
2059 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2066 * @brief From startstream.log
2074 * For SN9C201 with SOI968.
2075 * This is function triggers a working stream of image data and a glowing LED.
2077 int microdia_624e_start_stream(struct usb_microdia
*dev
)
2080 __u8 unknown1
[9] = { dev
->sensor_flags
, dev
->sensor_slave_address
,
2081 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
2174 __u8 qtable1
[64] = {
2175 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
2176 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
2177 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
2178 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
2179 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
2180 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
2181 0x4f, 0x53, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
2182 0x64, 0x5c, 0x53, 0x64, 0x4b, 0x53, 0x58, 0x53
2185 __u8 qtable2
[64] = {
2186 0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
2187 0x15, 0x26, 0x53, 0x36, 0x2e, 0x36, 0x53, 0x53,
2188 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2189 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2190 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2191 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2192 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2193 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53
2197 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++) {
2200 ret
= usb_microdia_control_write(dev
, reg
, &value
, 1);
2202 UDIA_INFO("Bridge Init Error (%d). line %d\n", ret
, i
);
2207 memset(reg_11c0
, 0x00, 48);
2208 ret
= usb_microdia_control_write(dev
, 0x11c0, reg_11c0
, 48);
2212 ret
= usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
2216 ret
= usb_microdia_control_write(dev
, 0x1140, qtable2
, 64);
2220 /* this is the same register as the I2C write, not sure why
2221 * we're writing 9 bytes -- the SN9C102 docs say all writes
2222 * must be 8 bytes, but we don't have docs for SN9C20x */
2223 ret
= usb_microdia_control_write(dev
, 0x10c0, unknown1
, 9);
2227 if (dev
->sensor_init
)
2228 dev
->sensor_init(dev
);
2233 UDIA_ERROR("start stream: failed (%d)!\n", ret
);
2237 int microdia_624f_start_stream(struct usb_microdia
*dev
)
2240 __u8 unknown1
[9] = { dev
->sensor_flags
, dev
->sensor_slave_address
,
2241 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
2305 __u8 reg_11c0
[48] = {
2306 0x10, 0x21, 0x34, 0x40, 0x47, 0x4f, 0x57, 0x5f,
2307 0x64, 0x68, 0x6d, 0x73, 0x79, 0x80, 0x89, 0x97,
2308 0x0d, 0x1c, 0x2a, 0x33, 0x38, 0x3d, 0x44, 0x4a,
2309 0x4e, 0x52, 0x56, 0x5b, 0x61, 0x68, 0x6f, 0x7a,
2310 0x0d, 0x1a, 0x2a, 0x31, 0x36, 0x3b, 0x41, 0x47,
2311 0x4a, 0x4e, 0x53, 0x58, 0x5d, 0x64, 0x6b, 0x76
2314 __u8 qtable1
[64] = {
2315 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
2316 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
2317 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
2318 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
2319 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
2320 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
2321 0x4f, 0x54, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
2322 0x64, 0x5c, 0x54, 0x64, 0x4b, 0x54, 0x58, 0x54
2325 __u8 qtable2
[64] = {
2326 0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
2327 0x15, 0x26, 0x54, 0x36, 0x2e, 0x36, 0x54, 0x54,
2328 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2329 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2330 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2331 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2332 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2333 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54
2336 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++) {
2339 ret
= usb_microdia_control_write(dev
, reg
, &value
, 1);
2341 UDIA_INFO("Bridge Init Error (%d). line %d\n", ret
, i
);
2346 ret
= usb_microdia_control_write(dev
, 0x11c0, reg_11c0
, 48);
2350 ret
= usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
2354 ret
= usb_microdia_control_write(dev
, 0x1140, qtable2
, 64);
2358 /* this is the same register as the I2C write, not sure why
2359 * we're writing 9 bytes -- the SN9C102 docs say all writes
2360 * must be 8 bytes, but we don't have docs for SN9C20x */
2361 ret
= usb_microdia_control_write(dev
, 0x10c0, unknown1
, 9);
2365 if (dev
->sensor_init
)
2366 dev
->sensor_init(dev
);
2371 UDIA_ERROR("start stream: failed (%d)!\n", ret
);
2375 int microdia_6260_start_stream(struct usb_microdia
*dev
)
2380 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
2382 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
2384 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
2386 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
2388 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
2390 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2392 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
2394 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2396 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2398 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
2400 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10;
2402 ret
= usb_microdia_control_write(dev
, 0x1067, buf
, 5);
2404 buf
[0] = 0x80; buf
[1] = 0x21; buf
[2] = 0x00; buf
[3] = 0x00;
2405 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
2407 ret
= usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
2409 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
2410 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
2411 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
2412 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
2413 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
2414 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
2415 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 24);
2417 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
2418 ret
= usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
2420 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
2422 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
2424 buf
[0] = 0x8a; buf
[1] = 0x8c; buf
[2] = 0x08;
2425 ret
= usb_microdia_control_write(dev
, 0x1188, buf
, 3);
2427 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
2428 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
2429 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
2430 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
2431 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
2432 buf
[20] = 0xf4; buf
[21] = 0xff;
2433 ret
= usb_microdia_control_write(dev
, 0x118b, buf
, 22);
2435 buf
[0] = 0x00; buf
[1] = 0x00;
2436 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
2438 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x00;
2439 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
2441 ret
= usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
2444 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2447 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2449 ret
= ov7670_initialise(dev
);
2453 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x3b, dev
->sensor_flags
, buf
);
2454 ret
= usb_microdia_control_read(dev
, 0x10c1, buf
, 1);
2456 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
2458 /* TRY TO READ FROM EEPROM: */
2459 ret
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, dev
->sensor_flags
, buf
);
2461 UDIA_INFO("No EEPROM found\n");
2463 UDIA_INFO("Read from EEPROM successful\n");
2466 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
2468 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
2470 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
2472 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
2474 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
2475 buf
[4] = 0x50; buf
[5] = 0x3c;
2476 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
2478 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
2480 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
2483 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
2485 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
2486 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
2488 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
2489 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
2491 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2493 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2495 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2497 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2499 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
2501 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
2503 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2504 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2506 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2507 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2509 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2510 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2512 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2513 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2515 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2516 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2518 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2519 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2521 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2523 /* OV7670 Intialise Part 2 */
2524 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
2525 buf
[4] = 0x50; buf
[5] = 0x3c;
2526 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
2528 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
2530 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
2533 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
2535 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
2536 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
2538 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
2539 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
2542 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2544 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2546 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2548 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2550 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2552 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2554 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
2556 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
2558 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2559 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2561 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2562 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2564 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2565 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2567 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2568 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2570 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2571 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2573 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2574 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2576 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2578 /* OV7670 Initialisation Part 3 Goes Here */
2580 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2586 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
2590 * @returns 0 (ok) or -1 (error)
2594 * Windows driver versions: 5.7.23.000
2595 * Windows versions: 2000 and XP
2596 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
2597 * All logs were made using AMCAP with 640x480, RGB24
2599 int microdia_6270_start_stream(struct usb_microdia
*dev
)
2606 /* Check if sensor slave address is valid: */
2607 if ((dev
->sensor_slave_address
!= MT9V111_I2C_SLAVE_ADDRESS
) && (dev
->sensor_slave_address
!= MT9V011_I2C_SLAVE_ADDRESS
)) {
2608 UDIA_INFO("microdia_6270_start_stream(): Invalid sensor slave address !\n");
2612 /* <= INTERRUPT COMING BACK (URB 1953) */
2613 /* SWITCH TO ALTERNATE SETTINGS 8 (URB 1954) // NOT IN ALEX'S LOG */
2614 /* => INTERRUPT GOING DOWN (URB 1955) */
2617 usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 1956 */
2619 /* <= INTERRUPT COMING BACK (URB 1955) */
2620 /* => INTERRUPT GOING DOWN (URB 1957) */
2623 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 1958 */
2625 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 1959 */
2627 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 1960 */
2629 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 1961 */
2631 usb_microdia_control_write(dev
, 0x1020, buf
, 1); /* URB 1962 */
2632 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
2633 usb_microdia_control_write(dev
, 0x1067, buf
, 5); /* URB 1963 */
2635 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
2636 /* STRANGE I2C MESSAGE: */
2638 /* - byte 8 = 0x00 at first start + first cycle */
2639 /* - procedure not complete: no wait/check for ack/error, no readout of 0x10c2 */
2640 /* - dummy writes at first cycle and read at second cycle, but there are many I2C messages in the meantime, so this should not work */
2642 /* AT FIRST START + FIRST CYCLE: */
2643 buf
[0] = 0x80; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x00; buf
[3] = 0x00;
2644 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x03;
2645 /* AT ALL FURTHER STARTS + FIRST CYCLE: */
2646 /* MT9V111: I2C MESSAGE => IFP Register 0x33: Auto exposure */
2647 /* buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x33; buf[3] = 0x00; */
2648 /* buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03; */
2649 /* MT9V011: ????????????????????????? */
2650 /* buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x07; buf[3] = 0x00; */
2651 /* buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03; */
2652 /* ALWAYS AT 2nd AND FURTHER CYCLES: */
2654 /* buf[0] = 0xa2; buf[1] = 0x5c; buf[2] = 0x00; buf[3] = 0x36; */
2655 /* buf[4] = 0x00; buf[5] = 0x82; buf[6] = 0x3a; buf[7] = 0x10; buf[8] = 0x03; */
2656 /* => buf[3] to buf[6] simply contain bytes read with URB 2215 */
2658 /* buf[0] = 0xb0; buf[1] = 0x5d; buf[2] = 0x07; buf[3] = 0x00; */
2659 /* buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03; */
2660 usb_microdia_control_write(dev
, 0x10c0, buf
, 9); /* URB 1964 */
2661 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
2663 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
2664 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
2665 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
2666 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
2667 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
2668 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
2669 usb_microdia_control_write(dev
, 0x10e0, buf
, 24); /* URB 1965 */
2670 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
2671 usb_microdia_control_write(dev
, 0x10f8, buf
, 3); /* URB 1966 */
2672 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
2673 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 1967 */
2674 buf
[0] = 0x06; buf
[1] = 0x0c; buf
[2] = 0x08;
2675 usb_microdia_control_write(dev
, 0x1188, buf
, 3); /* URB 1968 */
2676 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
2677 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
2678 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
2679 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
2680 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
2681 buf
[20] = 0xf4; buf
[21] = 0xff;
2682 usb_microdia_control_write(dev
, 0x118b, buf
, 22); /* URB 1969 */
2683 buf
[0] = 0x00; buf
[1] = 0x00;
2684 usb_microdia_control_write(dev
, 0x11a1, buf
, 2); /* URB 1970 */
2685 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x08;
2686 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
2688 usb_microdia_control_write(dev
, 0x11b7, buf
, 9); /* URB 1971 */
2690 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 1972 */
2692 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 1973 */
2694 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
2697 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
2698 /* Write to IFP register 0x0d: Color Correction Register 8 */
2699 buf
[0] = 0x00; buf
[1] = 0x01;
2700 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); /* URBs 1974-1976 */
2701 /* Write to IFP register 0x0d: Color Correction Register 8 */
2702 buf
[0] = 0x00; buf
[1] = 0x00; /* ??? */
2703 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); /* URBs 1977-1979 */
2704 /* Writes to IFP registers 0x01: Register Address Space Selection */
2705 /* 0x02: Color Correction Register 1 */
2706 buf
[0] = 0x00; buf
[1] = 0x01; /* select IFP address space */
2707 buf
[2] = 0x00; buf
[3] = 0x16; /* ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2708 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); /* URBs 1980-1982 */
2709 /* Writes to IFP registers 0x03: Color Correction Register 3 */
2710 /* 0x04: Color Correction Register 4 */
2711 buf
[0] = 0x01; buf
[1] = 0xe1; /* ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2712 buf
[2] = 0x02; buf
[3] = 0x81; /* ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2713 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); /* URBs 1983-1985 */
2714 /* Writes to IFP registers 0x05: Aperture Correction (Sharpening) */
2715 /* 0x06: Operating Mode Control */
2716 buf
[0] = 0x00; buf
[1] = 0x04; /* 100% sharpening, no automatic sharpness reduction at low light // AT FIRST START + FIRST CYCLE: 0x00 0x00: no sharpening */
2717 buf
[2] = 0x00; buf
[3] = 0x00; /* stop AWB at the current values, no on-the-fly defect correction, no auto exposure, + RESREVED option */
2718 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); /* URBs 1986-1988 */
2719 /* Writes to IFP registers 0x07: Image Flow Processor Soft Reset */
2720 /* 0x08: Output Format Control */
2721 buf
[0] = 0x30; buf
[1] = 0x02; /* reset // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2722 buf
[2] = 0x04; buf
[3] = 0x80; /* bypass entire image processing, raw 8+2 Bayer data output directly */
2723 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); /* URBs 1989-1991 */
2724 /* "Dummy" write to IFP Register 0x11: Color Correction Register 12 */
2725 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); /* URBs 1992-1993 */
2726 /* Write to register 0x01: Register address space selection */
2727 /* Write to sensor register 0x02: Column Start */
2728 buf
[0] = 0x00; buf
[1] = 0x04; /* select sensor address space */
2729 buf
[2] = 0x00; buf
[3] = 0x16; /* start with column 22 */
2730 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); /* URBs 1994-1996 */
2731 /* Writes to sensor registers 0x03: Window Height */
2732 /* 0x04: Window Width */
2733 buf
[0] = 0x01; buf
[1] = 0xe6; /* 486 */
2734 buf
[2] = 0x02; buf
[3] = 0x86; /* 646 */
2735 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); /* URBs 1997-1999 */
2736 /* Writes to sensor registers 0x05: Horizontal Blanking */
2737 /* 0x06: Vertical Blanking */
2738 buf
[0] = 0x00; buf
[1] = 0x04; /* 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2739 buf
[2] = 0x00; buf
[3] = 0x00; /* 0 rows */
2740 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); /* URBs 2000-2002 */
2741 /* Writes to sensor registers 0x07: Output Control */
2742 /* 0x08: Row Start */
2743 buf
[0] = 0x30; buf
[1] = 0x02; /* normal operation + chip enable + RESERVED options */
2744 buf
[2] = 0x00; buf
[3] = 0x08; /* row 8 */
2745 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); /* URBs 2003-2005 */
2746 /* "Dummy" write to sensor Register 0x11: UNDOCUMENTED */
2747 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); /* URBs 2006-2007 */
2748 /* Writes to sensor registers 0x0c: Shutter Delay */
2749 /* 0x0d: Reset (Soft) (from MT9V011 datasheet) */
2750 buf
[0] = 0x00; buf
[1] = 0x00; /* 0 master clocks */
2751 buf
[2] = 0x00; buf
[3] = 0x00; /* return to normal operation */
2752 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
); /* URBs 2008-2010 */
2753 /* Writes to sensor registers 0x0e: UNDOCUMENTED */
2754 /* 0x0f: UNDOCUMENTED */
2755 buf
[0] = 0x00; buf
[1] = 0x00;
2756 buf
[2] = 0x00; buf
[3] = 0x00;
2757 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
); /* URBs 2011-2013 */
2758 /* Writes to sensor registers 0x10: UNDOCUMENTED */
2759 /* 0x11: UNDOCUMENTED */
2760 buf
[0] = 0x00; buf
[1] = 0x00;
2761 buf
[2] = 0x00; buf
[3] = 0x00;
2762 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
); /* URBs 2014-2016 */
2763 /* Writes to sensor registers 0x12: 2X Zoom Col Start => 0x1e bit 0 must be set to activate zoom */
2764 /* 0x13: 2X Zoom Row Start => 0x1e bit 0 must be set to activate zoom */
2765 buf
[0] = 0x00; buf
[1] = 0xb0; /* column 176 */
2766 buf
[2] = 0x00; buf
[3] = 0x7c; /* row 124 */
2767 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
); /* URBs 2017-2018 */
2768 /* Writes to sensor registers 0x14: UNDOCUMENTED */
2769 /* 0x15: UNDOCUMENTED */
2770 buf
[0] = 0x00; buf
[1] = 0x00;
2771 buf
[2] = 0x00; buf
[3] = 0x00;
2772 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
); /* URBs 2019-2021 */
2773 /* Writes to sensor registers 0x16: UNDOCUMENTED */
2774 /* 0x17: UNDOCUMENTED */
2775 buf
[0] = 0x00; buf
[1] = 0x00;
2776 buf
[2] = 0x00; buf
[3] = 0x00;
2777 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
); /* URBs 2022-2024 */
2778 /* Writes to sensor registers 0x18: UNDOCUMENTED */
2779 /* 0x19: UNDOCUMENTED */
2780 buf
[0] = 0x00; buf
[1] = 0x00;
2781 buf
[2] = 0x00; buf
[3] = 0x00;
2782 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
); /* URBs 2025-2027 */
2783 /* Writes to sensor registers 0x1a: UNDOCUMENTED */
2784 /* 0x1b: UNDOCUMENTED */
2785 buf
[0] = 0x00; buf
[1] = 0x00;
2786 buf
[2] = 0x00; buf
[3] = 0x00;
2787 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
); /* URBs 2028-2030 */
2788 /* Writes to sensor registers 0x1c: UNDOCUMENTED */
2789 /* 0x1d: UNDOCUMENTED */
2790 buf
[0] = 0x00; buf
[1] = 0x00;
2791 buf
[2] = 0x00; buf
[3] = 0x00;
2792 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
); /* URBs 2031-2033 */
2793 /* Write to sensor register 0x30: RESERVED */
2794 buf
[0] = 0x00; buf
[1] = 0x00;
2795 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x30, dev
->sensor_flags
, buf
); /* URBs 2034-2036 */
2796 /* Write to sensor register 0x20: Read Mode */
2797 buf
[0] = 0x00; buf
[1] = 0x00; /* normal readout */
2798 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); /* URBs 2037-2039 */
2799 /* Writes to sensor registers 0x30: RESERVED */
2800 /* 0x31: RESERVED */
2801 buf
[0] = 0x00; buf
[1] = 0x05;
2802 buf
[2] = 0x00; buf
[3] = 0x00;
2803 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x30, dev
->sensor_flags
, buf
); /* URBs 2040-2042 */
2804 /* "Dummy" write to sensor Register 0x34: RESERVED */
2805 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x34, dev
->sensor_flags
, NULL
); /* URBs 2043-2044 */
2806 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
2807 /* Write to sensor register 0x07: Output Control */
2808 buf
[0] = 0x00; buf
[1] = 0x02; /* chip enable, normal operation */
2809 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
2810 /* Write to sensor register 0x0d: Soft Reset */
2811 buf
[0] = 0x00; buf
[1] = 0x01; /* reset */
2812 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
2813 /* Write to sensor register 0x0d: Soft Reset */
2814 buf
[0] = 0x00; buf
[1] = 0x00; /* resume operation */
2815 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
2816 /* Writes to sensor registers 0x01: Row start */
2817 /* 0x02: Column Start */
2818 buf
[0] = 0x00; buf
[1] = 0x08; /* start with row 8 */
2819 buf
[2] = 0x00; buf
[3] = 0x16; /* start with column 22 */
2820 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
);
2821 /* Writes to sensor registers 0x03: Window Height */
2822 /* 0x04: Window Width */
2823 buf
[0] = 0x01; buf
[1] = 0xe1; /* 481 */
2824 buf
[2] = 0x02; buf
[3] = 0x81; /* 641 */
2825 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
);
2826 /* Writes to sensor registers 0x05: Horizontal Blanking */
2827 /* 0x06: Vertical Blanking */
2828 buf
[0] = 0x00; buf
[1] = 0x83; /* 131 columns (pixel clocks) */
2829 buf
[2] = 0x00; buf
[3] = 0x06; /* 6 rows */
2830 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
);
2831 /* Write to sensor register 0x0d: Soft Reset */
2832 buf
[0] = 0x00; buf
[1] = 0x02; /* UNKNOWN */
2833 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
2834 /* Writes to sensor registers 0x0a: Pixel Clock Speed */
2835 /* 0x0b: Frame Restart */
2836 buf
[0] = 0x00; buf
[1] = 0x00; /* default */
2837 buf
[2] = 0x00; buf
[3] = 0x00; /* (has no effect/no restart) */
2838 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0a, dev
->sensor_flags
, buf
);
2839 /* Writes to sensor registers 0x0c: Shutter Delay */
2840 /* 0x0d: Soft Reset */
2841 buf
[0] = 0x00; buf
[1] = 0x00; /* 0 master clocks */
2842 buf
[2] = 0x00; buf
[3] = 0x00; /* resume operation */
2843 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
);
2844 /* Writes to sensor registers 0x0e: UNDOCUMENTED */
2845 /* 0x0f: UNDOCUMENTED */
2846 buf
[0] = 0x00; buf
[1] = 0x00;
2847 buf
[2] = 0x00; buf
[3] = 0x00;
2848 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
);
2849 /* Writes to sensor registers 0x10: UNDOCUMENTED */
2850 /* 0x11: UNDOCUMENTED */
2851 buf
[0] = 0x00; buf
[1] = 0x00;
2852 buf
[2] = 0x00; buf
[3] = 0x00;
2853 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
);
2854 /* Writes to sensor registers 0x12: 2X Zoom Column Start (from MT9V111 datasheet) */
2855 /* 0x13: 2X Zoom Row Start (from MT9V111 datasheet) */
2856 buf
[0] = 0x00; buf
[1] = 0x00; /* column 0 => bit0 of reg 0x1e must be set to activate zoom */
2857 buf
[2] = 0x00; buf
[3] = 0x00; /* row 0 => bit0 of reg 0x1e must be set to activate zoom */
2858 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
);
2859 /* Writes to sensor registers 0x14: UNDOCUMENTED */
2860 /* 0x15: UNDOCUMENTED */
2861 buf
[0] = 0x00; buf
[1] = 0x00;
2862 buf
[2] = 0x00; buf
[3] = 0x00;
2863 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
);
2864 /* Writes to sensor registers 0x16: UNDOCUMENTED */
2865 /* 0x17: UNDOCUMENTED */
2866 buf
[0] = 0x00; buf
[1] = 0x00;
2867 buf
[2] = 0x00; buf
[3] = 0x00;
2868 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
);
2869 /* Writes to sensor registers 0x18: UNDOCUMENTED */
2870 /* 0x19: UNDOCUMENTED */
2871 buf
[0] = 0x00; buf
[1] = 0x00;
2872 buf
[2] = 0x00; buf
[3] = 0x00;
2873 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
);
2874 /* Writes to sensor registers 0x1a: UNDOCUMENTED */
2875 /* 0x1b: UNDOCUMENTED */
2876 buf
[0] = 0x00; buf
[1] = 0x00;
2877 buf
[2] = 0x00; buf
[3] = 0x00;
2878 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
);
2879 /* Writes to sensor registers 0x1c: UNDOCUMENTED */
2880 /* 0x1d: UNDOCUMENTED */
2881 buf
[0] = 0x00; buf
[1] = 0x00;
2882 buf
[2] = 0x00; buf
[3] = 0x00;
2883 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
);
2884 /* Write to sensor register 0x32: RESERVED */
2885 buf
[0] = 0x00; buf
[1] = 0x00;
2886 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x32, dev
->sensor_flags
, buf
);
2887 /* Writes to sensor registers 0x20: Read Mode */
2888 /* 0x21: RESERVED */
2889 buf
[0] = 0x11; buf
[1] = 0x01; /* output all frames (including bad frames) + UNDOCUMENTED */
2890 buf
[2] = 0x00; buf
[3] = 0x00;
2891 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x20, dev
->sensor_flags
, buf
);
2892 /* Writes to sensor registers 0x22: RESERVED */
2893 /* 0x23: UNDOCUMENTED */
2894 buf
[0] = 0x00; buf
[1] = 0x00;
2895 buf
[2] = 0x00; buf
[3] = 0x00;
2896 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x22, dev
->sensor_flags
, buf
);
2897 /* Writes to sensor registers 0x24: UNDOCUMENTED */
2898 /* 0x25: UNDOCUMENTED */
2899 buf
[0] = 0x00; buf
[1] = 0x00;
2900 buf
[2] = 0x00; buf
[3] = 0x00;
2901 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x24, dev
->sensor_flags
, buf
);
2902 /* Writes to sensor registers 0x26: UNDOCUMENTED */
2903 /* 0x27: RESERVED */
2904 buf
[0] = 0x00; buf
[1] = 0x00;
2905 buf
[2] = 0x00; buf
[3] = 0x24;
2906 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x26, dev
->sensor_flags
, buf
);
2907 /* "Dummy" write to sensor Register 0x30: RESERVED */
2908 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x30, dev
->sensor_flags
, NULL
);
2909 /* Writes to sensor registers 0x2f: RESERVED */
2910 /* 0x30: RESERVED */
2911 buf
[0] = 0xf7; buf
[1] = 0xb0;
2912 buf
[2] = 0x00; buf
[3] = 0x05;
2913 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2f, dev
->sensor_flags
, buf
);
2914 /* Writes to sensor registers 0x31: RESERVED */
2915 /* 0x32: RESERVED */
2916 buf
[0] = 0x00; buf
[1] = 0x00;
2917 buf
[2] = 0x00; buf
[3] = 0x00;
2918 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x31, dev
->sensor_flags
, buf
);
2919 /* Writes to sensor registers 0x33: RESERVED */
2920 /* 0x34: RESERVED */
2921 buf
[0] = 0x00; buf
[1] = 0x00;
2922 buf
[2] = 0x01; buf
[3] = 0x00;
2923 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x33, dev
->sensor_flags
, buf
);
2924 /* "Dummy" write to sensor Register 0x3b: RESERVED */
2925 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x3b, dev
->sensor_flags
, NULL
);
2926 /* Write to sensor register 0x3d: RESERVED */
2927 buf
[0] = 0x06; buf
[1] = 0x8f;
2928 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x3d, dev
->sensor_flags
, buf
);
2929 /* Writes to sensor registers 0x40: RESERVED */
2930 /* 0x41: RESERVED */
2931 buf
[0] = 0x01; buf
[1] = 0xe0;
2932 buf
[2] = 0x00; buf
[3] = 0xd1;
2933 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x40, dev
->sensor_flags
, buf
);
2934 /* Write to sensor register 0x44: UNDOCUMENTED */
2935 buf
[0] = 0x00; buf
[1] = 0x82;
2936 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x44, dev
->sensor_flags
, buf
);
2937 /* Writes to sensor registers 0x5a: RESERVED */
2938 /* 0x5b: RESERVED */
2939 buf
[0] = 0x00; buf
[1] = 0x00;
2940 buf
[2] = 0x00; buf
[3] = 0x00;
2941 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5a, dev
->sensor_flags
, buf
);
2942 /* Writes to sensor registers 0x5c: RESERVED */
2943 /* 0x5d: RESERVED */
2944 buf
[0] = 0x00; buf
[1] = 0x00;
2945 buf
[2] = 0x00; buf
[3] = 0x00;
2946 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5c, dev
->sensor_flags
, buf
);
2947 /* Writes to sensor registers 0x5e: RESERVED */
2948 /* 0x5f: RESERVED */
2949 buf
[0] = 0x00; buf
[1] = 0x00;
2950 buf
[2] = 0xa3; buf
[3] = 0x1d;
2951 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5e, dev
->sensor_flags
, buf
);
2952 /* "Dummy" write to sensor Register 0x68: UNDOCUMENTED */
2953 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x68, dev
->sensor_flags
, NULL
);
2954 /* Write to sensor register 0x62: RESERVED */
2955 buf
[0] = 0x06; buf
[1] = 0x11;
2956 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x62, dev
->sensor_flags
, buf
);
2959 UDIA_INFO("1 or more errors occured in I2C-message-block 1 !\n");
2962 /* END OF I2C MESSAGES */
2963 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
2965 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
2967 usb_microdia_control_write(dev
, 0x1007, buf
, 8);
2969 usb_microdia_control_write(dev
, 0x1006, buf
, 8);
2973 /* *** TEMPORARY SWITCH TO SLAVE ADDRESS 0x50, I2C READ ATTEMPT: */
2974 /* - WE CURRENTLY KNOW NO 6270 CAM THAT IS SUCCESSFULLY READ HERE */
2975 /* - IF READ FAILS, THIS IS NEVER DONE AGAIN (IN NEXT CYCLE OR FURTHER STARTS) */
2976 usb_microdia_control_read(dev
, 0x10c1, buf
, 1); /* returns 0x5c */
2978 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
2979 retI2C
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, SN9C20X_I2C_2WIRE
, buf
);
2981 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");
2983 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
2986 buf
[0] = 0x47; /* ALEX: 0x44 */
2987 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2045 */
2988 buf
[0] = 0x47; /* ALEX: 0x04 */
2989 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2046 */
2991 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 2047 */
2993 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 2048 */
2994 buf
[0] = 0x84; /* ALEX: 0xc0 */
2995 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 2049 */
2998 usb_microdia_control_write(dev, 0x1001, buf, 1);
3001 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3002 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3005 /* Writes to sensor registers 0x02: Column Start */
3006 /* 0x03: Window Height */
3007 buf
[0] = 0x00; buf
[1] = 0x16; /* coulmn 22 */
3008 buf
[2] = 0x01; buf
[3] = 0xe1; /* 481 */
3009 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); /* URBs 2050-2052 */
3010 /* Writes to sensor registers 0x04: Window Width */
3011 /* 0x05: Horizontal Blanking */
3012 buf
[0] = 0x02; buf
[1] = 0x81; /* 641 */
3013 buf
[2] = 0x00; buf
[3] = 0x04; /* 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
3014 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); /* URBs 2053-2055 */
3015 /* Writes to sensor registers 0x06: Vertical Blanking */
3016 /* 0x07: Output Control */
3017 buf
[0] = 0x00; buf
[1] = 0x00; /* 0 rows */
3018 buf
[2] = 0x30; buf
[3] = 0x02; /* normal operation + chip enable + RESERVED options */
3019 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); /* URBs 2056-2058 */
3020 /* Write to sensor register 0x0e: UNDOCUMENTED */
3021 buf
[0] = 0x00; buf
[1] = 0x08;
3022 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); /* URBs 2059-2061 */
3024 UDIA_INFO("1 or more errors occured in I2C-message-block 2 !\n");
3027 /* END OF I2C MESSAGES */
3028 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3031 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
3032 buf
[4] = 0x28; buf
[5] = 0x3c;
3033 usb_microdia_control_write(dev
, 0x1180, buf
, 6); /* URB 2062 */
3034 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
3035 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 2063 */
3037 usb_microdia_control_write(dev
, 0x1189, buf
, 1); /* URB 2064 */
3038 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3039 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); /* URB 2065 */
3040 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3041 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); /* URB 2066 */
3042 buf
[0] = 0x78; /* ALEX: 0x7c */
3043 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 2067 */
3044 buf
[0] = 0x18; /* ALEX: 0x1c */
3045 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2068 */
3046 buf
[0] = 0x18; /* ALEX: 0x1c */
3047 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2069 */
3049 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2070 */
3051 usb_microdia_control_write(dev
, 0x118a, buf
, 1); /* URB 2071 */
3053 usb_microdia_control_write(dev
, 0x0395, buf
, 1); /* URB 2072 */
3056 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2073 */
3057 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2074 // 0x38 */
3060 else if (buf
[0] == 0xb8)
3062 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2075 */
3063 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2076 // 0xb9 */
3066 else if (buf
[0] == 0xb9)
3068 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2077 */
3069 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2078 */
3072 else if (buf
[0] == 0xba)
3074 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2079 */
3075 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2080 // 0x3b */
3078 else if (buf
[0] == 0xbb)
3080 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2081 */
3081 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2082 // 0x3c */
3084 else if (buf
[0] == 0xbc)
3086 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2083 */
3087 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2084 // 0x3d */
3088 last_11b8
[0] = buf
[0];
3089 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3092 else if (buf
[0] == 0xbd)
3094 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2085 */
3095 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2086 */
3098 else if (buf
[0] == 0xbe)
3100 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2087 */
3101 usb_microdia_control_read(dev
, 0x11b8, last_11b8
, 1); /* URB 2088 */
3103 buf
[0] = last_11b8
[0] & 0xf0; /* 0xf0 or 0x70 */
3104 buf
[0] = buf
[0] | 0x0d; /* 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES */
3105 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2089 */
3108 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3111 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3112 /* Write to sensor register 0x06: Vertical Blanking */
3113 buf
[0] = 0x00; buf
[1] = 0x2d; /* 45 rows */
3114 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); /* URBs 2090-2092 */
3115 /* Write to sensor register 0x05: Horizontal Blanking */
3116 buf
[0] = 0x00; buf
[1] = 0x04; /* 4 columns (pixel clocks) */
3117 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); /* URBs 2093-2095 */
3118 /* Write to sensor register 0x20: Read Mode */
3119 buf
[0] = 0x00; buf
[1] = 0x00; /* normal readout */
3120 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); /* URBs 2096-2098 */
3121 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3122 /* Write to sensor register 0x0a: Pixel Clock Speed */
3123 buf
[0] = 0x00; buf
[1] = 0x00; /* default */
3124 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0a, dev
->sensor_flags
, buf
);
3125 /* Write to sensor register 0x06: Vertical Blanking */
3126 buf
[0] = 0x00; buf
[1] = 0x29; /* 41 rows */
3127 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
3128 /* Write to sensor register 0x05: Horizontal Blanking */
3129 buf
[0] = 0x00; buf
[1] = 0x09; /* 9 columns (pixel clocks) */
3130 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
3131 /* Write to sensor register 0x20: Read Mode */
3132 buf
[0] = 0x11; buf
[1] = 0x01; /* output all frames (including bad ones) + UNKNOWN */
3133 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
3136 UDIA_INFO("1 or more errors occured in I2C-message-block 3 !\n");
3139 /* END OF I2C MESSAGES */
3140 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3144 usb_microdia_control_write(dev
, 0x1180, buf
, 1); /* URB 2099 */
3146 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3149 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3150 /* Write to sensor register 0x20: Read Mode */
3151 buf
[0] = 0x00; buf
[1] = 0x00; /* normal readout */
3152 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); /* URBs 2100-2102 */
3153 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3154 /* Write to sensor register 0x20: Read Mode */
3155 buf
[0] = 0x11; buf
[1] = 0x01; /* output all frames (including bad ones) + UNKNOWN */
3156 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
3159 UDIA_INFO("1 or more errors occured in I2C-message-block 4 !\n");
3162 /* END OF I2C MESSAGES */
3163 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3167 usb_microdia_control_write(dev
, 0x1182, buf
, 1); /* URB 2103 */
3170 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3173 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3174 /* Write to sensor register 0x09: Shutter Width */
3175 buf
[0] = 0x00; buf
[1] = 0x64; /* integration of 100 rows */
3176 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
); /* URBs 2104-2106 */
3177 /* Write to sensor register 0x2b: Green 1 Gain */
3178 /* 0x2c: Blue Gain */
3179 buf
[0] = 0x00; buf
[1] = 0xa0; /* 32*0.03125*2 = 2 */
3180 buf
[2] = 0x00; buf
[3] = 0xa0; /* 32*0.03125*2 = 2 */
3181 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
); /* URBs 2107-2109 */
3182 /* Write to sensor register 0x2d: Red Gain */
3183 /* 0x2e: Green 2 Gain */
3184 buf
[0] = 0x00; buf
[1] = 0xa0; /* 32*0.03125*2 = 2 */
3185 buf
[2] = 0x00; buf
[3] = 0xa0; /* 32*0.03125*2 = 2 */
3186 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
); /* URBs 2110-2112 */
3187 /* "Dummy" write to sensor Register 0x33: RESERVED */
3188 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
); /* URBs 2113-2114 */
3189 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3190 /* Write to sensor register 0x09: Shutter Width */
3191 buf
[0] = 0x00; buf
[1] = 0x64; /* integration of 100 rows */
3192 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
);
3193 /* Write to sensor register 0x07: Output Control */
3194 buf
[0] = 0x00; buf
[1] = 0x03; /* dont update changes until bit0=0, chip enable, normal operation */
3195 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
3196 /* Write to sensor register 0x2b: Green 1 Gain */
3197 /* 0x2c: Blue Gain */
3198 buf
[0] = 0x00; buf
[1] = 0x33; /* 51*0.03125*1 = 1.59375 */
3199 buf
[2] = 0x00; buf
[3] = 0xa0; /* 32*0.03125*2 = 2 */
3200 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
);
3201 /* Write to sensor register 0x2d: Red Gain */
3202 /* 0x2e: Green 2 Gain */
3203 buf
[0] = 0x00; buf
[1] = 0xa0; /* 32*0.03125*2 = 2 */
3204 buf
[2] = 0x00; buf
[3] = 0x33; /* 51*0.03125*1 = 1.59375 */
3205 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
);
3206 /* "Dummy" write to sensor Register 0x33: RESERVED */
3207 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
);
3208 /* Write to sensor register 0x07: Output Control */
3209 buf
[0] = 0x00; buf
[1] = 0x02; /* chip enable, normal operation */
3210 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
3213 UDIA_INFO("1 or more errors occured in I2C-message-block 5 !\n");
3216 /* END OF I2C MESSAGES */
3217 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3220 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2119 */
3222 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3224 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3226 usb_microdia_control_write(dev
, 0x118b, buf
, 1); /* URB 2124 */
3229 usb_microdia_control_write(dev
, 0x10f7, buf
, 1); /* URB 2135 */
3231 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3233 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3235 usb_microdia_control_write(dev
, 0x10f8, buf
, 1); /* URB 2138 */
3237 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3239 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3241 usb_microdia_control_write(dev
, 0x10fa, buf
, 1); /* URB 2139 */
3244 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); /* URB 2140 */
3246 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); /* URB 2141 */
3248 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2142 */
3249 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
3250 usb_microdia_control_write(dev
, 0x11bc, buf
, 4); /* URB 2143 */
3251 for (k
= 0; k
< 48; k
++)
3253 usb_microdia_control_write(dev
, 0x11c0, buf
, 48); /* URB 2144 */
3255 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
3256 buf
[4] = 0x04; buf
[5] = 0x3f;
3257 usb_microdia_control_write(dev
, 0x11a5, buf
, 6); /* URB 2149 */
3259 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3260 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
3261 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3262 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
3264 usb_microdia_control_write(dev
, 0x11af, buf
, 4); /* URB 2150 */
3266 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
3267 usb_microdia_control_write(dev
, 0x11b3, buf
, 4); /* URB 2151 */
3268 buf
[0] = 0x47; /* ALEX: 0x04 */
3269 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2152 */
3271 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2153 */
3272 buf
[0] = 0x67; /* ALEX: 0x24 */
3273 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2154 */
3274 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
3275 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
3276 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
3277 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
3278 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
3279 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
3280 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
3281 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
3282 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
3283 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
3284 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
3285 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
3286 buf
[48] = 0x4f; buf
[49] = 0x53; buf
[50] = 0x58; buf
[51] = 0x58;
3287 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
3288 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
3289 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
3290 usb_microdia_control_write(dev
, 0x1100, buf
, 64); /* URB 2155 */
3291 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
3292 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
3293 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x53; buf
[11] = 0x36;
3294 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53; buf
[15] = 0x53;
3295 buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
3296 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53;
3297 buf
[24] = 0x53; buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53;
3298 buf
[28] = 0x53; buf
[29] = 0x53; buf
[30] = 0x53; buf
[31] = 0x53;
3299 buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53; buf
[35] = 0x53;
3300 buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
3301 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53;
3302 buf
[44] = 0x53; buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53;
3303 buf
[48] = 0x53; buf
[49] = 0x53; buf
[50] = 0x53; buf
[51] = 0x53;
3304 buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53; buf
[55] = 0x53;
3305 buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
3306 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
3307 usb_microdia_control_write(dev
, 0x1140, buf
, 64); /* URB 2156 */
3308 buf
[0] = 0x47; /* ALEX: 0x04 */
3309 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2157 */
3311 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2158 */
3312 buf
[0] = 0x4b; /* ALEX: 0x08 */
3313 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2159 */
3315 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3316 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3319 /* Writes to sensor registers 0x02: Column Start */
3320 /* 0x03: Window Hight */
3321 buf
[0] = 0x00; buf
[1] = 0x16; /* coulmn 22 */
3322 buf
[2] = 0x01; buf
[3] = 0xe1; /* 481 */
3323 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); /* URBs 2160-2162 */
3324 /* Writes to sensor registers 0x04: Window Width */
3325 /* 0x05: Horizontal Blanking */
3326 buf
[0] = 0x02; buf
[1] = 0x81; /* 641 */
3327 buf
[2] = 0x00; buf
[3] = 0x04; /* 4 columns (pixel clocks) */
3328 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); /* URBs 2163-2165 */
3329 /* Writes to sensor registers 0x06: Vertical Blanking */
3330 /* 0x07: Output Control */
3331 buf
[0] = 0x00; buf
[1] = 0x2d; /* 45 rows */
3332 buf
[2] = 0x30; buf
[3] = 0x02; /* RESERVED options */
3333 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); /* URBs 2166-2167 */
3334 /* Writes to sensor register 0x0e: UNDOCUMENTED */
3335 buf
[0] = 0x00; buf
[1] = 0x08;
3336 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); /* URBs 2168-2170 */
3338 UDIA_INFO("1 or more errors occured in I2C-message-block 6 !\n");
3341 /* END OF I2C MESSAGES */
3342 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3343 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3345 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
3347 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
3351 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
3352 buf
[4] = 0x28; buf
[5] = 0x3c;
3353 usb_microdia_control_write(dev
, 0x1180, buf
, 6); /* URB 2171 */
3354 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
3355 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 2172 */
3357 usb_microdia_control_write(dev
, 0x1189, buf
, 1); /* URB 2173 */
3358 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3359 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); /* URB 2174 */
3360 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3361 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); /* URB 2175 */
3363 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2176 */
3365 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2177 */
3367 usb_microdia_control_write(dev
, 0x11b9, buf
, 1); /* URB 2178 */
3369 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2179 */
3371 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2180 */
3372 buf
[0] = 0x78; /* ALEX: 0x7c */
3373 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 2181 */
3374 buf
[0] = 0x18; /* ALEX: 0x1c */
3375 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2182 */
3376 buf
[0] = 0x18; /* ALEX: 0x1c */
3377 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2183 */
3378 buf
[0] = 0x7d; /* ALEX: 0xfc */
3379 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2184 */
3381 usb_microdia_control_write(dev
, 0x118a, buf
, 1); /* URB 2185 */
3383 usb_microdia_control_write(dev
, 0x0395, buf
, 1); /* URB 2186 */
3385 if ((last_11b8
[0] == 0x3d) || (last_11b8
[0] == 0x3f))
3387 else if ((last_11b8
[0] == 0xbd) || (last_11b8
[0] == 0xbf))
3389 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2187 */
3390 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2188 // 0x38 */
3393 else if (buf
[0] == 0xb8)
3395 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2189 */
3396 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2190 // 0xb9 */
3399 else if (buf
[0] == 0xb9)
3401 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2191 */
3402 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2192 // 0xba */
3405 else if (buf
[0] == 0xba)
3407 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2193 */
3408 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2194 // 0x3b */
3411 else if (buf
[0] == 0xbb)
3413 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2195 */
3414 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2196 // 0x3c */
3417 else if (buf
[0] == 0xbc)
3419 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2197 */
3420 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2198 // 0x3d */
3421 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3424 else if (buf
[0] == 0xbd)
3426 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2199 */
3427 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2200 */
3430 else if (buf
[0] == 0xbe)
3432 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2201 */
3433 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2202 */
3435 buf
[0] = buf
[0] & 0xf0; /* 0xf0 or 0x70 */
3436 buf
[0] = buf
[0] | 0x0d; /* 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES */
3437 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2089 */
3439 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3442 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3443 /* Write to sensor register 0x06: Vertical Blanking */
3444 buf
[0] = 0x00; buf
[1] = 0x2d; /* 45 rows */
3445 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); /* URBs 2204-2206 */
3446 /* Write to sensor register 0x05: Horizontal Blanking */
3447 buf
[0] = 0x00; buf
[1] = 0x04; /* 4 columns (pixel clocks) */
3448 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); /* URBs 2207-2209 */
3449 /* Read of sensor register 0x36: Chip Version (mirror of reg0xff) */
3450 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x36, dev
->sensor_flags
, buf
); /* URBs 2211-2215 // 0x82 0x3a */
3451 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3452 /* Write to sensor register 0x0a: Pixel Clock Speed */
3453 buf
[0] = 0x00; buf
[1] = 0x00; /* default */
3454 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
3455 /* Write to sensor register 0x06: Vertical Blanking */
3456 buf
[0] = 0x00; buf
[1] = 0x29; /* 41 rows */
3457 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
3458 /* Write to sensor register 0x05: Horizontal Blanking */
3459 buf
[0] = 0x00; buf
[1] = 0x09; /* 9 columns (pixel clocks) */
3460 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
3461 /* Read of sensor register 0x00: Chip Version (=reg0xff) */
3462 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x00, dev
->sensor_flags
, buf
); /* 0x82 0x43 */
3465 UDIA_INFO("1 or more errors occured in I2C-message-block 7 !\n");
3468 /* END OF I2C MESSAGES */
3469 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3473 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2216 */
3476 /*** NOW DRIVER DOES STOP-SEQUENCE
3477 - WITHOUT WRITES TO 0x1007 AND 0x1006 (URBs 3544-3550) => MT9V111
3478 - WRITING 0x40 INSTEAD OF 0x60 TO 0x1007 AND 0x1006 => MT9V011
3480 /*** 2nd, 3rd, ... CYCLE: ALL MESSAGES (URBs 1953 - URBs 2216) ARE REPEATED ***/
3481 /*** ----- WE DON'T DO THIS, IT SEEMS TO BE UNNECESSARY ----- ***/
3483 /* Setup IFP registers for AE and AWB (new, not in the logs): */
3484 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3485 mt9v111_setup_autoexposure(dev
);
3486 mt9v111_setup_autowhitebalance(dev
);
3487 mt9v111_set_autocorrections(dev
, 1);
3490 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3492 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3494 usb_microdia_control_write(dev
, 0x1007, buf
, 1); /* URB 2489 */
3495 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3497 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3499 usb_microdia_control_write(dev
, 0x1006, buf
, 1); /* URB 2490 */
3500 /* => These two writes seem to cause the cam to start sending isochronus USB messages */
3505 int microdia_627b_start_stream(struct usb_microdia
*dev
)
3508 /* Initialize the Bridge Controller */
3509 ret
= sn9c20x_initialize(dev
);
3510 /* Initialize the I2C interface in the Bridge */
3511 ret
= sn9c20x_i2c_initialize(dev
);
3512 /* Finally, Initialize the Sensor array */
3513 if (dev
->sensor_init
)
3514 dev
->sensor_init(dev
);
3519 * @brief From UsbSnoop-plugin-parsed.log
3523 * @returns 0 (OK) or <0 (Error)
3525 * @author Vincent, Kuzja
3527 int microdia_6288_start_stream(struct usb_microdia
*dev
)
3537 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3543 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3549 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3555 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3561 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3567 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3572 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
3573 buf
[3] = 0x10; buf
[4] = 0x08;
3574 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
3579 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;
3580 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
3585 buf
[0] = 0x44; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
3586 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
3587 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
3588 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
3589 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
3590 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
3591 ret
= usb_microdia_control_write(dev
, reg
, buf
, 24);
3596 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
3597 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
3602 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
3603 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
3608 buf
[0] = 0x86; buf
[1] = 0xcc; buf
[2] = 0x08;
3609 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
3614 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
3615 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
3616 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
3617 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
3618 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
3619 buf
[20] = 0xf4; buf
[21] = 0xff;
3620 ret
= usb_microdia_control_write(dev
, reg
, buf
, 22);
3625 buf
[0] = 0x00; buf
[1] = 0x00;
3626 ret
= usb_microdia_control_write(dev
, reg
, buf
, 2);
3631 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00; buf
[3] = 0x08;
3632 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
3634 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
3640 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3646 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3651 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3652 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3657 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3662 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3667 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3668 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3673 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3678 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3683 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3684 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3689 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3694 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3699 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0e; buf
[3] = 0x61; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3700 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3705 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3710 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3715 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3716 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3721 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3726 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3731 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x13; buf
[3] = 0xb8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3732 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3737 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3742 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3747 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x14; buf
[3] = 0x3e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3748 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3753 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3758 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3763 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x16; buf
[3] = 0x24; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3764 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3769 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3774 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3779 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3780 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3785 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3790 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3795 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3796 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3801 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3806 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3811 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3812 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3817 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3822 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3827 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x27; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3828 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3833 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3838 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3843 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x28; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3844 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3849 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3854 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3859 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x29; buf
[3] = 0x15; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3860 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3865 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3870 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3875 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2c; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3876 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3881 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3886 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3891 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3892 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3897 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3902 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3907 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x34; buf
[3] = 0x3d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3908 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3913 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3918 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3923 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x35; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3924 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3929 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3934 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3939 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x36; buf
[3] = 0xf8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3940 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3945 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3950 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3955 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x38; buf
[3] = 0x12; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3956 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3961 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3966 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3971 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x39; buf
[3] = 0x57; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3972 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3977 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3982 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3987 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3988 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3993 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3998 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4003 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3b; buf
[3] = 0xcc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4004 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4009 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4014 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4019 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3c; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4020 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4025 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4030 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4035 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3d; buf
[3] = 0x19; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4036 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4041 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4046 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4051 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3e; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4052 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4057 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4062 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4067 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3f; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4068 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4073 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4078 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4083 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x41; buf
[3] = 0x40; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4084 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4089 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4094 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4099 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x42; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4100 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4105 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4110 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4115 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x45; buf
[3] = 0x46; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4116 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4121 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4126 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4131 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x46; buf
[3] = 0x62; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4132 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4137 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4142 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4147 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x47; buf
[3] = 0x2a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4148 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4153 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4158 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4163 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x48; buf
[3] = 0x3c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4164 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4169 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4174 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4179 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4a; buf
[3] = 0xf0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4180 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4185 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4190 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4195 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4b; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4196 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4201 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4206 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4211 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4c; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4212 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4217 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4222 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4227 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4d; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4228 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4233 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4238 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4243 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4e; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4244 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4249 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4254 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4259 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x69; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4260 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4265 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4270 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4275 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6c; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4276 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4281 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4286 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4291 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6f; buf
[3] = 0x9e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4292 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4297 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4302 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4307 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x70; buf
[3] = 0x05; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4308 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4313 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4318 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4323 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x71; buf
[3] = 0x78; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4324 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4329 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4334 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4339 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x77; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4340 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4345 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4350 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4355 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8a; buf
[3] = 0x23; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4356 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4361 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4366 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4371 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8c; buf
[3] = 0x0d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4372 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4377 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4382 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4387 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x90; buf
[3] = 0x7e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4388 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4393 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4398 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4403 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x91; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4404 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4409 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4414 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4419 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x9f; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4420 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4425 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4430 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4435 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa0; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4436 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4441 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4446 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4451 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa4; buf
[3] = 0x50; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4452 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4457 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4462 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4467 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa5; buf
[3] = 0x68; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4468 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4473 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4478 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4483 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa6; buf
[3] = 0x60; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4484 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4489 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4494 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4499 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa8; buf
[3] = 0xc1; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4500 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4505 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4510 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4515 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa9; buf
[3] = 0xfa; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4516 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4521 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4526 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4531 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaa; buf
[3] = 0x92; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4532 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4537 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4542 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4547 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xab; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4548 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4553 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4558 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4563 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xac; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4564 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4569 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4574 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4579 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xad; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4580 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4585 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4590 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4595 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xae; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4596 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4601 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4606 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4611 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaf; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4612 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4617 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4622 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4627 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb2; buf
[3] = 0xf2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4628 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4633 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4638 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4643 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb3; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4644 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4649 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4654 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4659 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb4; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4660 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4665 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4670 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4675 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb5; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4676 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4681 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4686 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4691 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb6; buf
[3] = 0xaf; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4692 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4697 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4702 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4707 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbb; buf
[3] = 0xae; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4708 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4713 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4718 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4723 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbc; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4724 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4729 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4734 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4739 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbd; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4740 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4745 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4750 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4755 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbe; buf
[3] = 0x3b; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4756 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4761 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4766 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4771 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbf; buf
[3] = 0x3a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4772 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4777 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4782 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4787 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc0; buf
[3] = 0xe2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4788 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4793 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4798 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4803 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc1; buf
[3] = 0xc8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4804 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4809 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4814 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4819 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc2; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4820 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4825 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4830 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4835 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc4; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4836 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4841 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4846 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4851 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc6; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4852 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4857 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4862 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4867 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc7; buf
[3] = 0x81; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4868 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4873 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4878 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4883 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc9; buf
[3] = 0xe0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4884 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4889 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4894 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4899 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xca; buf
[3] = 0xe8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4900 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4905 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4910 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4915 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcc; buf
[3] = 0xd8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4916 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4921 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4926 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4931 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcd; buf
[3] = 0x93; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4932 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4937 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4942 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4947 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4953 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
4958 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4959 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4964 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4969 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4970 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4975 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4980 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4981 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4986 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4991 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4992 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4997 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5002 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5003 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5008 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5013 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5014 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5019 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5024 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5025 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5030 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5035 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5036 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5041 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5046 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5047 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5052 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5053 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5058 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5063 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5064 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5069 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5074 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5075 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5080 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5085 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5086 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5091 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5096 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5097 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5102 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5107 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5108 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5113 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5118 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5119 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5124 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5129 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5130 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5135 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5140 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5141 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5146 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
5152 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5158 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5164 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5170 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5176 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5182 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5188 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5194 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5200 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5206 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5212 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5217 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5218 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5223 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5228 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5233 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
5234 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5239 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5244 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5249 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5250 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5255 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5260 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5261 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5266 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5271 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5276 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x50; buf
[5] = 0x78;
5277 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
5282 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
5283 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
5289 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5295 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5300 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
5301 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5306 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
5307 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5313 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5319 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5325 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5331 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5337 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5343 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5349 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5354 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5360 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5365 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5371 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5376 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5382 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5387 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5393 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5398 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5404 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5409 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5415 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5420 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5421 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5426 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5431 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5436 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5437 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5442 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5447 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5452 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5453 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5458 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5463 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5468 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5469 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5474 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5479 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5484 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5485 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5490 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5495 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5500 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5501 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5506 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5511 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5516 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5517 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5522 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5527 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5533 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5538 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x7d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5539 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5544 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5549 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5554 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5555 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5560 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5565 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5570 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5571 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5576 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5581 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5586 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5587 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5592 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5597 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5602 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5603 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5608 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5613 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5618 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5619 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5624 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5629 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5634 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5635 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5640 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5645 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5650 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5651 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5656 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5661 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5667 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5673 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5679 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5685 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5691 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5697 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5703 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5709 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5714 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5715 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5720 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5721 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5722 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5723 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5724 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
5725 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x00; buf
[23] = 0x00;
5726 buf
[24] = 0x00; buf
[25] = 0x00; buf
[26] = 0x00; buf
[27] = 0x00;
5727 buf
[28] = 0x00; buf
[29] = 0x00; buf
[30] = 0x00; buf
[31] = 0x00;
5728 buf
[32] = 0x00; buf
[33] = 0x00; buf
[34] = 0x00; buf
[35] = 0x00;
5729 buf
[36] = 0x00; buf
[37] = 0x00; buf
[38] = 0x00; buf
[39] = 0x00;
5730 buf
[40] = 0x00; buf
[41] = 0x00; buf
[42] = 0x00; buf
[43] = 0x00;
5731 buf
[44] = 0x00; buf
[45] = 0x00; buf
[46] = 0x00; buf
[47] = 0x00;
5732 ret
= usb_microdia_control_write(dev
, reg
, buf
, 48);
5737 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
5738 buf
[4] = 0x04; buf
[5] = 0x3f;
5739 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
5744 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
5745 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5750 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
5751 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5757 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5763 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5769 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5774 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
5775 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
5776 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
5777 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
5778 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
5779 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
5780 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
5781 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
5782 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
5783 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
5784 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
5785 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
5786 buf
[48] = 0x4f; buf
[49] = 0x53; buf
[50] = 0x58; buf
[51] = 0x58;
5787 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
5788 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
5789 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
5790 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
5795 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
5796 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
5797 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x53; buf
[11] = 0x36;
5798 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53; buf
[15] = 0x53;
5799 buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
5800 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53;
5801 buf
[24] = 0x53; buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53;
5802 buf
[28] = 0x53; buf
[29] = 0x53; buf
[30] = 0x53; buf
[31] = 0x53;
5803 buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53; buf
[35] = 0x53;
5804 buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
5805 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53;
5806 buf
[44] = 0x53; buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53;
5807 buf
[48] = 0x53; buf
[49] = 0x53; buf
[50] = 0x53; buf
[51] = 0x53;
5808 buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53; buf
[55] = 0x53;
5809 buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
5810 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
5811 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
5817 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5823 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5829 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5835 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5841 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5847 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5853 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5859 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5864 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5865 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5870 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5875 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5880 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
5881 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5886 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5891 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5896 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5897 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5902 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5907 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5908 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5913 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5918 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5923 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
5924 buf
[4] = 0x50; buf
[5] = 0x78;
5925 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
5930 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
5932 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
5938 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5943 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
5944 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5949 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
5950 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5956 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5962 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5968 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5974 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5980 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5986 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5992 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5998 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6004 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6010 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6016 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6022 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6027 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6033 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6038 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6044 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6049 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6055 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6060 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6066 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6071 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6077 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6082 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6088 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6093 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6094 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6099 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6104 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6109 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6110 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6115 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6120 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6125 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x70; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6126 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6131 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6136 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6141 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6142 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6147 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6152 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6157 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6158 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6163 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6168 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6173 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6174 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6179 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6184 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6185 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6190 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6195 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6200 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6201 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6206 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6211 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6212 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6217 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6222 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6227 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1c; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6228 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6233 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6238 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6239 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6244 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6249 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6254 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6255 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6260 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6265 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6266 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6271 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6276 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6282 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6288 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6294 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6299 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6300 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6305 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6310 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6315 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6316 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6321 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6326 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6331 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6332 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6337 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6342 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6347 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x36; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6348 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6353 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6358 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6363 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6364 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6369 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6374 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6379 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6380 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6385 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6390 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6395 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6396 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6401 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6406 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6411 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x94; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6412 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6417 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6422 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6427 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x8d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6428 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6433 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6438 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6443 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x09; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6444 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6449 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6454 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6459 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x95; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6460 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6465 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6470 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6475 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6476 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6481 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6486 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6491 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6492 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6497 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6502 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6507 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x96; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6508 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6513 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6518 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6523 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6524 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6529 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6534 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6539 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6540 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6545 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6550 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6556 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6562 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6569 /* END OF MICRODIA 6288 START STREAM */
6573 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
6577 int dev_microdia_stop_stream(struct usb_microdia
*dev
)
6580 if (dev
&& dev
->stop_stream
)
6581 ret
= dev
->stop_stream(dev
);
6587 * @brief From stop.htm
6595 * For SN9C201 with MI1310.
6596 * This function has not been tested yet.
6598 int microdia_6242_stop_stream(struct usb_microdia
*dev
)
6602 __u8 only10c0
[3] = {0x0d, 0x00, 0x00};
6605 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
6608 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6611 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6613 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
6614 only10c0
[0], dev
->sensor_flags
, &only10c0
[1]);
6617 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
6620 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
6623 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6626 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6629 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
6630 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
6633 * After the select alternate setting 0 is actually another transfer:
6635 * usb_microdia_control_write(dev, 0x1066, buf, 1);
6643 * @brief From stopstream.log
6651 * For SN9C201 with SOI968.
6652 * I don't whether the function really stops the stream.
6653 * Nevertheless the LED on the webcam now stops glowing.
6654 * The function is very similar to "microdia_624f_stop_stream".
6656 int microdia_624e_stop_stream(struct usb_microdia
*dev
)
6661 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
6663 /* Next two writes added because it works better.
6664 * The LED stops glowing and I think the stream does too.
6665 * 0x20 = 0b00100000 which is the minimal of what the
6666 * other stopstreams have in common.
6669 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6672 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6675 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
6678 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
6680 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
6681 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
6683 usb_microdia_control_read(dev
, 0x1066, buf
, 1);
6689 int microdia_624f_stop_stream(struct usb_microdia
*dev
)
6697 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6703 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6709 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6715 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6721 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6727 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6735 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
6740 ret
= usb_microdia_control_read(dev
, command
, buf
, 1);
6745 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6752 UDIA_ERROR("command %x failed (%d)!\n", command
, ret
);
6756 int microdia_6260_stop_stream(struct usb_microdia
*dev
)
6762 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
6764 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
6766 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
6768 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6770 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6772 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
6773 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 3);
6776 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
6777 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
6779 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
6781 ret
= usb_microdia_control_write(dev
, 0x10c8, buf
, 1);
6783 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
6789 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
6793 * @returns 0 (ok) or -1 (error)
6797 * Windows driver version: 5.7.23.000
6798 * Windows versions: 2000 and XP
6799 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
6800 * All logs were made using AMCAP with 640x480, RGB24
6802 int microdia_6270_stop_stream(struct usb_microdia
*dev
)
6808 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
6810 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); /* URB 3541 */
6812 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); /* URB 3542 */
6813 /* => These two writes seem to cause the cam to stop sending isochronus USB messages */
6816 ret
+= usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 3544 */
6817 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
6819 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); /* URB 3541 */
6821 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); /* URB 3542 */
6823 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
6824 /* Write to sensor register 0x07: Output Control */
6825 buf
[0] = 0x00; buf
[1] = 0x00; /* stop sensor readout, normal operation */
6826 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
6828 buf
[0] = 0x38; /* ALEX: 0x3c */
6829 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 3545 */
6830 buf
[0] = 0x6d; /* ALEX: 0xec; FRANK: also 0x6c */
6831 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 3546 */
6832 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
6833 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 3); /* URB 3547 */
6835 /* INTERRUPT COMMING BACK (URB 2227) */
6836 /* SELECT ALTERNATE SETTINGS (URB 3548) */
6837 /* INTERRUPT GOING DOWN (URB 3549) */
6840 ret
+= usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 3550 */
6843 UDIA_INFO("One ore more errors occured while stopping stream !\n");
6850 int microdia_627b_stop_stream(struct usb_microdia
*dev
)
6858 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6864 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6870 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6876 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6882 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6887 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
6888 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
6894 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6901 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
6906 * @brief From UsbSnoop-plugin-parsed.log
6910 * @returns 0 (OK) or <0 (Error)
6912 * @author Vincent, Kuzja
6914 int microdia_6288_stop_stream(struct usb_microdia
*dev
)
6922 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6928 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6934 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6940 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6946 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6951 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
6952 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
6958 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6964 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
6968 int microdia_624f_flip_detect(struct usb_microdia
*dev
)
6973 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
6977 dev
->vsettings
.vflip
= 1;
6979 dev
->vsettings
.vflip
= 0;
6983 int microdia_6260_flip_detect(struct usb_microdia
*dev
)
6985 const __u8 flip_bit
= 0x01;
6988 static __u8 flip_reg
= flip_bit
;
6991 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
6994 if (flip_reg
!= (val
& flip_bit
)) {
6999 ret
= ov7670_auto_flip(dev
, vflip
);
7000 flip_reg
= (val
& flip_bit
);