diff options
-rw-r--r-- | linux/drivers/media/video/gspca/etoms.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 205 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.h | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/sonixb.c | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/sonixj.c | 4 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/vc032x.c | 16 | ||||
-rw-r--r-- | linux/drivers/media/video/gspca/zc3xx.c | 23 |
7 files changed, 85 insertions, 169 deletions
diff --git a/linux/drivers/media/video/gspca/etoms.c b/linux/drivers/media/video/gspca/etoms.c index fe34ee8d6..25d59ae1f 100644 --- a/linux/drivers/media/video/gspca/etoms.c +++ b/linux/drivers/media/video/gspca/etoms.c @@ -918,7 +918,9 @@ static struct sd_desc sd_desc = { /* -- module initialisation -- */ #define DVNM(name) .driver_info = (kernel_ulong_t) name static __devinitdata struct usb_device_id device_table[] = { +#ifndef CONFIG_USB_ET61X251 {USB_DEVICE(0x102c, 0x6151), DVNM("Qcam Sangha CIF")}, +#endif {USB_DEVICE(0x102c, 0x6251), DVNM("Qcam xxxxxx VGA")}, {} }; diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c index 5a0d60cb6..55d4af21e 100644 --- a/linux/drivers/media/video/gspca/gspca.c +++ b/linux/drivers/media/video/gspca/gspca.c @@ -36,15 +36,14 @@ #include "gspca.h" /* global values */ -#define DEF_NURBS 2 /* default number of URBs (mmap) */ -#define USR_NURBS 5 /* default number of URBs (userptr) */ +#define DEF_NURBS 2 /* default number of URBs */ MODULE_AUTHOR("Jean-Francois Moine <http://moinejf.free.fr>"); MODULE_DESCRIPTION("GSPCA USB Camera Driver"); MODULE_LICENSE("GPL"); -#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 5) -static const char version[] = "2.1.5"; +#define DRIVER_VERSION_NUMBER KERNEL_VERSION(2, 1, 6) +static const char version[] = "2.1.6"; static int video_nr = -1; @@ -153,7 +152,6 @@ static void fill_frame(struct gspca_dev *gspca_dev, } /* resubmit the URB */ -/*fixme: don't do that when userptr and too many URBs sent*/ urb->status = 0; st = usb_submit_urb(urb, GFP_ATOMIC); if (st < 0) @@ -163,18 +161,9 @@ static void fill_frame(struct gspca_dev *gspca_dev, /* * ISOC message interrupt from the USB device * - * Analyse each packet and call the subdriver for copy - * to the frame buffer. - * - * There are 2 functions: - * - the first one (isoc_irq_mmap) is used when the application - * buffers are mapped. The frame detection and copy is done - * at interrupt level. - * - the second one (isoc_irq_user) is used when the application - * buffers are in user space (userptr). The frame detection - * and copy is done by the application. + * Analyse each packet and call the subdriver for copy to the frame buffer. */ -static void isoc_irq_mmap(struct urb *urb +static void isoc_irq(struct urb *urb #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) , struct pt_regs *regs #endif @@ -188,59 +177,11 @@ static void isoc_irq_mmap(struct urb *urb fill_frame(gspca_dev, urb); } -static void isoc_irq_user(struct urb *urb -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19) - , struct pt_regs *regs -#endif -) -{ - struct gspca_dev *gspca_dev = (struct gspca_dev *) urb->context; - int i; - - PDEBUG(D_PACK, "isoc irq user"); - if (!gspca_dev->streaming) - return; - - i = gspca_dev->urb_in % gspca_dev->nurbs; - if (urb != gspca_dev->urb[i]) { - PDEBUG(D_ERR|D_PACK, "urb out of sequence"); - return; /* should never occur */ - } - - gspca_dev->urb_in++; - atomic_inc(&gspca_dev->nevent); /* new event */ - wake_up_interruptible(&gspca_dev->wq); -/*fixme: submit a new URBs until urb_in == urb_out (% nurbs)*/ -} - -/* - * treat the isoc messages - * - * This routine is called by the application (case userptr). - */ -static void isoc_transfer(struct gspca_dev *gspca_dev) -{ - struct urb *urb; - int i; - - for (;;) { - i = gspca_dev->urb_out; - PDEBUG(D_PACK, "isoc transf i:%d o:%d", gspca_dev->urb_in, i); - if (i == gspca_dev->urb_in) /* isoc message to read */ - break; /* no (more) message */ - atomic_dec(&gspca_dev->nevent); -/*PDEBUG(D_PACK, "isoc_trf nevent: %d", atomic_read(&gspca_dev->nevent));*/ - gspca_dev->urb_out = i + 1; /* message treated */ - urb = gspca_dev->urb[i % gspca_dev->nurbs]; - fill_frame(gspca_dev, urb); - } -} - /* * add data to the current frame * - * This function is called by the subdrivers at interrupt level - * or user level. + * This function is called by the subdrivers at interrupt level. + * * To build a frame, these ones must add * - one FIRST_PACKET * - 0 or many INTER_PACKETs @@ -283,16 +224,7 @@ struct gspca_frame *gspca_frame_add(struct gspca_dev *gspca_dev, frame->v4l2_buf.length); packet_type = DISCARD_PACKET; } else { - if (frame->v4l2_buf.memory != V4L2_MEMORY_USERPTR) { - memcpy(frame->data_end, data, len); - } else { - if (copy_to_user(frame->data_end, - data, len) != 0) { - PDEBUG(D_ERR|D_PACK, - "copy to user failed"); - packet_type = DISCARD_PACKET; - } - } + memcpy(frame->data_end, data, len); frame->data_end += len; } } @@ -339,7 +271,6 @@ static void *rvmalloc(unsigned long size) /* size = PAGE_ALIGN(size); (already done) */ mem = vmalloc_32(size); if (mem != NULL) { - memset(mem, 0, size); adr = (unsigned long) mem; while ((long) size > 0) { SetPageReserved(vmalloc_to_page((void *) adr)); @@ -350,14 +281,12 @@ static void *rvmalloc(unsigned long size) return mem; } -static void rvfree(void *mem, unsigned long size) +static void rvfree(void *mem, long size) { unsigned long adr; - if (!mem) - return; adr = (unsigned long) mem; - while ((long) size > 0) { + while (size > 0) { ClearPageReserved(vmalloc_to_page((void *) adr)); adr += PAGE_SIZE; size -= PAGE_SIZE; @@ -376,16 +305,13 @@ static int frame_alloc(struct gspca_dev *gspca_dev, frsz = gspca_dev->cam.cam_mode[i].sizeimage; PDEBUG(D_STREAM, "frame alloc frsz: %d", frsz); frsz = PAGE_ALIGN(frsz); - PDEBUG(D_STREAM, "new fr_sz: %d", frsz); gspca_dev->frsz = frsz; if (count > GSPCA_MAX_FRAMES) count = GSPCA_MAX_FRAMES; - if (gspca_dev->memory == V4L2_MEMORY_MMAP) { - gspca_dev->frbuf = rvmalloc(frsz * count); - if (!gspca_dev->frbuf) { - err("frame alloc failed"); - return -ENOMEM; - } + gspca_dev->frbuf = rvmalloc(frsz * count); + if (!gspca_dev->frbuf) { + err("frame alloc failed"); + return -ENOMEM; } gspca_dev->nframes = count; for (i = 0; i < count; i++) { @@ -397,11 +323,9 @@ static int frame_alloc(struct gspca_dev *gspca_dev, frame->v4l2_buf.length = frsz; frame->v4l2_buf.memory = gspca_dev->memory; frame->v4l2_buf.sequence = 0; - if (gspca_dev->memory == V4L2_MEMORY_MMAP) { - frame->data = frame->data_end = + frame->data = frame->data_end = gspca_dev->frbuf + i * frsz; - frame->v4l2_buf.m.offset = i * frsz; - } + frame->v4l2_buf.m.offset = i * frsz; } gspca_dev->fr_i = gspca_dev->fr_o = gspca_dev->fr_q = 0; gspca_dev->last_packet_type = DISCARD_PACKET; @@ -515,7 +439,6 @@ static int create_urbs(struct gspca_dev *gspca_dev, { struct urb *urb; int n, nurbs, i, psize, npkt, bsize; - usb_complete_t usb_complete; /* calculate the packet size and the number of packets */ psize = le16_to_cpu(ep->desc.wMaxPacketSize); @@ -528,14 +451,7 @@ static int create_urbs(struct gspca_dev *gspca_dev, bsize = psize * npkt; PDEBUG(D_STREAM, "isoc %d pkts size %d (bsize:%d)", npkt, psize, bsize); -/*fixme:don't submit all URBs when userptr*/ - if (gspca_dev->memory != V4L2_MEMORY_USERPTR) { - usb_complete = isoc_irq_mmap; - nurbs = DEF_NURBS; - } else { - usb_complete = isoc_irq_user; - nurbs = USR_NURBS; - } + nurbs = DEF_NURBS; gspca_dev->nurbs = nurbs; for (n = 0; n < nurbs; n++) { urb = usb_alloc_urb(npkt, GFP_KERNEL); @@ -562,7 +478,7 @@ static int create_urbs(struct gspca_dev *gspca_dev, urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; urb->interval = ep->desc.bInterval; - urb->complete = usb_complete; + urb->complete = isoc_irq; urb->number_of_packets = npkt; urb->transfer_buffer_length = bsize; for (i = 0; i < npkt; i++) { @@ -570,7 +486,6 @@ static int create_urbs(struct gspca_dev *gspca_dev, urb->iso_frame_desc[i].offset = psize * i; } } - gspca_dev->urb_in = gspca_dev->urb_out = 0; return 0; } @@ -1069,6 +984,7 @@ static int vidioc_reqbufs(struct file *file, void *priv, if (rb->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) return -EINVAL; switch (rb->memory) { + case GSPCA_MEMORY_READ: case V4L2_MEMORY_MMAP: case V4L2_MEMORY_USERPTR: break; @@ -1078,13 +994,6 @@ static int vidioc_reqbufs(struct file *file, void *priv, if (mutex_lock_interruptible(&gspca_dev->queue_lock)) return -ERESTARTSYS; - for (i = 0; i < gspca_dev->nframes; i++) { - if (gspca_dev->frame[i].vma_use_count) { - ret = -EBUSY; - goto out; - } - } - /* only one file may do capture */ if ((gspca_dev->capt_file != NULL && gspca_dev->capt_file != file) || gspca_dev->streaming) { @@ -1092,10 +1001,20 @@ static int vidioc_reqbufs(struct file *file, void *priv, goto out; } - if (rb->count == 0) { /* unrequest? */ + if (rb->count == 0) { /* unrequest */ + for (i = 0; i < gspca_dev->nframes; i++) { + if (gspca_dev->frame[i].vma_use_count) { + ret = -EBUSY; + goto out; + } + } frame_free(gspca_dev); gspca_dev->capt_file = NULL; } else { + if (gspca_dev->nframes != 0) { + ret = -EBUSY; + goto out; + } gspca_dev->memory = rb->memory; ret = frame_alloc(gspca_dev, rb->count); if (ret == 0) { @@ -1307,9 +1226,6 @@ static int dev_mmap(struct file *file, struct vm_area_struct *vma) struct page *page; unsigned long addr, start, size; int i, ret; -#ifdef CONFIG_VIDEO_V4L1_COMPAT - int compat = 0; -#endif start = vma->vm_start; size = vma->vm_end - vma->vm_start; @@ -1344,11 +1260,11 @@ static int dev_mmap(struct file *file, struct vm_area_struct *vma) goto out; } #ifdef CONFIG_VIDEO_V4L1_COMPAT - if (i == 0 && size == frame->v4l2_buf.length * gspca_dev->nframes) - compat = 1; - else + /* v4l1 maps all the buffers */ + if (i != 0 + || size != frame->v4l2_buf.length * gspca_dev->nframes) #endif - if (size != frame->v4l2_buf.length) { + if (size != frame->v4l2_buf.length) { PDEBUG(D_STREAM, "mmap bad size"); ret = -EINVAL; goto out; @@ -1374,14 +1290,6 @@ static int dev_mmap(struct file *file, struct vm_area_struct *vma) vma->vm_ops = &gspca_vm_ops; vma->vm_private_data = frame; gspca_vm_open(vma); -#ifdef CONFIG_VIDEO_V4L1_COMPAT - if (compat) { -/*fixme: ugly*/ - for (i = 1; i < gspca_dev->nframes; ++i) - gspca_dev->frame[i].v4l2_buf.flags |= - V4L2_BUF_FLAG_MAPPED; - } -#endif ret = 0; out: mutex_unlock(&gspca_dev->queue_lock); @@ -1399,10 +1307,6 @@ static int frame_wait(struct gspca_dev *gspca_dev, struct gspca_frame *frame; int i, j, ret; - /* if userptr, treat the awaiting URBs */ - if (gspca_dev->memory == V4L2_MEMORY_USERPTR) - isoc_transfer(gspca_dev); - /* check if a frame is ready */ i = gspca_dev->fr_o; j = gspca_dev->fr_queue[i]; @@ -1427,8 +1331,6 @@ static int frame_wait(struct gspca_dev *gspca_dev, atomic_dec(&gspca_dev->nevent); if (!gspca_dev->streaming || !gspca_dev->present) return -EIO; - if (gspca_dev->memory == V4L2_MEMORY_USERPTR) - isoc_transfer(gspca_dev); i = gspca_dev->fr_o; j = gspca_dev->fr_queue[i]; frame = &gspca_dev->frame[j]; @@ -1461,9 +1363,9 @@ static int vidioc_dqbuf(struct file *file, void *priv, int i, ret; PDEBUG(D_FRAM, "dqbuf"); - if (v4l2_buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE - || (v4l2_buf->memory != V4L2_MEMORY_MMAP - && v4l2_buf->memory != V4L2_MEMORY_USERPTR)) + if (v4l2_buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) + return -EINVAL; + if (v4l2_buf->memory != gspca_dev->memory) return -EINVAL; if (!gspca_dev->streaming) return -EINVAL; @@ -1481,6 +1383,16 @@ static int vidioc_dqbuf(struct file *file, void *priv, goto out; i = ret; /* frame index */ frame = &gspca_dev->frame[i]; + if (gspca_dev->memory == V4L2_MEMORY_USERPTR) { + if (copy_to_user((__u8 *) frame->v4l2_buf.m.userptr, + frame->data, + frame->v4l2_buf.bytesused)) { + PDEBUG(D_ERR|D_STREAM, + "dqbuf cp to user failed"); + ret = -EFAULT; + goto out; + } + } frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE; memcpy(v4l2_buf, &frame->v4l2_buf, sizeof *v4l2_buf); PDEBUG(D_FRAM, "dqbuf %d", i); @@ -1535,8 +1447,6 @@ static int vidioc_qbuf(struct file *file, void *priv, /* frame->v4l2_buf.flags &= ~V4L2_BUF_FLAG_DONE; */ if (frame->v4l2_buf.memory == V4L2_MEMORY_USERPTR) { - frame->data = frame->data_end = - (__u8 *) v4l2_buf->m.userptr; frame->v4l2_buf.m.userptr = v4l2_buf->m.userptr; frame->v4l2_buf.length = v4l2_buf->length; } @@ -1574,7 +1484,7 @@ static int read_alloc(struct gspca_dev *gspca_dev, memset(&rb, 0, sizeof rb); rb.count = gspca_dev->nbufread; rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - rb.memory = V4L2_MEMORY_MMAP; + rb.memory = GSPCA_MEMORY_READ; ret = vidioc_reqbufs(file, gspca_dev, &rb); if (ret != 0) { PDEBUG(D_STREAM, "read reqbuf err %d", ret); @@ -1582,7 +1492,7 @@ static int read_alloc(struct gspca_dev *gspca_dev, } memset(&v4l2_buf, 0, sizeof v4l2_buf); v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - v4l2_buf.memory = V4L2_MEMORY_MMAP; + v4l2_buf.memory = GSPCA_MEMORY_READ; for (i = 0; i < gspca_dev->nbufread; i++) { v4l2_buf.index = i; /*fixme: ugly!*/ @@ -1635,11 +1545,6 @@ static unsigned int dev_poll(struct file *file, poll_table *wait) goto out; } - /* if userptr, treat the awaiting URBs */ - if (gspca_dev->memory == V4L2_MEMORY_USERPTR - && gspca_dev->capt_file == file) - isoc_transfer(gspca_dev); - i = gspca_dev->fr_o; i = gspca_dev->fr_queue[i]; if (gspca_dev->frame[i].v4l2_buf.flags & V4L2_BUF_FLAG_DONE) @@ -1684,7 +1589,7 @@ static ssize_t dev_read(struct file *file, char __user *data, for (;;) { memset(&v4l2_buf, 0, sizeof v4l2_buf); v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; - v4l2_buf.memory = V4L2_MEMORY_MMAP; + v4l2_buf.memory = GSPCA_MEMORY_READ; ret = vidioc_dqbuf(file, gspca_dev, &v4l2_buf); if (ret != 0) { PDEBUG(D_STREAM, "read dqbuf err %d", ret); @@ -1706,14 +1611,8 @@ static ssize_t dev_read(struct file *file, char __user *data, } /* copy the frame */ - if (count < frame->v4l2_buf.bytesused) { - PDEBUG(D_STREAM, "read bad count: %d < %d", - count, frame->v4l2_buf.bytesused); -/*fixme: special errno?*/ - ret = -EINVAL; - goto out; - } - count = frame->v4l2_buf.bytesused; + if (count > frame->v4l2_buf.bytesused) + count = frame->v4l2_buf.bytesused; ret = copy_to_user(data, frame->data, count); if (ret != 0) { PDEBUG(D_ERR|D_STREAM, diff --git a/linux/drivers/media/video/gspca/gspca.h b/linux/drivers/media/video/gspca/gspca.h index 945f1ab4c..9b645af81 100644 --- a/linux/drivers/media/video/gspca/gspca.h +++ b/linux/drivers/media/video/gspca/gspca.h @@ -156,8 +156,6 @@ struct gspca_dev { char nbufread; /* number of buffers for read() */ char nurbs; /* number of allocated URBs */ char memory; /* memory type (V4L2_MEMORY_xxx) */ - __u8 urb_in; /* URB pointers - used when !mmap */ - __u8 urb_out; __u8 nbalt; /* number of USB alternate settings */ }; diff --git a/linux/drivers/media/video/gspca/sonixb.c b/linux/drivers/media/video/gspca/sonixb.c index 3272593c5..a4594dc0e 100644 --- a/linux/drivers/media/video/gspca/sonixb.c +++ b/linux/drivers/media/video/gspca/sonixb.c @@ -866,6 +866,7 @@ static struct sd_desc sd_desc = { /* -- module initialisation -- */ #define DVNM(name) .driver_info = (kernel_ulong_t) name static __devinitdata struct usb_device_id device_table[] = { +#ifndef CONFIG_USB_SN9C102 {USB_DEVICE(0x0c45, 0x6001), DVNM("Genius VideoCAM NB")}, {USB_DEVICE(0x0c45, 0x6005), DVNM("Sweex Tas5110")}, {USB_DEVICE(0x0c45, 0x6007), DVNM("Sonix sn9c101 + Tas5110D")}, @@ -882,6 +883,7 @@ static __devinitdata struct usb_device_id device_table[] = { {USB_DEVICE(0x0c45, 0x602e), DVNM("Genius VideoCam Messenger")}, {USB_DEVICE(0x0c45, 0x60af), DVNM("Trust WB3100P")}, {USB_DEVICE(0x0c45, 0x60b0), DVNM("Genius VideoCam Look")}, +#endif {} }; MODULE_DEVICE_TABLE(usb, device_table); diff --git a/linux/drivers/media/video/gspca/sonixj.c b/linux/drivers/media/video/gspca/sonixj.c index debbef092..785ca2e50 100644 --- a/linux/drivers/media/video/gspca/sonixj.c +++ b/linux/drivers/media/video/gspca/sonixj.c @@ -1627,11 +1627,13 @@ static const struct sd_desc sd_desc = { /* -- module initialisation -- */ #define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { +#ifndef CONFIG_USB_SN9C102 {USB_DEVICE(0x0458, 0x7025), DVNM("Genius Eye 311Q")}, {USB_DEVICE(0x045e, 0x00f5), DVNM("MicroSoft VX3000")}, {USB_DEVICE(0x045e, 0x00f7), DVNM("MicroSoft VX1000")}, {USB_DEVICE(0x0471, 0x0327), DVNM("Philips SPC 600 NC")}, {USB_DEVICE(0x0471, 0x0328), DVNM("Philips SPC 700 NC")}, +#endif {USB_DEVICE(0x0471, 0x0330), DVNM("Philips SPC 710NC")}, {USB_DEVICE(0x0c45, 0x6040), DVNM("Speed NVC 350K")}, {USB_DEVICE(0x0c45, 0x607c), DVNM("Sonix sn9c102p Hv7131R")}, @@ -1641,10 +1643,12 @@ static const __devinitdata struct usb_device_id device_table[] = { {USB_DEVICE(0x0c45, 0x60fc), DVNM("LG-LIC300")}, {USB_DEVICE(0x0c45, 0x612a), DVNM("Avant Camera")}, {USB_DEVICE(0x0c45, 0x612c), DVNM("Typhoon Rasy Cam 1.3MPix")}, +#ifndef CONFIG_USB_SN9C102 {USB_DEVICE(0x0c45, 0x6130), DVNM("Sonix Pccam")}, {USB_DEVICE(0x0c45, 0x6138), DVNM("Sn9c120 Mo4000")}, {USB_DEVICE(0x0c45, 0x613b), DVNM("Surfer SN-206")}, {USB_DEVICE(0x0c45, 0x613c), DVNM("Sonix Pccam168")}, +#endif {} }; MODULE_DEVICE_TABLE(usb, device_table); diff --git a/linux/drivers/media/video/gspca/vc032x.c b/linux/drivers/media/video/gspca/vc032x.c index ad46273cd..1129cbeb8 100644 --- a/linux/drivers/media/video/gspca/vc032x.c +++ b/linux/drivers/media/video/gspca/vc032x.c @@ -1512,20 +1512,20 @@ static __u8 i2c_write(struct usb_device *dev, if (size > 3 || size < 1) return -EINVAL; reg_r(dev, 0xa1, 0xb33f, &retbyte, 1); - reg_w(dev, 0xa0, size , 0xb334); - reg_w(dev, 0xa0, reg , 0xb33a); + reg_w(dev, 0xa0, size, 0xb334); + reg_w(dev, 0xa0, reg, 0xb33a); switch (size) { case 1: - reg_w(dev, 0xa0, val[0] , 0xb336); + reg_w(dev, 0xa0, val[0], 0xb336); break; case 2: - reg_w(dev, 0xa0, val[0] , 0xb336); - reg_w(dev, 0xa0, val[1] , 0xb337); + reg_w(dev, 0xa0, val[0], 0xb336); + reg_w(dev, 0xa0, val[1], 0xb337); break; case 3: - reg_w(dev, 0xa0, val[0] , 0xb336); - reg_w(dev, 0xa0, val[1] , 0xb337); - reg_w(dev, 0xa0, val[2] , 0xb338); + reg_w(dev, 0xa0, val[0], 0xb336); + reg_w(dev, 0xa0, val[1], 0xb337); + reg_w(dev, 0xa0, val[2], 0xb338); break; default: reg_w(dev, 0xa0, 0x01, 0xb334); diff --git a/linux/drivers/media/video/gspca/zc3xx.c b/linux/drivers/media/video/gspca/zc3xx.c index 72ae1e006..b0599532f 100644 --- a/linux/drivers/media/video/gspca/zc3xx.c +++ b/linux/drivers/media/video/gspca/zc3xx.c @@ -7136,10 +7136,10 @@ static int sd_config(struct gspca_dev *gspca_dev, gspca_dev->nbalt--; if (vga) { cam->cam_mode = vga_mode; - cam->nmodes = sizeof vga_mode / sizeof vga_mode[0]; + cam->nmodes = ARRAY_SIZE(vga_mode); } else { cam->cam_mode = sif_mode; - cam->nmodes = sizeof sif_mode / sizeof sif_mode[0]; + cam->nmodes = ARRAY_SIZE(sif_mode); } sd->qindex = 1; sd->brightness = sd_ctrls[SD_BRIGHTNESS].qctrl.default_value; @@ -7510,21 +7510,26 @@ static const struct sd_desc sd_desc = { #define DVNM(name) .driver_info = (kernel_ulong_t) name static const __devinitdata struct usb_device_id device_table[] = { {USB_DEVICE(0x041e, 0x041e), DVNM("Creative WebCam Live!")}, +#ifndef CONFIG_USB_ZC0301 {USB_DEVICE(0x041e, 0x4017), DVNM("Creative Webcam Mobile PD1090")}, {USB_DEVICE(0x041e, 0x401c), DVNM("Creative NX")}, {USB_DEVICE(0x041e, 0x401e), DVNM("Creative Nx Pro")}, {USB_DEVICE(0x041e, 0x401f), DVNM("Creative Webcam Notebook PD1171")}, -/*0x041e, 0x4022*/ +#endif {USB_DEVICE(0x041e, 0x4029), DVNM("Creative WebCam Vista Pro")}, +#ifndef CONFIG_USB_ZC0301 {USB_DEVICE(0x041e, 0x4034), DVNM("Creative Instant P0620")}, {USB_DEVICE(0x041e, 0x4035), DVNM("Creative Instant P0620D")}, {USB_DEVICE(0x041e, 0x4036), DVNM("Creative Live !")}, {USB_DEVICE(0x041e, 0x403a), DVNM("Creative Nx Pro 2")}, +#endif {USB_DEVICE(0x041e, 0x4051), DVNM("Creative Notebook Pro (VF0250)")}, {USB_DEVICE(0x041e, 0x4053), DVNM("Creative Live!Cam Video IM")}, +#ifndef CONFIG_USB_ZC0301 {USB_DEVICE(0x0458, 0x7007), DVNM("Genius VideoCam V2")}, {USB_DEVICE(0x0458, 0x700c), DVNM("Genius VideoCam V3")}, {USB_DEVICE(0x0458, 0x700f), DVNM("Genius VideoCam Web V2")}, +#endif {USB_DEVICE(0x0461, 0x0a00), DVNM("MicroInnovation WebCam320")}, {USB_DEVICE(0x046d, 0x08a0), DVNM("Logitech QC IM")}, {USB_DEVICE(0x046d, 0x08a1), DVNM("Logitech QC IM 0x08A1 +sound")}, @@ -7533,10 +7538,12 @@ static const __devinitdata struct usb_device_id device_table[] = { {USB_DEVICE(0x046d, 0x08a6), DVNM("Logitech QCim")}, {USB_DEVICE(0x046d, 0x08a7), DVNM("Logitech QuickCam Image")}, {USB_DEVICE(0x046d, 0x08a9), DVNM("Logitech Notebook Deluxe")}, - {USB_DEVICE(0x046d, 0x08aa), DVNM("Labtec Webcam Notebook")}, + {USB_DEVICE(0x046d, 0x08aa), DVNM("Labtec Webcam Notebook")}, {USB_DEVICE(0x046d, 0x08ac), DVNM("Logitech QuickCam Cool")}, {USB_DEVICE(0x046d, 0x08ad), DVNM("Logitech QCCommunicate STX")}, +#ifndef CONFIG_USB_ZC0301 {USB_DEVICE(0x046d, 0x08ae), DVNM("Logitech QuickCam for Notebooks")}, +#endif {USB_DEVICE(0x046d, 0x08af), DVNM("Logitech QuickCam Cool")}, {USB_DEVICE(0x046d, 0x08b9), DVNM("Logitech QC IM ???")}, {USB_DEVICE(0x046d, 0x08d7), DVNM("Logitech QCam STX")}, @@ -7549,18 +7556,22 @@ static const __devinitdata struct usb_device_id device_table[] = { {USB_DEVICE(0x0471, 0x032d), DVNM("Philips spc210nc")}, {USB_DEVICE(0x0471, 0x032e), DVNM("Philips spc315nc")}, {USB_DEVICE(0x055f, 0xc005), DVNM("Mustek Wcam300A")}, +#ifndef CONFIG_USB_ZC0301 {USB_DEVICE(0x055f, 0xd003), DVNM("Mustek WCam300A")}, {USB_DEVICE(0x055f, 0xd004), DVNM("Mustek WCam300 AN")}, +#endif {USB_DEVICE(0x0698, 0x2003), DVNM("CTX M730V built in")}, -/*0x0ac8, 0x0301*/ {USB_DEVICE(0x0ac8, 0x0302), DVNM("Z-star Vimicro zc0302")}, +#ifndef CONFIG_USB_ZC0301 {USB_DEVICE(0x0ac8, 0x301b), DVNM("Z-Star zc301b")}, {USB_DEVICE(0x0ac8, 0x303b), DVNM("Vimicro 0x303b")}, +#endif {USB_DEVICE(0x0ac8, 0x305b), DVNM("Z-star Vimicro zc0305b")}, +#ifndef CONFIG_USB_ZC0301 {USB_DEVICE(0x0ac8, 0x307b), DVNM("Z-Star 307b")}, {USB_DEVICE(0x10fd, 0x0128), DVNM("Typhoon Webshot II 300k 0x0128")}, -/*0x10fd, 0x804e*/ {USB_DEVICE(0x10fd, 0x8050), DVNM("Typhoon Webshot II USB 300k")}, +#endif {} /* end of entry */ }; #undef DVNAME |