From eec25fa7f98f8707eb84fede96f10496adf5047f Mon Sep 17 00:00:00 2001 From: Yuri Funduryan Date: Sun, 17 Feb 2008 01:22:37 -0300 Subject: V4L/DVB (7228): saa7134: fix FM radio support for the Pinnacle PCTV 110i This also has some coding style fixes. Signed-off-by: Yuri Funduryan Signed-off-by: Hartmut Hackmann Reviewed-by: Hermann Pitton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-cards.c | 41 +++++++++++++++-------------- 1 file changed, 21 insertions(+), 20 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 262830d..6f57442 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -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] = { -- cgit v1.1 From e8d35932e9942dffcc96c03f539d7e261d641bfd Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Sat, 23 Feb 2008 07:29:16 -0300 Subject: V4L/DVB (7236): bttv: struct member initialized twice fixes sparse warning: drivers/media/video/bt8xx/bttv-driver.c:3391:3: warning: Initializer entry defined twice drivers/media/video/bt8xx/bttv-driver.c:3392:3: also defined here Signed-off-by: Harvey Harrison Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-driver.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index 5404fcc..a080c14 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -3389,7 +3389,6 @@ static struct video_device bttv_video_template = .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, .vidioc_s_fbuf = bttv_s_fbuf, -- cgit v1.1 From a54d1dea0071a4f6aa46d8e937428c053732efcb Mon Sep 17 00:00:00 2001 From: Ian Armstrong Date: Sat, 26 Jan 2008 08:52:58 -0300 Subject: V4L/DVB (7242): ivtv: fix for yuv filter table check As the result of a previous change that delayed the loading of the firmware, the driver can sometimes report a bogus error regarding the yuv output filter table not being found in the firmware. This patch moves the filter table check to ensure it's only done after the firmware has been loaded. Signed-off-by: Ian Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-driver.c | 4 ---- drivers/media/video/ivtv/ivtv-firmware.c | 8 ++++++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index d42f120..9d36ab9 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c @@ -54,7 +54,6 @@ #include "ivtv-vbi.h" #include "ivtv-routing.h" #include "ivtv-gpio.h" -#include "ivtv-yuv.h" #include #include @@ -1053,9 +1052,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 */ diff --git a/drivers/media/video/ivtv/ivtv-firmware.c b/drivers/media/video/ivtv/ivtv-firmware.c index 425eb10..6dba55b 100644 --- a/drivers/media/video/ivtv/ivtv-firmware.c +++ b/drivers/media/video/ivtv/ivtv-firmware.c @@ -22,6 +22,7 @@ #include "ivtv-driver.h" #include "ivtv-mailbox.h" #include "ivtv-firmware.h" +#include "ivtv-yuv.h" #include #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; } -- cgit v1.1 From 2db2da913fb7d10a0281cd856135ef19fc2e67a8 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 25 Feb 2008 00:08:10 -0300 Subject: V4L/DVB (7251): VIDEO_VIVI must depend on VIDEO_DEV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This patch fixes the following compile error with VIDEO_VIVI=y, VIDEO_DEV=m reported by Toralf Förster: <-- snip --> ... LD .tmp_vmlinux1 drivers/built-in.o: In function `vivi_release': vivi.c:(.text+0x322f5): undefined reference to `video_unregister_device' vivi.c:(.text+0x32337): undefined reference to `video_device_release' drivers/built-in.o: In function `vivi_open': vivi.c:(.text+0x32845): undefined reference to `v4l2_type_names' drivers/built-in.o: In function `vivi_init': vivi.c:(.init.text+0x1d20): undefined reference to `video_device_alloc' vivi.c:(.init.text+0x1d48): undefined reference to `video_register_device' drivers/built-in.o:(.rodata+0x1b40): undefined reference to `video_ioctl2'drivers/built-in.o:(.data+0x140c): undefined reference to `video_device_release' <-- snip --> Signed-off-by: Adrian Bunk Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 37072a2..2c292ee 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -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--- -- cgit v1.1 From 189bf5f05093ff71cec3e2a16d199a85ba035a43 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 19 Feb 2008 16:22:25 -0300 Subject: V4L/DVB (7267): cx88: Fix: Loads tuner module before sending commands to it Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx88/cx88-cards.c | 5 +++++ drivers/media/video/cx88/cx88-video.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index e6b7f51..8c9a8ad 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c @@ -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); diff --git a/drivers/media/video/cx88/cx88-video.c b/drivers/media/video/cx88/cx88-video.c index 7f1931a..2271796 100644 --- a/drivers/media/video/cx88/cx88-video.c +++ b/drivers/media/video/cx88/cx88-video.c @@ -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"); -- cgit v1.1 From c030f5e697af1127002a0aeffcd259f9bcff5471 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Tue, 19 Feb 2008 16:26:33 -0300 Subject: V4L/DVB (7268): saa7134: fix: tuner should be loaded before calling saa7134_board_init2() There are several parts of saa7134_board_init2() that calls tuner modules. We should first load tuner, otherwise, the commands will fail. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 52baa4f..58ab163 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c @@ -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"); } -- cgit v1.1 From 165e1213e13b49761f8b3fd9314701f83cf3db3a Mon Sep 17 00:00:00 2001 From: Ian Armstrong Date: Tue, 26 Feb 2008 16:09:00 -0300 Subject: V4L/DVB (7279): ivtv: Add missing sg_init_table() If a dma transfer is attempted for either yuv or framebuffer output, a missing sg_init_table() call causes a kernel BUG in scatterlist.h if CONFIG_DEBUG_SG is set. Signed-off-by: Ian Armstrong Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ivtv/ivtv-driver.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/media') diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 9d36ab9..948ca35 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c @@ -699,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; -- cgit v1.1 From 8281db3b52c1b0e0bd249e8700cf35e64c1e13bd Mon Sep 17 00:00:00 2001 From: Julia Lawall Date: Tue, 26 Feb 2008 20:43:56 -0300 Subject: V4L/DVB (7285): em28xx: Correct use of ! and & In commit e6bafba5b4765a5a252f1b8d31cbf6d2459da337, a bug was fixed that involved converting !x & y to !(x & y). The code below shows the same pattern, and thus should perhaps be fixed in the same way. This is not tested and clearly changes the semantics, so it is only something to consider. The semantic patch that makes this change is as follows: (http://www.emn.fr/x-info/coccinelle/) // @@ expression E1,E2; @@ ( !E1 & !E2 | - !E1 & E2 + !(E1 & E2) ) // Signed-off-by: Julia Lawall Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 7d1537c..8630ee0 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -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 (!(((u8)ret) & 0x01)) return 0; msleep(5); } -- cgit v1.1 From 46cb57e62824a8d6f9e12bedc98c41738a1478ce Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Tue, 4 Mar 2008 13:09:09 -0300 Subject: V4L/DVB (7291): em28xx: correct use of and fix be less silly while we're there. Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/em28xx/em28xx-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/em28xx/em28xx-core.c b/drivers/media/video/em28xx/em28xx-core.c index 8630ee0..c1caaa8 100644 --- a/drivers/media/video/em28xx/em28xx-core.c +++ b/drivers/media/video/em28xx/em28xx-core.c @@ -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); } -- cgit v1.1 From 77596058e1c2ad95b566dfdc926611a8dd820ee0 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Wed, 27 Feb 2008 21:21:15 -0300 Subject: V4L/DVB (7328): usb/opera1.c: fix a memory leak This patch fixes a memory leak in the "testval == 0x67" case spotted by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/opera1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/dvb/dvb-usb/opera1.c b/drivers/media/dvb/dvb-usb/opera1.c index 21935bf..302cc67 100644 --- a/drivers/media/dvb/dvb-usb/opera1.c +++ b/drivers/media/dvb/dvb-usb/opera1.c @@ -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); } -- cgit v1.1 From c77990e754af7443246f24ccb2336bbd62b01cc0 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Wed, 5 Mar 2008 20:24:43 -0300 Subject: V4L/DVB (7330): V4L1 - fix v4l_compat_translate_ioctl possible NULL deref There are possible NULL pointer derefs in case of kzalloc fails so fix them. Signed-off-by: Cyrill Gorcunov Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/v4l1-compat.c | 50 ++++++++++++++++++++++++++++++++------- 1 file changed, 41 insertions(+), 9 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index dcf22a3..50e1ff9 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c @@ -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; -- cgit v1.1 From 974a911d2ae310d7082100e9992d1efdf72d86a5 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Fri, 7 Mar 2008 08:22:57 -0300 Subject: V4L/DVB (7334): usb video: add a device link to usbvideo devices, else hal will ignore them Signed-off-by: Pascal Terjan Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/usbvideo/usbvideo.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/usbvideo/usbvideo.c b/drivers/media/video/usbvideo/usbvideo.c index fb434b5..5d363be 100644 --- a/drivers/media/video/usbvideo/usbvideo.c +++ b/drivers/media/video/usbvideo/usbvideo.c @@ -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 : "???", -- cgit v1.1 From 7d5b7b98ae4cbf4c58d143ff7d4516c978e3e555 Mon Sep 17 00:00:00 2001 From: Roel Kluin <12o3l@tiscali.nl> Date: Sun, 9 Mar 2008 21:19:13 -0300 Subject: V4L/DVB (7362): tvp5150.c: logical-bitwise and confusion logical-bitwise & confusion Signed-off-by: Roel Kluin <12o3l@tiscali.nl> Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/tvp5150.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index 445eba4..d28318c 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -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; } -- cgit v1.1 From eee4470f197cfe88fd8aa871e9227b7033495b67 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Thu, 13 Mar 2008 21:08:20 -0300 Subject: V4L/DVB (7367): bug #10211: Fix depencencies for cx2341x Fix for build #408 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig index 2c292ee..1832966 100644 --- a/drivers/media/video/Kconfig +++ b/drivers/media/video/Kconfig @@ -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. -- cgit v1.1 From 5fa1247a2b56f33f88432c24e109deaf91ef8281 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 29 Mar 2008 03:07:38 +0000 Subject: NULL noise: drivers/media Acked-by: Harvey Harrison Signed-off-by: Linus Torvalds --- drivers/media/common/saa7146_core.c | 13 +++++-------- drivers/media/common/saa7146_fops.c | 2 +- drivers/media/dvb/dvb-core/dvb_net.c | 4 ++-- drivers/media/video/adv7170.c | 2 +- drivers/media/video/adv7175.c | 2 +- drivers/media/video/bt819.c | 2 +- drivers/media/video/bt856.c | 2 +- drivers/media/video/dpc7146.c | 2 +- drivers/media/video/mt20xx.c | 2 +- drivers/media/video/mxb.c | 5 ++--- drivers/media/video/pvrusb2/pvrusb2-ctrl.c | 4 ++-- drivers/media/video/pvrusb2/pvrusb2-hdw.c | 6 +++--- drivers/media/video/pvrusb2/pvrusb2-io.c | 2 +- drivers/media/video/pvrusb2/pvrusb2-ioread.c | 2 +- drivers/media/video/pwc/pwc-if.c | 7 +++---- drivers/media/video/saa7110.c | 4 ++-- drivers/media/video/saa7111.c | 2 +- drivers/media/video/saa7114.c | 2 +- drivers/media/video/saa7185.c | 2 +- drivers/media/video/tda9840.c | 2 +- drivers/media/video/tea6415c.c | 2 +- drivers/media/video/tea6420.c | 2 +- drivers/media/video/tvp5150.c | 4 ++-- drivers/media/video/zoran_driver.c | 2 +- 24 files changed, 37 insertions(+), 42 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/common/saa7146_core.c b/drivers/media/common/saa7146_core.c index 168a8d3..7707b8c 100644 --- a/drivers/media/common/saa7146_core.c +++ b/drivers/media/common/saa7146_core.c @@ -306,25 +306,22 @@ static irqreturn_t interrupt_hw(int irq, void *dev_id) return IRQ_NONE; } - if( 0 != (dev->ext)) { - if( 0 != (dev->ext->irq_mask & isr )) { - if( 0 != dev->ext->irq_func ) { + if (dev->ext) { + if (dev->ext->irq_mask & isr) { + if (dev->ext->irq_func) dev->ext->irq_func(dev, &isr); - } isr &= ~dev->ext->irq_mask; } } if (0 != (isr & (MASK_27))) { DEB_INT(("irq: RPS0 (0x%08x).\n",isr)); - if( 0 != dev->vv_data && 0 != dev->vv_callback) { + if (dev->vv_data && dev->vv_callback) dev->vv_callback(dev,isr); - } isr &= ~MASK_27; } if (0 != (isr & (MASK_28))) { - if( 0 != dev->vv_data && 0 != dev->vv_callback) { + if (dev->vv_data && dev->vv_callback) dev->vv_callback(dev,isr); - } isr &= ~MASK_28; } if (0 != (isr & (MASK_16|MASK_17))) { diff --git a/drivers/media/common/saa7146_fops.c b/drivers/media/common/saa7146_fops.c index f0703d8..171afe7 100644 --- a/drivers/media/common/saa7146_fops.c +++ b/drivers/media/common/saa7146_fops.c @@ -272,7 +272,7 @@ static int fops_open(struct inode *inode, struct file *file) result = 0; out: - if( fh != 0 && result != 0 ) { + if (fh && result != 0) { kfree(fh); file->private_data = NULL; } diff --git a/drivers/media/dvb/dvb-core/dvb_net.c b/drivers/media/dvb/dvb-core/dvb_net.c index ed3f826..4c8b62e 100644 --- a/drivers/media/dvb/dvb-core/dvb_net.c +++ b/drivers/media/dvb/dvb-core/dvb_net.c @@ -784,8 +784,8 @@ static int dvb_net_ts_callback(const u8 *buffer1, size_t buffer1_len, { struct net_device *dev = feed->priv; - if (buffer2 != 0) - printk(KERN_WARNING "buffer2 not 0: %p.\n", buffer2); + if (buffer2) + printk(KERN_WARNING "buffer2 not NULL: %p.\n", buffer2); if (buffer1_len > 32768) printk(KERN_WARNING "length > 32k: %zu.\n", buffer1_len); /* printk("TS callback: %u bytes, %u TS cells @ %p.\n", diff --git a/drivers/media/video/adv7170.c b/drivers/media/video/adv7170.c index cbab53f..fea2e72 100644 --- a/drivers/media/video/adv7170.c +++ b/drivers/media/video/adv7170.c @@ -408,7 +408,7 @@ adv7170_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; diff --git a/drivers/media/video/adv7175.c b/drivers/media/video/adv7175.c index 0d0c554..10d4d89 100644 --- a/drivers/media/video/adv7175.c +++ b/drivers/media/video/adv7175.c @@ -426,7 +426,7 @@ adv7175_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; diff --git a/drivers/media/video/bt819.c b/drivers/media/video/bt819.c index 12d1b92..e663cc0 100644 --- a/drivers/media/video/bt819.c +++ b/drivers/media/video/bt819.c @@ -524,7 +524,7 @@ bt819_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; diff --git a/drivers/media/video/bt856.c b/drivers/media/video/bt856.c index e1028a7..7dee2e3 100644 --- a/drivers/media/video/bt856.c +++ b/drivers/media/video/bt856.c @@ -311,7 +311,7 @@ bt856_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; diff --git a/drivers/media/video/dpc7146.c b/drivers/media/video/dpc7146.c index 566e479..9ceb6b2 100644 --- a/drivers/media/video/dpc7146.c +++ b/drivers/media/video/dpc7146.c @@ -131,7 +131,7 @@ static int dpc_probe(struct saa7146_dev* dev) device_for_each_child(&dpc->i2c_adapter.dev, dpc, dpc_check_clients); /* check if all devices are present */ - if( 0 == dpc->saa7111a ) { + if (!dpc->saa7111a) { DEB_D(("dpc_v4l2.o: dpc_attach failed for this device.\n")); i2c_del_adapter(&dpc->i2c_adapter); kfree(dpc); diff --git a/drivers/media/video/mt20xx.c b/drivers/media/video/mt20xx.c index 58bab65..74fd6a0 100644 --- a/drivers/media/video/mt20xx.c +++ b/drivers/media/video/mt20xx.c @@ -647,7 +647,7 @@ struct dvb_frontend *microtune_attach(struct dvb_frontend *fe, default: tuner_info("microtune %s found, not (yet?) supported, sorry :-/\n", name); - return 0; + return NULL; } strlcpy(fe->ops.tuner_ops.info.name, name, diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index add6d0d..cb5a510 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c @@ -221,9 +221,8 @@ static int mxb_probe(struct saa7146_dev* dev) device_for_each_child(&mxb->i2c_adapter.dev, mxb, mxb_check_clients); /* check if all devices are present */ - if( 0 == mxb->tea6420_1 || 0 == mxb->tea6420_2 || 0 == mxb->tea6415c - || 0 == mxb->tda9840 || 0 == mxb->saa7111a || 0 == mxb->tuner ) { - + if (!mxb->tea6420_1 || !mxb->tea6420_2 || !mxb->tea6415c || + !mxb->tda9840 || !mxb->saa7111a || !mxb->tuner) { printk("mxb: did not find all i2c devices. aborting\n"); i2c_del_adapter(&mxb->i2c_adapter); kfree(mxb); diff --git a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c index 46f156f..5a3e8d2 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ctrl.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ctrl.c @@ -60,7 +60,7 @@ int pvr2_ctrl_set_mask_value(struct pvr2_ctrl *cptr,int mask,int val) int ret = 0; if (!cptr) return -EINVAL; LOCK_TAKE(cptr->hdw->big_lock); do { - if (cptr->info->set_value != 0) { + if (cptr->info->set_value) { if (cptr->info->type == pvr2_ctl_bitmask) { mask &= cptr->info->def.type_bitmask.valid_bits; } else if (cptr->info->type == pvr2_ctl_int) { @@ -265,7 +265,7 @@ unsigned int pvr2_ctrl_get_v4lflags(struct pvr2_ctrl *cptr) int pvr2_ctrl_is_writable(struct pvr2_ctrl *cptr) { if (!cptr) return 0; - return cptr->info->set_value != 0; + return cptr->info->set_value != NULL; } diff --git a/drivers/media/video/pvrusb2/pvrusb2-hdw.c b/drivers/media/video/pvrusb2/pvrusb2-hdw.c index 41ae980..d6955fa3 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/video/pvrusb2/pvrusb2-hdw.c @@ -2291,7 +2291,7 @@ static int pvr2_hdw_commit_setup(struct pvr2_hdw *hdw) for (idx = 0; idx < hdw->control_cnt; idx++) { cptr = hdw->controls + idx; - if (cptr->info->is_dirty == 0) continue; + if (!cptr->info->is_dirty) continue; if (!cptr->info->is_dirty(cptr)) continue; commit_flag = !0; @@ -2646,7 +2646,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, u16 address; unsigned int pipe; LOCK_TAKE(hdw->big_lock); do { - if ((hdw->fw_buffer == 0) == !enable_flag) break; + if ((hdw->fw_buffer == NULL) == !enable_flag) break; if (!enable_flag) { pvr2_trace(PVR2_TRACE_FIRMWARE, @@ -2715,7 +2715,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, /* Return true if we're in a mode for retrieval CPU firmware */ int pvr2_hdw_cpufw_get_enabled(struct pvr2_hdw *hdw) { - return hdw->fw_buffer != 0; + return hdw->fw_buffer != NULL; } diff --git a/drivers/media/video/pvrusb2/pvrusb2-io.c b/drivers/media/video/pvrusb2/pvrusb2-io.c index ce3c898..a9889ff 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-io.c +++ b/drivers/media/video/pvrusb2/pvrusb2-io.c @@ -563,7 +563,7 @@ void pvr2_stream_kill(struct pvr2_stream *sp) struct pvr2_buffer *bp; mutex_lock(&sp->mutex); do { pvr2_stream_internal_flush(sp); - while ((bp = pvr2_stream_get_ready_buffer(sp)) != 0) { + while ((bp = pvr2_stream_get_ready_buffer(sp)) != NULL) { pvr2_buffer_set_idle(bp); } if (sp->buffer_total_count != sp->buffer_target_count) { diff --git a/drivers/media/video/pvrusb2/pvrusb2-ioread.c b/drivers/media/video/pvrusb2/pvrusb2-ioread.c index f782418..c572212 100644 --- a/drivers/media/video/pvrusb2/pvrusb2-ioread.c +++ b/drivers/media/video/pvrusb2/pvrusb2-ioread.c @@ -165,7 +165,7 @@ static int pvr2_ioread_start(struct pvr2_ioread *cp) if (!(cp->stream)) return 0; pvr2_trace(PVR2_TRACE_START_STOP, "/*---TRACE_READ---*/ pvr2_ioread_start id=%p",cp); - while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != 0) { + while ((bp = pvr2_stream_get_idle_buffer(cp->stream)) != NULL) { stat = pvr2_buffer_queue(bp); if (stat < 0) { pvr2_trace(PVR2_TRACE_DATA_FLOW, diff --git a/drivers/media/video/pwc/pwc-if.c b/drivers/media/video/pwc/pwc-if.c index f991d72..e0a453a 100644 --- a/drivers/media/video/pwc/pwc-if.c +++ b/drivers/media/video/pwc/pwc-if.c @@ -915,7 +915,7 @@ static void pwc_iso_stop(struct pwc_device *pdev) struct urb *urb; urb = pdev->sbuf[i].urb; - if (urb != 0) { + if (urb) { PWC_DEBUG_MEMORY("Unlinking URB %p\n", urb); usb_kill_urb(urb); } @@ -931,7 +931,7 @@ static void pwc_iso_free(struct pwc_device *pdev) struct urb *urb; urb = pdev->sbuf[i].urb; - if (urb != 0) { + if (urb) { PWC_DEBUG_MEMORY("Freeing URB\n"); usb_free_urb(urb); pdev->sbuf[i].urb = NULL; @@ -1759,8 +1759,7 @@ static int usb_pwc_probe(struct usb_interface *intf, const struct usb_device_id /* Allocate video_device structure */ pdev->vdev = video_device_alloc(); - if (pdev->vdev == 0) - { + if (!pdev->vdev) { PWC_ERROR("Err, cannot allocate video_device struture. Failing probe."); kfree(pdev); return -ENOMEM; diff --git a/drivers/media/video/saa7110.c b/drivers/media/video/saa7110.c index 061134a..1df2602 100644 --- a/drivers/media/video/saa7110.c +++ b/drivers/media/video/saa7110.c @@ -488,7 +488,7 @@ saa7110_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; @@ -496,7 +496,7 @@ saa7110_detect_client (struct i2c_adapter *adapter, strlcpy(I2C_NAME(client), "saa7110", sizeof(I2C_NAME(client))); decoder = kzalloc(sizeof(struct saa7110), GFP_KERNEL); - if (decoder == 0) { + if (!decoder) { kfree(client); return -ENOMEM; } diff --git a/drivers/media/video/saa7111.c b/drivers/media/video/saa7111.c index 7ae2d64..a0772c5 100644 --- a/drivers/media/video/saa7111.c +++ b/drivers/media/video/saa7111.c @@ -502,7 +502,7 @@ saa7111_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; diff --git a/drivers/media/video/saa7114.c b/drivers/media/video/saa7114.c index 677df51..bf91a4f 100644 --- a/drivers/media/video/saa7114.c +++ b/drivers/media/video/saa7114.c @@ -841,7 +841,7 @@ saa7114_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; diff --git a/drivers/media/video/saa7185.c b/drivers/media/video/saa7185.c index 66cc92c..41f7044 100644 --- a/drivers/media/video/saa7185.c +++ b/drivers/media/video/saa7185.c @@ -403,7 +403,7 @@ saa7185_detect_client (struct i2c_adapter *adapter, return 0; client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (client == 0) + if (!client) return -ENOMEM; client->addr = address; client->adapter = adapter; diff --git a/drivers/media/video/tda9840.c b/drivers/media/video/tda9840.c index ef494fe..bdca5d2 100644 --- a/drivers/media/video/tda9840.c +++ b/drivers/media/video/tda9840.c @@ -172,7 +172,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind) /* allocate memory for client structure */ client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (0 == client) { + if (!client) { printk("not enough kernel memory\n"); return -ENOMEM; } diff --git a/drivers/media/video/tea6415c.c b/drivers/media/video/tea6415c.c index 523df0b..df2fad9 100644 --- a/drivers/media/video/tea6415c.c +++ b/drivers/media/video/tea6415c.c @@ -64,7 +64,7 @@ static int detect(struct i2c_adapter *adapter, int address, int kind) /* allocate memory for client structure */ client = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (0 == client) { + if (!client) { return -ENOMEM; } diff --git a/drivers/media/video/tea6420.c b/drivers/media/video/tea6420.c index ca05cd6..4ff6c63 100644 --- a/drivers/media/video/tea6420.c +++ b/drivers/media/video/tea6420.c @@ -101,7 +101,7 @@ static int tea6420_detect(struct i2c_adapter *adapter, int address, int kind) /* allocate memory for client structure */ client = kzalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (0 == client) { + if (!client) { return -ENOMEM; } diff --git a/drivers/media/video/tvp5150.c b/drivers/media/video/tvp5150.c index d28318c..b6e24e7 100644 --- a/drivers/media/video/tvp5150.c +++ b/drivers/media/video/tvp5150.c @@ -1072,12 +1072,12 @@ static int tvp5150_detect_client(struct i2c_adapter *adapter, return 0; c = kmalloc(sizeof(struct i2c_client), GFP_KERNEL); - if (c == 0) + if (!c) return -ENOMEM; memcpy(c, &client_template, sizeof(struct i2c_client)); core = kzalloc(sizeof(struct tvp5150), GFP_KERNEL); - if (core == 0) { + if (!core) { kfree(c); return -ENOMEM; } diff --git a/drivers/media/video/zoran_driver.c b/drivers/media/video/zoran_driver.c index dd3d7d2..fea4946 100644 --- a/drivers/media/video/zoran_driver.c +++ b/drivers/media/video/zoran_driver.c @@ -339,7 +339,7 @@ v4l_fbuffer_alloc (struct file *file) /* Use kmalloc */ mem = kmalloc(fh->v4l_buffers.buffer_size, GFP_KERNEL); - if (mem == 0) { + if (!mem) { dprintk(1, KERN_ERR "%s: v4l_fbuffer_alloc() - kmalloc for V4L buf %d failed\n", -- cgit v1.1 From 97cf010aeb03fd515613313ad43508e49acae7fb Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 29 Mar 2008 03:10:48 +0000 Subject: zr364xx __user annotations Signed-off-by: Al Viro Signed-off-by: Linus Torvalds --- drivers/media/video/zr364xx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/zr364xx.c b/drivers/media/video/zr364xx.c index 1b44784..04949c8 100644 --- a/drivers/media/video/zr364xx.c +++ b/drivers/media/video/zr364xx.c @@ -390,7 +390,7 @@ static int read_frame(struct zr364xx_camera *cam, int framenum) } -static ssize_t zr364xx_read(struct file *file, char *buf, size_t cnt, +static ssize_t zr364xx_read(struct file *file, char __user *buf, size_t cnt, loff_t * ppos) { unsigned long count = cnt; -- cgit v1.1 From 5cd3955cb8adfc1edf481e9e1cb2289db50ccacb Mon Sep 17 00:00:00 2001 From: Robert Fitzsimons Date: Tue, 1 Apr 2008 11:41:54 -0300 Subject: V4L/DVB (7277): bttv: Re-enabling radio support requires the use of struct bttv_fh A number of the radio tuner ioctl functions are shared with the TV tuner, these functions require a struct bttv_fh data structure to be allocated and initialized. Signed-off-by: Robert Fitzsimons Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-driver.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index a080c14..fc3f57a 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -3415,6 +3415,7 @@ static int radio_open(struct inode *inode, struct file *file) { int minor = iminor(inode); struct bttv *btv = NULL; + struct bttv_fh *fh; unsigned int i; dprintk("bttv: open minor=%d\n",minor); @@ -3429,12 +3430,19 @@ static int radio_open(struct inode *inode, struct file *file) return -ENODEV; dprintk("bttv%d: open called (radio)\n",btv->c.nr); + + /* allocate per filehandle data */ + fh = kmalloc(sizeof(*fh), GFP_KERNEL); + if (NULL == fh) + return -ENOMEM; + file->private_data = fh; + *fh = btv->init; + v4l2_prio_open(&btv->prio, &fh->prio); + mutex_lock(&btv->lock); btv->radio_user++; - file->private_data = btv; - bttv_call_i2c_clients(btv,AUDC_SET_RADIO,NULL); audio_input(btv,TVAUDIO_INPUT_RADIO); @@ -3444,7 +3452,8 @@ static int radio_open(struct inode *inode, struct file *file) static int radio_release(struct inode *inode, struct file *file) { - struct bttv *btv = file->private_data; + struct bttv_fh *fh = file->private_data; + struct bttv *btv = fh->btv; struct rds_command cmd; btv->radio_user--; @@ -3569,7 +3578,8 @@ static int radio_g_input(struct file *filp, void *priv, unsigned int *i) static ssize_t radio_read(struct file *file, char __user *data, size_t count, loff_t *ppos) { - struct bttv *btv = file->private_data; + struct bttv_fh *fh = file->private_data; + struct bttv *btv = fh->btv; struct rds_command cmd; cmd.block_count = count/3; cmd.buffer = data; @@ -3583,7 +3593,8 @@ static ssize_t radio_read(struct file *file, char __user *data, static unsigned int radio_poll(struct file *file, poll_table *wait) { - struct bttv *btv = file->private_data; + struct bttv_fh *fh = file->private_data; + struct bttv *btv = fh->btv; struct rds_command cmd; cmd.instance = file; cmd.event_list = wait; -- cgit v1.1 From 1b0690134ec5dafb523a951a8756bb8735382fec Mon Sep 17 00:00:00 2001 From: Robert Fitzsimons Date: Tue, 1 Apr 2008 11:41:54 -0300 Subject: V4L/DVB (7278): bttv: Re-enable radio tuner support for VIDIOCGFREQ/VIDIOCSFREQ ioctls Signed-off-by: Robert Fitzsimons Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-driver.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index fc3f57a..ee826fd 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -1990,7 +1990,7 @@ static int bttv_g_frequency(struct file *file, void *priv, if (0 != err) return err; - f->type = V4L2_TUNER_ANALOG_TV; + f->type = btv->radio_user ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; f->frequency = btv->freq; return 0; @@ -2009,7 +2009,8 @@ static int bttv_s_frequency(struct file *file, void *priv, if (unlikely(f->tuner != 0)) return -EINVAL; - if (unlikely(f->type != V4L2_TUNER_ANALOG_TV)) + if (unlikely(f->type != (btv->radio_user + ? V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV))) return -EINVAL; mutex_lock(&btv->lock); btv->freq = f->frequency; -- cgit v1.1 From c137918978889fa4711d286e0a8ca3d93fdcb991 Mon Sep 17 00:00:00 2001 From: Robert Fitzsimons Date: Tue, 1 Apr 2008 11:42:28 -0300 Subject: V4L/DVB (7400): bttv: Add a radio compat_ioctl file operation Signed-off-by: Robert Fitzsimons Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-driver.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media') diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index ee826fd..e68326f 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -3611,6 +3611,7 @@ static const struct file_operations radio_fops = .open = radio_open, .read = radio_read, .release = radio_release, + .compat_ioctl = v4l_compat_ioctl32, .ioctl = video_ioctl2, .llseek = no_llseek, .poll = radio_poll, -- cgit v1.1 From 1a002ebf60c011ed6574b8e3ed9aa85f1ead6a95 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Tue, 1 Apr 2008 17:49:13 -0300 Subject: V4L/DVB (7461): bttv: fix missed index check We should check for proper index first Signed-off-by: Cyrill Gorcunov Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/bt8xx/bttv-driver.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/media') diff --git a/drivers/media/video/bt8xx/bttv-driver.c b/drivers/media/video/bt8xx/bttv-driver.c index e68326f..fcf8f2d 100644 --- a/drivers/media/video/bt8xx/bttv-driver.c +++ b/drivers/media/video/bt8xx/bttv-driver.c @@ -3518,8 +3518,12 @@ static int radio_enum_input(struct file *file, void *priv, static int radio_g_audio(struct file *file, void *priv, struct v4l2_audio *a) { + if (a->index != 0) + return -EINVAL; + memset(a, 0, sizeof(*a)); strcpy(a->name, "Radio"); + return 0; } -- cgit v1.1 From 31c8cc9742daa6ffedf7ba8a9bc465b10dee4b52 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Sat, 29 Mar 2008 17:30:26 -0300 Subject: V4L/DVB (7464): Convert driver to use a single SRAM memory map This reduces the memory footprint and removes the need to manually configure each map, which lead to a bug where the Fusion EXP 5 board broke for a while. This also fixes digital support again for the DViCO FusionHDTV5Express. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx23885/cx23885-core.c | 134 +---------------------------- 1 file changed, 1 insertion(+), 133 deletions(-) (limited to 'drivers/media') diff --git a/drivers/media/video/cx23885/cx23885-core.c b/drivers/media/video/cx23885/cx23885-core.c index 8e40c7b..7f10b27 100644 --- a/drivers/media/video/cx23885/cx23885-core.c +++ b/drivers/media/video/cx23885/cx23885-core.c @@ -56,137 +56,6 @@ LIST_HEAD(cx23885_devlist); #define NO_SYNC_LINE (-1U) -/* - * CX23885 Assumptions - * 1 line = 16 bytes of CDT - * cmds size = 80 - * cdt size = 16 * linesize - * iqsize = 64 - * maxlines = 6 - * - * Address Space: - * 0x00000000 0x00008fff FIFO clusters - * 0x00010000 0x000104af Channel Management Data Structures - * 0x000104b0 0x000104ff Free - * 0x00010500 0x000108bf 15 channels * iqsize - * 0x000108c0 0x000108ff Free - * 0x00010900 0x00010e9f IQ's + Cluster Descriptor Tables - * 15 channels * (iqsize + (maxlines * linesize)) - * 0x00010ea0 0x00010xxx Free - */ - -static struct sram_channel cx23885_sram_channels[] = { - [SRAM_CH01] = { - .name = "VID A", - .cmds_start = 0x10000, - .ctrl_start = 0x105b0, - .cdt = 0x107b0, - .fifo_start = 0x40, - .fifo_size = 0x2800, - .ptr1_reg = DMA1_PTR1, - .ptr2_reg = DMA1_PTR2, - .cnt1_reg = DMA1_CNT1, - .cnt2_reg = DMA1_CNT2, - .jumponly = 1, - }, - [SRAM_CH02] = { - .name = "ch2", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA2_PTR1, - .ptr2_reg = DMA2_PTR2, - .cnt1_reg = DMA2_CNT1, - .cnt2_reg = DMA2_CNT2, - }, - [SRAM_CH03] = { - .name = "TS1 B", - .cmds_start = 0x100A0, - .ctrl_start = 0x10630, - .cdt = 0x10870, - .fifo_start = 0x5000, - .fifo_size = 0x1000, - .ptr1_reg = DMA3_PTR1, - .ptr2_reg = DMA3_PTR2, - .cnt1_reg = DMA3_CNT1, - .cnt2_reg = DMA3_CNT2, - }, - [SRAM_CH04] = { - .name = "ch4", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA4_PTR1, - .ptr2_reg = DMA4_PTR2, - .cnt1_reg = DMA4_CNT1, - .cnt2_reg = DMA4_CNT2, - }, - [SRAM_CH05] = { - .name = "ch5", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA5_PTR1, - .ptr2_reg = DMA5_PTR2, - .cnt1_reg = DMA5_CNT1, - .cnt2_reg = DMA5_CNT2, - }, - [SRAM_CH06] = { - .name = "TS2 C", - .cmds_start = 0x10140, - .ctrl_start = 0x10680, - .cdt = 0x108d0, - .fifo_start = 0x6000, - .fifo_size = 0x1000, - .ptr1_reg = DMA5_PTR1, - .ptr2_reg = DMA5_PTR2, - .cnt1_reg = DMA5_CNT1, - .cnt2_reg = DMA5_CNT2, - }, - [SRAM_CH07] = { - .name = "ch7", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA6_PTR1, - .ptr2_reg = DMA6_PTR2, - .cnt1_reg = DMA6_CNT1, - .cnt2_reg = DMA6_CNT2, - }, - [SRAM_CH08] = { - .name = "ch8", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA7_PTR1, - .ptr2_reg = DMA7_PTR2, - .cnt1_reg = DMA7_CNT1, - .cnt2_reg = DMA7_CNT2, - }, - [SRAM_CH09] = { - .name = "ch9", - .cmds_start = 0x0, - .ctrl_start = 0x0, - .cdt = 0x0, - .fifo_start = 0x0, - .fifo_size = 0x0, - .ptr1_reg = DMA8_PTR1, - .ptr2_reg = DMA8_PTR2, - .cnt1_reg = DMA8_CNT1, - .cnt2_reg = DMA8_CNT2, - }, -}; - /* FIXME, these allocations will change when * analog arrives. The be reviewed. * CX23887 Assumptions @@ -754,6 +623,7 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) atomic_inc(&dev->refcount); dev->nr = cx23885_devcount++; + dev->sram_channels = cx23887_sram_channels; sprintf(dev->name, "cx23885[%d]", dev->nr); mutex_lock(&devlist); @@ -763,13 +633,11 @@ static int cx23885_dev_setup(struct cx23885_dev *dev) /* Configure the internal memory */ if(dev->pci->device == 0x8880) { dev->bridge = CX23885_BRIDGE_887; - dev->sram_channels = cx23887_sram_channels; /* Apply a sensible clock frequency for the PCIe bridge */ dev->clk_freq = 25000000; } else if(dev->pci->device == 0x8852) { dev->bridge = CX23885_BRIDGE_885; - dev->sram_channels = cx23885_sram_channels; /* Apply a sensible clock frequency for the PCIe bridge */ dev->clk_freq = 28000000; } else -- cgit v1.1 From c88133ecb3db2e3779d897abca960c450623a2a2 Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Sat, 29 Mar 2008 17:36:09 -0300 Subject: V4L/DVB (7465): Fix eeprom parsing and errors on the HVR1800 products On some models, the valid Hauppauge eeprom data begins at a different offset. This patch avoid unfriendly 'corrupt' eeprom errors during driver load. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx23885/cx23885-cards.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers/media') diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 2d414da..761ad4f 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c @@ -347,10 +347,13 @@ void cx23885_card_setup(struct cx23885_dev *dev) case CX23885_BOARD_HAUPPAUGE_HVR1250: case CX23885_BOARD_HAUPPAUGE_HVR1500: case CX23885_BOARD_HAUPPAUGE_HVR1500Q: + if (dev->i2c_bus[0].i2c_rc == 0) + hauppauge_eeprom(dev, eeprom+0x80); + break; case CX23885_BOARD_HAUPPAUGE_HVR1800: case CX23885_BOARD_HAUPPAUGE_HVR1800lp: if (dev->i2c_bus[0].i2c_rc == 0) - hauppauge_eeprom(dev, eeprom+0x80); + hauppauge_eeprom(dev, eeprom+0xc0); break; } -- cgit v1.1 From 4b15b5ec36fc54bf3412f042d5833049876446eb Mon Sep 17 00:00:00 2001 From: Steven Toth Date: Sat, 29 Mar 2008 17:37:00 -0300 Subject: V4L/DVB (7466): Avoid minor model number warning when an OEM HVR1250 board is detected Avoid minor model number warning when an OEM HVR1250 board is detected. Signed-off-by: Steven Toth Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx23885/cx23885-cards.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media') diff --git a/drivers/media/video/cx23885/cx23885-cards.c b/drivers/media/video/cx23885/cx23885-cards.c index 761ad4f..dfa2698 100644 --- a/drivers/media/video/cx23885/cx23885-cards.c +++ b/drivers/media/video/cx23885/cx23885-cards.c @@ -232,6 +232,7 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) case 78631: /* WinTV-HVR1800 (PCIe, OEM, No IR, No FM, Dual channel ATSC and MPEG2 HW Encoder */ case 79001: /* WinTV-HVR1250 (PCIe, Retail, IR, full height, ATSC and Basic analog */ case 79101: /* WinTV-HVR1250 (PCIe, Retail, IR, half height, ATSC and Basic analog */ + case 79561: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ case 79571: /* WinTV-HVR1250 (PCIe, OEM, No IR, full height, ATSC and Basic analog */ case 79671: /* WinTV-HVR1250 (PCIe, OEM, No IR, half height, ATSC and Basic analog */ break; -- cgit v1.1 From 19ac111c038537b73c9a0bca24bad123c2ba5f42 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 31 Mar 2008 09:08:08 -0300 Subject: V4L/DVB (7485): v4l2-int-device.c: add MODULE_LICENSE Now that it's in an own module it needs a MODULE_LICENSE. Signed-off-by: Adrian Bunk Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/v4l2-int-device.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers/media') diff --git a/drivers/media/video/v4l2-int-device.c b/drivers/media/video/v4l2-int-device.c index a545dca..0e45499 100644 --- a/drivers/media/video/v4l2-int-device.c +++ b/drivers/media/video/v4l2-int-device.c @@ -156,3 +156,5 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg) find_ioctl(d->u.slave, cmd, (v4l2_int_ioctl_func *)no_such_ioctl_1))(d, arg); } + +MODULE_LICENSE("GPL"); -- cgit v1.1 From 044dfc99fe3e1e0fa85bbdd1936ee229e399250c Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Mon, 31 Mar 2008 21:21:48 -0300 Subject: V4L/DVB (7486): radio-cadet: wrap PNP probe code in #ifdef CONFIG_PNP Wrap PNP probe code in #ifdef CONFIG_PNP. Without this change, we'll have unresolved references to pnp_get_resource() function when CONFIG_PNP=n. (This is a new interface that's not in mainline yet.) Signed-off-by: Bjorn Helgaas Signed-off-by: Andrew Morton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/radio/radio-cadet.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/media') diff --git a/drivers/media/radio/radio-cadet.c b/drivers/media/radio/radio-cadet.c index 34e317c..57b9e3a 100644 --- a/drivers/media/radio/radio-cadet.c +++ b/drivers/media/radio/radio-cadet.c @@ -587,6 +587,8 @@ static struct video_device cadet_radio= .vidioc_s_input = vidioc_s_input, }; +#ifdef CONFIG_PNP + static struct pnp_device_id cadet_pnp_devices[] = { /* ADS Cadet AM/FM Radio Card */ {.id = "MSM0c24", .driver_data = 0}, @@ -621,6 +623,10 @@ static struct pnp_driver cadet_pnp_driver = { .remove = NULL, }; +#else +static struct pnp_driver cadet_pnp_driver; +#endif + static int cadet_probe(void) { static int iovals[8]={0x330,0x332,0x334,0x336,0x338,0x33a,0x33c,0x33e}; -- cgit v1.1