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 * This will execute a function determined by the array #cameras and
107 * the function find_camera().
110 int dev_microdia_camera_set_contrast(struct usb_microdia
*dev
)
113 if (dev
&& dev
->set_contrast
)
114 ret
= dev
->set_contrast(dev
);
119 * @brief Wrapper function for device-specific brightness functions
121 * @param dev Pointer to device structure
123 * @returns 0 or negative error value
125 * This will execute a function determined by the array #cameras and
126 * the function find_camera().
129 int dev_microdia_camera_set_brightness(struct usb_microdia
*dev
)
132 if (dev
&& dev
->set_brightness
)
133 ret
= dev
->set_brightness(dev
);
138 * @brief Wrapper function for device-specific gamma functions
140 * @param dev Pointer to device structure
142 * @returns 0 or negative error value
144 * This will execute a function determined by the array #cameras and
145 * the function find_camera().
148 int dev_microdia_camera_set_gamma(struct usb_microdia
*dev
)
151 if (dev
&& dev
->set_gamma
)
152 ret
= dev
->set_gamma(dev
);
157 * @brief Wrapper function for device-specific exposure functions
159 * @param dev Pointer to device structure
161 * @returns 0 or negative error value
163 * This will execute a function determined by the array #cameras and
164 * the function find_camera().
167 int dev_microdia_camera_set_exposure(struct usb_microdia
*dev
)
169 if (dev
->set_exposure
!= NULL
)
170 return dev
->set_exposure(dev
);
176 * @brief Wrapper function for device-specific hvflip functions
178 * @param dev Pointer to device structure
180 * @returns 0 or negative error value
182 * This will execute a function determined by the array #cameras and
183 * the function find_camera().
186 int dev_microdia_camera_set_hvflip(struct usb_microdia
*dev
)
189 if (dev
&& dev
->set_hvflip
)
190 ret
= dev
->set_hvflip(dev
);
196 * @brief Wrapper function for device-specific sharpness functions
198 * @param dev Pointer to device structure
200 * @returns 0 or negative error value
202 * This will execute a function determined by the array #cameras and
203 * the function find_camera().
206 int dev_microdia_camera_set_sharpness(struct usb_microdia
*dev
)
209 if (dev
&& dev
->set_sharpness
)
210 ret
= dev
->set_sharpness(dev
);
216 * @brief Wrapper function for device-specific rgb-gain functions
218 * @param dev Pointer to device structure
220 * @returns 0 or negative error value
222 * This will execute a function determined by the array #cameras and
223 * the function find_camera().
226 int dev_microdia_camera_set_rgb_gain(struct usb_microdia
*dev
)
229 if (dev
&& dev
->set_rgb_gain
)
230 ret
= dev
->set_rgb_gain(dev
);
236 * @brief Wrapper function for device-specific auto-exposure functions
238 * @param dev Pointer to device structure
240 * @returns 0 or negative error value
242 * This will execute a function determined by the array #cameras and
243 * the function find_camera().
246 int dev_microdia_camera_set_auto_exposure(struct usb_microdia
*dev
)
249 if (dev
&& dev
->set_auto_exposure
)
250 ret
= dev
->set_auto_exposure(dev
);
256 * @brief Wrapper function for device-specific auto-whitebalance functions
258 * @param dev Pointer to device structure
260 * @returns 0 or negative error value
262 * This will execute a function determined by the array #cameras and
263 * the function find_camera().
266 int dev_microdia_camera_set_auto_whitebalance(struct usb_microdia
*dev
)
269 if (dev
&& dev
->set_auto_whitebalance
)
270 ret
= dev
->set_auto_whitebalance(dev
);
277 * @brief Wrapper function for device-specific initialization functions
279 * @param dev Pointer to device structure
281 * @returns 0 or negative error value
283 * This will execute a function determined by the array #cameras and
284 * the function find_camera().
287 int dev_microdia_initialize_device(struct usb_microdia
*dev
)
291 if (dev
&& dev
->initialize
)
292 ret
= dev
->initialize(dev
);
298 * @brief From init-physical-replug.log
306 * For SN9C201 with MI1300.
309 int microdia_6240_initialize(struct usb_microdia
*dev
)
315 * @brief From start.log (14 jun 2008)
323 * For SN9C201 with MI1300.
326 int microdia_6240_start_stream(struct usb_microdia
*dev
)
333 /* Setup the bridge registers */
334 static __u16 bridge6240_init
[][2] = {
1059 static __u8 mi1300_init
[][2] = {
1246 /* initialize SN9C201 for 6240 */
1247 for (i
= 0; i
< ARRAY_SIZE(bridge6240_init
); i
++) {
1248 reg
= bridge6240_init
[i
][0];
1249 value
[0] = bridge6240_init
[i
][1];
1250 ret
= usb_microdia_control_write(dev
, reg
, value
, 1);
1252 UDIA_INFO("6240 Bridge: Inititialization Error (%d) on array line %d\n", ret
, i
);
1257 /* initialize the Bridge to I2C interface */
1258 ret
= sn9c20x_i2c_initialize(dev
);
1260 /* initialize the Sensor MI 1300 */
1261 for (i
= 0; i
< ARRAY_SIZE(mi1300_init
); i
++) {
1262 reg
= mi1300_init
[i
][0];
1263 value
[0] = mi1300_init
[i
][1];
1264 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
1265 reg
, dev
->sensor_flags
, value
);
1267 UDIA_INFO("Sensor MI 1300: Inititialization Error (%d) on array line %d\n", ret
, i
);
1272 UDIA_INFO("...start function completed without errors.\n");
1277 * @brief From stop-close-amcap.log
1285 * For SN9C201 with MI1300. Comments from parser-usbsnoop(updated_13Mar2008).pl output
1288 int microdia_6240_stop_stream(struct usb_microdia
*dev
)
1295 static __u8 mi1300_stop
[][2] = {
1300 static __u16 bridge6240_stop
[][2] = {
1312 UDIA_INFO("Stopping camera...\n");
1314 for (i
= 0; i
< ARRAY_SIZE(mi1300_stop
); i
++) {
1315 reg
= mi1300_stop
[i
][0];
1316 value
[0] = mi1300_stop
[i
][1];
1317 ret
= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 1,
1318 reg
, dev
->sensor_flags
, value
);
1320 UDIA_INFO("Sensor MI 1300: Stop Sequence Error (%d) on array line %d\n", ret
, i
);
1325 for (i
= 0; i
< ARRAY_SIZE(bridge6240_stop
); i
++) {
1326 reg
= bridge6240_stop
[i
][0];
1327 value
[0] = bridge6240_stop
[i
][1];
1328 ret
= usb_microdia_control_write(dev
, reg
, value
, 1);
1330 UDIA_INFO("6240 Bridge: Stop Sequence Error (%d) on array line %d\n", ret
, i
);
1339 * @brief From init.sequence.log
1347 * For SN9C201 with SOI968.
1348 * Tests showed this function is actually unnecessary.
1349 * Nevertheless the reads may give us valuable values we don't know about yet.
1351 int microdia_624e_initialize(struct usb_microdia
*dev
)
1355 usb_microdia_control_read(dev
, 0x130d, &buf
, 1);
1356 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
1362 * @brief From UsbSnoop-plugin-parsed.log
1368 int microdia_624f_initialize(struct usb_microdia
*dev
)
1370 /* Do nothing here */
1375 * @brief From UsbSnoop-plugin-parsed.log
1381 int microdia_6260_initialize(struct usb_microdia
*dev
)
1385 usb_microdia_control_read(dev
, 0x130d, &buf
, 1);
1386 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
1388 usb_microdia_control_write(dev
, 0x10c8, &buf
, 1);
1389 usb_microdia_control_read(dev
, 0x100a, &buf
, 1);
1391 usb_microdia_control_write(dev
, 0x100a, &buf
, 1);
1392 usb_microdia_control_read(dev
, 0x100b, &buf
, 1);
1394 usb_microdia_control_write(dev
, 0x100b, &buf
, 1);
1395 usb_microdia_control_read(dev
, 0x1001, &buf
, 1);
1397 usb_microdia_control_write(dev
, 0x1001, &buf
, 1);
1398 usb_microdia_control_read(dev
, 0x1040, &buf
, 1);
1400 usb_microdia_control_write(dev
, 0x1040, &buf
, 1);
1401 usb_microdia_control_read(dev
, 0x1045, &buf
, 1);
1403 usb_microdia_control_write(dev
, 0x1045, &buf
, 1);
1404 usb_microdia_control_read(dev
, 0x1046, &buf
, 1);
1406 usb_microdia_control_write(dev
, 0x1046, &buf
, 1);
1408 usb_microdia_control_write(dev
, 0x1045, &buf
, 1);
1410 usb_microdia_control_write(dev
, 0x1040, &buf
, 1);
1412 usb_microdia_control_write(dev
, 0x1020, &buf
, 1);
1418 * @brief From 6 init-logs
1422 * @returns 0 (ok) or -1 (error)
1426 * Windows driver versions: 5.5.8.12 and 5.7.23.000
1427 * Windows versions: 2000 and XP
1428 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
1430 * Comments behind read oprations contain HEX-values that appeared in the logs
1432 int microdia_6270_initialize(struct usb_microdia
*dev
)
1444 ret
+= usb_microdia_control_read(dev
, 0x130d, buf
, 1); /* URB 5 0x81,0x85,0x04,0x8b,0x02,... */
1446 ret
+= usb_microdia_control_read(dev
, 0x1040, buf
, 1); /* URB 6 0xe4,0xc4,0xa4,0x44,... */
1449 * THE OLD DRIVER 5.5.8.12 DOES AN ADDITIONAL WRITE HERE:
1451 * usb_microdia_control_write(dev, 0x10c8, buf, 1);
1454 ret
+= usb_microdia_control_read(dev
, 0x118a, buf
, 1); /* URB 7 0x05,0x7b,0x01,0x04,... */
1456 ret
+= usb_microdia_control_read(dev
, 0x0395, buf_0395
, 1); /* URB 8 0xc2,0x82,0x38,0x98,0x04,... */
1457 /* => this value will be rewritten to 0x118a and 0x0395 later (URBs 81+82) */
1460 ret
+= usb_microdia_control_write(dev
, 0x118a, buf
, 1); /* URB 9 */
1462 ret
+= usb_microdia_control_write(dev
, 0x0395, buf
, 1); /* URB 10 */
1464 ret
+= usb_microdia_control_read(dev
, 0x11b8, buf_11b8
, 1); /* URB 11 0xa0,0x00,0x24,... */
1465 /* => this value will be rewritten to 0x11b8 later (URB 83) */
1468 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 12 */
1470 ret
+= usb_microdia_control_read(dev
, 0x1000, buf_1000
, 5); /* URB 13 0x30 0xCF 0x00 0x03 (0x02 or 0x00) */
1471 /* => these values will be rewritten to 0x1000 later (URB 84) */
1473 buf
[0] = 0x70; buf
[1] = 0x00; buf
[2] = 0x18; buf
[3] = 0x00; buf
[4] = 0x00;
1474 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 5); /* URB 14 */
1476 ret
+= usb_microdia_control_read(dev
, 0x1060, buf_1060
, 2); /* URB 15 0x08 0x00 (always ???) */
1477 /* => this value will be rewritten to 0x1060 later (URB 85) */
1479 buf
[0] = 0x00; buf
[1] = 0x03;
1480 ret
+= usb_microdia_control_write(dev
, 0x1060, buf
, 2); /* URB 16 */
1482 /* initialize I2C registers to avoid getting no ACK at first I2C operation: */
1483 ret
+= sn9c20x_i2c_initialize(dev
);
1485 /* enable I2C communication (bit 0) */
1486 buf
[0] = 0x21; /* THE OLD DRIVER 5.5.8.12 WRITES 0x5d */
1487 ret
+= usb_microdia_control_write(dev
, 0x10c8, buf
, 1); /* URB 17 */
1489 /* probe sensor model: */
1490 retSP
= mt9vx11_sensor_probe(dev
); /* substitutes URBs 18-48 */
1491 if ((retSP
== 0) && (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
))
1492 /* switch (back) to IFP address space: */
1493 retASS
= mt9v111_select_address_space(dev
, MT9V111_ADDRESSSPACE_IFP
);
1495 ret
+= usb_microdia_control_write(dev
, 0x118a, buf_0395
, 1); /* URB 81 => write value read with URB 8 */
1497 ret
+= usb_microdia_control_write(dev
, 0x0395, buf_0395
, 1); /* URB 82 => write value read with URB 8 */
1499 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf_11b8
, 1); /* URB 83 => write value read with URB 11 */
1501 ret
+= usb_microdia_control_write(dev
, 0x1000, buf_1000
, 5); /* URB 84 => write value read with URB 13 */
1503 ret
+= usb_microdia_control_write(dev
, 0x1060, buf_1060
, 2); /* URB 85 => write value read with URB 15; (always 08 00 ???) */
1505 /* USB-interrupt-message: doesn't work yet (returns error -110) */
1506 /* 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 */
1509 * THE OLD DRIVER 5.5.8.12 DOES AN ADDITIONAL WRITE HERE:
1511 * usb_microdia_control_write(dev, 0x1020, wbuf, 1);
1514 if ((retSP
!= 0) || (retASS
!= 0) || (ret
< 33)) {
1516 UDIA_INFO("One ore more errors occured during initialization !\n");
1525 * @brief From UsbSnoop-plugin-parsed.log
1531 int microdia_627b_initialize(struct usb_microdia
*dev
)
1533 /* Apparently we don't need to write anything here */
1538 * @brief From init-start-stop-log (made by VÃctor M. Hernández Rocamora)
1542 * @returns 0 (ok) or -1 (error)
1546 * USB-Logger: SniffUSB 2.0
1548 * Comments behind read oprations contain HEX-values that appeared in the log
1550 int microdia_627f_initialize(struct usb_microdia
*dev
)
1555 ret
+= usb_microdia_control_read(dev
, 0x130d, buf
, 1); /* URB 5 0x81 */
1557 ret
+= usb_microdia_control_read(dev
, 0x1040, buf
, 1); /* URB 6 0xe4 */
1560 ret
+= usb_microdia_control_write(dev
, 0x10c8, buf
, 1); /* URB 7 */
1563 ret
+= usb_microdia_control_write(dev
, 0x1020, buf
, 1); /* URB 8 */
1565 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); /* URB 9 0x0f */
1568 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); /* URB 10 */
1570 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); /* URB 11 0x1f */
1573 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); /* URB 12 */
1575 ret
+= usb_microdia_control_read(dev
, 0x1045, buf
, 1); /* URB 13 0x0f */
1578 ret
+= usb_microdia_control_write(dev
, 0x1045, buf
, 1); /* URB 14 */
1581 UDIA_INFO("One ore more errors occured during initialization !\n");
1588 * @brief From UsbSnoop-plugin-parsed.log
1592 * @returns 0 (OK) or <0 (Error)
1594 * @author Vincent, Kuzja
1596 int microdia_6288_initialize(struct usb_microdia
*dev
)
1604 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
1609 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
1618 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
1623 * @brief Wrapper function for device-specific startstream functions
1625 * @param dev Pointer to device structure
1629 * This will execute a function determined by the array #cameras and
1630 * the function find_camera().
1633 int dev_microdia_start_stream(struct usb_microdia
*dev
)
1636 if (dev
&& dev
->start_stream
)
1637 ret
= dev
->start_stream(dev
);
1643 * @brief From start.htm
1651 * For SN9C201 with MI1310.
1653 int microdia_6242_start_stream(struct usb_microdia
*dev
)
1659 0x01, 0x18, 0x00, 0x30, 0x00, 0x09, 0x00, 0xed,
1660 0x0f, 0xda, 0x0f, 0x3a, 0x00, 0x3a, 0x00, 0xd0,
1661 0x0f, 0xf7, 0x0f, 0x00, 0x00, 0x00, 0x60, 0x0a};
1664 0x02, 0x00, 0x02, 0x00, 0x50, 0x78, 0x00, 0x00,
1668 0x00, 0x20, 0x20, 0x20, 0x20, 0x00, 0x24, 0x3b,
1669 0x4f, 0x61, 0x71, 0x80, 0x8f, 0x9d, 0xab, 0xb8,
1670 0xc4, 0xd1, 0xdd, 0xe9, 0xf4, 0xff};
1672 __u8 qtable1
[64] = {
1673 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
1674 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
1675 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
1676 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
1677 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
1678 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
1679 0x4f, 0x54, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
1680 0x64, 0x5c, 0x54, 0x64, 0x4b, 0x54, 0x58, 0x54};
1682 __u8 qtable2
[64] = {
1683 0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
1684 0x15, 0x26, 0x54, 0x36, 0x2e, 0x36, 0x54, 0x54,
1685 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1686 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1687 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1688 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1689 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
1690 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54};
1692 __u8 first10c0
[7][3] = {
1702 __u8 second10c0a
[2][5] = {
1703 {0x01, 0x00, 0x0e, 0x00, 0x14},
1704 {0x03, 0x03, 0xc4, 0x05, 0x14}
1707 __u8 second10c0b
[3] =
1710 __u8 third10c0
[4][3] = {
1717 __u8 fourth10c0a
[3][3] = {
1723 __u8 fourth10c0b
[2][5] = {
1724 {0x2b, 0x01, 0x88, 0x01, 0x88},
1725 {0x2d, 0x01, 0x88, 0x01, 0x88}
1728 __u8 fifth10c0
[4][3] = {
1734 /* interrupt down */
1737 usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 1 */
1740 /* interrupt down */
1743 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
1746 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
1749 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
1752 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1755 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
1758 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
1761 usb_microdia_control_write(dev
, 0x1020, buf
, 1);
1763 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
1764 buf
[3] = 0x10; buf
[4] = 0x08;
1765 usb_microdia_control_write(dev
, 0x1067, buf
, 5);
1767 buf
[0] = 0xb0; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x0d;
1768 buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00;
1769 buf
[6] = 0x00; buf
[7] = 0x10; buf
[8] = 0x03;
1770 usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
1772 usb_microdia_control_write(dev
, 0x10e0, urb10
, 24); /* URB 10 */
1774 buf
[0] = 0x00; buf
[1] = 0x00; buf
[3] = 0x00;
1775 usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
1777 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00;
1778 buf
[3] = 0xe0; buf
[4] = 0x03;
1779 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
1781 usb_microdia_control_write(dev
, 0x1180, urb13
, 11);
1783 usb_microdia_control_write(dev
, 0x118b, urb14
, 22);
1785 buf
[0] = 0x00; buf
[1] = 0x00;
1786 usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
1788 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00;
1789 buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00;
1790 buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x00;
1791 usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
1794 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1797 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
1799 for (i
= 0; i
< 7; i
++)
1800 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1801 first10c0
[i
][0], dev
->sensor_flags
, &first10c0
[i
][1]); /* URB 9-48 */
1804 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
1807 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
1810 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 50 */
1813 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1816 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1819 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1822 usb_microdia_control_write(dev
, 0x1001, buf
, 1);
1825 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
1828 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
1831 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
1834 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
1837 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
1839 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1840 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
1842 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1843 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
1845 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
1846 0x09, dev
->sensor_flags
, NULL
);
1848 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1849 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
1851 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
1852 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
1853 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
1855 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
1856 buf
[3] = 0xf0; buf
[4] = 0x00;
1857 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 70 */
1860 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
1862 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
1863 usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
1865 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
1866 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
1869 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
1872 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
1875 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
1878 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1881 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
1884 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
1887 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 80 */
1888 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1891 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1892 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1895 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1896 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1899 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1900 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1903 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
1904 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
1907 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 90 */
1909 for (i
= 0; i
< 4; i
++)
1910 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1911 third10c0
[i
][0], dev
->sensor_flags
, &third10c0
[i
][1]); /* URB 97-106 */
1914 usb_microdia_control_write(dev
, 0x1180, buf
, 1);
1916 for (i
= 0; i
< 3; i
++)
1917 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1918 fourth10c0a
[i
][0], dev
->sensor_flags
, &fourth10c0a
[i
][1]);
1920 for (i
= 0; i
< 2; i
++)
1921 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
1922 fourth10c0b
[i
][0], dev
->sensor_flags
, &fourth10c0b
[i
][1]);
1924 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
1925 0x33, dev
->sensor_flags
, NULL
);
1927 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
1928 first10c0
[0][0], dev
->sensor_flags
, &first10c0
[0][1]);
1931 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
1934 usb_microdia_control_write(dev
, 0x118b, buf
, 1);
1937 usb_microdia_control_write(dev
, 0x10f7, buf
, 1);
1940 usb_microdia_control_write(dev
, 0x10f8, buf
, 1);
1943 usb_microdia_control_write(dev
, 0x10fa, buf
, 1);
1946 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
1949 usb_microdia_control_write(dev
, 0x10f9, buf
, 1);
1952 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
1954 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
1955 usb_microdia_control_write(dev
, 0x11bc, buf
, 4);
1957 /* Set whole array buf to 0x00 */
1958 memset(buf
, 0x00, 48);
1959 usb_microdia_control_write(dev
, 0x11c0, buf
, 48);
1961 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a;
1962 buf
[3] = 0x05; buf
[4] = 0x04; buf
[5] = 0x3f;
1963 usb_microdia_control_write(dev
, 0x11a5, buf
, 6);
1965 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
1966 usb_microdia_control_write(dev
, 0x11af, buf
, 4);
1968 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
1969 usb_microdia_control_write(dev
, 0x11b3, buf
, 4);
1972 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1975 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
1978 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1980 usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
1982 usb_microdia_control_write(dev
, 0x1140, qtable2
, 64); /* URB 150 */
1985 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1988 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
1991 usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
1994 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
1997 usb_microdia_control_write(dev
, 0x11bc, buf
, 1);
2000 usb_microdia_control_write(dev
, 0x11bd, buf
, 1);
2003 usb_microdia_control_write(dev
, 0x11be, buf
, 1);
2006 usb_microdia_control_write(dev
, 0x11bf, buf
, 1);
2008 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
2009 second10c0a
[0][0], dev
->sensor_flags
, &second10c0a
[0][1]);
2011 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4,
2012 second10c0a
[1][0], dev
->sensor_flags
, &second10c0a
[1][1]);
2014 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0,
2015 0x09, dev
->sensor_flags
, NULL
);
2017 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
2018 second10c0b
[0], dev
->sensor_flags
, &second10c0b
[1]);
2020 buf
[0] = 0x06; buf
[1] = 0x00; buf
[2] = 0x02;
2021 buf
[3] = 0x00; buf
[4] = 0x28; buf
[5] = 0x3c;
2022 usb_microdia_control_write(dev
, 0x1180, buf
, 6);
2024 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00;
2025 buf
[3] = 0xf0; buf
[4] = 0x00;
2026 usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
2029 usb_microdia_control_write(dev
, 0x1189, buf
, 1);
2031 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
2032 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); /* URB 170 */
2034 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
2035 usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
2038 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2041 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
2044 usb_microdia_control_write(dev
, 0x11b9, buf
, 1);
2047 usb_microdia_control_write(dev
, 0x11ba, buf
, 1);
2050 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2053 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2056 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2059 usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2062 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 180 */
2065 usb_microdia_control_write(dev
, 0x118a, buf
, 1);
2068 usb_microdia_control_write(dev
, 0x0395, buf
, 1);
2071 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2072 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2075 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2076 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2079 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2080 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2083 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2084 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 190 */
2087 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2088 usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2091 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2093 for (i
= 0; i
< 3; i
++)
2094 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
2095 fifth10c0
[i
][0], dev
->sensor_flags
, &fifth10c0
[i
][1]); /* URB 200-205 */
2097 sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2,
2098 0x00, dev
->sensor_flags
, buf
);
2099 /* __u8 result[2] = {buf[3], buf[4]}; */
2102 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2109 * @brief From startstream.log
2117 * For SN9C201 with SOI968.
2118 * This is function triggers a working stream of image data and a glowing LED.
2120 int microdia_624e_start_stream(struct usb_microdia
*dev
)
2123 __u8 unknown1
[9] = { dev
->sensor_flags
, dev
->sensor_slave_address
,
2124 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
2217 __u8 qtable1
[64] = {
2218 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
2219 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
2220 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
2221 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
2222 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
2223 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
2224 0x4f, 0x53, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
2225 0x64, 0x5c, 0x53, 0x64, 0x4b, 0x53, 0x58, 0x53
2228 __u8 qtable2
[64] = {
2229 0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
2230 0x15, 0x26, 0x53, 0x36, 0x2e, 0x36, 0x53, 0x53,
2231 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2232 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2233 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2234 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2235 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53,
2236 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53, 0x53
2240 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++) {
2243 ret
= usb_microdia_control_write(dev
, reg
, &value
, 1);
2245 UDIA_INFO("Bridge Init Error (%d). line %d\n", ret
, i
);
2250 memset(reg_11c0
, 0x00, 48);
2251 ret
= usb_microdia_control_write(dev
, 0x11c0, reg_11c0
, 48);
2255 ret
= usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
2259 ret
= usb_microdia_control_write(dev
, 0x1140, qtable2
, 64);
2263 /* this is the same register as the I2C write, not sure why
2264 * we're writing 9 bytes -- the SN9C102 docs say all writes
2265 * must be 8 bytes, but we don't have docs for SN9C20x */
2266 ret
= usb_microdia_control_write(dev
, 0x10c0, unknown1
, 9);
2270 if (dev
->sensor_init
)
2271 dev
->sensor_init(dev
);
2276 UDIA_ERROR("start stream: failed (%d)!\n", ret
);
2280 int microdia_624f_start_stream(struct usb_microdia
*dev
)
2283 __u8 unknown1
[9] = { dev
->sensor_flags
, dev
->sensor_slave_address
,
2284 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03 };
2348 __u8 reg_11c0
[48] = {
2349 0x10, 0x21, 0x34, 0x40, 0x47, 0x4f, 0x57, 0x5f,
2350 0x64, 0x68, 0x6d, 0x73, 0x79, 0x80, 0x89, 0x97,
2351 0x0d, 0x1c, 0x2a, 0x33, 0x38, 0x3d, 0x44, 0x4a,
2352 0x4e, 0x52, 0x56, 0x5b, 0x61, 0x68, 0x6f, 0x7a,
2353 0x0d, 0x1a, 0x2a, 0x31, 0x36, 0x3b, 0x41, 0x47,
2354 0x4a, 0x4e, 0x53, 0x58, 0x5d, 0x64, 0x6b, 0x76
2357 __u8 qtable1
[64] = {
2358 0x0d, 0x08, 0x08, 0x0d, 0x08, 0x08, 0x0d, 0x0d,
2359 0x0d, 0x0d, 0x11, 0x0d, 0x0d, 0x11, 0x15, 0x21,
2360 0x15, 0x15, 0x11, 0x11, 0x15, 0x2a, 0x1d, 0x1d,
2361 0x19, 0x21, 0x32, 0x2a, 0x32, 0x32, 0x2e, 0x2a,
2362 0x2e, 0x2e, 0x36, 0x3a, 0x4b, 0x43, 0x36, 0x3a,
2363 0x47, 0x3a, 0x2e, 0x2e, 0x43, 0x5c, 0x43, 0x47,
2364 0x4f, 0x54, 0x58, 0x58, 0x58, 0x32, 0x3f, 0x60,
2365 0x64, 0x5c, 0x54, 0x64, 0x4b, 0x54, 0x58, 0x54
2368 __u8 qtable2
[64] = {
2369 0x0d, 0x11, 0x11, 0x15, 0x11, 0x15, 0x26, 0x15,
2370 0x15, 0x26, 0x54, 0x36, 0x2e, 0x36, 0x54, 0x54,
2371 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2372 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2373 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2374 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2375 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54,
2376 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54, 0x54
2379 for (i
= 0; i
< ARRAY_SIZE(regs
); i
++) {
2382 ret
= usb_microdia_control_write(dev
, reg
, &value
, 1);
2384 UDIA_INFO("Bridge Init Error (%d). line %d\n", ret
, i
);
2389 ret
= usb_microdia_control_write(dev
, 0x11c0, reg_11c0
, 48);
2393 ret
= usb_microdia_control_write(dev
, 0x1100, qtable1
, 64);
2397 ret
= usb_microdia_control_write(dev
, 0x1140, qtable2
, 64);
2401 /* this is the same register as the I2C write, not sure why
2402 * we're writing 9 bytes -- the SN9C102 docs say all writes
2403 * must be 8 bytes, but we don't have docs for SN9C20x */
2404 ret
= usb_microdia_control_write(dev
, 0x10c0, unknown1
, 9);
2408 if (dev
->sensor_init
)
2409 dev
->sensor_init(dev
);
2414 UDIA_ERROR("start stream: failed (%d)!\n", ret
);
2419 * @brief Start stream from 6260 devices
2423 * @returns 0 or negative error code
2426 int microdia_6260_start_stream(struct usb_microdia
*dev
)
2431 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
2433 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
2435 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
2437 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
2439 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
2441 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2443 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
2445 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2447 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2449 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
2451 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10;
2453 ret
= usb_microdia_control_write(dev
, 0x1067, buf
, 5);
2455 buf
[0] = 0x80; buf
[1] = 0x21; buf
[2] = 0x00; buf
[3] = 0x00;
2456 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
2458 ret
= usb_microdia_control_write(dev
, 0x10c0, buf
, 9);
2460 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
2461 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
2462 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
2463 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
2464 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
2465 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
2466 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 24);
2468 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
2469 ret
= usb_microdia_control_write(dev
, 0x10f8, buf
, 3);
2471 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
2473 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
2475 buf
[0] = 0x8a; buf
[1] = 0x8c; buf
[2] = 0x08;
2476 ret
= usb_microdia_control_write(dev
, 0x1188, buf
, 3);
2478 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
2479 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
2480 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
2481 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
2482 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
2483 buf
[20] = 0xf4; buf
[21] = 0xff;
2484 ret
= usb_microdia_control_write(dev
, 0x118b, buf
, 22);
2486 buf
[0] = 0x00; buf
[1] = 0x00;
2487 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 2);
2489 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x00;
2490 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
2492 ret
= usb_microdia_control_write(dev
, 0x11b7, buf
, 9);
2495 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2498 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2500 ret
= ov7670_initialise(dev
);
2504 ret
= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 1, 0x3b, dev
->sensor_flags
, buf
);
2505 ret
= usb_microdia_control_read(dev
, 0x10c1, buf
, 1);
2507 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
2509 /* TRY TO READ FROM EEPROM: */
2510 ret
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, dev
->sensor_flags
, buf
);
2512 UDIA_INFO("No EEPROM found\n");
2514 UDIA_INFO("Read from EEPROM successful\n");
2517 ret
= usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
2519 ret
= usb_microdia_control_write(dev
, 0x10e0, buf
, 1);
2521 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
2523 ret
= usb_microdia_control_write(dev
, 0x1001, buf
, 1);
2525 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
2526 buf
[4] = 0x50; buf
[5] = 0x3c;
2527 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
2529 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
2531 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
2534 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
2536 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
2537 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
2539 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
2540 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
2542 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2544 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2546 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2548 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2550 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
2552 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
2554 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2555 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2557 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2558 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2560 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2561 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2563 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2564 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2566 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2567 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2569 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2570 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2572 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2574 /* OV7670 Intialise Part 2 */
2575 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
2576 buf
[4] = 0x50; buf
[5] = 0x3c;
2577 ret
= usb_microdia_control_write(dev
, 0x1180, buf
, 6);
2579 buf
[0] = 0x00; buf
[1] = 0x40; buf
[2] = 0x00; buf
[3] = 0xf0;
2581 ret
= usb_microdia_control_write(dev
, 0x10fb, buf
, 5);
2584 ret
= usb_microdia_control_write(dev
, 0x1189, buf
, 1);
2586 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0x50;
2587 ret
= usb_microdia_control_write(dev
, 0x11a1, buf
, 4);
2589 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x3c;
2590 ret
= usb_microdia_control_write(dev
, 0x11ab, buf
, 4);
2593 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2595 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2597 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
2599 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2601 ret
= usb_microdia_control_write(dev
, 0x1002, buf
, 1);
2603 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2605 ret
= usb_microdia_control_write(dev
, 0x118a, buf
, 1);
2607 ret
= usb_microdia_control_write(dev
, 0x0395, buf
, 1);
2609 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2610 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2612 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2613 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2615 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2616 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2618 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2619 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2621 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2622 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2624 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2625 ret
= usb_microdia_control_read(dev
, 0x11b8, buf
, 1);
2627 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
2629 /* OV7670 Initialisation Part 3 Goes Here */
2631 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
2637 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
2641 * @returns 0 (ok) or -1 (error)
2645 * Windows driver versions: 5.7.23.000
2646 * Windows versions: 2000 and XP
2647 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
2648 * All logs were made using AMCAP with 640x480, RGB24
2650 int microdia_6270_start_stream(struct usb_microdia
*dev
)
2657 /* Check if sensor slave address is valid: */
2658 if ((dev
->sensor_slave_address
!= MT9V111_I2C_SLAVE_ADDRESS
) && (dev
->sensor_slave_address
!= MT9V011_I2C_SLAVE_ADDRESS
)) {
2659 UDIA_INFO("microdia_6270_start_stream(): Invalid sensor slave address !\n");
2663 /* <= INTERRUPT COMING BACK (URB 1953) */
2664 /* SWITCH TO ALTERNATE SETTINGS 8 (URB 1954) // NOT IN ALEX'S LOG */
2665 /* => INTERRUPT GOING DOWN (URB 1955) */
2668 usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 1956 */
2670 /* <= INTERRUPT COMING BACK (URB 1955) */
2671 /* => INTERRUPT GOING DOWN (URB 1957) */
2674 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 1958 */
2676 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 1959 */
2678 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 1960 */
2680 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 1961 */
2682 usb_microdia_control_write(dev
, 0x1020, buf
, 1); /* URB 1962 */
2683 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20; buf
[3] = 0x10; buf
[4] = 0x08;
2684 usb_microdia_control_write(dev
, 0x1067, buf
, 5); /* URB 1963 */
2686 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
2687 /* STRANGE I2C MESSAGE: */
2689 /* - byte 8 = 0x00 at first start + first cycle */
2690 /* - procedure not complete: no wait/check for ack/error, no readout of 0x10c2 */
2691 /* - dummy writes at first cycle and read at second cycle, but there are many I2C messages in the meantime, so this should not work */
2693 /* AT FIRST START + FIRST CYCLE: */
2694 buf
[0] = 0x80; buf
[1] = dev
->sensor_slave_address
; buf
[2] = 0x00; buf
[3] = 0x00;
2695 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00; buf
[8] = 0x03;
2696 /* AT ALL FURTHER STARTS + FIRST CYCLE: */
2697 /* MT9V111: I2C MESSAGE => IFP Register 0x33: Auto exposure */
2698 /* buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x33; buf[3] = 0x00; */
2699 /* buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03; */
2700 /* MT9V011: ????????????????????????? */
2701 /* buf[0] = 0x90; buf[1] = dev->sensor_slave_address; buf[2] = 0x07; buf[3] = 0x00; */
2702 /* buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03; */
2703 /* ALWAYS AT 2nd AND FURTHER CYCLES: */
2705 /* buf[0] = 0xa2; buf[1] = 0x5c; buf[2] = 0x00; buf[3] = 0x36; */
2706 /* buf[4] = 0x00; buf[5] = 0x82; buf[6] = 0x3a; buf[7] = 0x10; buf[8] = 0x03; */
2707 /* => buf[3] to buf[6] simply contain bytes read with URB 2215 */
2709 /* buf[0] = 0xb0; buf[1] = 0x5d; buf[2] = 0x07; buf[3] = 0x00; */
2710 /* buf[4] = 0x00; buf[5] = 0x00; buf[6] = 0x00; buf[7] = 0x10; buf[8] = 0x03; */
2711 usb_microdia_control_write(dev
, 0x10c0, buf
, 9); /* URB 1964 */
2712 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
2714 buf
[0] = 0x45; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
2715 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
2716 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
2717 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
2718 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
2719 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
2720 usb_microdia_control_write(dev
, 0x10e0, buf
, 24); /* URB 1965 */
2721 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
2722 usb_microdia_control_write(dev
, 0x10f8, buf
, 3); /* URB 1966 */
2723 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
2724 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 1967 */
2725 buf
[0] = 0x06; buf
[1] = 0x0c; buf
[2] = 0x08;
2726 usb_microdia_control_write(dev
, 0x1188, buf
, 3); /* URB 1968 */
2727 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
2728 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
2729 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
2730 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
2731 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
2732 buf
[20] = 0xf4; buf
[21] = 0xff;
2733 usb_microdia_control_write(dev
, 0x118b, buf
, 22); /* URB 1969 */
2734 buf
[0] = 0x00; buf
[1] = 0x00;
2735 usb_microdia_control_write(dev
, 0x11a1, buf
, 2); /* URB 1970 */
2736 buf
[0] = 0x60; buf
[1] = 0x28; buf
[2] = 0x00; buf
[3] = 0x08;
2737 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
2739 usb_microdia_control_write(dev
, 0x11b7, buf
, 9); /* URB 1971 */
2741 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 1972 */
2743 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 1973 */
2745 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
2748 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
2749 /* Write to IFP register 0x0d: Color Correction Register 8 */
2750 buf
[0] = 0x00; buf
[1] = 0x01;
2751 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); /* URBs 1974-1976 */
2752 /* Write to IFP register 0x0d: Color Correction Register 8 */
2753 buf
[0] = 0x00; buf
[1] = 0x00; /* ??? */
2754 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
); /* URBs 1977-1979 */
2755 /* Writes to IFP registers 0x01: Register Address Space Selection */
2756 /* 0x02: Color Correction Register 1 */
2757 buf
[0] = 0x00; buf
[1] = 0x01; /* select IFP address space */
2758 buf
[2] = 0x00; buf
[3] = 0x16; /* ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2759 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); /* URBs 1980-1982 */
2760 /* Writes to IFP registers 0x03: Color Correction Register 3 */
2761 /* 0x04: Color Correction Register 4 */
2762 buf
[0] = 0x01; buf
[1] = 0xe1; /* ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2763 buf
[2] = 0x02; buf
[3] = 0x81; /* ??? // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2764 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); /* URBs 1983-1985 */
2765 /* Writes to IFP registers 0x05: Aperture Correction (Sharpening) */
2766 /* 0x06: Operating Mode Control */
2767 buf
[0] = 0x00; buf
[1] = 0x04; /* 100% sharpening, no automatic sharpness reduction at low light // AT FIRST START + FIRST CYCLE: 0x00 0x00: no sharpening */
2768 buf
[2] = 0x00; buf
[3] = 0x00; /* stop AWB at the current values, no on-the-fly defect correction, no auto exposure, + RESREVED option */
2769 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); /* URBs 1986-1988 */
2770 /* Writes to IFP registers 0x07: Image Flow Processor Soft Reset */
2771 /* 0x08: Output Format Control */
2772 buf
[0] = 0x30; buf
[1] = 0x02; /* reset // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2773 buf
[2] = 0x04; buf
[3] = 0x80; /* bypass entire image processing, raw 8+2 Bayer data output directly */
2774 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); /* URBs 1989-1991 */
2775 /* "Dummy" write to IFP Register 0x11: Color Correction Register 12 */
2776 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); /* URBs 1992-1993 */
2777 /* Write to register 0x01: Register address space selection */
2778 /* Write to sensor register 0x02: Column Start */
2779 buf
[0] = 0x00; buf
[1] = 0x04; /* select sensor address space */
2780 buf
[2] = 0x00; buf
[3] = 0x16; /* start with column 22 */
2781 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
); /* URBs 1994-1996 */
2782 /* Writes to sensor registers 0x03: Window Height */
2783 /* 0x04: Window Width */
2784 buf
[0] = 0x01; buf
[1] = 0xe6; /* 486 */
2785 buf
[2] = 0x02; buf
[3] = 0x86; /* 646 */
2786 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
); /* URBs 1997-1999 */
2787 /* Writes to sensor registers 0x05: Horizontal Blanking */
2788 /* 0x06: Vertical Blanking */
2789 buf
[0] = 0x00; buf
[1] = 0x04; /* 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
2790 buf
[2] = 0x00; buf
[3] = 0x00; /* 0 rows */
2791 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
); /* URBs 2000-2002 */
2792 /* Writes to sensor registers 0x07: Output Control */
2793 /* 0x08: Row Start */
2794 buf
[0] = 0x30; buf
[1] = 0x02; /* normal operation + chip enable + RESERVED options */
2795 buf
[2] = 0x00; buf
[3] = 0x08; /* row 8 */
2796 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x07, dev
->sensor_flags
, buf
); /* URBs 2003-2005 */
2797 /* "Dummy" write to sensor Register 0x11: UNDOCUMENTED */
2798 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x11, dev
->sensor_flags
, NULL
); /* URBs 2006-2007 */
2799 /* Writes to sensor registers 0x0c: Shutter Delay */
2800 /* 0x0d: Reset (Soft) (from MT9V011 datasheet) */
2801 buf
[0] = 0x00; buf
[1] = 0x00; /* 0 master clocks */
2802 buf
[2] = 0x00; buf
[3] = 0x00; /* return to normal operation */
2803 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
); /* URBs 2008-2010 */
2804 /* Writes to sensor registers 0x0e: UNDOCUMENTED */
2805 /* 0x0f: UNDOCUMENTED */
2806 buf
[0] = 0x00; buf
[1] = 0x00;
2807 buf
[2] = 0x00; buf
[3] = 0x00;
2808 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
); /* URBs 2011-2013 */
2809 /* Writes to sensor registers 0x10: UNDOCUMENTED */
2810 /* 0x11: UNDOCUMENTED */
2811 buf
[0] = 0x00; buf
[1] = 0x00;
2812 buf
[2] = 0x00; buf
[3] = 0x00;
2813 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
); /* URBs 2014-2016 */
2814 /* Writes to sensor registers 0x12: 2X Zoom Col Start => 0x1e bit 0 must be set to activate zoom */
2815 /* 0x13: 2X Zoom Row Start => 0x1e bit 0 must be set to activate zoom */
2816 buf
[0] = 0x00; buf
[1] = 0xb0; /* column 176 */
2817 buf
[2] = 0x00; buf
[3] = 0x7c; /* row 124 */
2818 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
); /* URBs 2017-2018 */
2819 /* Writes to sensor registers 0x14: UNDOCUMENTED */
2820 /* 0x15: UNDOCUMENTED */
2821 buf
[0] = 0x00; buf
[1] = 0x00;
2822 buf
[2] = 0x00; buf
[3] = 0x00;
2823 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
); /* URBs 2019-2021 */
2824 /* Writes to sensor registers 0x16: UNDOCUMENTED */
2825 /* 0x17: UNDOCUMENTED */
2826 buf
[0] = 0x00; buf
[1] = 0x00;
2827 buf
[2] = 0x00; buf
[3] = 0x00;
2828 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
); /* URBs 2022-2024 */
2829 /* Writes to sensor registers 0x18: UNDOCUMENTED */
2830 /* 0x19: UNDOCUMENTED */
2831 buf
[0] = 0x00; buf
[1] = 0x00;
2832 buf
[2] = 0x00; buf
[3] = 0x00;
2833 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
); /* URBs 2025-2027 */
2834 /* Writes to sensor registers 0x1a: UNDOCUMENTED */
2835 /* 0x1b: UNDOCUMENTED */
2836 buf
[0] = 0x00; buf
[1] = 0x00;
2837 buf
[2] = 0x00; buf
[3] = 0x00;
2838 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
); /* URBs 2028-2030 */
2839 /* Writes to sensor registers 0x1c: UNDOCUMENTED */
2840 /* 0x1d: UNDOCUMENTED */
2841 buf
[0] = 0x00; buf
[1] = 0x00;
2842 buf
[2] = 0x00; buf
[3] = 0x00;
2843 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
); /* URBs 2031-2033 */
2844 /* Write to sensor register 0x30: RESERVED */
2845 buf
[0] = 0x00; buf
[1] = 0x00;
2846 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x30, dev
->sensor_flags
, buf
); /* URBs 2034-2036 */
2847 /* Write to sensor register 0x20: Read Mode */
2848 buf
[0] = 0x00; buf
[1] = 0x00; /* normal readout */
2849 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); /* URBs 2037-2039 */
2850 /* Writes to sensor registers 0x30: RESERVED */
2851 /* 0x31: RESERVED */
2852 buf
[0] = 0x00; buf
[1] = 0x05;
2853 buf
[2] = 0x00; buf
[3] = 0x00;
2854 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x30, dev
->sensor_flags
, buf
); /* URBs 2040-2042 */
2855 /* "Dummy" write to sensor Register 0x34: RESERVED */
2856 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x34, dev
->sensor_flags
, NULL
); /* URBs 2043-2044 */
2857 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
2858 /* Write to sensor register 0x07: Output Control */
2859 buf
[0] = 0x00; buf
[1] = 0x02; /* chip enable, normal operation */
2860 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
2861 /* Write to sensor register 0x0d: Soft Reset */
2862 buf
[0] = 0x00; buf
[1] = 0x01; /* reset */
2863 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
2864 /* Write to sensor register 0x0d: Soft Reset */
2865 buf
[0] = 0x00; buf
[1] = 0x00; /* resume operation */
2866 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
2867 /* Writes to sensor registers 0x01: Row start */
2868 /* 0x02: Column Start */
2869 buf
[0] = 0x00; buf
[1] = 0x08; /* start with row 8 */
2870 buf
[2] = 0x00; buf
[3] = 0x16; /* start with column 22 */
2871 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x01, dev
->sensor_flags
, buf
);
2872 /* Writes to sensor registers 0x03: Window Height */
2873 /* 0x04: Window Width */
2874 buf
[0] = 0x01; buf
[1] = 0xe1; /* 481 */
2875 buf
[2] = 0x02; buf
[3] = 0x81; /* 641 */
2876 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x03, dev
->sensor_flags
, buf
);
2877 /* Writes to sensor registers 0x05: Horizontal Blanking */
2878 /* 0x06: Vertical Blanking */
2879 buf
[0] = 0x00; buf
[1] = 0x83; /* 131 columns (pixel clocks) */
2880 buf
[2] = 0x00; buf
[3] = 0x06; /* 6 rows */
2881 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x05, dev
->sensor_flags
, buf
);
2882 /* Write to sensor register 0x0d: Soft Reset */
2883 buf
[0] = 0x00; buf
[1] = 0x02; /* UNKNOWN */
2884 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0d, dev
->sensor_flags
, buf
);
2885 /* Writes to sensor registers 0x0a: Pixel Clock Speed */
2886 /* 0x0b: Frame Restart */
2887 buf
[0] = 0x00; buf
[1] = 0x00; /* default */
2888 buf
[2] = 0x00; buf
[3] = 0x00; /* (has no effect/no restart) */
2889 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0a, dev
->sensor_flags
, buf
);
2890 /* Writes to sensor registers 0x0c: Shutter Delay */
2891 /* 0x0d: Soft Reset */
2892 buf
[0] = 0x00; buf
[1] = 0x00; /* 0 master clocks */
2893 buf
[2] = 0x00; buf
[3] = 0x00; /* resume operation */
2894 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0c, dev
->sensor_flags
, buf
);
2895 /* Writes to sensor registers 0x0e: UNDOCUMENTED */
2896 /* 0x0f: UNDOCUMENTED */
2897 buf
[0] = 0x00; buf
[1] = 0x00;
2898 buf
[2] = 0x00; buf
[3] = 0x00;
2899 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x0e, dev
->sensor_flags
, buf
);
2900 /* Writes to sensor registers 0x10: UNDOCUMENTED */
2901 /* 0x11: UNDOCUMENTED */
2902 buf
[0] = 0x00; buf
[1] = 0x00;
2903 buf
[2] = 0x00; buf
[3] = 0x00;
2904 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x10, dev
->sensor_flags
, buf
);
2905 /* Writes to sensor registers 0x12: 2X Zoom Column Start (from MT9V111 datasheet) */
2906 /* 0x13: 2X Zoom Row Start (from MT9V111 datasheet) */
2907 buf
[0] = 0x00; buf
[1] = 0x00; /* column 0 => bit0 of reg 0x1e must be set to activate zoom */
2908 buf
[2] = 0x00; buf
[3] = 0x00; /* row 0 => bit0 of reg 0x1e must be set to activate zoom */
2909 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x12, dev
->sensor_flags
, buf
);
2910 /* Writes to sensor registers 0x14: UNDOCUMENTED */
2911 /* 0x15: UNDOCUMENTED */
2912 buf
[0] = 0x00; buf
[1] = 0x00;
2913 buf
[2] = 0x00; buf
[3] = 0x00;
2914 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x14, dev
->sensor_flags
, buf
);
2915 /* Writes to sensor registers 0x16: UNDOCUMENTED */
2916 /* 0x17: UNDOCUMENTED */
2917 buf
[0] = 0x00; buf
[1] = 0x00;
2918 buf
[2] = 0x00; buf
[3] = 0x00;
2919 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x16, dev
->sensor_flags
, buf
);
2920 /* Writes to sensor registers 0x18: UNDOCUMENTED */
2921 /* 0x19: UNDOCUMENTED */
2922 buf
[0] = 0x00; buf
[1] = 0x00;
2923 buf
[2] = 0x00; buf
[3] = 0x00;
2924 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x18, dev
->sensor_flags
, buf
);
2925 /* Writes to sensor registers 0x1a: UNDOCUMENTED */
2926 /* 0x1b: UNDOCUMENTED */
2927 buf
[0] = 0x00; buf
[1] = 0x00;
2928 buf
[2] = 0x00; buf
[3] = 0x00;
2929 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1a, dev
->sensor_flags
, buf
);
2930 /* Writes to sensor registers 0x1c: UNDOCUMENTED */
2931 /* 0x1d: UNDOCUMENTED */
2932 buf
[0] = 0x00; buf
[1] = 0x00;
2933 buf
[2] = 0x00; buf
[3] = 0x00;
2934 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x1c, dev
->sensor_flags
, buf
);
2935 /* Write to sensor register 0x32: RESERVED */
2936 buf
[0] = 0x00; buf
[1] = 0x00;
2937 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x32, dev
->sensor_flags
, buf
);
2938 /* Writes to sensor registers 0x20: Read Mode */
2939 /* 0x21: RESERVED */
2940 buf
[0] = 0x11; buf
[1] = 0x01; /* output all frames (including bad frames) + UNDOCUMENTED */
2941 buf
[2] = 0x00; buf
[3] = 0x00;
2942 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x20, dev
->sensor_flags
, buf
);
2943 /* Writes to sensor registers 0x22: RESERVED */
2944 /* 0x23: UNDOCUMENTED */
2945 buf
[0] = 0x00; buf
[1] = 0x00;
2946 buf
[2] = 0x00; buf
[3] = 0x00;
2947 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x22, dev
->sensor_flags
, buf
);
2948 /* Writes to sensor registers 0x24: UNDOCUMENTED */
2949 /* 0x25: UNDOCUMENTED */
2950 buf
[0] = 0x00; buf
[1] = 0x00;
2951 buf
[2] = 0x00; buf
[3] = 0x00;
2952 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x24, dev
->sensor_flags
, buf
);
2953 /* Writes to sensor registers 0x26: UNDOCUMENTED */
2954 /* 0x27: RESERVED */
2955 buf
[0] = 0x00; buf
[1] = 0x00;
2956 buf
[2] = 0x00; buf
[3] = 0x24;
2957 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x26, dev
->sensor_flags
, buf
);
2958 /* "Dummy" write to sensor Register 0x30: RESERVED */
2959 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x30, dev
->sensor_flags
, NULL
);
2960 /* Writes to sensor registers 0x2f: RESERVED */
2961 /* 0x30: RESERVED */
2962 buf
[0] = 0xf7; buf
[1] = 0xb0;
2963 buf
[2] = 0x00; buf
[3] = 0x05;
2964 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2f, dev
->sensor_flags
, buf
);
2965 /* Writes to sensor registers 0x31: RESERVED */
2966 /* 0x32: RESERVED */
2967 buf
[0] = 0x00; buf
[1] = 0x00;
2968 buf
[2] = 0x00; buf
[3] = 0x00;
2969 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x31, dev
->sensor_flags
, buf
);
2970 /* Writes to sensor registers 0x33: RESERVED */
2971 /* 0x34: RESERVED */
2972 buf
[0] = 0x00; buf
[1] = 0x00;
2973 buf
[2] = 0x01; buf
[3] = 0x00;
2974 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x33, dev
->sensor_flags
, buf
);
2975 /* "Dummy" write to sensor Register 0x3b: RESERVED */
2976 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x3b, dev
->sensor_flags
, NULL
);
2977 /* Write to sensor register 0x3d: RESERVED */
2978 buf
[0] = 0x06; buf
[1] = 0x8f;
2979 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x3d, dev
->sensor_flags
, buf
);
2980 /* Writes to sensor registers 0x40: RESERVED */
2981 /* 0x41: RESERVED */
2982 buf
[0] = 0x01; buf
[1] = 0xe0;
2983 buf
[2] = 0x00; buf
[3] = 0xd1;
2984 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x40, dev
->sensor_flags
, buf
);
2985 /* Write to sensor register 0x44: UNDOCUMENTED */
2986 buf
[0] = 0x00; buf
[1] = 0x82;
2987 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x44, dev
->sensor_flags
, buf
);
2988 /* Writes to sensor registers 0x5a: RESERVED */
2989 /* 0x5b: RESERVED */
2990 buf
[0] = 0x00; buf
[1] = 0x00;
2991 buf
[2] = 0x00; buf
[3] = 0x00;
2992 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5a, dev
->sensor_flags
, buf
);
2993 /* Writes to sensor registers 0x5c: RESERVED */
2994 /* 0x5d: RESERVED */
2995 buf
[0] = 0x00; buf
[1] = 0x00;
2996 buf
[2] = 0x00; buf
[3] = 0x00;
2997 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5c, dev
->sensor_flags
, buf
);
2998 /* Writes to sensor registers 0x5e: RESERVED */
2999 /* 0x5f: RESERVED */
3000 buf
[0] = 0x00; buf
[1] = 0x00;
3001 buf
[2] = 0xa3; buf
[3] = 0x1d;
3002 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x5e, dev
->sensor_flags
, buf
);
3003 /* "Dummy" write to sensor Register 0x68: UNDOCUMENTED */
3004 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x68, dev
->sensor_flags
, NULL
);
3005 /* Write to sensor register 0x62: RESERVED */
3006 buf
[0] = 0x06; buf
[1] = 0x11;
3007 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x62, dev
->sensor_flags
, buf
);
3010 UDIA_INFO("1 or more errors occured in I2C-message-block 1 !\n");
3013 /* END OF I2C MESSAGES */
3014 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3016 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3018 usb_microdia_control_write(dev
, 0x1007, buf
, 8);
3020 usb_microdia_control_write(dev
, 0x1006, buf
, 8);
3024 /* *** TEMPORARY SWITCH TO SLAVE ADDRESS 0x50, I2C READ ATTEMPT: */
3025 /* - WE CURRENTLY KNOW NO 6270 CAM THAT IS SUCCESSFULLY READ HERE */
3026 /* - IF READ FAILS, THIS IS NEVER DONE AGAIN (IN NEXT CYCLE OR FURTHER STARTS) */
3027 usb_microdia_control_read(dev
, 0x10c1, buf
, 1); /* returns 0x5c */
3029 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
3030 retI2C
= sn9c20x_read_i2c_data(dev
, 0x50, 1, 0x00, SN9C20X_I2C_2WIRE
, buf
);
3032 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");
3034 usb_microdia_control_write(dev
, 0x10c1, buf
, 1);
3037 buf
[0] = 0x47; /* ALEX: 0x44 */
3038 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2045 */
3039 buf
[0] = 0x47; /* ALEX: 0x04 */
3040 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2046 */
3042 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 2047 */
3044 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 2048 */
3045 buf
[0] = 0x84; /* ALEX: 0xc0 */
3046 usb_microdia_control_write(dev
, 0x1001, buf
, 1); /* URB 2049 */
3049 usb_microdia_control_write(dev, 0x1001, buf, 1);
3052 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3053 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3056 /* Writes to sensor registers 0x02: Column Start */
3057 /* 0x03: Window Height */
3058 buf
[0] = 0x00; buf
[1] = 0x16; /* coulmn 22 */
3059 buf
[2] = 0x01; buf
[3] = 0xe1; /* 481 */
3060 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); /* URBs 2050-2052 */
3061 /* Writes to sensor registers 0x04: Window Width */
3062 /* 0x05: Horizontal Blanking */
3063 buf
[0] = 0x02; buf
[1] = 0x81; /* 641 */
3064 buf
[2] = 0x00; buf
[3] = 0x04; /* 4 columns (pixel clocks) // AT FIRST START + FIRST CYCLE: 0x00 0x00 */
3065 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); /* URBs 2053-2055 */
3066 /* Writes to sensor registers 0x06: Vertical Blanking */
3067 /* 0x07: Output Control */
3068 buf
[0] = 0x00; buf
[1] = 0x00; /* 0 rows */
3069 buf
[2] = 0x30; buf
[3] = 0x02; /* normal operation + chip enable + RESERVED options */
3070 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); /* URBs 2056-2058 */
3071 /* Write to sensor register 0x0e: UNDOCUMENTED */
3072 buf
[0] = 0x00; buf
[1] = 0x08;
3073 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); /* URBs 2059-2061 */
3075 UDIA_INFO("1 or more errors occured in I2C-message-block 2 !\n");
3078 /* END OF I2C MESSAGES */
3079 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3082 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
3083 buf
[4] = 0x28; buf
[5] = 0x3c;
3084 usb_microdia_control_write(dev
, 0x1180, buf
, 6); /* URB 2062 */
3085 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
3086 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 2063 */
3088 usb_microdia_control_write(dev
, 0x1189, buf
, 1); /* URB 2064 */
3089 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3090 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); /* URB 2065 */
3091 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3092 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); /* URB 2066 */
3093 buf
[0] = 0x78; /* ALEX: 0x7c */
3094 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 2067 */
3095 buf
[0] = 0x18; /* ALEX: 0x1c */
3096 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2068 */
3097 buf
[0] = 0x18; /* ALEX: 0x1c */
3098 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2069 */
3100 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2070 */
3102 usb_microdia_control_write(dev
, 0x118a, buf
, 1); /* URB 2071 */
3104 usb_microdia_control_write(dev
, 0x0395, buf
, 1); /* URB 2072 */
3107 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2073 */
3108 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2074 // 0x38 */
3111 else if (buf
[0] == 0xb8)
3113 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2075 */
3114 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2076 // 0xb9 */
3117 else if (buf
[0] == 0xb9)
3119 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2077 */
3120 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2078 */
3123 else if (buf
[0] == 0xba)
3125 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2079 */
3126 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2080 // 0x3b */
3129 else if (buf
[0] == 0xbb)
3131 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2081 */
3132 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2082 // 0x3c */
3135 else if (buf
[0] == 0xbc)
3137 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2083 */
3138 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2084 // 0x3d */
3139 last_11b8
[0] = buf
[0];
3140 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3143 else if (buf
[0] == 0xbd)
3145 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2085 */
3146 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2086 */
3149 else if (buf
[0] == 0xbe)
3151 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2087 */
3152 usb_microdia_control_read(dev
, 0x11b8, last_11b8
, 1); /* URB 2088 */
3154 buf
[0] = last_11b8
[0] & 0xf0; /* 0xf0 or 0x70 */
3155 buf
[0] = buf
[0] | 0x0d; /* 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES */
3156 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2089 */
3159 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3162 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3163 /* Write to sensor register 0x06: Vertical Blanking */
3164 buf
[0] = 0x00; buf
[1] = 0x2d; /* 45 rows */
3165 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); /* URBs 2090-2092 */
3166 /* Write to sensor register 0x05: Horizontal Blanking */
3167 buf
[0] = 0x00; buf
[1] = 0x04; /* 4 columns (pixel clocks) */
3168 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); /* URBs 2093-2095 */
3169 /* Write to sensor register 0x20: Read Mode */
3170 buf
[0] = 0x00; buf
[1] = 0x00; /* normal readout */
3171 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); /* URBs 2096-2098 */
3172 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3173 /* Write to sensor register 0x0a: Pixel Clock Speed */
3174 buf
[0] = 0x00; buf
[1] = 0x00; /* default */
3175 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0a, dev
->sensor_flags
, buf
);
3176 /* Write to sensor register 0x06: Vertical Blanking */
3177 buf
[0] = 0x00; buf
[1] = 0x29; /* 41 rows */
3178 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
3179 /* Write to sensor register 0x05: Horizontal Blanking */
3180 buf
[0] = 0x00; buf
[1] = 0x09; /* 9 columns (pixel clocks) */
3181 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
3182 /* Write to sensor register 0x20: Read Mode */
3183 buf
[0] = 0x11; buf
[1] = 0x01; /* output all frames (including bad ones) + UNKNOWN */
3184 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
3187 UDIA_INFO("1 or more errors occured in I2C-message-block 3 !\n");
3190 /* END OF I2C MESSAGES */
3191 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3195 usb_microdia_control_write(dev
, 0x1180, buf
, 1); /* URB 2099 */
3197 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3200 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3201 /* Write to sensor register 0x20: Read Mode */
3202 buf
[0] = 0x00; buf
[1] = 0x00; /* normal readout */
3203 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
); /* URBs 2100-2102 */
3204 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3205 /* Write to sensor register 0x20: Read Mode */
3206 buf
[0] = 0x11; buf
[1] = 0x01; /* output all frames (including bad ones) + UNKNOWN */
3207 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x20, dev
->sensor_flags
, buf
);
3210 UDIA_INFO("1 or more errors occured in I2C-message-block 4 !\n");
3213 /* END OF I2C MESSAGES */
3214 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3218 usb_microdia_control_write(dev
, 0x1182, buf
, 1); /* URB 2103 */
3221 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3224 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3225 /* Write to sensor register 0x09: Shutter Width */
3226 buf
[0] = 0x00; buf
[1] = 0x64; /* integration of 100 rows */
3227 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
); /* URBs 2104-2106 */
3228 /* Write to sensor register 0x2b: Green 1 Gain */
3229 /* 0x2c: Blue Gain */
3230 buf
[0] = 0x00; buf
[1] = 0xa0; /* 32*0.03125*2 = 2 */
3231 buf
[2] = 0x00; buf
[3] = 0xa0; /* 32*0.03125*2 = 2 */
3232 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
); /* URBs 2107-2109 */
3233 /* Write to sensor register 0x2d: Red Gain */
3234 /* 0x2e: Green 2 Gain */
3235 buf
[0] = 0x00; buf
[1] = 0xa0; /* 32*0.03125*2 = 2 */
3236 buf
[2] = 0x00; buf
[3] = 0xa0; /* 32*0.03125*2 = 2 */
3237 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
); /* URBs 2110-2112 */
3238 /* "Dummy" write to sensor Register 0x33: RESERVED */
3239 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
); /* URBs 2113-2114 */
3240 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3241 /* Write to sensor register 0x09: Shutter Width */
3242 buf
[0] = 0x00; buf
[1] = 0x64; /* integration of 100 rows */
3243 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x09, dev
->sensor_flags
, buf
);
3244 /* Write to sensor register 0x07: Output Control */
3245 buf
[0] = 0x00; buf
[1] = 0x03; /* dont update changes until bit0=0, chip enable, normal operation */
3246 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
3247 /* Write to sensor register 0x2b: Green 1 Gain */
3248 /* 0x2c: Blue Gain */
3249 buf
[0] = 0x00; buf
[1] = 0x33; /* 51*0.03125*1 = 1.59375 */
3250 buf
[2] = 0x00; buf
[3] = 0xa0; /* 32*0.03125*2 = 2 */
3251 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2b, dev
->sensor_flags
, buf
);
3252 /* Write to sensor register 0x2d: Red Gain */
3253 /* 0x2e: Green 2 Gain */
3254 buf
[0] = 0x00; buf
[1] = 0xa0; /* 32*0.03125*2 = 2 */
3255 buf
[2] = 0x00; buf
[3] = 0x33; /* 51*0.03125*1 = 1.59375 */
3256 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x2d, dev
->sensor_flags
, buf
);
3257 /* "Dummy" write to sensor Register 0x33: RESERVED */
3258 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 0, 0x33, dev
->sensor_flags
, NULL
);
3259 /* Write to sensor register 0x07: Output Control */
3260 buf
[0] = 0x00; buf
[1] = 0x02; /* chip enable, normal operation */
3261 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
3264 UDIA_INFO("1 or more errors occured in I2C-message-block 5 !\n");
3267 /* END OF I2C MESSAGES */
3268 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3271 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2119 */
3273 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3275 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3277 usb_microdia_control_write(dev
, 0x118b, buf
, 1); /* URB 2124 */
3280 usb_microdia_control_write(dev
, 0x10f7, buf
, 1); /* URB 2135 */
3282 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3284 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3286 usb_microdia_control_write(dev
, 0x10f8, buf
, 1); /* URB 2138 */
3288 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3290 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3292 usb_microdia_control_write(dev
, 0x10fa, buf
, 1); /* URB 2139 */
3295 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); /* URB 2140 */
3297 usb_microdia_control_write(dev
, 0x10f9, buf
, 1); /* URB 2141 */
3299 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2142 */
3300 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
3301 usb_microdia_control_write(dev
, 0x11bc, buf
, 4); /* URB 2143 */
3302 for (k
= 0; k
< 48; k
++)
3304 usb_microdia_control_write(dev
, 0x11c0, buf
, 48); /* URB 2144 */
3306 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
3307 buf
[4] = 0x04; buf
[5] = 0x3f;
3308 usb_microdia_control_write(dev
, 0x11a5, buf
, 6); /* URB 2149 */
3310 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3311 buf
[0] = 0x14; buf
[1] = 0xec; buf
[2] = 0x0a; buf
[3] = 0xf6;
3312 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3313 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
3315 usb_microdia_control_write(dev
, 0x11af, buf
, 4); /* URB 2150 */
3317 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x2d; buf
[3] = 0xdd;
3318 usb_microdia_control_write(dev
, 0x11b3, buf
, 4); /* URB 2151 */
3319 buf
[0] = 0x47; /* ALEX: 0x04 */
3320 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2152 */
3322 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2153 */
3323 buf
[0] = 0x67; /* ALEX: 0x24 */
3324 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2154 */
3325 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
3326 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
3327 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
3328 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
3329 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
3330 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
3331 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
3332 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
3333 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
3334 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
3335 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
3336 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
3337 buf
[48] = 0x4f; buf
[49] = 0x53; buf
[50] = 0x58; buf
[51] = 0x58;
3338 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
3339 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
3340 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
3341 usb_microdia_control_write(dev
, 0x1100, buf
, 64); /* URB 2155 */
3342 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
3343 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
3344 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x53; buf
[11] = 0x36;
3345 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53; buf
[15] = 0x53;
3346 buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
3347 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53;
3348 buf
[24] = 0x53; buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53;
3349 buf
[28] = 0x53; buf
[29] = 0x53; buf
[30] = 0x53; buf
[31] = 0x53;
3350 buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53; buf
[35] = 0x53;
3351 buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
3352 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53;
3353 buf
[44] = 0x53; buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53;
3354 buf
[48] = 0x53; buf
[49] = 0x53; buf
[50] = 0x53; buf
[51] = 0x53;
3355 buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53; buf
[55] = 0x53;
3356 buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
3357 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
3358 usb_microdia_control_write(dev
, 0x1140, buf
, 64); /* URB 2156 */
3359 buf
[0] = 0x47; /* ALEX: 0x04 */
3360 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2157 */
3362 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2158 */
3363 buf
[0] = 0x4b; /* ALEX: 0x08 */
3364 usb_microdia_control_write(dev
, 0x10e0, buf
, 1); /* URB 2159 */
3366 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3367 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3370 /* Writes to sensor registers 0x02: Column Start */
3371 /* 0x03: Window Hight */
3372 buf
[0] = 0x00; buf
[1] = 0x16; /* coulmn 22 */
3373 buf
[2] = 0x01; buf
[3] = 0xe1; /* 481 */
3374 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x02, dev
->sensor_flags
, buf
); /* URBs 2160-2162 */
3375 /* Writes to sensor registers 0x04: Window Width */
3376 /* 0x05: Horizontal Blanking */
3377 buf
[0] = 0x02; buf
[1] = 0x81; /* 641 */
3378 buf
[2] = 0x00; buf
[3] = 0x04; /* 4 columns (pixel clocks) */
3379 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x04, dev
->sensor_flags
, buf
); /* URBs 2163-2165 */
3380 /* Writes to sensor registers 0x06: Vertical Blanking */
3381 /* 0x07: Output Control */
3382 buf
[0] = 0x00; buf
[1] = 0x2d; /* 45 rows */
3383 buf
[2] = 0x30; buf
[3] = 0x02; /* RESERVED options */
3384 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 4, 0x06, dev
->sensor_flags
, buf
); /* URBs 2166-2167 */
3385 /* Writes to sensor register 0x0e: UNDOCUMENTED */
3386 buf
[0] = 0x00; buf
[1] = 0x08;
3387 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x0e, dev
->sensor_flags
, buf
); /* URBs 2168-2170 */
3389 UDIA_INFO("1 or more errors occured in I2C-message-block 6 !\n");
3392 /* END OF I2C MESSAGES */
3393 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3394 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3396 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
3398 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
3402 buf
[0] = 0x02; buf
[1] = 0x00; buf
[2] = 0x02; buf
[3] = 0x00;
3403 buf
[4] = 0x28; buf
[5] = 0x3c;
3404 usb_microdia_control_write(dev
, 0x1180, buf
, 6); /* URB 2171 */
3405 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
3406 usb_microdia_control_write(dev
, 0x10fb, buf
, 5); /* URB 2172 */
3408 usb_microdia_control_write(dev
, 0x1189, buf
, 1); /* URB 2173 */
3409 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x6a; buf
[3] = 0x50;
3410 usb_microdia_control_write(dev
, 0x11a1, buf
, 4); /* URB 2174 */
3411 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x50; buf
[3] = 0x3c;
3412 usb_microdia_control_write(dev
, 0x11ab, buf
, 4); /* URB 2175 */
3414 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2176 */
3416 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2177 */
3418 usb_microdia_control_write(dev
, 0x11b9, buf
, 1); /* URB 2178 */
3420 usb_microdia_control_write(dev
, 0x11ba, buf
, 1); /* URB 2179 */
3422 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2180 */
3423 buf
[0] = 0x78; /* ALEX: 0x7c */
3424 usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 2181 */
3425 buf
[0] = 0x18; /* ALEX: 0x1c */
3426 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2182 */
3427 buf
[0] = 0x18; /* ALEX: 0x1c */
3428 usb_microdia_control_write(dev
, 0x1002, buf
, 1); /* URB 2183 */
3429 buf
[0] = 0x7d; /* ALEX: 0xfc */
3430 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2184 */
3432 usb_microdia_control_write(dev
, 0x118a, buf
, 1); /* URB 2185 */
3434 usb_microdia_control_write(dev
, 0x0395, buf
, 1); /* URB 2186 */
3436 if ((last_11b8
[0] == 0x3d) || (last_11b8
[0] == 0x3f))
3438 else if ((last_11b8
[0] == 0xbd) || (last_11b8
[0] == 0xbf))
3440 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2187 */
3441 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2188 // 0x38 */
3444 else if (buf
[0] == 0xb8)
3446 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2189 */
3447 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2190 // 0xb9 */
3450 else if (buf
[0] == 0xb9)
3452 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2191 */
3453 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2192 // 0xba */
3456 else if (buf
[0] == 0xba)
3458 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2193 */
3459 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2194 // 0x3b */
3462 else if (buf
[0] == 0xbb)
3464 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2195 */
3465 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2196 // 0x3c */
3468 else if (buf
[0] == 0xbc)
3470 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2197 */
3471 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2198 // 0x3d */
3472 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3475 else if (buf
[0] == 0xbd)
3477 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2199 */
3478 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2200 */
3481 else if (buf
[0] == 0xbe)
3483 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2201 */
3484 usb_microdia_control_read(dev
, 0x11b8, buf
, 1); /* URB 2202 */
3486 buf
[0] = buf
[0] & 0xf0; /* 0xf0 or 0x70 */
3487 buf
[0] = buf
[0] | 0x0d; /* 0x0c => THIS VALUE SEEMS TO DEPEND ON WHAT WAS READ/WRITTEN IN THE LAST 8 READS/WRITES */
3488 usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 2089 */
3490 /* ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3493 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3494 /* Write to sensor register 0x06: Vertical Blanking */
3495 buf
[0] = 0x00; buf
[1] = 0x2d; /* 45 rows */
3496 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
); /* URBs 2204-2206 */
3497 /* Write to sensor register 0x05: Horizontal Blanking */
3498 buf
[0] = 0x00; buf
[1] = 0x04; /* 4 columns (pixel clocks) */
3499 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
); /* URBs 2207-2209 */
3500 /* Read of sensor register 0x36: Chip Version (mirror of reg0xff) */
3501 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x36, dev
->sensor_flags
, buf
); /* URBs 2211-2215 // 0x82 0x3a */
3502 } else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
3503 /* Write to sensor register 0x0a: Pixel Clock Speed */
3504 buf
[0] = 0x00; buf
[1] = 0x00; /* default */
3505 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
3506 /* Write to sensor register 0x06: Vertical Blanking */
3507 buf
[0] = 0x00; buf
[1] = 0x29; /* 41 rows */
3508 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x06, dev
->sensor_flags
, buf
);
3509 /* Write to sensor register 0x05: Horizontal Blanking */
3510 buf
[0] = 0x00; buf
[1] = 0x09; /* 9 columns (pixel clocks) */
3511 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x05, dev
->sensor_flags
, buf
);
3512 /* Read of sensor register 0x00: Chip Version (=reg0xff) */
3513 retI2C
+= sn9c20x_read_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x00, dev
->sensor_flags
, buf
); /* 0x82 0x43 */
3516 UDIA_INFO("1 or more errors occured in I2C-message-block 7 !\n");
3519 /* END OF I2C MESSAGES */
3520 /* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
3524 usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 2216 */
3527 /*** NOW DRIVER DOES STOP-SEQUENCE
3528 - WITHOUT WRITES TO 0x1007 AND 0x1006 (URBs 3544-3550) => MT9V111
3529 - WRITING 0x40 INSTEAD OF 0x60 TO 0x1007 AND 0x1006 => MT9V011
3531 /*** 2nd, 3rd, ... CYCLE: ALL MESSAGES (URBs 1953 - URBs 2216) ARE REPEATED ***/
3532 /*** ----- WE DON'T DO THIS, IT SEEMS TO BE UNNECESSARY ----- ***/
3534 /* Setup IFP registers for AE and AWB (new, not in the logs): */
3535 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
3536 mt9v111_setup_autoexposure(dev
);
3537 mt9v111_setup_autowhitebalance(dev
);
3538 mt9v111_set_autocorrections(dev
, 1);
3541 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3543 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3545 usb_microdia_control_write(dev
, 0x1007, buf
, 1); /* URB 2489 */
3546 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
)
3548 else if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
)
3550 usb_microdia_control_write(dev
, 0x1006, buf
, 1); /* URB 2490 */
3551 /* => These two writes seem to cause the cam to start sending isochronus USB messages */
3557 * @brief Start stream from 627b devices
3561 * @returns 0 or negative error code
3564 int microdia_627b_start_stream(struct usb_microdia
*dev
)
3567 /* Initialize the Bridge Controller */
3568 ret
= sn9c20x_initialize(dev
);
3569 /* Initialize the I2C interface in the Bridge */
3570 ret
= sn9c20x_i2c_initialize(dev
);
3571 /* Finally, Initialize the Sensor array */
3572 if (dev
->sensor_init
)
3573 dev
->sensor_init(dev
);
3578 * @brief From UsbSnoop-plugin-parsed.log
3582 * @returns 0 (OK) or <0 (Error)
3584 * @author Vincent, Kuzja
3586 int microdia_6288_start_stream(struct usb_microdia
*dev
)
3596 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3602 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3608 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3614 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3620 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3626 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3631 buf
[0] = 0x40; buf
[1] = 0x30; buf
[2] = 0x20;
3632 buf
[3] = 0x10; buf
[4] = 0x08;
3633 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
3638 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;
3639 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
3644 buf
[0] = 0x44; buf
[1] = 0x18; buf
[2] = 0x00; buf
[3] = 0x30;
3645 buf
[4] = 0x00; buf
[5] = 0x09; buf
[6] = 0x00; buf
[7] = 0xed;
3646 buf
[8] = 0x0f; buf
[9] = 0xda; buf
[10] = 0x0f; buf
[11] = 0x3a;
3647 buf
[12] = 0x00; buf
[13] = 0x3a; buf
[14] = 0x00; buf
[15] = 0xd0;
3648 buf
[16] = 0x0f; buf
[17] = 0xf7; buf
[18] = 0x0f; buf
[19] = 0x00;
3649 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x60; buf
[23] = 0x0a;
3650 ret
= usb_microdia_control_write(dev
, reg
, buf
, 24);
3655 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00;
3656 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
3661 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
3662 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
3667 buf
[0] = 0x86; buf
[1] = 0xcc; buf
[2] = 0x08;
3668 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
3673 buf
[0] = 0x00; buf
[1] = 0x20; buf
[2] = 0x20; buf
[3] = 0x20;
3674 buf
[4] = 0x20; buf
[5] = 0x00; buf
[6] = 0x24; buf
[7] = 0x3b;
3675 buf
[8] = 0x4f; buf
[9] = 0x61; buf
[10] = 0x71; buf
[11] = 0x80;
3676 buf
[12] = 0x8f; buf
[13] = 0x9d; buf
[14] = 0xab; buf
[15] = 0xb8;
3677 buf
[16] = 0xc4; buf
[17] = 0xd1; buf
[18] = 0xdd; buf
[19] = 0xe9;
3678 buf
[20] = 0xf4; buf
[21] = 0xff;
3679 ret
= usb_microdia_control_write(dev
, reg
, buf
, 22);
3684 buf
[0] = 0x00; buf
[1] = 0x00;
3685 ret
= usb_microdia_control_write(dev
, reg
, buf
, 2);
3690 buf
[0] = 0x60; buf
[1] = 0x20; buf
[2] = 0x00; buf
[3] = 0x08;
3691 buf
[4] = 0x00; buf
[5] = 0x40; buf
[6] = 0x01; buf
[7] = 0xf0;
3693 ret
= usb_microdia_control_write(dev
, reg
, buf
, 9);
3699 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3705 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
3710 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3711 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3716 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3721 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3726 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x12; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3727 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3732 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3737 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3742 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3743 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3748 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3753 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3758 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x0e; buf
[3] = 0x61; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3759 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3764 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3769 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3774 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3775 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3780 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3785 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3790 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x13; buf
[3] = 0xb8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3791 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3796 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3801 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3806 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x14; buf
[3] = 0x3e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3807 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3812 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3817 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3822 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x16; buf
[3] = 0x24; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3823 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3828 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3833 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3838 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3839 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3844 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3849 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3854 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3855 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3860 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3865 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3870 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3871 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3876 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3881 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3886 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x27; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3887 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3892 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3897 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3902 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x28; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3903 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3908 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3913 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3918 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x29; buf
[3] = 0x15; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3919 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3924 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3929 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3934 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2c; buf
[3] = 0x08; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3935 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3940 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3945 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3950 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3951 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3956 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3961 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3966 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x34; buf
[3] = 0x3d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3967 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3972 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3977 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3982 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x35; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3983 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
3988 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3993 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
3998 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x36; buf
[3] = 0xf8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
3999 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4004 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4009 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4014 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x38; buf
[3] = 0x12; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4015 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4020 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4025 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4030 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x39; buf
[3] = 0x57; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4031 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4036 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4041 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4046 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4047 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4052 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4057 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4062 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3b; buf
[3] = 0xcc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4063 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4068 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4073 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4078 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3c; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4079 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4084 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4089 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4094 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3d; buf
[3] = 0x19; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4095 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4100 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4105 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4110 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3e; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4111 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4116 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4121 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4126 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x3f; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4127 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4132 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4137 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4142 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x41; buf
[3] = 0x40; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4143 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4148 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4153 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4158 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x42; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4159 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4164 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4169 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4174 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x45; buf
[3] = 0x46; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4175 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4180 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4185 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4190 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x46; buf
[3] = 0x62; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4191 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4196 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4201 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4206 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x47; buf
[3] = 0x2a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4207 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4212 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4217 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4222 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x48; buf
[3] = 0x3c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4223 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4228 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4233 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4238 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4a; buf
[3] = 0xf0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4239 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4244 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4249 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4254 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4b; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4255 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4260 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4265 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4270 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4c; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4271 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4276 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4281 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4286 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4d; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4287 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4292 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4297 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4302 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x4e; buf
[3] = 0xdc; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4303 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4308 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4313 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4318 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x69; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4319 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4324 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4329 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4334 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6c; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4335 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4340 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4345 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4350 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x6f; buf
[3] = 0x9e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4351 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4356 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4361 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4366 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x70; buf
[3] = 0x05; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4367 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4372 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4377 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4382 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x71; buf
[3] = 0x78; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4383 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4388 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4393 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4398 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x77; buf
[3] = 0x02; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4399 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4404 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4409 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4414 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8a; buf
[3] = 0x23; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4415 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4420 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4425 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4430 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x8c; buf
[3] = 0x0d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4431 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4436 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4441 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4446 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x90; buf
[3] = 0x7e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4447 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4452 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4457 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4462 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x91; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4463 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4468 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4473 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4478 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x9f; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4479 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4484 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4489 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4494 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa0; buf
[3] = 0x6e; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4495 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4500 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4505 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4510 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa4; buf
[3] = 0x50; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4511 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4516 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4521 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4526 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa5; buf
[3] = 0x68; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4527 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4532 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4537 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4542 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa6; buf
[3] = 0x60; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4543 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4548 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4553 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4558 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa8; buf
[3] = 0xc1; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4559 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4564 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4569 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4574 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa9; buf
[3] = 0xfa; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4575 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4580 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4585 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4590 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaa; buf
[3] = 0x92; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4591 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4596 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4601 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4606 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xab; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4607 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4612 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4617 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4622 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xac; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4623 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4628 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4633 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4638 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xad; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4639 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4644 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4649 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4654 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xae; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4655 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4660 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4665 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4670 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xaf; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4671 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4676 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4681 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4686 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb2; buf
[3] = 0xf2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4687 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4692 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4697 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4702 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb3; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4703 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4708 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4713 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4718 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb4; buf
[3] = 0x20; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4719 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4724 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4729 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4734 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb5; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4735 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4740 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4745 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4750 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xb6; buf
[3] = 0xaf; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4751 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4756 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4761 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4766 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbb; buf
[3] = 0xae; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4767 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4772 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4777 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4782 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbc; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4783 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4788 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4793 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4798 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbd; buf
[3] = 0x44; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4799 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4804 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4809 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4814 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbe; buf
[3] = 0x3b; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4815 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4820 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4825 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4830 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xbf; buf
[3] = 0x3a; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4831 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4836 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4841 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4846 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc0; buf
[3] = 0xe2; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4847 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4852 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4857 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4862 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc1; buf
[3] = 0xc8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4863 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4868 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4873 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4878 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc2; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4879 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4884 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4889 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4894 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc4; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4895 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4900 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4905 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4910 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc6; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4911 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4916 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4921 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4926 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc7; buf
[3] = 0x81; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4927 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4932 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4937 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4942 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xc9; buf
[3] = 0xe0; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4943 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4948 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4953 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4958 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xca; buf
[3] = 0xe8; 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 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4974 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcc; buf
[3] = 0xd8; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4975 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4980 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4985 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
4990 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xcd; buf
[3] = 0x93; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
4991 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
4996 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5001 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5006 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5012 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5017 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5018 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5023 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5028 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5029 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5034 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5039 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5040 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5045 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5050 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5051 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5056 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5061 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5062 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5067 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5072 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5073 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5078 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5083 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5084 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5089 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5094 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5095 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5100 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5105 buf
[0] = 0x90; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5106 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5111 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5112 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5117 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5122 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5123 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5128 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5133 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5134 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5139 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5144 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5145 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5150 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5155 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5156 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5161 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5166 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5167 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5172 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5177 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5178 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5183 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5188 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5189 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5194 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5199 buf
[0] = 0x92; buf
[1] = 0x50; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5200 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5205 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
5211 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5217 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5223 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5229 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5235 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5241 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5247 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5253 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5259 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5265 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5271 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5276 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5277 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5282 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5287 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5292 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
5293 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5298 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5303 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5308 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5309 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5314 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5319 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5320 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5325 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5330 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5335 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00; buf
[4] = 0x50; buf
[5] = 0x78;
5336 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
5341 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0; buf
[4] = 0x00;
5342 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
5348 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5354 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5359 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
5360 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5365 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
5366 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5372 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5378 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5384 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5390 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5396 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5402 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5408 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5413 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5419 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5424 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5430 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5435 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5441 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5446 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5452 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5457 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5463 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5468 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5474 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5479 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5480 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5485 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5490 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5495 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5496 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5501 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5506 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5511 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5512 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5517 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5522 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5527 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5528 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5533 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5538 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5543 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5544 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5549 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5554 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5559 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5560 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5565 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5570 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5575 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x1e; buf
[3] = 0x04; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5576 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5581 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5586 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5592 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5597 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x7d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5598 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5603 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5608 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5613 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5614 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5619 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5624 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5629 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5630 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5635 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5640 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5645 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5646 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5651 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5656 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5661 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5662 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5667 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5672 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5677 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5678 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5683 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5688 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5693 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5694 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5699 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5704 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5709 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5710 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5715 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5720 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5726 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5732 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5738 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5744 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5750 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5756 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5762 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5768 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5773 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5774 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5779 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0x00; buf
[3] = 0x00;
5780 buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x00;
5781 buf
[8] = 0x00; buf
[9] = 0x00; buf
[10] = 0x00; buf
[11] = 0x00;
5782 buf
[12] = 0x00; buf
[13] = 0x00; buf
[14] = 0x00; buf
[15] = 0x00;
5783 buf
[16] = 0x00; buf
[17] = 0x00; buf
[18] = 0x00; buf
[19] = 0x00;
5784 buf
[20] = 0x00; buf
[21] = 0x00; buf
[22] = 0x00; buf
[23] = 0x00;
5785 buf
[24] = 0x00; buf
[25] = 0x00; buf
[26] = 0x00; buf
[27] = 0x00;
5786 buf
[28] = 0x00; buf
[29] = 0x00; buf
[30] = 0x00; buf
[31] = 0x00;
5787 buf
[32] = 0x00; buf
[33] = 0x00; buf
[34] = 0x00; buf
[35] = 0x00;
5788 buf
[36] = 0x00; buf
[37] = 0x00; buf
[38] = 0x00; buf
[39] = 0x00;
5789 buf
[40] = 0x00; buf
[41] = 0x00; buf
[42] = 0x00; buf
[43] = 0x00;
5790 buf
[44] = 0x00; buf
[45] = 0x00; buf
[46] = 0x00; buf
[47] = 0x00;
5791 ret
= usb_microdia_control_write(dev
, reg
, buf
, 48);
5796 buf
[0] = 0x2d; buf
[1] = 0x2d; buf
[2] = 0x3a; buf
[3] = 0x05;
5797 buf
[4] = 0x04; buf
[5] = 0x3f;
5798 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
5803 buf
[0] = 0x28; buf
[1] = 0xd8; buf
[2] = 0x14; buf
[3] = 0xec;
5804 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5809 buf
[0] = 0x32; buf
[1] = 0xdd; buf
[2] = 0x32; buf
[3] = 0xdd;
5810 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
5816 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5822 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5828 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5833 buf
[0] = 0x0d; buf
[1] = 0x08; buf
[2] = 0x08; buf
[3] = 0x0d;
5834 buf
[4] = 0x08; buf
[5] = 0x08; buf
[6] = 0x0d; buf
[7] = 0x0d;
5835 buf
[8] = 0x0d; buf
[9] = 0x0d; buf
[10] = 0x11; buf
[11] = 0x0d;
5836 buf
[12] = 0x0d; buf
[13] = 0x11; buf
[14] = 0x15; buf
[15] = 0x21;
5837 buf
[16] = 0x15; buf
[17] = 0x15; buf
[18] = 0x11; buf
[19] = 0x11;
5838 buf
[20] = 0x15; buf
[21] = 0x2a; buf
[22] = 0x1d; buf
[23] = 0x1d;
5839 buf
[24] = 0x19; buf
[25] = 0x21; buf
[26] = 0x32; buf
[27] = 0x2a;
5840 buf
[28] = 0x32; buf
[29] = 0x32; buf
[30] = 0x2e; buf
[31] = 0x2a;
5841 buf
[32] = 0x2e; buf
[33] = 0x2e; buf
[34] = 0x36; buf
[35] = 0x3a;
5842 buf
[36] = 0x4b; buf
[37] = 0x43; buf
[38] = 0x36; buf
[39] = 0x3a;
5843 buf
[40] = 0x47; buf
[41] = 0x3a; buf
[42] = 0x2e; buf
[43] = 0x2e;
5844 buf
[44] = 0x43; buf
[45] = 0x5c; buf
[46] = 0x43; buf
[47] = 0x47;
5845 buf
[48] = 0x4f; buf
[49] = 0x53; buf
[50] = 0x58; buf
[51] = 0x58;
5846 buf
[52] = 0x58; buf
[53] = 0x32; buf
[54] = 0x3f; buf
[55] = 0x60;
5847 buf
[56] = 0x64; buf
[57] = 0x5c; buf
[58] = 0x53; buf
[59] = 0x64;
5848 buf
[60] = 0x4b; buf
[61] = 0x53; buf
[62] = 0x58; buf
[63] = 0x53;
5849 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
5854 buf
[0] = 0x0d; buf
[1] = 0x11; buf
[2] = 0x11; buf
[3] = 0x15;
5855 buf
[4] = 0x11; buf
[5] = 0x15; buf
[6] = 0x26; buf
[7] = 0x15;
5856 buf
[8] = 0x15; buf
[9] = 0x26; buf
[10] = 0x53; buf
[11] = 0x36;
5857 buf
[12] = 0x2e; buf
[13] = 0x36; buf
[14] = 0x53; buf
[15] = 0x53;
5858 buf
[16] = 0x53; buf
[17] = 0x53; buf
[18] = 0x53; buf
[19] = 0x53;
5859 buf
[20] = 0x53; buf
[21] = 0x53; buf
[22] = 0x53; buf
[23] = 0x53;
5860 buf
[24] = 0x53; buf
[25] = 0x53; buf
[26] = 0x53; buf
[27] = 0x53;
5861 buf
[28] = 0x53; buf
[29] = 0x53; buf
[30] = 0x53; buf
[31] = 0x53;
5862 buf
[32] = 0x53; buf
[33] = 0x53; buf
[34] = 0x53; buf
[35] = 0x53;
5863 buf
[36] = 0x53; buf
[37] = 0x53; buf
[38] = 0x53; buf
[39] = 0x53;
5864 buf
[40] = 0x53; buf
[41] = 0x53; buf
[42] = 0x53; buf
[43] = 0x53;
5865 buf
[44] = 0x53; buf
[45] = 0x53; buf
[46] = 0x53; buf
[47] = 0x53;
5866 buf
[48] = 0x53; buf
[49] = 0x53; buf
[50] = 0x53; buf
[51] = 0x53;
5867 buf
[52] = 0x53; buf
[53] = 0x53; buf
[54] = 0x53; buf
[55] = 0x53;
5868 buf
[56] = 0x53; buf
[57] = 0x53; buf
[58] = 0x53; buf
[59] = 0x53;
5869 buf
[60] = 0x53; buf
[61] = 0x53; buf
[62] = 0x53; buf
[63] = 0x53;
5870 ret
= usb_microdia_control_write(dev
, reg
, buf
, 64);
5876 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5882 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5888 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5894 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5900 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5906 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5912 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5918 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
5923 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x03; buf
[3] = 0x14; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5924 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5929 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5934 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5939 buf
[0] = 0xd0; buf
[1] = 0x30; buf
[2] = 0x17; buf
[3] = 0x1b; buf
[4] = 0xbc; buf
[5] = 0x01; buf
[6] = 0x7a; buf
[7] = 0x10;
5940 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5945 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5950 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5955 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5956 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5961 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5966 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x32; buf
[3] = 0x82; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
5967 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
5972 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5977 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
5982 buf
[0] = 0x05; buf
[1] = 0x00; buf
[2] = 0x01; buf
[3] = 0x00;
5983 buf
[4] = 0x50; buf
[5] = 0x78;
5984 ret
= usb_microdia_control_write(dev
, reg
, buf
, 6);
5989 buf
[0] = 0x00; buf
[1] = 0xa0; buf
[2] = 0x00; buf
[3] = 0xf0;
5991 ret
= usb_microdia_control_write(dev
, reg
, buf
, 5);
5997 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6002 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xd5; buf
[3] = 0xa0;
6003 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
6008 buf
[0] = 0x00; buf
[1] = 0x00; buf
[2] = 0xa0; buf
[3] = 0x78;
6009 ret
= usb_microdia_control_write(dev
, reg
, buf
, 4);
6015 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6021 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6027 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6033 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6039 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6045 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6051 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6057 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6063 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6069 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6075 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6081 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6086 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6092 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6097 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6103 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6108 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6114 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6119 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6125 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6130 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6136 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6141 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6147 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6152 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x11; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6153 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6158 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6163 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6168 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6169 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6174 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6179 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6184 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2b; buf
[3] = 0x70; 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
, 1);
6200 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x92; 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 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6216 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x93; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6217 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6222 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6227 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6232 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0a; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6233 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6238 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6243 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6244 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6249 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6254 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6259 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x0b; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6260 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6265 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6270 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6271 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6276 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6281 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6286 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1c; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6287 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6292 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6297 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6298 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6303 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6308 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6313 buf
[0] = 0x90; buf
[1] = 0x30; buf
[2] = 0x1d; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6314 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6319 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6324 buf
[0] = 0x92; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6325 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6330 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6335 ret
= usb_microdia_control_read(dev
, reg
, buf
, 5);
6341 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6347 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6353 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6358 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0xa1; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6359 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6364 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6369 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6374 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x10; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6375 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6380 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6385 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6390 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x04; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6391 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6396 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6401 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6406 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2d; buf
[3] = 0x36; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6407 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6412 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6417 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6422 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x2e; buf
[3] = 0x00; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6423 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6428 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6433 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6438 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x01; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6439 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6444 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6449 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6454 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x06; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6455 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6460 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6465 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6470 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x94; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6471 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6476 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6481 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6486 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x8d; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6487 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6492 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6497 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6502 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x09; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6503 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6508 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6513 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6518 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x95; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6519 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6524 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6529 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6534 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x85; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6535 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6540 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6545 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6550 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x00; buf
[3] = 0x0c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x15;
6551 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6556 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6561 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6566 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x01; buf
[3] = 0x96; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6567 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6572 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6577 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6582 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x80; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6583 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6588 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6593 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6598 buf
[0] = 0xa0; buf
[1] = 0x30; buf
[2] = 0x02; buf
[3] = 0x7c; buf
[4] = 0x00; buf
[5] = 0x00; buf
[6] = 0x00; buf
[7] = 0x10;
6599 ret
= usb_microdia_control_write(dev
, reg
, buf
, 8);
6604 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6609 ret
= usb_microdia_control_read(dev
, reg
, buf
, 1);
6615 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6621 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6628 /* END OF MICRODIA 6288 START STREAM */
6632 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
6637 * @brief Wrapper function for device-specific stopstream functions
6639 * @param dev Pointer to device structure
6643 * This will execute a function determined by the array #cameras and
6644 * the function find_camera().
6647 int dev_microdia_stop_stream(struct usb_microdia
*dev
)
6650 if (dev
&& dev
->stop_stream
)
6651 ret
= dev
->stop_stream(dev
);
6657 * @brief From stop.htm
6665 * For SN9C201 with MI1310.
6666 * This function has not been tested yet.
6668 int microdia_6242_stop_stream(struct usb_microdia
*dev
)
6672 __u8 only10c0
[3] = {0x0d, 0x00, 0x00};
6675 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
6678 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6681 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6683 sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2,
6684 only10c0
[0], dev
->sensor_flags
, &only10c0
[1]);
6687 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
6690 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
6693 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6696 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6699 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
6700 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
6703 * After the select alternate setting 0 is actually another transfer:
6705 * usb_microdia_control_write(dev, 0x1066, buf, 1);
6713 * @brief From stopstream.log
6721 * For SN9C201 with SOI968.
6722 * I don't whether the function really stops the stream.
6723 * Nevertheless the LED on the webcam now stops glowing.
6724 * The function is very similar to "microdia_624f_stop_stream".
6726 int microdia_624e_stop_stream(struct usb_microdia
*dev
)
6731 usb_microdia_control_write(dev
, 0x1061, buf
, 1);
6733 /* Next two writes added because it works better.
6734 * The LED stops glowing and I think the stream does too.
6735 * 0x20 = 0b00100000 which is the minimal of what the
6736 * other stopstreams have in common.
6739 usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6742 usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6745 usb_microdia_control_write(dev
, 0x1000, buf
, 1);
6748 usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
6750 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
6751 usb_microdia_control_write(dev
, 0x1000, buf
, 3);
6753 usb_microdia_control_read(dev
, 0x1066, buf
, 1);
6760 * @brief Stop device 624f from streaming
6762 * @param dev Pointer to device structure
6764 * @returns 0 or negative error code
6767 int microdia_624f_stop_stream(struct usb_microdia
*dev
)
6775 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6781 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6787 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6793 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6799 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6805 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6813 ret
= usb_microdia_control_write(dev
, command
, buf
, 3);
6818 ret
= usb_microdia_control_read(dev
, command
, buf
, 1);
6823 ret
= usb_microdia_control_write(dev
, command
, buf
, 1);
6830 UDIA_ERROR("command %x failed (%d)!\n", command
, ret
);
6835 * @brief Stop device 6260 from streaming
6837 * @param dev Pointer to device structure
6839 * @returns 0 or negative error code
6842 int microdia_6260_stop_stream(struct usb_microdia
*dev
)
6848 ret
= usb_microdia_control_write(dev
, 0x1061, buf
, 1);
6850 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 1);
6852 ret
= usb_microdia_control_write(dev
, 0x11b8, buf
, 1);
6854 ret
= usb_microdia_control_write(dev
, 0x1007, buf
, 1);
6856 ret
= usb_microdia_control_write(dev
, 0x1006, buf
, 1);
6858 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
6859 ret
= usb_microdia_control_write(dev
, 0x1000, buf
, 3);
6862 ret
= usb_microdia_control_write(dev
, 0x1066, buf
, 1);
6863 ret
= usb_microdia_control_read(dev
, 0x1045, buf
, 1);
6865 ret
= usb_microdia_control_write(dev
, 0x1045, buf
, 1);
6867 ret
= usb_microdia_control_write(dev
, 0x10c8, buf
, 1);
6869 ret
= usb_microdia_control_write(dev
, 0x1020, buf
, 1);
6875 * @brief From 7 start-stop-logs (made by Alex Carlos, Boris Borisov, bohzan and Comer352l)
6879 * @returns 0 (ok) or -1 (error)
6883 * Windows driver version: 5.7.23.000
6884 * Windows versions: 2000 and XP
6885 * USB-Logger: SniffUSB 1.8 and 2.0, USBTrace 2.0, SnoopyPro
6886 * All logs were made using AMCAP with 640x480, RGB24
6888 int microdia_6270_stop_stream(struct usb_microdia
*dev
)
6894 if (dev
->sensor_slave_address
== MT9V111_I2C_SLAVE_ADDRESS
) {
6896 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); /* URB 3541 */
6898 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); /* URB 3542 */
6899 /* => These two writes seem to cause the cam to stop sending isochronus USB messages */
6902 ret
+= usb_microdia_control_write(dev
, 0x1061, buf
, 1); /* URB 3544 */
6903 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
6905 ret
+= usb_microdia_control_write(dev
, 0x1007, buf
, 1); /* URB 3541 */
6907 ret
+= usb_microdia_control_write(dev
, 0x1006, buf
, 1); /* URB 3542 */
6909 if (dev
->sensor_slave_address
== MT9V011_I2C_SLAVE_ADDRESS
) {
6910 /* Write to sensor register 0x07: Output Control */
6911 buf
[0] = 0x00; buf
[1] = 0x00; /* stop sensor readout, normal operation */
6912 retI2C
+= sn9c20x_write_i2c_data(dev
, dev
->sensor_slave_address
, 2, 0x07, dev
->sensor_flags
, buf
);
6914 buf
[0] = 0x38; /* ALEX: 0x3c */
6915 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 1); /* URB 3545 */
6916 buf
[0] = 0x6d; /* ALEX: 0xec; FRANK: also 0x6c */
6917 ret
+= usb_microdia_control_write(dev
, 0x11b8, buf
, 1); /* URB 3546 */
6918 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
6919 ret
+= usb_microdia_control_write(dev
, 0x1000, buf
, 3); /* URB 3547 */
6921 /* INTERRUPT COMMING BACK (URB 2227) */
6922 /* SELECT ALTERNATE SETTINGS (URB 3548) */
6923 /* INTERRUPT GOING DOWN (URB 3549) */
6926 ret
+= usb_microdia_control_write(dev
, 0x1066, buf
, 1); /* URB 3550 */
6929 UDIA_INFO("One ore more errors occured while stopping stream !\n");
6937 * @brief Stop device 627b from streaming
6939 * @param dev Pointer to device structure
6941 * @returns 0 or negative error code
6944 int microdia_627b_stop_stream(struct usb_microdia
*dev
)
6952 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6958 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6964 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6970 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6976 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6981 buf
[0] = 0x38; buf
[1] = 0xe7; buf
[2] = 0x11;
6982 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
6988 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
6995 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
7000 * @brief From UsbSnoop-plugin-parsed.log
7004 * @returns 0 (OK) or <0 (Error)
7006 * @author Vincent, Kuzja
7008 int microdia_6288_stop_stream(struct usb_microdia
*dev
)
7016 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7022 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7028 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7034 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7040 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7045 buf
[0] = 0x98; buf
[1] = 0xe7; buf
[2] = 0x11;
7046 ret
= usb_microdia_control_write(dev
, reg
, buf
, 3);
7052 ret
= usb_microdia_control_write(dev
, reg
, buf
, 1);
7058 UDIA_ERROR("r/w in Register %x failed (%d)!\n", reg
, ret
);
7063 * @brief Detect whether the image for 624f has to be flipped
7065 * @param dev Pointer to device structure
7067 * @returns 0 or negative error code
7070 int microdia_624f_flip_detect(struct usb_microdia
*dev
)
7075 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
7079 dev
->vsettings
.vflip
= 1;
7081 dev
->vsettings
.vflip
= 0;
7086 * @brief Detect whether the image for 6260 has to be flipped
7088 * @param dev Pointer to device structure
7090 * @returns 0 or negative error code
7093 int microdia_6260_flip_detect(struct usb_microdia
*dev
)
7095 const __u8 flip_bit
= 0x01;
7098 static __u8 flip_reg
= flip_bit
;
7101 ret
= usb_microdia_control_read(dev
, 0x1009, &val
, 1);
7104 if (flip_reg
!= (val
& flip_bit
)) {
7109 ret
= ov7670_auto_flip(dev
, vflip
);
7110 flip_reg
= (val
& flip_bit
);