Commit ba422428 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (7367): bug #10211: Fix depencencies for cx2341x
  V4L/DVB (7362): tvp5150.c: logical-bitwise and confusion
  V4L/DVB (7334): usb video: add a device link to usbvideo devices, else hal will ignore them
  V4L/DVB (7330): V4L1 - fix v4l_compat_translate_ioctl possible NULL deref
  V4L/DVB (7328): usb/opera1.c: fix a memory leak
  V4L/DVB (7291): em28xx: correct use of and fix
  V4L/DVB (7285): em28xx: Correct use of ! and &
  V4L/DVB (7279): ivtv: Add missing sg_init_table()
  V4L/DVB (7268): saa7134: fix: tuner should be loaded before calling saa7134_board_init2()
  V4L/DVB (7267): cx88: Fix: Loads tuner module before sending commands to it
  V4L/DVB (7251): VIDEO_VIVI must depend on VIDEO_DEV
  V4L/DVB (7242): ivtv: fix for yuv filter table check
  V4L/DVB (7236): bttv: struct member initialized twice
  V4L/DVB (7228): saa7134: fix FM radio support for the Pinnacle PCTV 110i
parents aedb60a6 eee4470f
......@@ -478,9 +478,9 @@ static int opera1_xilinx_load_firmware(struct usb_device *dev,
err("could not restart the USB controller CPU.");
ret = -EINVAL;
}
kfree(p);
}
}
kfree(p);
if (fw) {
release_firmware(fw);
}
......
......@@ -305,7 +305,7 @@ comment "MPEG video encoders"
config VIDEO_CX2341X
tristate "Conexant CX2341x MPEG encoders"
depends on VIDEO_V4L2 && EXPERIMENTAL
depends on VIDEO_V4L2 && EXPERIMENTAL && VIDEO_V4L2_COMMON
---help---
Support for the Conexant CX23416 MPEG encoders
and CX23415 MPEG encoder/decoders.
......@@ -382,7 +382,7 @@ endmenu # encoder / decoder chips
config VIDEO_VIVI
tristate "Virtual Video Driver"
depends on VIDEO_V4L2 && !SPARC32 && !SPARC64
depends on VIDEO_DEV && VIDEO_V4L2 && !SPARC32 && !SPARC64
select VIDEOBUF_VMALLOC
default n
---help---
......
......@@ -3388,7 +3388,6 @@ static struct video_device bttv_video_template =
#ifdef CONFIG_VIDEO_V4L1_COMPAT
.vidiocgmbuf = vidiocgmbuf,
#endif
.vidioc_g_crop = bttv_g_crop,
.vidioc_g_crop = bttv_g_crop,
.vidioc_s_crop = bttv_s_crop,
.vidioc_g_fbuf = bttv_g_fbuf,
......
......@@ -2196,6 +2196,11 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
cx88_reset(core);
cx88_card_setup_pre_i2c(core);
cx88_i2c_init(core, pci);
/* load tuner module, if needed */
if (TUNER_ABSENT != core->board.tuner_type)
request_module("tuner");
cx88_call_i2c_clients (core, TUNER_SET_STANDBY, NULL);
cx88_card_setup(core);
cx88_ir_init(core, pci);
......
......@@ -1826,8 +1826,6 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
cx_set(MO_PCI_INTMSK, core->pci_irqmask);
/* load and configure helper modules */
if (TUNER_ABSENT != core->board.tuner_type)
request_module("tuner");
if (core->board.audio_chip == AUDIO_CHIP_WM8775)
request_module("wm8775");
......
......@@ -267,7 +267,7 @@ static int em28xx_write_ac97(struct em28xx *dev, u8 reg, u8 *val)
for (i = 0; i < 10; i++) {
if ((ret = em28xx_read_reg(dev, AC97BUSY_REG)) < 0)
return ret;
if (!((u8) ret) & 0x01)
if (!(ret & 0x01))
return 0;
msleep(5);
}
......
......@@ -54,7 +54,6 @@
#include "ivtv-vbi.h"
#include "ivtv-routing.h"
#include "ivtv-gpio.h"
#include "ivtv-yuv.h"
#include <media/tveeprom.h>
#include <media/saa7115.h>
......@@ -700,6 +699,9 @@ static int __devinit ivtv_init_struct1(struct ivtv *itv)
itv->vbi.in.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
itv->vbi.sliced_in = &itv->vbi.in.fmt.sliced;
/* Init the sg table for osd/yuv output */
sg_init_table(itv->udma.SGlist, IVTV_DMA_SG_OSD_ENT);
/* OSD */
itv->osd_global_alpha_state = 1;
itv->osd_global_alpha = 255;
......@@ -1053,9 +1055,6 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
goto free_io;
}
/* Check yuv output filter table */
if (itv->has_cx23415) ivtv_yuv_filter_check(itv);
ivtv_gpio_init(itv);
/* active i2c */
......
......@@ -22,6 +22,7 @@
#include "ivtv-driver.h"
#include "ivtv-mailbox.h"
#include "ivtv-firmware.h"
#include "ivtv-yuv.h"
#include <linux/firmware.h>
#define IVTV_MASK_SPU_ENABLE 0xFFFFFFFE
......@@ -225,11 +226,14 @@ int ivtv_firmware_init(struct ivtv *itv)
return 0;
itv->dec_mbox.mbox = ivtv_search_mailbox(itv->dec_mem, IVTV_DECODER_SIZE);
if (itv->dec_mbox.mbox == NULL)
if (itv->dec_mbox.mbox == NULL) {
IVTV_ERR("Decoder mailbox not found\n");
else if (itv->has_cx23415 && ivtv_vapi(itv, CX2341X_DEC_PING_FW, 0)) {
} else if (itv->has_cx23415 && ivtv_vapi(itv, CX2341X_DEC_PING_FW, 0)) {
IVTV_ERR("Decoder firmware dead!\n");
itv->dec_mbox.mbox = NULL;
} else {
/* Firmware okay, so check yuv output filter table */
ivtv_yuv_filter_check(itv);
}
return itv->dec_mbox.mbox ? 0 : -ENODEV;
}
......
......@@ -2484,27 +2484,28 @@ struct saa7134_board saa7134_boards[] = {
.tuner_addr = ADDR_UNSET,
.radio_addr = ADDR_UNSET,
.gpiomask = 0x080200000,
.inputs = {{
.name = name_tv,
.vmux = 4,
.amux = TV,
.tv = 1,
},{
.name = name_comp1,
.vmux = 1,
.amux = LINE2,
},{
.name = name_comp2,
.vmux = 0,
.amux = LINE2,
},{
.name = name_svideo,
.vmux = 8,
.amux = LINE2,
}},
.inputs = { {
.name = name_tv,
.vmux = 4,
.amux = TV,
.tv = 1,
}, {
.name = name_comp1,
.vmux = 1,
.amux = LINE2,
}, {
.name = name_comp2,
.vmux = 0,
.amux = LINE2,
}, {
.name = name_svideo,
.vmux = 8,
.amux = LINE2,
} },
.radio = {
.name = name_radio,
.amux = LINE1,
.name = name_radio,
.amux = TV,
.gpio = 0x0200000,
},
},
[SAA7134_BOARD_ASUSTeK_P7131_DUAL] = {
......
......@@ -1022,12 +1022,13 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
saa7134_i2c_register(dev);
/* initialize hardware #2 */
if (TUNER_ABSENT != dev->tuner_type)
request_module("tuner");
saa7134_board_init2(dev);
saa7134_hwinit2(dev);
/* load i2c helpers */
if (TUNER_ABSENT != dev->tuner_type)
request_module("tuner");
if (card_is_empress(dev)) {
request_module("saa6752hs");
}
......
......@@ -672,7 +672,7 @@ static int tvp5150_set_vbi(struct i2c_client *c,
if (std == V4L2_STD_ALL) {
tvp5150_err("VBI can't be configured without knowing number of lines\n");
return 0;
} else if (std && V4L2_STD_625_50) {
} else if (std & V4L2_STD_625_50) {
/* Don't follow NTSC Line number convension */
line += 3;
}
......@@ -719,7 +719,7 @@ static int tvp5150_get_vbi(struct i2c_client *c,
if (std == V4L2_STD_ALL) {
tvp5150_err("VBI can't be configured without knowing number of lines\n");
return 0;
} else if (std && V4L2_STD_625_50) {
} else if (std & V4L2_STD_625_50) {
/* Don't follow NTSC Line number convension */
line += 3;
}
......
......@@ -1034,6 +1034,11 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
info("%s: iface=%d. endpoint=$%02x paletteBits=$%08lx",
__FUNCTION__, uvd->iface, uvd->video_endp, uvd->paletteBits);
}
if (uvd->dev == NULL) {
err("%s: uvd->dev == NULL", __FUNCTION__);
return -EINVAL;
}
uvd->vdev.dev=&(uvd->dev->dev);
if (video_register_device(&uvd->vdev, VFL_TYPE_GRABBER, video_nr) == -1) {
err("%s: video_register_device failed", __FUNCTION__);
return -EPIPE;
......@@ -1041,10 +1046,6 @@ int usbvideo_RegisterVideoDevice(struct uvd *uvd)
if (uvd->debug > 1) {
info("%s: video_register_device() successful", __FUNCTION__);
}
if (uvd->dev == NULL) {
err("%s: uvd->dev == NULL", __FUNCTION__);
return -EINVAL;
}
info("%s on /dev/video%d: canvas=%s videosize=%s",
(uvd->handle != NULL) ? uvd->handle->drvName : "???",
......
......@@ -303,7 +303,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_capability *cap = arg;
cap2 = kzalloc(sizeof(*cap2),GFP_KERNEL);
cap2 = kzalloc(sizeof(*cap2), GFP_KERNEL);
if (!cap2) {
err = -ENOMEM;
break;
}
memset(cap, 0, sizeof(*cap));
memset(&fbuf2, 0, sizeof(fbuf2));
......@@ -426,7 +430,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_window *win = arg;
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(win,0,sizeof(*win));
fmt2->type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
......@@ -464,7 +472,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
struct video_window *win = arg;
int err1,err2;
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
drv(inode, file, VIDIOC_STREAMOFF, &fmt2->type);
err1 = drv(inode, file, VIDIOC_G_FMT, fmt2);
......@@ -586,6 +598,12 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_picture *pict = arg;
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
pict->brightness = get_v4l_control(inode, file,
V4L2_CID_BRIGHTNESS,drv);
pict->hue = get_v4l_control(inode, file,
......@@ -597,7 +615,6 @@ v4l_compat_translate_ioctl(struct inode *inode,
pict->whiteness = get_v4l_control(inode, file,
V4L2_CID_WHITENESS, drv);
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
if (err < 0) {
......@@ -617,6 +634,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
struct video_picture *pict = arg;
int mem_err = 0, ovl_err = 0;
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(&fbuf2, 0, sizeof(fbuf2));
set_v4l_control(inode, file,
......@@ -636,7 +658,6 @@ v4l_compat_translate_ioctl(struct inode *inode,
* different pixel formats for memory vs overlay.
*/
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
/* If VIDIOC_G_FMT failed, then the driver likely doesn't
......@@ -890,7 +911,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct video_mmap *mm = arg;
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
memset(&buf2,0,sizeof(buf2));
fmt2->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
......@@ -986,7 +1011,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
{
struct vbi_format *fmt = arg;
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
err = drv(inode, file, VIDIOC_G_FMT, fmt2);
......@@ -1018,8 +1047,11 @@ v4l_compat_translate_ioctl(struct inode *inode,
break;
}
fmt2 = kzalloc(sizeof(*fmt2),GFP_KERNEL);
fmt2 = kzalloc(sizeof(*fmt2), GFP_KERNEL);
if (!fmt2) {
err = -ENOMEM;
break;
}
fmt2->type = V4L2_BUF_TYPE_VBI_CAPTURE;
fmt2->fmt.vbi.samples_per_line = fmt->samples_per_line;
fmt2->fmt.vbi.sampling_rate = fmt->sampling_rate;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment