2004-08-12-0101Z


Making some progress. Figured out roughly how this hotplug data is gathered and edited the C and header files accordingly. Now it recognizes the camera:

Aug 12 00:55:21 zero kernel: drivers/usb/media/stv680.c: [stv680_probe:1399] STV(i): STV0680 camera found.
Aug 12 00:55:21 zero kernel: drivers/usb/media/stv680.c: [stv680_probe:1437] STV(i): registered new video device: video0

However, it won't let me read from it, and the perms seem to me like they should allow it:

open("/dev/video0", O_RDONLY|O_LARGEFILE) = -1 EPERM (Operation not permitted)
write(2, "head: ", 6head: ) = 6
write(2, "/dev/video0", 11/dev/video0) = 11
write(2, ": Operation not permitted", 25: Operation not permitted) = 25
write(2, "\n", 1) = 1
exit_group(1) = ?
jcomeau@zero:~/www/www/blog$ ls -l /dev/video0
crw-rw-rw- 2 root sys 81, 0 Mar 9 2003 /dev/video0

Here's the patch so far:

root@zero:/usr/src/linux-2.6.7/drivers/usb/media# gendiff . .orig
--- ./stv680.h.orig 2004-06-16 05:19:44.000000000 +0000
+++ ./stv680.h 2004-08-11 23:00:11.000000000 +0000
@@ -41,12 +41,15 @@

#define USB_PENCAM_VENDOR_ID 0x0553
#define USB_PENCAM_PRODUCT_ID 0x0202
+#define USB_JB1CAM_VENDOR_ID 0x4483
+#define USB_JB1CAM_PRODUCT_ID 0x0005
#define PENCAM_TIMEOUT 1000
/* fmt 4 */
#define STV_VIDEO_PALETTE VIDEO_PALETTE_RGB24

static struct usb_device_id device_table[] = {
{USB_DEVICE (USB_PENCAM_VENDOR_ID, USB_PENCAM_PRODUCT_ID)},
+ {USB_DEVICE (USB_JB1CAM_VENDOR_ID, USB_JB1CAM_PRODUCT_ID)},
{}
};
MODULE_DEVICE_TABLE (usb, device_table);
--- ./stv680.c.orig 2004-06-16 05:19:42.000000000 +0000
+++ ./stv680.c 2004-08-11 23:45:22.000000000 +0000
@@ -74,7 +74,7 @@
static int swapRGB = 0; /* default for auto sleect */
static int swapRGB_on = 0; /* default to allow auto select; -1=swap never, +1= swap always */

-static unsigned int debug = 0;
+static unsigned int debug = 2;

#define PDEBUG(level, fmt, args...) \
do { \
@@ -86,8 +86,9 @@
/*
* Version Information
*/
-#define DRIVER_VERSION "v0.25"
+#define DRIVER_VERSION "v0.25jc"
#define DRIVER_AUTHOR "Kevin Sisson <kjsisson@bellsouth.net>"
+#define DRIVER_HACKER "John Comeau <jc@jcomeau.com>"
#define DRIVER_DESC "STV0680 USB Camera Driver"

MODULE_AUTHOR (DRIVER_AUTHOR);
@@ -1392,7 +1393,8 @@

interface = &intf->altsetting[0];
/* Is it a STV680? */
- if ((dev->descriptor.idVendor == USB_PENCAM_VENDOR_ID) && (dev->descriptor.idProduct == USB_PENCAM_PRODUCT_ID)) {
+ if (((dev->descriptor.idVendor == USB_PENCAM_VENDOR_ID) && (dev->descriptor.idProduct == USB_PENCAM_PRODUCT_ID)) ||
+ ((dev->descriptor.idVendor == USB_JB1CAM_VENDOR_ID) && (dev->descriptor.idProduct == USB_JB1CAM_PRODUCT_ID))) {
camera_name = "STV0680";
PDEBUG (0, "STV(i): STV0680 camera found.");
} else {

Back to blog or home page

last updated 2013-01-10 20:27:42. served from tektonic.jcomeau.com