1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
$NetBSD: patch-ab,v 1.1.1.1 2002/02/18 03:06:16 wulf Exp $
--- vid.c.orig Mon May 8 14:29:03 2000
+++ vid.c Fri Dec 28 20:01:07 2001
@@ -294,7 +294,11 @@
} else {
int i = 0;
for(i = 0; i < 15; ++i) {
+#ifdef __NetBSD__
+ sprintf(dev, "/dev/ugen%d.00", i);
+#else
sprintf(dev, "/dev/ugen%d", i);
+#endif
if((fd = open(dev, O_RDWR)) < 0)
continue;
if(ioctl(fd, USB_GET_DEVICEINFO, &udi) < 0
@@ -398,7 +402,8 @@
if(ov511_reg_write(fd, OV511_REG_CE_EN, 0x0) < 0)
exit(1);
- ov511_i2c_write(fd, OV7610_REG_RWB, 0x5);
+ ov511_i2c_write(fd, OV7610_REG_GC, 0x00);
+ ov511_i2c_write(fd, OV7610_REG_RWB, 0x05);
ov511_i2c_write(fd, OV7610_REG_EC, 0xFF);
ov511_i2c_write(fd, OV7610_REG_COMB, 0x01);
ov511_i2c_write(fd, OV7610_REG_FD, 0x06);
@@ -468,7 +473,11 @@
vs.xels = pnm_allocarray(vs.width, vs.height);
/* open the isochronous endpoint (endpoint 1) */
- sprintf(isocdev, "%s.1", devname);
+#ifdef __NetBSD__
+ sprintf(isocdev, "%s.01", strtok(devname,"."));
+#else
+ sprintf(isocdev, "%s.01", devname);
+#endif
if((isoc = open(isocdev, O_RDONLY)) < 0) {
perror(isocdev);
exit(1);
|