aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-06 17:27:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-06 17:27:15 -0400
commit11f9b020fa921bb33fff65b947f6422fe15f4414 (patch)
tree9f974d8037480192202ed9f9020adb7f8f2f0b53 /drivers
parente683b423007b9befec30c672c695d0e6abf87493 (diff)
parentdb98fb8b5b9210ba3b14fb984a26060e4afdb9f5 (diff)
Merge branch 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (33 commits) V4L/DVB (9103): em28xx: HVR-900 B3C0 - fix audio clicking issue V4L/DVB (9099): em28xx: Add detection for K-WORLD DVB-T 310U V4L/DVB (9092): gspca: Bad init values for sonixj ov7660. V4L/DVB (9080): gspca: Add a delay after writing to the sonixj sensors. V4L/DVB (9075): gspca: Bad check of returned status in i2c_read() spca561. V4L/DVB (9053): fix buffer overflow in uvc-video V4L/DVB (9043): S5H1420: Fix size of shadow-array to avoid overflow V4L/DVB (9037): Fix support for Hauppauge Nova-S SE V4L/DVB (9029): Fix deadlock in demux code V4L/DVB (8979): sms1xxx: Add new USB product ID for Hauppauge WinTV MiniStick V4L/DVB (8978): sms1xxx: fix product name for Hauppauge WinTV MiniStick V4L/DVB (8967): Use correct XC3028L firmware for AMD ATI TV Wonder 600 V4L/DVB (8963): s2255drv field count fix V4L/DVB (8961): zr36067: Fix RGBR pixel format V4L/DVB (8960): drivers/media/video/cafe_ccic.c needs mm.h V4L/DVB (8958): zr36067: Return proper bytes-per-line value V4L/DVB (8957): zr36067: Restore the default pixel format V4L/DVB (8955): bttv: Prevent NULL pointer dereference in radio_open V4L/DVB (8935): em28xx-cards: Remove duplicate entry (EM2800_BOARD_KWORLD_USB2800) V4L/DVB (8933): gspca: Disable light frquency for zc3xx cs2102 Kokom. ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/common/tuners/tuner-xc2028.h1
-rw-r--r--drivers/media/dvb/b2c2/flexcop-fe-tuner.c1
-rw-r--r--drivers/media/dvb/dvb-core/dmxdev.c16
-rw-r--r--drivers/media/dvb/dvb-core/dvb_demux.c16
-rw-r--r--drivers/media/dvb/frontends/s5h1420.c11
-rw-r--r--drivers/media/dvb/frontends/s5h1420.h8
-rw-r--r--drivers/media/dvb/siano/sms-cards.c4
-rw-r--r--drivers/media/video/bt8xx/bttv-driver.c2
-rw-r--r--drivers/media/video/cafe_ccic.c1
-rw-r--r--drivers/media/video/cpia2/cpia2_usb.c5
-rw-r--r--drivers/media/video/cx18/cx18-cards.c2
-rw-r--r--drivers/media/video/cx88/cx88-blackbird.c1
-rw-r--r--drivers/media/video/em28xx/em28xx-audio.c12
-rw-r--r--drivers/media/video/em28xx/em28xx-cards.c55
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c9
-rw-r--r--drivers/media/video/gspca/gspca.c3
-rw-r--r--drivers/media/video/gspca/pac7311.c1
-rw-r--r--drivers/media/video/gspca/sonixb.c4
-rw-r--r--drivers/media/video/gspca/sonixj.c19
-rw-r--r--drivers/media/video/gspca/spca561.c2
-rw-r--r--drivers/media/video/gspca/zc3xx.c4
-rw-r--r--drivers/media/video/ov511.c6
-rw-r--r--drivers/media/video/pvrusb2/pvrusb2-devattr.c2
-rw-r--r--drivers/media/video/s2255drv.c3
-rw-r--r--drivers/media/video/uvc/uvc_ctrl.c2
-rw-r--r--drivers/media/video/w9968cf.c2
-rw-r--r--drivers/media/video/wm8739.c4
-rw-r--r--drivers/media/video/zoran_card.c2
-rw-r--r--drivers/media/video/zoran_driver.c15
29 files changed, 128 insertions, 85 deletions
diff --git a/drivers/media/common/tuners/tuner-xc2028.h b/drivers/media/common/tuners/tuner-xc2028.h
index 216025cf5d4b..2c5b6282b569 100644
--- a/drivers/media/common/tuners/tuner-xc2028.h
+++ b/drivers/media/common/tuners/tuner-xc2028.h
@@ -10,6 +10,7 @@
10#include "dvb_frontend.h" 10#include "dvb_frontend.h"
11 11
12#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw" 12#define XC2028_DEFAULT_FIRMWARE "xc3028-v27.fw"
13#define XC3028L_DEFAULT_FIRMWARE "xc3028L-v36.fw"
13 14
14/* Dmoduler IF (kHz) */ 15/* Dmoduler IF (kHz) */
15#define XC3028_FE_DEFAULT 0 /* Don't load SCODE */ 16#define XC3028_FE_DEFAULT 0 /* Don't load SCODE */
diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
index 4eed783f4bce..a127a4175c40 100644
--- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c
@@ -491,6 +491,7 @@ static struct s5h1420_config skystar2_rev2_7_s5h1420_config = {
491 .demod_address = 0x53, 491 .demod_address = 0x53,
492 .invert = 1, 492 .invert = 1,
493 .repeated_start_workaround = 1, 493 .repeated_start_workaround = 1,
494 .serial_mpeg = 1,
494}; 495};
495 496
496static struct itd1000_config skystar2_rev2_7_itd1000_config = { 497static struct itd1000_config skystar2_rev2_7_itd1000_config = {
diff --git a/drivers/media/dvb/dvb-core/dmxdev.c b/drivers/media/dvb/dvb-core/dmxdev.c
index 069d847ba887..0c733c66a441 100644
--- a/drivers/media/dvb/dvb-core/dmxdev.c
+++ b/drivers/media/dvb/dvb-core/dmxdev.c
@@ -364,15 +364,16 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
364 enum dmx_success success) 364 enum dmx_success success)
365{ 365{
366 struct dmxdev_filter *dmxdevfilter = filter->priv; 366 struct dmxdev_filter *dmxdevfilter = filter->priv;
367 unsigned long flags;
367 int ret; 368 int ret;
368 369
369 if (dmxdevfilter->buffer.error) { 370 if (dmxdevfilter->buffer.error) {
370 wake_up(&dmxdevfilter->buffer.queue); 371 wake_up(&dmxdevfilter->buffer.queue);
371 return 0; 372 return 0;
372 } 373 }
373 spin_lock(&dmxdevfilter->dev->lock); 374 spin_lock_irqsave(&dmxdevfilter->dev->lock, flags);
374 if (dmxdevfilter->state != DMXDEV_STATE_GO) { 375 if (dmxdevfilter->state != DMXDEV_STATE_GO) {
375 spin_unlock(&dmxdevfilter->dev->lock); 376 spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
376 return 0; 377 return 0;
377 } 378 }
378 del_timer(&dmxdevfilter->timer); 379 del_timer(&dmxdevfilter->timer);
@@ -391,7 +392,7 @@ static int dvb_dmxdev_section_callback(const u8 *buffer1, size_t buffer1_len,
391 } 392 }
392 if (dmxdevfilter->params.sec.flags & DMX_ONESHOT) 393 if (dmxdevfilter->params.sec.flags & DMX_ONESHOT)
393 dmxdevfilter->state = DMXDEV_STATE_DONE; 394 dmxdevfilter->state = DMXDEV_STATE_DONE;
394 spin_unlock(&dmxdevfilter->dev->lock); 395 spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
395 wake_up(&dmxdevfilter->buffer.queue); 396 wake_up(&dmxdevfilter->buffer.queue);
396 return 0; 397 return 0;
397} 398}
@@ -403,11 +404,12 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
403{ 404{
404 struct dmxdev_filter *dmxdevfilter = feed->priv; 405 struct dmxdev_filter *dmxdevfilter = feed->priv;
405 struct dvb_ringbuffer *buffer; 406 struct dvb_ringbuffer *buffer;
407 unsigned long flags;
406 int ret; 408 int ret;
407 409
408 spin_lock(&dmxdevfilter->dev->lock); 410 spin_lock_irqsave(&dmxdevfilter->dev->lock, flags);
409 if (dmxdevfilter->params.pes.output == DMX_OUT_DECODER) { 411 if (dmxdevfilter->params.pes.output == DMX_OUT_DECODER) {
410 spin_unlock(&dmxdevfilter->dev->lock); 412 spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
411 return 0; 413 return 0;
412 } 414 }
413 415
@@ -417,7 +419,7 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
417 else 419 else
418 buffer = &dmxdevfilter->dev->dvr_buffer; 420 buffer = &dmxdevfilter->dev->dvr_buffer;
419 if (buffer->error) { 421 if (buffer->error) {
420 spin_unlock(&dmxdevfilter->dev->lock); 422 spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
421 wake_up(&buffer->queue); 423 wake_up(&buffer->queue);
422 return 0; 424 return 0;
423 } 425 }
@@ -428,7 +430,7 @@ static int dvb_dmxdev_ts_callback(const u8 *buffer1, size_t buffer1_len,
428 dvb_ringbuffer_flush(buffer); 430 dvb_ringbuffer_flush(buffer);
429 buffer->error = ret; 431 buffer->error = ret;
430 } 432 }
431 spin_unlock(&dmxdevfilter->dev->lock); 433 spin_unlock_irqrestore(&dmxdevfilter->dev->lock, flags);
432 wake_up(&buffer->queue); 434 wake_up(&buffer->queue);
433 return 0; 435 return 0;
434} 436}
diff --git a/drivers/media/dvb/dvb-core/dvb_demux.c b/drivers/media/dvb/dvb-core/dvb_demux.c
index e2eca0b1fe7c..a2c1fd5d2f67 100644
--- a/drivers/media/dvb/dvb-core/dvb_demux.c
+++ b/drivers/media/dvb/dvb-core/dvb_demux.c
@@ -399,7 +399,9 @@ static void dvb_dmx_swfilter_packet(struct dvb_demux *demux, const u8 *buf)
399void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf, 399void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf,
400 size_t count) 400 size_t count)
401{ 401{
402 spin_lock(&demux->lock); 402 unsigned long flags;
403
404 spin_lock_irqsave(&demux->lock, flags);
403 405
404 while (count--) { 406 while (count--) {
405 if (buf[0] == 0x47) 407 if (buf[0] == 0x47)
@@ -407,16 +409,17 @@ void dvb_dmx_swfilter_packets(struct dvb_demux *demux, const u8 *buf,
407 buf += 188; 409 buf += 188;
408 } 410 }
409 411
410 spin_unlock(&demux->lock); 412 spin_unlock_irqrestore(&demux->lock, flags);
411} 413}
412 414
413EXPORT_SYMBOL(dvb_dmx_swfilter_packets); 415EXPORT_SYMBOL(dvb_dmx_swfilter_packets);
414 416
415void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count) 417void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
416{ 418{
419 unsigned long flags;
417 int p = 0, i, j; 420 int p = 0, i, j;
418 421
419 spin_lock(&demux->lock); 422 spin_lock_irqsave(&demux->lock, flags);
420 423
421 if (demux->tsbufp) { 424 if (demux->tsbufp) {
422 i = demux->tsbufp; 425 i = demux->tsbufp;
@@ -449,17 +452,18 @@ void dvb_dmx_swfilter(struct dvb_demux *demux, const u8 *buf, size_t count)
449 } 452 }
450 453
451bailout: 454bailout:
452 spin_unlock(&demux->lock); 455 spin_unlock_irqrestore(&demux->lock, flags);
453} 456}
454 457
455EXPORT_SYMBOL(dvb_dmx_swfilter); 458EXPORT_SYMBOL(dvb_dmx_swfilter);
456 459
457void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count) 460void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count)
458{ 461{
462 unsigned long flags;
459 int p = 0, i, j; 463 int p = 0, i, j;
460 u8 tmppack[188]; 464 u8 tmppack[188];
461 465
462 spin_lock(&demux->lock); 466 spin_lock_irqsave(&demux->lock, flags);
463 467
464 if (demux->tsbufp) { 468 if (demux->tsbufp) {
465 i = demux->tsbufp; 469 i = demux->tsbufp;
@@ -500,7 +504,7 @@ void dvb_dmx_swfilter_204(struct dvb_demux *demux, const u8 *buf, size_t count)
500 } 504 }
501 505
502bailout: 506bailout:
503 spin_unlock(&demux->lock); 507 spin_unlock_irqrestore(&demux->lock, flags);
504} 508}
505 509
506EXPORT_SYMBOL(dvb_dmx_swfilter_204); 510EXPORT_SYMBOL(dvb_dmx_swfilter_204);
diff --git a/drivers/media/dvb/frontends/s5h1420.c b/drivers/media/dvb/frontends/s5h1420.c
index 747d3fa2e5e5..2e9fd2893ede 100644
--- a/drivers/media/dvb/frontends/s5h1420.c
+++ b/drivers/media/dvb/frontends/s5h1420.c
@@ -59,7 +59,7 @@ struct s5h1420_state {
59 * it does not support repeated-start, workaround: write addr-1 59 * it does not support repeated-start, workaround: write addr-1
60 * and then read 60 * and then read
61 */ 61 */
62 u8 shadow[255]; 62 u8 shadow[256];
63}; 63};
64 64
65static u32 s5h1420_getsymbolrate(struct s5h1420_state* state); 65static u32 s5h1420_getsymbolrate(struct s5h1420_state* state);
@@ -94,8 +94,11 @@ static u8 s5h1420_readreg(struct s5h1420_state *state, u8 reg)
94 if (ret != 3) 94 if (ret != 3)
95 return ret; 95 return ret;
96 } else { 96 } else {
97 ret = i2c_transfer(state->i2c, &msg[1], 2); 97 ret = i2c_transfer(state->i2c, &msg[1], 1);
98 if (ret != 2) 98 if (ret != 1)
99 return ret;
100 ret = i2c_transfer(state->i2c, &msg[2], 1);
101 if (ret != 1)
99 return ret; 102 return ret;
100 } 103 }
101 104
@@ -823,7 +826,7 @@ static int s5h1420_init (struct dvb_frontend* fe)
823 struct s5h1420_state* state = fe->demodulator_priv; 826 struct s5h1420_state* state = fe->demodulator_priv;
824 827
825 /* disable power down and do reset */ 828 /* disable power down and do reset */
826 state->CON_1_val = 0x10; 829 state->CON_1_val = state->config->serial_mpeg << 4;
827 s5h1420_writereg(state, 0x02, state->CON_1_val); 830 s5h1420_writereg(state, 0x02, state->CON_1_val);
828 msleep(10); 831 msleep(10);
829 s5h1420_reset(state); 832 s5h1420_reset(state);
diff --git a/drivers/media/dvb/frontends/s5h1420.h b/drivers/media/dvb/frontends/s5h1420.h
index 4c913f142bc4..ff308136d865 100644
--- a/drivers/media/dvb/frontends/s5h1420.h
+++ b/drivers/media/dvb/frontends/s5h1420.h
@@ -32,10 +32,12 @@ struct s5h1420_config
32 u8 demod_address; 32 u8 demod_address;
33 33
34 /* does the inversion require inversion? */ 34 /* does the inversion require inversion? */
35 u8 invert : 1; 35 u8 invert:1;
36 36
37 u8 repeated_start_workaround : 1; 37 u8 repeated_start_workaround:1;
38 u8 cdclk_polarity : 1; /* 1 == falling edge, 0 == raising edge */ 38 u8 cdclk_polarity:1; /* 1 == falling edge, 0 == raising edge */
39
40 u8 serial_mpeg:1;
39}; 41};
40 42
41#if defined(CONFIG_DVB_S5H1420) || (defined(CONFIG_DVB_S5H1420_MODULE) && defined(MODULE)) 43#if defined(CONFIG_DVB_S5H1420) || (defined(CONFIG_DVB_S5H1420_MODULE) && defined(MODULE))
diff --git a/drivers/media/dvb/siano/sms-cards.c b/drivers/media/dvb/siano/sms-cards.c
index cc5efb643f33..9da260fe3fd1 100644
--- a/drivers/media/dvb/siano/sms-cards.c
+++ b/drivers/media/dvb/siano/sms-cards.c
@@ -40,6 +40,8 @@ struct usb_device_id smsusb_id_table[] = {
40 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B }, 40 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B },
41 { USB_DEVICE(0x2040, 0x5500), 41 { USB_DEVICE(0x2040, 0x5500),
42 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, 42 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
43 { USB_DEVICE(0x2040, 0x5510),
44 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
43 { USB_DEVICE(0x2040, 0x5580), 45 { USB_DEVICE(0x2040, 0x5580),
44 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, 46 .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
45 { USB_DEVICE(0x2040, 0x5590), 47 { USB_DEVICE(0x2040, 0x5590),
@@ -87,7 +89,7 @@ static struct sms_board sms_boards[] = {
87 .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-nova-b-dvbt-01.fw", 89 .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-nova-b-dvbt-01.fw",
88 }, 90 },
89 [SMS1XXX_BOARD_HAUPPAUGE_WINDHAM] = { 91 [SMS1XXX_BOARD_HAUPPAUGE_WINDHAM] = {
90 .name = "Hauppauge WinTV-Nova-T-MiniStick", 92 .name = "Hauppauge WinTV MiniStick",
91 .type = SMS_NOVA_B0, 93 .type = SMS_NOVA_B0,
92 .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-01.fw", 94 .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-01.fw",
93 }, 95 },
diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c
index 6ae4cc860efe..933eaef41ead 100644
--- a/drivers/media/video/bt8xx/bttv-driver.c
+++ b/drivers/media/video/bt8xx/bttv-driver.c
@@ -3431,7 +3431,7 @@ static int radio_open(struct inode *inode, struct file *file)
3431 dprintk("bttv: open minor=%d\n",minor); 3431 dprintk("bttv: open minor=%d\n",minor);
3432 3432
3433 for (i = 0; i < bttv_num; i++) { 3433 for (i = 0; i < bttv_num; i++) {
3434 if (bttvs[i].radio_dev->minor == minor) { 3434 if (bttvs[i].radio_dev && bttvs[i].radio_dev->minor == minor) {
3435 btv = &bttvs[i]; 3435 btv = &bttvs[i];
3436 break; 3436 break;
3437 } 3437 }
diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c
index c149b7d712e5..5405c30dbb04 100644
--- a/drivers/media/video/cafe_ccic.c
+++ b/drivers/media/video/cafe_ccic.c
@@ -19,6 +19,7 @@
19#include <linux/module.h> 19#include <linux/module.h>
20#include <linux/init.h> 20#include <linux/init.h>
21#include <linux/fs.h> 21#include <linux/fs.h>
22#include <linux/mm.h>
22#include <linux/pci.h> 23#include <linux/pci.h>
23#include <linux/i2c.h> 24#include <linux/i2c.h>
24#include <linux/interrupt.h> 25#include <linux/interrupt.h>
diff --git a/drivers/media/video/cpia2/cpia2_usb.c b/drivers/media/video/cpia2/cpia2_usb.c
index a4574740350d..a8a199047cbd 100644
--- a/drivers/media/video/cpia2/cpia2_usb.c
+++ b/drivers/media/video/cpia2/cpia2_usb.c
@@ -632,7 +632,7 @@ int cpia2_usb_transfer_cmd(struct camera_data *cam,
632static int submit_urbs(struct camera_data *cam) 632static int submit_urbs(struct camera_data *cam)
633{ 633{
634 struct urb *urb; 634 struct urb *urb;
635 int fx, err, i; 635 int fx, err, i, j;
636 636
637 for(i=0; i<NUM_SBUF; ++i) { 637 for(i=0; i<NUM_SBUF; ++i) {
638 if (cam->sbuf[i].data) 638 if (cam->sbuf[i].data)
@@ -657,6 +657,9 @@ static int submit_urbs(struct camera_data *cam)
657 } 657 }
658 urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL); 658 urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL);
659 if (!urb) { 659 if (!urb) {
660 ERR("%s: usb_alloc_urb error!\n", __func__);
661 for (j = 0; j < i; j++)
662 usb_free_urb(cam->sbuf[j].urb);
660 return -ENOMEM; 663 return -ENOMEM;
661 } 664 }
662 665
diff --git a/drivers/media/video/cx18/cx18-cards.c b/drivers/media/video/cx18/cx18-cards.c
index 8fe5f38c4d7c..3cb9734ec07b 100644
--- a/drivers/media/video/cx18/cx18-cards.c
+++ b/drivers/media/video/cx18/cx18-cards.c
@@ -163,7 +163,7 @@ static const struct cx18_card cx18_card_h900 = {
163 }, 163 },
164 .audio_inputs = { 164 .audio_inputs = {
165 { CX18_CARD_INPUT_AUD_TUNER, 165 { CX18_CARD_INPUT_AUD_TUNER,
166 CX18_AV_AUDIO8, 0 }, 166 CX18_AV_AUDIO5, 0 },
167 { CX18_CARD_INPUT_LINE_IN1, 167 { CX18_CARD_INPUT_LINE_IN1,
168 CX18_AV_AUDIO_SERIAL1, 0 }, 168 CX18_AV_AUDIO_SERIAL1, 0 },
169 }, 169 },
diff --git a/drivers/media/video/cx88/cx88-blackbird.c b/drivers/media/video/cx88/cx88-blackbird.c
index 9a1374a38ec7..6b922066a660 100644
--- a/drivers/media/video/cx88/cx88-blackbird.c
+++ b/drivers/media/video/cx88/cx88-blackbird.c
@@ -1070,6 +1070,7 @@ static int mpeg_open(struct inode *inode, struct file *file)
1070 err = drv->request_acquire(drv); 1070 err = drv->request_acquire(drv);
1071 if(err != 0) { 1071 if(err != 0) {
1072 dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err); 1072 dprintk(1,"%s: Unable to acquire hardware, %d\n", __func__, err);
1073 unlock_kernel();
1073 return err; 1074 return err;
1074 } 1075 }
1075 } 1076 }
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c
index 3c006103c1eb..ac3292d7646c 100644
--- a/drivers/media/video/em28xx/em28xx-audio.c
+++ b/drivers/media/video/em28xx/em28xx-audio.c
@@ -117,10 +117,10 @@ static void em28xx_audio_isocirq(struct urb *urb)
117 117
118 if (oldptr + length >= runtime->buffer_size) { 118 if (oldptr + length >= runtime->buffer_size) {
119 unsigned int cnt = 119 unsigned int cnt =
120 runtime->buffer_size - oldptr - 1; 120 runtime->buffer_size - oldptr;
121 memcpy(runtime->dma_area + oldptr * stride, cp, 121 memcpy(runtime->dma_area + oldptr * stride, cp,
122 cnt * stride); 122 cnt * stride);
123 memcpy(runtime->dma_area, cp + cnt, 123 memcpy(runtime->dma_area, cp + cnt * stride,
124 length * stride - cnt * stride); 124 length * stride - cnt * stride);
125 } else { 125 } else {
126 memcpy(runtime->dma_area + oldptr * stride, cp, 126 memcpy(runtime->dma_area + oldptr * stride, cp,
@@ -161,8 +161,14 @@ static int em28xx_init_audio_isoc(struct em28xx *dev)
161 161
162 memset(dev->adev->transfer_buffer[i], 0x80, sb_size); 162 memset(dev->adev->transfer_buffer[i], 0x80, sb_size);
163 urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC); 163 urb = usb_alloc_urb(EM28XX_NUM_AUDIO_PACKETS, GFP_ATOMIC);
164 if (!urb) 164 if (!urb) {
165 em28xx_errdev("usb_alloc_urb failed!\n");
166 for (j = 0; j < i; j++) {
167 usb_free_urb(dev->adev->urb[j]);
168 kfree(dev->adev->transfer_buffer[j]);
169 }
165 return -ENOMEM; 170 return -ENOMEM;
171 }
166 172
167 urb->dev = dev->udev; 173 urb->dev = dev->udev;
168 urb->context = dev; 174 urb->context = dev;
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c
index 452da70e719f..de943cf6c169 100644
--- a/drivers/media/video/em28xx/em28xx-cards.c
+++ b/drivers/media/video/em28xx/em28xx-cards.c
@@ -93,28 +93,6 @@ struct em28xx_board em28xx_boards[] = {
93 .amux = 0, 93 .amux = 0,
94 } }, 94 } },
95 }, 95 },
96 [EM2800_BOARD_KWORLD_USB2800] = {
97 .name = "Kworld USB2800",
98 .valid = EM28XX_BOARD_NOT_VALIDATED,
99 .is_em2800 = 1,
100 .vchannels = 3,
101 .tuner_type = TUNER_PHILIPS_FCV1236D,
102 .tda9887_conf = TDA9887_PRESENT,
103 .decoder = EM28XX_SAA7113,
104 .input = { {
105 .type = EM28XX_VMUX_TELEVISION,
106 .vmux = SAA7115_COMPOSITE2,
107 .amux = 0,
108 }, {
109 .type = EM28XX_VMUX_COMPOSITE1,
110 .vmux = SAA7115_COMPOSITE0,
111 .amux = 1,
112 }, {
113 .type = EM28XX_VMUX_SVIDEO,
114 .vmux = SAA7115_SVIDEO3,
115 .amux = 1,
116 } },
117 },
118 [EM2820_BOARD_KWORLD_PVRTV2800RF] = { 96 [EM2820_BOARD_KWORLD_PVRTV2800RF] = {
119 .name = "Kworld PVR TV 2800 RF", 97 .name = "Kworld PVR TV 2800 RF",
120 .is_em2800 = 0, 98 .is_em2800 = 0,
@@ -599,7 +577,7 @@ struct em28xx_board em28xx_boards[] = {
599 }, { 577 }, {
600 .type = EM28XX_VMUX_COMPOSITE1, 578 .type = EM28XX_VMUX_COMPOSITE1,
601 .vmux = TVP5150_COMPOSITE1, 579 .vmux = TVP5150_COMPOSITE1,
602 .amux = 1, 580 .amux = 3,
603 }, { 581 }, {
604 .type = EM28XX_VMUX_SVIDEO, 582 .type = EM28XX_VMUX_SVIDEO,
605 .vmux = TVP5150_SVIDEO, 583 .vmux = TVP5150_SVIDEO,
@@ -952,22 +930,23 @@ struct em28xx_board em28xx_boards[] = {
952 }, 930 },
953 [EM2880_BOARD_KWORLD_DVB_310U] = { 931 [EM2880_BOARD_KWORLD_DVB_310U] = {
954 .name = "KWorld DVB-T 310U", 932 .name = "KWorld DVB-T 310U",
955 .valid = EM28XX_BOARD_NOT_VALIDATED,
956 .vchannels = 3, 933 .vchannels = 3,
957 .tuner_type = TUNER_XC2028, 934 .tuner_type = TUNER_XC2028,
935 .has_dvb = 1,
936 .mts_firmware = 1,
958 .decoder = EM28XX_TVP5150, 937 .decoder = EM28XX_TVP5150,
959 .input = { { 938 .input = { {
960 .type = EM28XX_VMUX_TELEVISION, 939 .type = EM28XX_VMUX_TELEVISION,
961 .vmux = TVP5150_COMPOSITE0, 940 .vmux = TVP5150_COMPOSITE0,
962 .amux = 0, 941 .amux = EM28XX_AMUX_VIDEO,
963 }, { 942 }, {
964 .type = EM28XX_VMUX_COMPOSITE1, 943 .type = EM28XX_VMUX_COMPOSITE1,
965 .vmux = TVP5150_COMPOSITE1, 944 .vmux = TVP5150_COMPOSITE1,
966 .amux = 1, 945 .amux = EM28XX_AMUX_AC97_LINE_IN,
967 }, { 946 }, { /* S-video has not been tested yet */
968 .type = EM28XX_VMUX_SVIDEO, 947 .type = EM28XX_VMUX_SVIDEO,
969 .vmux = TVP5150_SVIDEO, 948 .vmux = TVP5150_SVIDEO,
970 .amux = 1, 949 .amux = EM28XX_AMUX_AC97_LINE_IN,
971 } }, 950 } },
972 }, 951 },
973 [EM2881_BOARD_DNT_DA2_HYBRID] = { 952 [EM2881_BOARD_DNT_DA2_HYBRID] = {
@@ -1282,6 +1261,7 @@ static struct em28xx_reg_seq em2882_terratec_hybrid_xs_digital[] = {
1282static struct em28xx_hash_table em28xx_eeprom_hash [] = { 1261static struct em28xx_hash_table em28xx_eeprom_hash [] = {
1283 /* P/N: SA 60002070465 Tuner: TVF7533-MF */ 1262 /* P/N: SA 60002070465 Tuner: TVF7533-MF */
1284 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, 1263 {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF},
1264 {0x966a0441, EM2880_BOARD_KWORLD_DVB_310U, TUNER_XC2028},
1285}; 1265};
1286 1266
1287/* I2C devicelist hash table for devices with generic USB IDs */ 1267/* I2C devicelist hash table for devices with generic USB IDs */
@@ -1552,9 +1532,12 @@ static void em28xx_setup_xc3028(struct em28xx *dev, struct xc2028_ctrl *ctl)
1552 /* djh - Not sure which demod we need here */ 1532 /* djh - Not sure which demod we need here */
1553 ctl->demod = XC3028_FE_DEFAULT; 1533 ctl->demod = XC3028_FE_DEFAULT;
1554 break; 1534 break;
1535 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
1536 ctl->demod = XC3028_FE_DEFAULT;
1537 ctl->fname = XC3028L_DEFAULT_FIRMWARE;
1538 break;
1555 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950: 1539 case EM2883_BOARD_HAUPPAUGE_WINTV_HVR_950:
1556 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO: 1540 case EM2880_BOARD_PINNACLE_PCTV_HD_PRO:
1557 case EM2880_BOARD_AMD_ATI_TV_WONDER_HD_600:
1558 /* FIXME: Better to specify the needed IF */ 1541 /* FIXME: Better to specify the needed IF */
1559 ctl->demod = XC3028_FE_DEFAULT; 1542 ctl->demod = XC3028_FE_DEFAULT;
1560 break; 1543 break;
@@ -1764,6 +1747,20 @@ void em28xx_card_setup(struct em28xx *dev)
1764 break; 1747 break;
1765 case EM2820_BOARD_UNKNOWN: 1748 case EM2820_BOARD_UNKNOWN:
1766 case EM2800_BOARD_UNKNOWN: 1749 case EM2800_BOARD_UNKNOWN:
1750 /*
1751 * The K-WORLD DVB-T 310U is detected as an MSI Digivox AD.
1752 *
1753 * This occurs because they share identical USB vendor and
1754 * product IDs.
1755 *
1756 * What we do here is look up the EEPROM hash of the K-WORLD
1757 * and if it is found then we decide that we do not have
1758 * a DIGIVOX and reset the device to the K-WORLD instead.
1759 *
1760 * This solution is only valid if they do not share eeprom
1761 * hash identities which has not been determined as yet.
1762 */
1763 case EM2880_BOARD_MSI_DIGIVOX_AD:
1767 if (!em28xx_hint_board(dev)) 1764 if (!em28xx_hint_board(dev))
1768 em28xx_set_model(dev); 1765 em28xx_set_model(dev);
1769 break; 1766 break;
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index 4b992bc0083c..d2b1a1a52689 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -452,6 +452,15 @@ static int dvb_init(struct em28xx *dev)
452 goto out_free; 452 goto out_free;
453 } 453 }
454 break; 454 break;
455 case EM2880_BOARD_KWORLD_DVB_310U:
456 dvb->frontend = dvb_attach(zl10353_attach,
457 &em28xx_zl10353_with_xc3028,
458 &dev->i2c_adap);
459 if (attach_xc3028(0x61, dev) < 0) {
460 result = -EINVAL;
461 goto out_free;
462 }
463 break;
455 default: 464 default:
456 printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card" 465 printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card"
457 " isn't supported yet\n", 466 " isn't supported yet\n",
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 7be69284da03..ac95c55887df 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -459,6 +459,7 @@ static int create_urbs(struct gspca_dev *gspca_dev,
459 urb = usb_alloc_urb(npkt, GFP_KERNEL); 459 urb = usb_alloc_urb(npkt, GFP_KERNEL);
460 if (!urb) { 460 if (!urb) {
461 err("usb_alloc_urb failed"); 461 err("usb_alloc_urb failed");
462 destroy_urbs(gspca_dev);
462 return -ENOMEM; 463 return -ENOMEM;
463 } 464 }
464 urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev, 465 urb->transfer_buffer = usb_buffer_alloc(gspca_dev->dev,
@@ -468,8 +469,8 @@ static int create_urbs(struct gspca_dev *gspca_dev,
468 469
469 if (urb->transfer_buffer == NULL) { 470 if (urb->transfer_buffer == NULL) {
470 usb_free_urb(urb); 471 usb_free_urb(urb);
471 destroy_urbs(gspca_dev);
472 err("usb_buffer_urb failed"); 472 err("usb_buffer_urb failed");
473 destroy_urbs(gspca_dev);
473 return -ENOMEM; 474 return -ENOMEM;
474 } 475 }
475 gspca_dev->urb[n] = urb; 476 gspca_dev->urb[n] = urb;
diff --git a/drivers/media/video/gspca/pac7311.c b/drivers/media/video/gspca/pac7311.c
index d4be51843286..ba865b7f1ed8 100644
--- a/drivers/media/video/gspca/pac7311.c
+++ b/drivers/media/video/gspca/pac7311.c
@@ -1063,6 +1063,7 @@ static __devinitdata struct usb_device_id device_table[] = {
1063 {USB_DEVICE(0x093a, 0x2621), .driver_info = SENSOR_PAC7302}, 1063 {USB_DEVICE(0x093a, 0x2621), .driver_info = SENSOR_PAC7302},
1064 {USB_DEVICE(0x093a, 0x2624), .driver_info = SENSOR_PAC7302}, 1064 {USB_DEVICE(0x093a, 0x2624), .driver_info = SENSOR_PAC7302},
1065 {USB_DEVICE(0x093a, 0x2626), .driver_info = SENSOR_PAC7302}, 1065 {USB_DEVICE(0x093a, 0x2626), .driver_info = SENSOR_PAC7302},
1066 {USB_DEVICE(0x093a, 0x262a), .driver_info = SENSOR_PAC7302},
1066 {} 1067 {}
1067}; 1068};
1068MODULE_DEVICE_TABLE(usb, device_table); 1069MODULE_DEVICE_TABLE(usb, device_table);
diff --git a/drivers/media/video/gspca/sonixb.c b/drivers/media/video/gspca/sonixb.c
index 5dd78c6766ea..12b81ae526b7 100644
--- a/drivers/media/video/gspca/sonixb.c
+++ b/drivers/media/video/gspca/sonixb.c
@@ -232,7 +232,7 @@ static struct ctrl sd_ctrls[] = {
232static struct v4l2_pix_format vga_mode[] = { 232static struct v4l2_pix_format vga_mode[] = {
233 {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE, 233 {160, 120, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
234 .bytesperline = 160, 234 .bytesperline = 160,
235 .sizeimage = 160 * 120 * 5 / 4, 235 .sizeimage = 160 * 120,
236 .colorspace = V4L2_COLORSPACE_SRGB, 236 .colorspace = V4L2_COLORSPACE_SRGB,
237 .priv = 2 | MODE_RAW}, 237 .priv = 2 | MODE_RAW},
238 {160, 120, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, 238 {160, 120, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE,
@@ -264,7 +264,7 @@ static struct v4l2_pix_format sif_mode[] = {
264 .priv = 1 | MODE_REDUCED_SIF}, 264 .priv = 1 | MODE_REDUCED_SIF},
265 {176, 144, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE, 265 {176, 144, V4L2_PIX_FMT_SBGGR8, V4L2_FIELD_NONE,
266 .bytesperline = 176, 266 .bytesperline = 176,
267 .sizeimage = 176 * 144 * 5 / 4, 267 .sizeimage = 176 * 144,
268 .colorspace = V4L2_COLORSPACE_SRGB, 268 .colorspace = V4L2_COLORSPACE_SRGB,
269 .priv = 1 | MODE_RAW}, 269 .priv = 1 | MODE_RAW},
270 {176, 144, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE, 270 {176, 144, V4L2_PIX_FMT_SN9C10X, V4L2_FIELD_NONE,
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index d75b1d20b318..572b0f363b64 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -707,6 +707,7 @@ static void i2c_w8(struct gspca_dev *gspca_dev,
707 0x08, 0, /* value, index */ 707 0x08, 0, /* value, index */
708 gspca_dev->usb_buf, 8, 708 gspca_dev->usb_buf, 8,
709 500); 709 500);
710 msleep(2);
710} 711}
711 712
712/* read 5 bytes in gspca_dev->usb_buf */ 713/* read 5 bytes in gspca_dev->usb_buf */
@@ -976,13 +977,13 @@ static int sd_init(struct gspca_dev *gspca_dev)
976 case BRIDGE_SN9C105: 977 case BRIDGE_SN9C105:
977 if (regF1 != 0x11) 978 if (regF1 != 0x11)
978 return -ENODEV; 979 return -ENODEV;
979 reg_w(gspca_dev, 0x02, regGpio, 2); 980 reg_w(gspca_dev, 0x01, regGpio, 2);
980 break; 981 break;
981 case BRIDGE_SN9C120: 982 case BRIDGE_SN9C120:
982 if (regF1 != 0x12) 983 if (regF1 != 0x12)
983 return -ENODEV; 984 return -ENODEV;
984 regGpio[1] = 0x70; 985 regGpio[1] = 0x70;
985 reg_w(gspca_dev, 0x02, regGpio, 2); 986 reg_w(gspca_dev, 0x01, regGpio, 2);
986 break; 987 break;
987 default: 988 default:
988/* case BRIDGE_SN9C110: */ 989/* case BRIDGE_SN9C110: */
@@ -1183,7 +1184,7 @@ static void sd_start(struct gspca_dev *gspca_dev)
1183 static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec }; 1184 static const __u8 CA[] = { 0x28, 0xd8, 0x14, 0xec };
1184 static const __u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */ 1185 static const __u8 CE[] = { 0x32, 0xdd, 0x2d, 0xdd }; /* MI0360 */
1185 static const __u8 CE_ov76xx[] = 1186 static const __u8 CE_ov76xx[] =
1186 { 0x32, 0xdd, 0x32, 0xdd }; /* OV7630/48 */ 1187 { 0x32, 0xdd, 0x32, 0xdd };
1187 1188
1188 sn9c1xx = sn_tb[(int) sd->sensor]; 1189 sn9c1xx = sn_tb[(int) sd->sensor];
1189 configure_gpio(gspca_dev, sn9c1xx); 1190 configure_gpio(gspca_dev, sn9c1xx);
@@ -1223,8 +1224,15 @@ static void sd_start(struct gspca_dev *gspca_dev)
1223 reg_w(gspca_dev, 0x20, gamma_def, sizeof gamma_def); 1224 reg_w(gspca_dev, 0x20, gamma_def, sizeof gamma_def);
1224 for (i = 0; i < 8; i++) 1225 for (i = 0; i < 8; i++)
1225 reg_w(gspca_dev, 0x84, reg84, sizeof reg84); 1226 reg_w(gspca_dev, 0x84, reg84, sizeof reg84);
1227 switch (sd->sensor) {
1228 case SENSOR_OV7660:
1229 reg_w1(gspca_dev, 0x9a, 0x05);
1230 break;
1231 default:
1226 reg_w1(gspca_dev, 0x9a, 0x08); 1232 reg_w1(gspca_dev, 0x9a, 0x08);
1227 reg_w1(gspca_dev, 0x99, 0x59); 1233 reg_w1(gspca_dev, 0x99, 0x59);
1234 break;
1235 }
1228 1236
1229 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv; 1237 mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mode].priv;
1230 if (mode) 1238 if (mode)
@@ -1275,8 +1283,8 @@ static void sd_start(struct gspca_dev *gspca_dev)
1275/* reg1 = 0x44; */ 1283/* reg1 = 0x44; */
1276/* reg1 = 0x46; (done) */ 1284/* reg1 = 0x46; (done) */
1277 } else { 1285 } else {
1278 reg17 = 0x22; /* 640 MCKSIZE */ 1286 reg17 = 0xa2; /* 640 */
1279 reg1 = 0x06; 1287 reg1 = 0x44;
1280 } 1288 }
1281 break; 1289 break;
1282 } 1290 }
@@ -1285,6 +1293,7 @@ static void sd_start(struct gspca_dev *gspca_dev)
1285 switch (sd->sensor) { 1293 switch (sd->sensor) {
1286 case SENSOR_OV7630: 1294 case SENSOR_OV7630:
1287 case SENSOR_OV7648: 1295 case SENSOR_OV7648:
1296 case SENSOR_OV7660:
1288 reg_w(gspca_dev, 0xce, CE_ov76xx, 4); 1297 reg_w(gspca_dev, 0xce, CE_ov76xx, 4);
1289 break; 1298 break;
1290 default: 1299 default:
diff --git a/drivers/media/video/gspca/spca561.c b/drivers/media/video/gspca/spca561.c
index cfbc9ebc5c5d..95fcfcb9e31b 100644
--- a/drivers/media/video/gspca/spca561.c
+++ b/drivers/media/video/gspca/spca561.c
@@ -225,7 +225,7 @@ static int i2c_read(struct gspca_dev *gspca_dev, __u16 reg, __u8 mode)
225 reg_w_val(gspca_dev->dev, 0x8802, (mode | 0x01)); 225 reg_w_val(gspca_dev->dev, 0x8802, (mode | 0x01));
226 do { 226 do {
227 reg_r(gspca_dev, 0x8803, 1); 227 reg_r(gspca_dev, 0x8803, 1);
228 if (!gspca_dev->usb_buf) 228 if (!gspca_dev->usb_buf[0])
229 break; 229 break;
230 } while (--retry); 230 } while (--retry);
231 if (retry == 0) 231 if (retry == 0)
diff --git a/drivers/media/video/gspca/zc3xx.c b/drivers/media/video/gspca/zc3xx.c
index 8d7c27e6ac77..d61ef727e0c2 100644
--- a/drivers/media/video/gspca/zc3xx.c
+++ b/drivers/media/video/gspca/zc3xx.c
@@ -6576,8 +6576,8 @@ static int setlightfreq(struct gspca_dev *gspca_dev)
6576 cs2102_60HZ, cs2102_60HZScale}, 6576 cs2102_60HZ, cs2102_60HZScale},
6577/* SENSOR_CS2102K 1 */ 6577/* SENSOR_CS2102K 1 */
6578 {cs2102_NoFliker, cs2102_NoFlikerScale, 6578 {cs2102_NoFliker, cs2102_NoFlikerScale,
6579 cs2102_50HZ, cs2102_50HZScale, 6579 NULL, NULL, /* currently disabled */
6580 cs2102_60HZ, cs2102_60HZScale}, 6580 NULL, NULL},
6581/* SENSOR_GC0305 2 */ 6581/* SENSOR_GC0305 2 */
6582 {gc0305_NoFliker, gc0305_NoFliker, 6582 {gc0305_NoFliker, gc0305_NoFliker,
6583 gc0305_50HZ, gc0305_50HZ, 6583 gc0305_50HZ, gc0305_50HZ,
diff --git a/drivers/media/video/ov511.c b/drivers/media/video/ov511.c
index 3d3c48db45d9..c6852402c5e9 100644
--- a/drivers/media/video/ov511.c
+++ b/drivers/media/video/ov511.c
@@ -3591,7 +3591,7 @@ static int
3591ov51x_init_isoc(struct usb_ov511 *ov) 3591ov51x_init_isoc(struct usb_ov511 *ov)
3592{ 3592{
3593 struct urb *urb; 3593 struct urb *urb;
3594 int fx, err, n, size; 3594 int fx, err, n, i, size;
3595 3595
3596 PDEBUG(3, "*** Initializing capture ***"); 3596 PDEBUG(3, "*** Initializing capture ***");
3597 3597
@@ -3662,6 +3662,8 @@ ov51x_init_isoc(struct usb_ov511 *ov)
3662 urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL); 3662 urb = usb_alloc_urb(FRAMES_PER_DESC, GFP_KERNEL);
3663 if (!urb) { 3663 if (!urb) {
3664 err("init isoc: usb_alloc_urb ret. NULL"); 3664 err("init isoc: usb_alloc_urb ret. NULL");
3665 for (i = 0; i < n; i++)
3666 usb_free_urb(ov->sbuf[i].urb);
3665 return -ENOMEM; 3667 return -ENOMEM;
3666 } 3668 }
3667 ov->sbuf[n].urb = urb; 3669 ov->sbuf[n].urb = urb;
@@ -5651,7 +5653,7 @@ static ssize_t show_exposure(struct device *cd,
5651 if (!ov->dev) 5653 if (!ov->dev)
5652 return -ENODEV; 5654 return -ENODEV;
5653 sensor_get_exposure(ov, &exp); 5655 sensor_get_exposure(ov, &exp);
5654 return sprintf(buf, "%d\n", exp >> 8); 5656 return sprintf(buf, "%d\n", exp);
5655} 5657}
5656static DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL); 5658static DEVICE_ATTR(exposure, S_IRUGO, show_exposure, NULL);
5657 5659
diff --git a/drivers/media/video/pvrusb2/pvrusb2-devattr.c b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
index 88e175168438..cbe2a3417851 100644
--- a/drivers/media/video/pvrusb2/pvrusb2-devattr.c
+++ b/drivers/media/video/pvrusb2/pvrusb2-devattr.c
@@ -489,6 +489,8 @@ static const struct pvr2_device_desc pvr2_device_751xx = {
489struct usb_device_id pvr2_device_table[] = { 489struct usb_device_id pvr2_device_table[] = {
490 { USB_DEVICE(0x2040, 0x2900), 490 { USB_DEVICE(0x2040, 0x2900),
491 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx}, 491 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
492 { USB_DEVICE(0x2040, 0x2950), /* Logically identical to 2900 */
493 .driver_info = (kernel_ulong_t)&pvr2_device_29xxx},
492 { USB_DEVICE(0x2040, 0x2400), 494 { USB_DEVICE(0x2040, 0x2400),
493 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx}, 495 .driver_info = (kernel_ulong_t)&pvr2_device_24xxx},
494 { USB_DEVICE(0x1164, 0x0622), 496 { USB_DEVICE(0x1164, 0x0622),
diff --git a/drivers/media/video/s2255drv.c b/drivers/media/video/s2255drv.c
index b1d09d8e2b85..92b83feae366 100644
--- a/drivers/media/video/s2255drv.c
+++ b/drivers/media/video/s2255drv.c
@@ -669,7 +669,7 @@ static void s2255_fillbuff(struct s2255_dev *dev, struct s2255_buffer *buf,
669 (unsigned long)vbuf, pos); 669 (unsigned long)vbuf, pos);
670 /* tell v4l buffer was filled */ 670 /* tell v4l buffer was filled */
671 671
672 buf->vb.field_count++; 672 buf->vb.field_count = dev->frame_count[chn] * 2;
673 do_gettimeofday(&ts); 673 do_gettimeofday(&ts);
674 buf->vb.ts = ts; 674 buf->vb.ts = ts;
675 buf->vb.state = VIDEOBUF_DONE; 675 buf->vb.state = VIDEOBUF_DONE;
@@ -1268,6 +1268,7 @@ static int vidioc_streamon(struct file *file, void *priv, enum v4l2_buf_type i)
1268 dev->last_frame[chn] = -1; 1268 dev->last_frame[chn] = -1;
1269 dev->bad_payload[chn] = 0; 1269 dev->bad_payload[chn] = 0;
1270 dev->cur_frame[chn] = 0; 1270 dev->cur_frame[chn] = 0;
1271 dev->frame_count[chn] = 0;
1271 for (j = 0; j < SYS_FRAMES; j++) { 1272 for (j = 0; j < SYS_FRAMES; j++) {
1272 dev->buffer[chn].frame[j].ulState = 0; 1273 dev->buffer[chn].frame[j].ulState = 0;
1273 dev->buffer[chn].frame[j].cur_size = 0; 1274 dev->buffer[chn].frame[j].cur_size = 0;
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
index 6ef3e5297de8..feab12aa2c7b 100644
--- a/drivers/media/video/uvc/uvc_ctrl.c
+++ b/drivers/media/video/uvc/uvc_ctrl.c
@@ -592,7 +592,7 @@ int uvc_query_v4l2_ctrl(struct uvc_video_device *video,
592 if (ctrl == NULL) 592 if (ctrl == NULL)
593 return -EINVAL; 593 return -EINVAL;
594 594
595 data = kmalloc(8, GFP_KERNEL); 595 data = kmalloc(ctrl->info->size, GFP_KERNEL);
596 if (data == NULL) 596 if (data == NULL)
597 return -ENOMEM; 597 return -ENOMEM;
598 598
diff --git a/drivers/media/video/w9968cf.c b/drivers/media/video/w9968cf.c
index 168baabe4659..11edf79f57be 100644
--- a/drivers/media/video/w9968cf.c
+++ b/drivers/media/video/w9968cf.c
@@ -911,7 +911,6 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)
911 911
912 for (i = 0; i < W9968CF_URBS; i++) { 912 for (i = 0; i < W9968CF_URBS; i++) {
913 urb = usb_alloc_urb(W9968CF_ISO_PACKETS, GFP_KERNEL); 913 urb = usb_alloc_urb(W9968CF_ISO_PACKETS, GFP_KERNEL);
914 cam->urb[i] = urb;
915 if (!urb) { 914 if (!urb) {
916 for (j = 0; j < i; j++) 915 for (j = 0; j < i; j++)
917 usb_free_urb(cam->urb[j]); 916 usb_free_urb(cam->urb[j]);
@@ -919,6 +918,7 @@ static int w9968cf_start_transfer(struct w9968cf_device* cam)
919 return -ENOMEM; 918 return -ENOMEM;
920 } 919 }
921 920
921 cam->urb[i] = urb;
922 urb->dev = udev; 922 urb->dev = udev;
923 urb->context = (void*)cam; 923 urb->context = (void*)cam;
924 urb->pipe = usb_rcvisocpipe(udev, 1); 924 urb->pipe = usb_rcvisocpipe(udev, 1);
diff --git a/drivers/media/video/wm8739.c b/drivers/media/video/wm8739.c
index 95c79ad80487..54ac3fe26ec2 100644
--- a/drivers/media/video/wm8739.c
+++ b/drivers/media/video/wm8739.c
@@ -274,10 +274,8 @@ static int wm8739_probe(struct i2c_client *client,
274 client->addr << 1, client->adapter->name); 274 client->addr << 1, client->adapter->name);
275 275
276 state = kmalloc(sizeof(struct wm8739_state), GFP_KERNEL); 276 state = kmalloc(sizeof(struct wm8739_state), GFP_KERNEL);
277 if (state == NULL) { 277 if (state == NULL)
278 kfree(client);
279 return -ENOMEM; 278 return -ENOMEM;
280 }
281 state->vol_l = 0x17; /* 0dB */ 279 state->vol_l = 0x17; /* 0dB */
282 state->vol_r = 0x17; /* 0dB */ 280 state->vol_r = 0x17; /* 0dB */
283 state->muted = 0; 281 state->muted = 0;
diff --git a/drivers/media/video/zoran_card.c b/drivers/media/video/zoran_card.c
index d842a7cb99d2..3282be730298 100644
--- a/drivers/media/video/zoran_card.c
+++ b/drivers/media/video/zoran_card.c
@@ -988,7 +988,7 @@ zoran_open_init_params (struct zoran *zr)
988 zr->v4l_grab_seq = 0; 988 zr->v4l_grab_seq = 0;
989 zr->v4l_settings.width = 192; 989 zr->v4l_settings.width = 192;
990 zr->v4l_settings.height = 144; 990 zr->v4l_settings.height = 144;
991 zr->v4l_settings.format = &zoran_formats[4]; /* YUY2 - YUV-4:2:2 packed */ 991 zr->v4l_settings.format = &zoran_formats[7]; /* YUY2 - YUV-4:2:2 packed */
992 zr->v4l_settings.bytesperline = 992 zr->v4l_settings.bytesperline =
993 zr->v4l_settings.width * 993 zr->v4l_settings.width *
994 ((zr->v4l_settings.format->depth + 7) / 8); 994 ((zr->v4l_settings.format->depth + 7) / 8);
diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c
index ec6f59674b10..2dab9eea4def 100644
--- a/drivers/media/video/zoran_driver.c
+++ b/drivers/media/video/zoran_driver.c
@@ -134,7 +134,7 @@ const struct zoran_format zoran_formats[] = {
134 }, { 134 }, {
135 .name = "16-bit RGB BE", 135 .name = "16-bit RGB BE",
136 ZFMT(-1, 136 ZFMT(-1,
137 V4L2_PIX_FMT_RGB565, V4L2_COLORSPACE_SRGB), 137 V4L2_PIX_FMT_RGB565X, V4L2_COLORSPACE_SRGB),
138 .depth = 16, 138 .depth = 16,
139 .flags = ZORAN_FORMAT_CAPTURE | 139 .flags = ZORAN_FORMAT_CAPTURE |
140 ZORAN_FORMAT_OVERLAY, 140 ZORAN_FORMAT_OVERLAY,
@@ -2737,7 +2737,8 @@ zoran_do_ioctl (struct inode *inode,
2737 fh->v4l_settings.format->fourcc; 2737 fh->v4l_settings.format->fourcc;
2738 fmt->fmt.pix.colorspace = 2738 fmt->fmt.pix.colorspace =
2739 fh->v4l_settings.format->colorspace; 2739 fh->v4l_settings.format->colorspace;
2740 fmt->fmt.pix.bytesperline = 0; 2740 fmt->fmt.pix.bytesperline =
2741 fh->v4l_settings.bytesperline;
2741 if (BUZ_MAX_HEIGHT < 2742 if (BUZ_MAX_HEIGHT <
2742 (fh->v4l_settings.height * 2)) 2743 (fh->v4l_settings.height * 2))
2743 fmt->fmt.pix.field = 2744 fmt->fmt.pix.field =
@@ -2833,13 +2834,6 @@ zoran_do_ioctl (struct inode *inode,
2833 fmt->fmt.pix.pixelformat, 2834 fmt->fmt.pix.pixelformat,
2834 (char *) &printformat); 2835 (char *) &printformat);
2835 2836
2836 if (fmt->fmt.pix.bytesperline > 0) {
2837 dprintk(5,
2838 KERN_ERR "%s: bpl not supported\n",
2839 ZR_DEVNAME(zr));
2840 return -EINVAL;
2841 }
2842
2843 /* we can be requested to do JPEG/raw playback/capture */ 2837 /* we can be requested to do JPEG/raw playback/capture */
2844 if (! 2838 if (!
2845 (fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE || 2839 (fmt->type == V4L2_BUF_TYPE_VIDEO_CAPTURE ||
@@ -2923,6 +2917,7 @@ zoran_do_ioctl (struct inode *inode,
2923 fh->jpg_buffers.buffer_size = 2917 fh->jpg_buffers.buffer_size =
2924 zoran_v4l2_calc_bufsize(&fh-> 2918 zoran_v4l2_calc_bufsize(&fh->
2925 jpg_settings); 2919 jpg_settings);
2920 fmt->fmt.pix.bytesperline = 0;
2926 fmt->fmt.pix.sizeimage = 2921 fmt->fmt.pix.sizeimage =
2927 fh->jpg_buffers.buffer_size; 2922 fh->jpg_buffers.buffer_size;
2928 2923
@@ -2979,6 +2974,8 @@ zoran_do_ioctl (struct inode *inode,
2979 2974
2980 /* tell the user the 2975 /* tell the user the
2981 * results/missing stuff */ 2976 * results/missing stuff */
2977 fmt->fmt.pix.bytesperline =
2978 fh->v4l_settings.bytesperline;
2982 fmt->fmt.pix.sizeimage = 2979 fmt->fmt.pix.sizeimage =
2983 fh->v4l_settings.height * 2980 fh->v4l_settings.height *
2984 fh->v4l_settings.bytesperline; 2981 fh->v4l_settings.bytesperline;