diff options
author | Nicola Soranzo <nsoranzo@tiscali.it> | 2009-02-10 21:28:24 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:45 -0400 |
commit | a1a6ee74f2c68918f2e145dccba3637eea91a52a (patch) | |
tree | bd30e007e8903b469c785bf531527986faa6fa66 /drivers/media/video/em28xx | |
parent | 7aa0eabde08259c47586df934921c67cff36e7dc (diff) |
V4L/DVB (10525): em28xx: Coding style fixes and a typo correction
Lots of coding style fixes and a typo correction for em28xx.
[dougsland@redhat.com: fixed a reject due to a change on em28xx-audio.c]
Signed-off-by: Nicola Soranzo <nsoranzo@tiscali.it>
Signed-off-by: Douglas Schilling Landgraf <dougsland@redhat.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r-- | drivers/media/video/em28xx/em28xx-audio.c | 5 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-cards.c | 24 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-core.c | 19 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-i2c.c | 6 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 43 | ||||
-rw-r--r-- | drivers/media/video/em28xx/em28xx.h | 6 |
6 files changed, 58 insertions, 45 deletions
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index abbf9ee0d39a..6296697d025f 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
@@ -245,7 +245,7 @@ static int snd_pcm_alloc_vmalloc_buffer(struct snd_pcm_substream *subs, | |||
245 | { | 245 | { |
246 | struct snd_pcm_runtime *runtime = subs->runtime; | 246 | struct snd_pcm_runtime *runtime = subs->runtime; |
247 | 247 | ||
248 | dprintk("Alocating vbuffer\n"); | 248 | dprintk("Allocating vbuffer\n"); |
249 | if (runtime->dma_area) { | 249 | if (runtime->dma_area) { |
250 | if (runtime->dma_bytes > size) | 250 | if (runtime->dma_bytes > size) |
251 | return 0; | 251 | return 0; |
@@ -409,8 +409,7 @@ static int snd_em28xx_capture_trigger(struct snd_pcm_substream *substream, | |||
409 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream | 409 | static snd_pcm_uframes_t snd_em28xx_capture_pointer(struct snd_pcm_substream |
410 | *substream) | 410 | *substream) |
411 | { | 411 | { |
412 | unsigned long flags; | 412 | unsigned long flags; |
413 | |||
414 | struct em28xx *dev; | 413 | struct em28xx *dev; |
415 | snd_pcm_uframes_t hwptr_done; | 414 | snd_pcm_uframes_t hwptr_done; |
416 | 415 | ||
diff --git a/drivers/media/video/em28xx/em28xx-cards.c b/drivers/media/video/em28xx/em28xx-cards.c index 89a8f2657b13..419304d31256 100644 --- a/drivers/media/video/em28xx/em28xx-cards.c +++ b/drivers/media/video/em28xx/em28xx-cards.c | |||
@@ -244,7 +244,7 @@ struct em28xx_board em28xx_boards[] = { | |||
244 | .name = "Hauppauge WinTV USB 2", | 244 | .name = "Hauppauge WinTV USB 2", |
245 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, | 245 | .tuner_type = TUNER_PHILIPS_FM1236_MK3, |
246 | .tda9887_conf = TDA9887_PRESENT | | 246 | .tda9887_conf = TDA9887_PRESENT | |
247 | TDA9887_PORT1_ACTIVE| | 247 | TDA9887_PORT1_ACTIVE | |
248 | TDA9887_PORT2_ACTIVE, | 248 | TDA9887_PORT2_ACTIVE, |
249 | .decoder = EM28XX_TVP5150, | 249 | .decoder = EM28XX_TVP5150, |
250 | .has_msp34xx = 1, | 250 | .has_msp34xx = 1, |
@@ -517,7 +517,7 @@ struct em28xx_board em28xx_boards[] = { | |||
517 | }, | 517 | }, |
518 | [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = { | 518 | [EM2861_BOARD_YAKUMO_MOVIE_MIXER] = { |
519 | .name = "Yakumo MovieMixer", | 519 | .name = "Yakumo MovieMixer", |
520 | .tuner_type = TUNER_ABSENT, /* Capture only device */ | 520 | .tuner_type = TUNER_ABSENT, /* Capture only device */ |
521 | .decoder = EM28XX_TVP5150, | 521 | .decoder = EM28XX_TVP5150, |
522 | .input = { { | 522 | .input = { { |
523 | .type = EM28XX_VMUX_TELEVISION, | 523 | .type = EM28XX_VMUX_TELEVISION, |
@@ -861,11 +861,11 @@ struct em28xx_board em28xx_boards[] = { | |||
861 | } }, | 861 | } }, |
862 | }, | 862 | }, |
863 | [EM2800_BOARD_GRABBEEX_USB2800] = { | 863 | [EM2800_BOARD_GRABBEEX_USB2800] = { |
864 | .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder", | 864 | .name = "eMPIA Technology, Inc. GrabBeeX+ Video Encoder", |
865 | .is_em2800 = 1, | 865 | .is_em2800 = 1, |
866 | .decoder = EM28XX_SAA711X, | 866 | .decoder = EM28XX_SAA711X, |
867 | .tuner_type = TUNER_ABSENT, /* capture only board */ | 867 | .tuner_type = TUNER_ABSENT, /* capture only board */ |
868 | .input = { { | 868 | .input = { { |
869 | .type = EM28XX_VMUX_COMPOSITE1, | 869 | .type = EM28XX_VMUX_COMPOSITE1, |
870 | .vmux = SAA7115_COMPOSITE0, | 870 | .vmux = SAA7115_COMPOSITE0, |
871 | .amux = EM28XX_AMUX_LINE_IN, | 871 | .amux = EM28XX_AMUX_LINE_IN, |
@@ -1217,7 +1217,9 @@ struct em28xx_board em28xx_boards[] = { | |||
1217 | .has_dvb = 1, | 1217 | .has_dvb = 1, |
1218 | .dvb_gpio = kworld_330u_digital, | 1218 | .dvb_gpio = kworld_330u_digital, |
1219 | .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, | 1219 | .xclk = EM28XX_XCLK_FREQUENCY_12MHZ, |
1220 | .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | EM28XX_I2C_EEPROM_ON_BOARD | EM28XX_I2C_EEPROM_KEY_VALID, | 1220 | .i2c_speed = EM28XX_I2C_CLK_WAIT_ENABLE | |
1221 | EM28XX_I2C_EEPROM_ON_BOARD | | ||
1222 | EM28XX_I2C_EEPROM_KEY_VALID, | ||
1221 | .input = { { | 1223 | .input = { { |
1222 | .type = EM28XX_VMUX_TELEVISION, | 1224 | .type = EM28XX_VMUX_TELEVISION, |
1223 | .vmux = TVP5150_COMPOSITE0, | 1225 | .vmux = TVP5150_COMPOSITE0, |
@@ -1299,7 +1301,7 @@ struct em28xx_board em28xx_boards[] = { | |||
1299 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); | 1301 | const unsigned int em28xx_bcount = ARRAY_SIZE(em28xx_boards); |
1300 | 1302 | ||
1301 | /* table of devices that work with this driver */ | 1303 | /* table of devices that work with this driver */ |
1302 | struct usb_device_id em28xx_id_table [] = { | 1304 | struct usb_device_id em28xx_id_table[] = { |
1303 | { USB_DEVICE(0xeb1a, 0x2750), | 1305 | { USB_DEVICE(0xeb1a, 0x2750), |
1304 | .driver_info = EM2750_BOARD_UNKNOWN }, | 1306 | .driver_info = EM2750_BOARD_UNKNOWN }, |
1305 | { USB_DEVICE(0xeb1a, 0x2751), | 1307 | { USB_DEVICE(0xeb1a, 0x2751), |
@@ -1401,7 +1403,7 @@ MODULE_DEVICE_TABLE(usb, em28xx_id_table); | |||
1401 | /* | 1403 | /* |
1402 | * EEPROM hash table for devices with generic USB IDs | 1404 | * EEPROM hash table for devices with generic USB IDs |
1403 | */ | 1405 | */ |
1404 | static struct em28xx_hash_table em28xx_eeprom_hash [] = { | 1406 | static struct em28xx_hash_table em28xx_eeprom_hash[] = { |
1405 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ | 1407 | /* P/N: SA 60002070465 Tuner: TVF7533-MF */ |
1406 | {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, | 1408 | {0x6ce05a8f, EM2820_BOARD_PROLINK_PLAYTV_USB2, TUNER_YMEC_TVF_5533MF}, |
1407 | {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF}, | 1409 | {0x72cc5a8b, EM2820_BOARD_PROLINK_PLAYTV_BOX4_USB2, TUNER_YMEC_TVF_5533MF}, |
@@ -1433,7 +1435,7 @@ int em28xx_tuner_callback(void *ptr, int component, int command, int arg) | |||
1433 | } | 1435 | } |
1434 | EXPORT_SYMBOL_GPL(em28xx_tuner_callback); | 1436 | EXPORT_SYMBOL_GPL(em28xx_tuner_callback); |
1435 | 1437 | ||
1436 | static void inline em28xx_set_model(struct em28xx *dev) | 1438 | static inline void em28xx_set_model(struct em28xx *dev) |
1437 | { | 1439 | { |
1438 | memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board)); | 1440 | memcpy(&dev->board, &em28xx_boards[dev->model], sizeof(dev->board)); |
1439 | 1441 | ||
diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 43f1d0e4c549..eee8d015b249 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c | |||
@@ -33,8 +33,8 @@ | |||
33 | /* #define ENABLE_DEBUG_ISOC_FRAMES */ | 33 | /* #define ENABLE_DEBUG_ISOC_FRAMES */ |
34 | 34 | ||
35 | static unsigned int core_debug; | 35 | static unsigned int core_debug; |
36 | module_param(core_debug,int,0644); | 36 | module_param(core_debug, int, 0644); |
37 | MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); | 37 | MODULE_PARM_DESC(core_debug, "enable debug messages [core]"); |
38 | 38 | ||
39 | #define em28xx_coredbg(fmt, arg...) do {\ | 39 | #define em28xx_coredbg(fmt, arg...) do {\ |
40 | if (core_debug) \ | 40 | if (core_debug) \ |
@@ -42,8 +42,8 @@ MODULE_PARM_DESC(core_debug,"enable debug messages [core]"); | |||
42 | dev->name, __func__ , ##arg); } while (0) | 42 | dev->name, __func__ , ##arg); } while (0) |
43 | 43 | ||
44 | static unsigned int reg_debug; | 44 | static unsigned int reg_debug; |
45 | module_param(reg_debug,int,0644); | 45 | module_param(reg_debug, int, 0644); |
46 | MODULE_PARM_DESC(reg_debug,"enable debug messages [URB reg]"); | 46 | MODULE_PARM_DESC(reg_debug, "enable debug messages [URB reg]"); |
47 | 47 | ||
48 | #define em28xx_regdbg(fmt, arg...) do {\ | 48 | #define em28xx_regdbg(fmt, arg...) do {\ |
49 | if (reg_debug) \ | 49 | if (reg_debug) \ |
@@ -77,7 +77,7 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg, | |||
77 | return -EINVAL; | 77 | return -EINVAL; |
78 | 78 | ||
79 | if (reg_debug) { | 79 | if (reg_debug) { |
80 | printk( KERN_DEBUG "(pipe 0x%08x): " | 80 | printk(KERN_DEBUG "(pipe 0x%08x): " |
81 | "IN: %02x %02x %02x %02x %02x %02x %02x %02x ", | 81 | "IN: %02x %02x %02x %02x %02x %02x %02x %02x ", |
82 | pipe, | 82 | pipe, |
83 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 83 | USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
@@ -154,7 +154,7 @@ int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf, | |||
154 | if (reg_debug) { | 154 | if (reg_debug) { |
155 | int byte; | 155 | int byte; |
156 | 156 | ||
157 | printk( KERN_DEBUG "(pipe 0x%08x): " | 157 | printk(KERN_DEBUG "(pipe 0x%08x): " |
158 | "OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>", | 158 | "OUT: %02x %02x %02x %02x %02x %02x %02x %02x >>>", |
159 | pipe, | 159 | pipe, |
160 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, | 160 | USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, |
@@ -462,7 +462,8 @@ int em28xx_audio_analog_set(struct em28xx *dev) | |||
462 | if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) { | 462 | if (dev->ctl_aoutput & EM28XX_AOUT_PCM_IN) { |
463 | int sel = ac97_return_record_select(dev->ctl_aoutput); | 463 | int sel = ac97_return_record_select(dev->ctl_aoutput); |
464 | 464 | ||
465 | /* Use the same input for both left and right channels */ | 465 | /* Use the same input for both left and right |
466 | channels */ | ||
466 | sel |= (sel << 8); | 467 | sel |= (sel << 8); |
467 | 468 | ||
468 | em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel); | 469 | em28xx_write_ac97(dev, AC97_RECORD_SELECT, sel); |
@@ -698,7 +699,7 @@ static int em28xx_scaler_set(struct em28xx *dev, u16 h, u16 v) | |||
698 | em28xx_write_regs(dev, EM28XX_R32_VSCALELOW, (char *)buf, 2); | 699 | em28xx_write_regs(dev, EM28XX_R32_VSCALELOW, (char *)buf, 2); |
699 | /* it seems that both H and V scalers must be active | 700 | /* it seems that both H and V scalers must be active |
700 | to work correctly */ | 701 | to work correctly */ |
701 | mode = (h || v)? 0x30: 0x00; | 702 | mode = (h || v) ? 0x30 : 0x00; |
702 | } | 703 | } |
703 | return em28xx_write_reg_bits(dev, EM28XX_R26_COMPR, mode, 0x30); | 704 | return em28xx_write_reg_bits(dev, EM28XX_R26_COMPR, mode, 0x30); |
704 | } | 705 | } |
@@ -958,7 +959,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets, | |||
958 | em28xx_err("unable to allocate %i bytes for transfer" | 959 | em28xx_err("unable to allocate %i bytes for transfer" |
959 | " buffer %i%s\n", | 960 | " buffer %i%s\n", |
960 | sb_size, i, | 961 | sb_size, i, |
961 | in_interrupt()?" while in int":""); | 962 | in_interrupt() ? " while in int" : ""); |
962 | em28xx_uninit_isoc(dev); | 963 | em28xx_uninit_isoc(dev); |
963 | return -ENOMEM; | 964 | return -ENOMEM; |
964 | } | 965 | } |
diff --git a/drivers/media/video/em28xx/em28xx-i2c.c b/drivers/media/video/em28xx/em28xx-i2c.c index d69f0efcc9aa..2dab43d22da2 100644 --- a/drivers/media/video/em28xx/em28xx-i2c.c +++ b/drivers/media/video/em28xx/em28xx-i2c.c | |||
@@ -402,10 +402,12 @@ static int em28xx_i2c_eeprom(struct em28xx *dev, unsigned char *eedata, int len) | |||
402 | dev->name); | 402 | dev->name); |
403 | break; | 403 | break; |
404 | case 2: | 404 | case 2: |
405 | printk(KERN_INFO "%s:\tI2S audio, sample rate=32k\n", dev->name); | 405 | printk(KERN_INFO "%s:\tI2S audio, sample rate=32k\n", |
406 | dev->name); | ||
406 | break; | 407 | break; |
407 | case 3: | 408 | case 3: |
408 | printk(KERN_INFO "%s:\tI2S audio, 3 sample rates\n", dev->name); | 409 | printk(KERN_INFO "%s:\tI2S audio, 3 sample rates\n", |
410 | dev->name); | ||
409 | break; | 411 | break; |
410 | } | 412 | } |
411 | 413 | ||
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 5b2a19b0cca6..efd641587e04 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -186,7 +186,8 @@ static void em28xx_copy_video(struct em28xx *dev, | |||
186 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (1)\n", | 186 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (1)\n", |
187 | ((char *)startwrite + lencopy) - | 187 | ((char *)startwrite + lencopy) - |
188 | ((char *)outp + buf->vb.size)); | 188 | ((char *)outp + buf->vb.size)); |
189 | lencopy = remain = (char *)outp + buf->vb.size - (char *)startwrite; | 189 | remain = (char *)outp + buf->vb.size - (char *)startwrite; |
190 | lencopy = remain; | ||
190 | } | 191 | } |
191 | if (lencopy <= 0) | 192 | if (lencopy <= 0) |
192 | return; | 193 | return; |
@@ -202,7 +203,8 @@ static void em28xx_copy_video(struct em28xx *dev, | |||
202 | else | 203 | else |
203 | lencopy = bytesperline; | 204 | lencopy = bytesperline; |
204 | 205 | ||
205 | if ((char *)startwrite + lencopy > (char *)outp + buf->vb.size) { | 206 | if ((char *)startwrite + lencopy > (char *)outp + |
207 | buf->vb.size) { | ||
206 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n", | 208 | em28xx_isocdbg("Overflow of %zi bytes past buffer end (2)\n", |
207 | ((char *)startwrite + lencopy) - | 209 | ((char *)startwrite + lencopy) - |
208 | ((char *)outp + buf->vb.size)); | 210 | ((char *)outp + buf->vb.size)); |
@@ -347,7 +349,7 @@ static inline int em28xx_isoc_copy(struct em28xx *dev, struct urb *urb) | |||
347 | } | 349 | } |
348 | if (p[0] == 0x22 && p[1] == 0x5a) { | 350 | if (p[0] == 0x22 && p[1] == 0x5a) { |
349 | em28xx_isocdbg("Video frame %d, length=%i, %s\n", p[2], | 351 | em28xx_isocdbg("Video frame %d, length=%i, %s\n", p[2], |
350 | len, (p[2] & 1)? "odd" : "even"); | 352 | len, (p[2] & 1) ? "odd" : "even"); |
351 | 353 | ||
352 | if (!(p[2] & 1)) { | 354 | if (!(p[2] & 1)) { |
353 | if (buf != NULL) | 355 | if (buf != NULL) |
@@ -476,7 +478,9 @@ fail: | |||
476 | static void | 478 | static void |
477 | buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) | 479 | buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) |
478 | { | 480 | { |
479 | struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb); | 481 | struct em28xx_buffer *buf = container_of(vb, |
482 | struct em28xx_buffer, | ||
483 | vb); | ||
480 | struct em28xx_fh *fh = vq->priv_data; | 484 | struct em28xx_fh *fh = vq->priv_data; |
481 | struct em28xx *dev = fh->dev; | 485 | struct em28xx *dev = fh->dev; |
482 | struct em28xx_dmaqueue *vidq = &dev->vidq; | 486 | struct em28xx_dmaqueue *vidq = &dev->vidq; |
@@ -489,7 +493,9 @@ buffer_queue(struct videobuf_queue *vq, struct videobuf_buffer *vb) | |||
489 | static void buffer_release(struct videobuf_queue *vq, | 493 | static void buffer_release(struct videobuf_queue *vq, |
490 | struct videobuf_buffer *vb) | 494 | struct videobuf_buffer *vb) |
491 | { | 495 | { |
492 | struct em28xx_buffer *buf = container_of(vb, struct em28xx_buffer, vb); | 496 | struct em28xx_buffer *buf = container_of(vb, |
497 | struct em28xx_buffer, | ||
498 | vb); | ||
493 | struct em28xx_fh *fh = vq->priv_data; | 499 | struct em28xx_fh *fh = vq->priv_data; |
494 | struct em28xx *dev = (struct em28xx *)fh->dev; | 500 | struct em28xx *dev = (struct em28xx *)fh->dev; |
495 | 501 | ||
@@ -557,7 +563,7 @@ static int res_get(struct em28xx_fh *fh) | |||
557 | 563 | ||
558 | static int res_check(struct em28xx_fh *fh) | 564 | static int res_check(struct em28xx_fh *fh) |
559 | { | 565 | { |
560 | return (fh->stream_on); | 566 | return fh->stream_on; |
561 | } | 567 | } |
562 | 568 | ||
563 | static void res_free(struct em28xx_fh *fh) | 569 | static void res_free(struct em28xx_fh *fh) |
@@ -791,7 +797,7 @@ out: | |||
791 | return rc; | 797 | return rc; |
792 | } | 798 | } |
793 | 799 | ||
794 | static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id * norm) | 800 | static int vidioc_s_std(struct file *file, void *priv, v4l2_std_id *norm) |
795 | { | 801 | { |
796 | struct em28xx_fh *fh = priv; | 802 | struct em28xx_fh *fh = priv; |
797 | struct em28xx *dev = fh->dev; | 803 | struct em28xx *dev = fh->dev; |
@@ -1436,7 +1442,7 @@ static int vidioc_reqbufs(struct file *file, void *priv, | |||
1436 | if (rc < 0) | 1442 | if (rc < 0) |
1437 | return rc; | 1443 | return rc; |
1438 | 1444 | ||
1439 | return (videobuf_reqbufs(&fh->vb_vidq, rb)); | 1445 | return videobuf_reqbufs(&fh->vb_vidq, rb); |
1440 | } | 1446 | } |
1441 | 1447 | ||
1442 | static int vidioc_querybuf(struct file *file, void *priv, | 1448 | static int vidioc_querybuf(struct file *file, void *priv, |
@@ -1450,7 +1456,7 @@ static int vidioc_querybuf(struct file *file, void *priv, | |||
1450 | if (rc < 0) | 1456 | if (rc < 0) |
1451 | return rc; | 1457 | return rc; |
1452 | 1458 | ||
1453 | return (videobuf_querybuf(&fh->vb_vidq, b)); | 1459 | return videobuf_querybuf(&fh->vb_vidq, b); |
1454 | } | 1460 | } |
1455 | 1461 | ||
1456 | static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) | 1462 | static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) |
@@ -1463,7 +1469,7 @@ static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *b) | |||
1463 | if (rc < 0) | 1469 | if (rc < 0) |
1464 | return rc; | 1470 | return rc; |
1465 | 1471 | ||
1466 | return (videobuf_qbuf(&fh->vb_vidq, b)); | 1472 | return videobuf_qbuf(&fh->vb_vidq, b); |
1467 | } | 1473 | } |
1468 | 1474 | ||
1469 | static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) | 1475 | static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) |
@@ -1476,8 +1482,7 @@ static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *b) | |||
1476 | if (rc < 0) | 1482 | if (rc < 0) |
1477 | return rc; | 1483 | return rc; |
1478 | 1484 | ||
1479 | return (videobuf_dqbuf(&fh->vb_vidq, b, | 1485 | return videobuf_dqbuf(&fh->vb_vidq, b, file->f_flags & O_NONBLOCK); |
1480 | file->f_flags & O_NONBLOCK)); | ||
1481 | } | 1486 | } |
1482 | 1487 | ||
1483 | #ifdef CONFIG_VIDEO_V4L1_COMPAT | 1488 | #ifdef CONFIG_VIDEO_V4L1_COMPAT |
@@ -1786,7 +1791,7 @@ em28xx_v4l2_read(struct file *filp, char __user *buf, size_t count, | |||
1786 | * em28xx_v4l2_poll() | 1791 | * em28xx_v4l2_poll() |
1787 | * will allocate buffers when called for the first time | 1792 | * will allocate buffers when called for the first time |
1788 | */ | 1793 | */ |
1789 | static unsigned int em28xx_v4l2_poll(struct file *filp, poll_table * wait) | 1794 | static unsigned int em28xx_v4l2_poll(struct file *filp, poll_table *wait) |
1790 | { | 1795 | { |
1791 | struct em28xx_fh *fh = filp->private_data; | 1796 | struct em28xx_fh *fh = filp->private_data; |
1792 | struct em28xx *dev = fh->dev; | 1797 | struct em28xx *dev = fh->dev; |
@@ -1939,8 +1944,8 @@ static struct video_device em28xx_radio_template = { | |||
1939 | 1944 | ||
1940 | 1945 | ||
1941 | static struct video_device *em28xx_vdev_init(struct em28xx *dev, | 1946 | static struct video_device *em28xx_vdev_init(struct em28xx *dev, |
1942 | const struct video_device *template, | 1947 | const struct video_device *template, |
1943 | const char *type_name) | 1948 | const char *type_name) |
1944 | { | 1949 | { |
1945 | struct video_device *vfd; | 1950 | struct video_device *vfd; |
1946 | 1951 | ||
@@ -1989,8 +1994,9 @@ int em28xx_register_analog_devices(struct em28xx *dev) | |||
1989 | /* enable vbi capturing */ | 1994 | /* enable vbi capturing */ |
1990 | 1995 | ||
1991 | /* em28xx_write_reg(dev, EM28XX_R0E_AUDIOSRC, 0xc0); audio register */ | 1996 | /* em28xx_write_reg(dev, EM28XX_R0E_AUDIOSRC, 0xc0); audio register */ |
1992 | val = (u8)em28xx_read_reg(dev, EM28XX_R0F_XCLK); | 1997 | val = (u8)em28xx_read_reg(dev, EM28XX_R0F_XCLK); |
1993 | em28xx_write_reg(dev, EM28XX_R0F_XCLK, (EM28XX_XCLK_AUDIO_UNMUTE | val)); | 1998 | em28xx_write_reg(dev, EM28XX_R0F_XCLK, |
1999 | (EM28XX_XCLK_AUDIO_UNMUTE | val)); | ||
1994 | em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x51); | 2000 | em28xx_write_reg(dev, EM28XX_R11_VINCTRL, 0x51); |
1995 | 2001 | ||
1996 | em28xx_set_outfmt(dev); | 2002 | em28xx_set_outfmt(dev); |
@@ -2025,7 +2031,8 @@ int em28xx_register_analog_devices(struct em28xx *dev) | |||
2025 | } | 2031 | } |
2026 | 2032 | ||
2027 | if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { | 2033 | if (em28xx_boards[dev->model].radio.type == EM28XX_RADIO) { |
2028 | dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, "radio"); | 2034 | dev->radio_dev = em28xx_vdev_init(dev, &em28xx_radio_template, |
2035 | "radio"); | ||
2029 | if (!dev->radio_dev) { | 2036 | if (!dev->radio_dev) { |
2030 | em28xx_errdev("cannot allocate video_device.\n"); | 2037 | em28xx_errdev("cannot allocate video_device.\n"); |
2031 | return -ENODEV; | 2038 | return -ENODEV; |
diff --git a/drivers/media/video/em28xx/em28xx.h b/drivers/media/video/em28xx/em28xx.h index 6844b98e1b67..5115db3a76a6 100644 --- a/drivers/media/video/em28xx/em28xx.h +++ b/drivers/media/video/em28xx/em28xx.h | |||
@@ -161,7 +161,8 @@ | |||
161 | */ | 161 | */ |
162 | 162 | ||
163 | /* time to wait when stopping the isoc transfer */ | 163 | /* time to wait when stopping the isoc transfer */ |
164 | #define EM28XX_URB_TIMEOUT msecs_to_jiffies(EM28XX_NUM_BUFS * EM28XX_NUM_PACKETS) | 164 | #define EM28XX_URB_TIMEOUT \ |
165 | msecs_to_jiffies(EM28XX_NUM_BUFS * EM28XX_NUM_PACKETS) | ||
165 | 166 | ||
166 | /* time in msecs to wait for i2c writes to finish */ | 167 | /* time in msecs to wait for i2c writes to finish */ |
167 | #define EM2800_I2C_WRITE_TIMEOUT 20 | 168 | #define EM2800_I2C_WRITE_TIMEOUT 20 |
@@ -530,7 +531,8 @@ struct em28xx { | |||
530 | int num_alt; /* Number of alternative settings */ | 531 | int num_alt; /* Number of alternative settings */ |
531 | unsigned int *alt_max_pkt_size; /* array of wMaxPacketSize */ | 532 | unsigned int *alt_max_pkt_size; /* array of wMaxPacketSize */ |
532 | struct urb *urb[EM28XX_NUM_BUFS]; /* urb for isoc transfers */ | 533 | struct urb *urb[EM28XX_NUM_BUFS]; /* urb for isoc transfers */ |
533 | char *transfer_buffer[EM28XX_NUM_BUFS]; /* transfer buffers for isoc transfer */ | 534 | char *transfer_buffer[EM28XX_NUM_BUFS]; /* transfer buffers for isoc |
535 | transfer */ | ||
534 | char urb_buf[URB_MAX_CTRL_SIZE]; /* urb control msg buffer */ | 536 | char urb_buf[URB_MAX_CTRL_SIZE]; /* urb control msg buffer */ |
535 | 537 | ||
536 | /* helper funcs that call usb_control_msg */ | 538 | /* helper funcs that call usb_control_msg */ |