From 2c2742da1e590f426e8d85ce4e33b69142245fb8 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 5 Nov 2010 07:35:35 -0300 Subject: [media] BZ#22292: dibx000_common: Restore i2c algo pointer Commit a90f933507859941c4a58028d7593a80f57895c4 accidentally removed the piece of code setting the i2c algo pointer. Restore it. That's what happens when you put two code statements on the same line... Signed-off-by: Jean Delvare Tested by: Chris Clayton Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/dibx000_common.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/media/dvb/frontends/dibx000_common.c b/drivers/media/dvb/frontends/dibx000_common.c index a4991026254..2311c0a3406 100644 --- a/drivers/media/dvb/frontends/dibx000_common.c +++ b/drivers/media/dvb/frontends/dibx000_common.c @@ -130,6 +130,7 @@ static int i2c_adapter_init(struct i2c_adapter *i2c_adap, struct dibx000_i2c_master *mst) { strncpy(i2c_adap->name, name, sizeof(i2c_adap->name)); + i2c_adap->algo = algo; i2c_adap->algo_data = NULL; i2c_set_adapdata(i2c_adap, mst); if (i2c_add_adapter(i2c_adap) < 0) -- cgit v1.2.3 From 0edf2e5e2bd0ae7689ce8a57ae3c87cc1f0c6548 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Wed, 27 Oct 2010 09:30:32 -0300 Subject: [media] v4l: kill the BKL All of the hard problems for BKL removal appear to be solved in the v4l-dvb/master tree. This removes the BKL from the various open functions that do not need it, or only use it to protect an open count. The zoran driver is nontrivial in this regard, so I introduce a new mutex that locks both the open/release and the ioctl functions. Someone with access to the hardware can probably improve that by using the existing lock in all cases. Finally, all drivers that still use the locked version of the ioctl function now get called under a new mutex instead of the BKL. Signed-off-by: Arnd Bergmann Signed-off-by: Mauro Carvalho Chehab --- drivers/media/Kconfig | 1 - drivers/media/video/cx231xx/cx231xx-417.c | 6 ++---- drivers/media/video/cx23885/cx23885-417.c | 9 +-------- drivers/media/video/cx23885/cx23885-video.c | 5 ----- drivers/media/video/se401.c | 7 +++---- drivers/media/video/stk-webcam.c | 4 ---- drivers/media/video/tlg2300/pd-main.c | 13 ++++--------- drivers/media/video/usbvideo/vicam.c | 29 ++++++++++++++--------------- drivers/media/video/v4l2-dev.c | 7 ++++--- drivers/media/video/zoran/zoran.h | 1 + drivers/media/video/zoran/zoran_card.c | 1 + drivers/media/video/zoran/zoran_driver.c | 27 +++++++++++++++++++++------ 12 files changed, 51 insertions(+), 59 deletions(-) diff --git a/drivers/media/Kconfig b/drivers/media/Kconfig index bad2cedb8d9..a28541b2b1a 100644 --- a/drivers/media/Kconfig +++ b/drivers/media/Kconfig @@ -19,7 +19,6 @@ comment "Multimedia core support" config VIDEO_DEV tristate "Video For Linux" - depends on BKL # used in many drivers for ioctl handling, need to kill ---help--- V4L core support for video capture and overlay devices, webcams and AM/FM radio cards. diff --git a/drivers/media/video/cx231xx/cx231xx-417.c b/drivers/media/video/cx231xx/cx231xx-417.c index aab21f3ce47..4c7cac3b625 100644 --- a/drivers/media/video/cx231xx/cx231xx-417.c +++ b/drivers/media/video/cx231xx/cx231xx-417.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -1927,10 +1926,9 @@ static int mpeg_open(struct file *file) dev = h; } - if (dev == NULL) { - unlock_kernel(); + if (dev == NULL) return -ENODEV; - } + mutex_lock(&dev->lock); /* allocate + initialize per filehandle data */ diff --git a/drivers/media/video/cx23885/cx23885-417.c b/drivers/media/video/cx23885/cx23885-417.c index a6cc12f8736..9a98dc55f65 100644 --- a/drivers/media/video/cx23885/cx23885-417.c +++ b/drivers/media/video/cx23885/cx23885-417.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -1576,12 +1575,8 @@ static int mpeg_open(struct file *file) /* allocate + initialize per filehandle data */ fh = kzalloc(sizeof(*fh), GFP_KERNEL); - if (NULL == fh) { - unlock_kernel(); + if (!fh) return -ENOMEM; - } - - lock_kernel(); file->private_data = fh; fh->dev = dev; @@ -1592,8 +1587,6 @@ static int mpeg_open(struct file *file) V4L2_FIELD_INTERLACED, sizeof(struct cx23885_buffer), fh, NULL); - unlock_kernel(); - return 0; } diff --git a/drivers/media/video/cx23885/cx23885-video.c b/drivers/media/video/cx23885/cx23885-video.c index 93af9c65b48..3cc9f462d08 100644 --- a/drivers/media/video/cx23885/cx23885-video.c +++ b/drivers/media/video/cx23885/cx23885-video.c @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -743,8 +742,6 @@ static int video_open(struct file *file) if (NULL == fh) return -ENOMEM; - lock_kernel(); - file->private_data = fh; fh->dev = dev; fh->radio = radio; @@ -762,8 +759,6 @@ static int video_open(struct file *file) dprintk(1, "post videobuf_queue_init()\n"); - unlock_kernel(); - return 0; } diff --git a/drivers/media/video/se401.c b/drivers/media/video/se401.c index 41d0166c0f9..41360d7c3e9 100644 --- a/drivers/media/video/se401.c +++ b/drivers/media/video/se401.c @@ -31,7 +31,6 @@ static const char version[] = "0.24"; #include #include #include -#include #include #include #include "se401.h" @@ -951,9 +950,9 @@ static int se401_open(struct file *file) struct usb_se401 *se401 = (struct usb_se401 *)dev; int err = 0; - lock_kernel(); + mutex_lock(&se401->lock); if (se401->user) { - unlock_kernel(); + mutex_unlock(&se401->lock); return -EBUSY; } se401->fbuf = rvmalloc(se401->maxframesize * SE401_NUMFRAMES); @@ -962,7 +961,7 @@ static int se401_open(struct file *file) else err = -ENOMEM; se401->user = !err; - unlock_kernel(); + mutex_unlock(&se401->lock); return err; } diff --git a/drivers/media/video/stk-webcam.c b/drivers/media/video/stk-webcam.c index f07a0f6b71c..b5afe5f841c 100644 --- a/drivers/media/video/stk-webcam.c +++ b/drivers/media/video/stk-webcam.c @@ -27,7 +27,6 @@ #include #include #include -#include #include #include @@ -673,14 +672,11 @@ static int v4l_stk_open(struct file *fp) vdev = video_devdata(fp); dev = vdev_to_camera(vdev); - lock_kernel(); if (dev == NULL || !is_present(dev)) { - unlock_kernel(); return -ENXIO; } fp->private_data = dev; usb_autopm_get_interface(dev->interface); - unlock_kernel(); return 0; } diff --git a/drivers/media/video/tlg2300/pd-main.c b/drivers/media/video/tlg2300/pd-main.c index 4555f4a5f4c..c91424c0c13 100644 --- a/drivers/media/video/tlg2300/pd-main.c +++ b/drivers/media/video/tlg2300/pd-main.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "vendorcmds.h" #include "pd-common.h" @@ -485,15 +484,11 @@ static void poseidon_disconnect(struct usb_interface *interface) /*unregister v4l2 device */ v4l2_device_unregister(&pd->v4l2_dev); - lock_kernel(); - { - pd_dvb_usb_device_exit(pd); - poseidon_fm_exit(pd); + pd_dvb_usb_device_exit(pd); + poseidon_fm_exit(pd); - poseidon_audio_free(pd); - pd_video_exit(pd); - } - unlock_kernel(); + poseidon_audio_free(pd); + pd_video_exit(pd); usb_set_intfdata(interface, NULL); kref_put(&pd->kref, poseidon_delete); diff --git a/drivers/media/video/usbvideo/vicam.c b/drivers/media/video/usbvideo/vicam.c index 5d6fd01f918..dc17cce2fbb 100644 --- a/drivers/media/video/usbvideo/vicam.c +++ b/drivers/media/video/usbvideo/vicam.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include #include @@ -483,29 +482,28 @@ vicam_open(struct file *file) return -EINVAL; } - /* the videodev_lock held above us protects us from - * simultaneous opens...for now. we probably shouldn't - * rely on this fact forever. + /* cam_lock/open_count protects us from simultaneous opens + * ... for now. we probably shouldn't rely on this fact forever. */ - lock_kernel(); + mutex_lock(&cam->cam_lock); if (cam->open_count > 0) { printk(KERN_INFO "vicam_open called on already opened camera"); - unlock_kernel(); + mutex_unlock(&cam->cam_lock); return -EBUSY; } cam->raw_image = kmalloc(VICAM_MAX_READ_SIZE, GFP_KERNEL); if (!cam->raw_image) { - unlock_kernel(); + mutex_unlock(&cam->cam_lock); return -ENOMEM; } cam->framebuf = rvmalloc(VICAM_MAX_FRAME_SIZE * VICAM_FRAMES); if (!cam->framebuf) { kfree(cam->raw_image); - unlock_kernel(); + mutex_unlock(&cam->cam_lock); return -ENOMEM; } @@ -513,10 +511,17 @@ vicam_open(struct file *file) if (!cam->cntrlbuf) { kfree(cam->raw_image); rvfree(cam->framebuf, VICAM_MAX_FRAME_SIZE * VICAM_FRAMES); - unlock_kernel(); + mutex_unlock(&cam->cam_lock); return -ENOMEM; } + cam->needsDummyRead = 1; + cam->open_count++; + + file->private_data = cam; + mutex_unlock(&cam->cam_lock); + + // First upload firmware, then turn the camera on if (!cam->is_initialized) { @@ -527,12 +532,6 @@ vicam_open(struct file *file) set_camera_power(cam, 1); - cam->needsDummyRead = 1; - cam->open_count++; - - file->private_data = cam; - unlock_kernel(); - return 0; } diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c index 0ca7978654b..03f7f4670e9 100644 --- a/drivers/media/video/v4l2-dev.c +++ b/drivers/media/video/v4l2-dev.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include @@ -247,10 +246,12 @@ static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) mutex_unlock(vdev->lock); } else if (vdev->fops->ioctl) { /* TODO: convert all drivers to unlocked_ioctl */ - lock_kernel(); + static DEFINE_MUTEX(v4l2_ioctl_mutex); + + mutex_lock(&v4l2_ioctl_mutex); if (video_is_registered(vdev)) ret = vdev->fops->ioctl(filp, cmd, arg); - unlock_kernel(); + mutex_unlock(&v4l2_ioctl_mutex); } else ret = -ENOTTY; diff --git a/drivers/media/video/zoran/zoran.h b/drivers/media/video/zoran/zoran.h index 37fe16181e3..27f05551183 100644 --- a/drivers/media/video/zoran/zoran.h +++ b/drivers/media/video/zoran/zoran.h @@ -388,6 +388,7 @@ struct zoran { struct videocodec *vfe; /* video front end */ struct mutex resource_lock; /* prevent evil stuff */ + struct mutex other_lock; /* please merge with above */ u8 initialized; /* flag if zoran has been correctly initialized */ int user; /* number of current users */ diff --git a/drivers/media/video/zoran/zoran_card.c b/drivers/media/video/zoran/zoran_card.c index 0aac376c3f7..7e6d62467ea 100644 --- a/drivers/media/video/zoran/zoran_card.c +++ b/drivers/media/video/zoran/zoran_card.c @@ -1227,6 +1227,7 @@ static int __devinit zoran_probe(struct pci_dev *pdev, snprintf(ZR_DEVNAME(zr), sizeof(ZR_DEVNAME(zr)), "MJPEG[%u]", zr->id); spin_lock_init(&zr->spinlock); mutex_init(&zr->resource_lock); + mutex_init(&zr->other_lock); if (pci_enable_device(pdev)) goto zr_unreg; pci_read_config_byte(zr->pci_dev, PCI_CLASS_REVISION, &zr->revision); diff --git a/drivers/media/video/zoran/zoran_driver.c b/drivers/media/video/zoran/zoran_driver.c index 401082b853f..67a52e844ae 100644 --- a/drivers/media/video/zoran/zoran_driver.c +++ b/drivers/media/video/zoran/zoran_driver.c @@ -49,7 +49,6 @@ #include #include #include -#include #include #include #include @@ -913,7 +912,7 @@ static int zoran_open(struct file *file) dprintk(2, KERN_INFO "%s: %s(%s, pid=[%d]), users(-)=%d\n", ZR_DEVNAME(zr), __func__, current->comm, task_pid_nr(current), zr->user + 1); - lock_kernel(); + mutex_lock(&zr->other_lock); if (zr->user >= 2048) { dprintk(1, KERN_ERR "%s: too many users (%d) on device\n", @@ -963,14 +962,14 @@ static int zoran_open(struct file *file) file->private_data = fh; fh->zr = zr; zoran_open_init_session(fh); - unlock_kernel(); + mutex_unlock(&zr->other_lock); return 0; fail_fh: kfree(fh); fail_unlock: - unlock_kernel(); + mutex_unlock(&zr->other_lock); dprintk(2, KERN_INFO "%s: open failed (%d), users(-)=%d\n", ZR_DEVNAME(zr), res, zr->user); @@ -989,7 +988,7 @@ zoran_close(struct file *file) /* kernel locks (fs/device.c), so don't do that ourselves * (prevents deadlocks) */ - /*mutex_lock(&zr->resource_lock);*/ + mutex_lock(&zr->other_lock); zoran_close_end_session(fh); @@ -1023,6 +1022,7 @@ zoran_close(struct file *file) encoder_call(zr, video, s_routing, 2, 0, 0); } } + mutex_unlock(&zr->other_lock); file->private_data = NULL; kfree(fh->overlay_mask); @@ -3370,11 +3370,26 @@ static const struct v4l2_ioctl_ops zoran_ioctl_ops = { #endif }; +/* please use zr->resource_lock consistently and kill this wrapper */ +static long zoran_ioctl(struct file *file, unsigned int cmd, + unsigned long arg) +{ + struct zoran_fh *fh = file->private_data; + struct zoran *zr = fh->zr; + int ret; + + mutex_lock(&zr->other_lock); + ret = video_ioctl2(file, cmd, arg); + mutex_unlock(&zr->other_lock); + + return ret; +} + static const struct v4l2_file_operations zoran_fops = { .owner = THIS_MODULE, .open = zoran_open, .release = zoran_close, - .ioctl = video_ioctl2, + .unlocked_ioctl = zoran_ioctl, .read = zoran_read, .write = zoran_write, .mmap = zoran_mmap, -- cgit v1.2.3 From 35bbe587d0959712b69540077c9e0fd27d3e6baf Mon Sep 17 00:00:00 2001 From: Dmitri Belimov Date: Tue, 26 Oct 2010 00:31:40 -0300 Subject: [media] saa7134: Fix autodetect for Behold A7 and H7 TV cards The entries for those cards are after the generic entries, so they don't work, in practice. Moving them to happen before the generic entres fix the issue. Signed-off-by: Beholder Intl. Ltd. Dmitry Belimov Cc: stable@kernel.org Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-cards.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 10a6cbf6a79..0911cb580e1 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -6660,6 +6660,18 @@ struct pci_device_id saa7134_pci_tbl[] = { .subvendor = 0x13c2, .subdevice = 0x2804, .driver_data = SAA7134_BOARD_TECHNOTREND_BUDGET_T3000, + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x5ace, /* Beholder Intl. Ltd. */ + .subdevice = 0x7190, + .driver_data = SAA7134_BOARD_BEHOLD_H7, + }, { + .vendor = PCI_VENDOR_ID_PHILIPS, + .device = PCI_DEVICE_ID_PHILIPS_SAA7133, + .subvendor = 0x5ace, /* Beholder Intl. Ltd. */ + .subdevice = 0x7090, + .driver_data = SAA7134_BOARD_BEHOLD_A7, }, { /* --- boards without eeprom + subsystem ID --- */ .vendor = PCI_VENDOR_ID_PHILIPS, @@ -6698,18 +6710,6 @@ struct pci_device_id saa7134_pci_tbl[] = { .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID, .driver_data = SAA7134_BOARD_UNKNOWN, - }, { - .vendor = PCI_VENDOR_ID_PHILIPS, - .device = PCI_DEVICE_ID_PHILIPS_SAA7133, - .subvendor = 0x5ace, /* Beholder Intl. Ltd. */ - .subdevice = 0x7190, - .driver_data = SAA7134_BOARD_BEHOLD_H7, - }, { - .vendor = PCI_VENDOR_ID_PHILIPS, - .device = PCI_DEVICE_ID_PHILIPS_SAA7133, - .subvendor = 0x5ace, /* Beholder Intl. Ltd. */ - .subdevice = 0x7090, - .driver_data = SAA7134_BOARD_BEHOLD_A7, },{ /* --- end of list --- */ } -- cgit v1.2.3 From 399d84655648b052c03301a71caa33758d906c2e Mon Sep 17 00:00:00 2001 From: Daniel Drake Date: Wed, 27 Oct 2010 10:45:32 -0300 Subject: [media] cafe_ccic: fix subdev configuration For some reason, commit 1aafeb30104a is missing one change that was included in the email submission. The sensor configuration must be passed down to the ov7670 subdev. Signed-off-by: Daniel Drake Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cafe_ccic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/media/video/cafe_ccic.c b/drivers/media/video/cafe_ccic.c index 2934770dacc..7bc36670071 100644 --- a/drivers/media/video/cafe_ccic.c +++ b/drivers/media/video/cafe_ccic.c @@ -2065,8 +2065,9 @@ static int cafe_pci_probe(struct pci_dev *pdev, sensor_cfg.clock_speed = 45; cam->sensor_addr = 0x42; - cam->sensor = v4l2_i2c_new_subdev(&cam->v4l2_dev, &cam->i2c_adapter, - NULL, "ov7670", cam->sensor_addr, NULL); + cam->sensor = v4l2_i2c_new_subdev_cfg(&cam->v4l2_dev, &cam->i2c_adapter, + "ov7670", "ov7670", 0, &sensor_cfg, cam->sensor_addr, + NULL); if (cam->sensor == NULL) { ret = -ENODEV; goto out_smbus; -- cgit v1.2.3 From 4f52610e290eb6bf63522b0dad886ac88c7623cd Mon Sep 17 00:00:00 2001 From: Stefan Ringel Date: Wed, 27 Oct 2010 16:48:05 -0300 Subject: [media] tm6000: bugfix set tv standards bugfix set tv standards Signed-off-by: Stefan Ringel Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/tm6000/tm6000-video.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/tm6000/tm6000-video.c b/drivers/staging/tm6000/tm6000-video.c index 9ec82796634..c5690b2a892 100644 --- a/drivers/staging/tm6000/tm6000-video.c +++ b/drivers/staging/tm6000/tm6000-video.c @@ -1032,6 +1032,7 @@ static int vidioc_s_std (struct file *file, void *priv, v4l2_std_id *norm) struct tm6000_fh *fh=priv; struct tm6000_core *dev = fh->dev; + dev->norm = *norm; rc = tm6000_init_analog_mode(dev); fh->width = dev->width; -- cgit v1.2.3 From a8de6635799b58b52c610da9ee390a3e900e7bc7 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Fri, 5 Nov 2010 06:26:03 -0300 Subject: [media] ARM mx3_camera: check for DMA engine type We have two dma engines in MX3 systems: The IPU and the SDMA engine. We have to check if we got a channel from the correct engine before proceeding with a channel. Signed-off-by: Sascha Hauer Cc: Guennadi Liakhovetski Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/mx3_camera.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/media/video/mx3_camera.c b/drivers/media/video/mx3_camera.c index 29c5fc34813..aa871c2936b 100644 --- a/drivers/media/video/mx3_camera.c +++ b/drivers/media/video/mx3_camera.c @@ -27,6 +27,7 @@ #include #include +#include #define MX3_CAM_DRV_NAME "mx3-camera" @@ -638,6 +639,9 @@ static bool chan_filter(struct dma_chan *chan, void *arg) struct dma_chan_request *rq = arg; struct mx3_camera_pdata *pdata; + if (!imx_dma_is_ipu(chan)) + return false; + if (!rq) return false; -- cgit v1.2.3 From 352f5d250ad395c678eebb2c9e1ad8b06114c6e9 Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Tue, 2 Nov 2010 12:08:51 -0300 Subject: [media] SoC Camera: OMAP1: update for recent framework changes The recently added OMAP1 camera driver was not ready for one video queue per device framework changes. Fix it. Created and tested against linux-2.6.37-rc1. Signed-off-by: Janusz Krzysztofik Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/omap1_camera.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c index 7c30e62b50d..5ec38f83585 100644 --- a/drivers/media/video/omap1_camera.c +++ b/drivers/media/video/omap1_camera.c @@ -1386,7 +1386,7 @@ static void omap1_cam_init_videobuf(struct videobuf_queue *q, } } -static int omap1_cam_reqbufs(struct soc_camera_file *icf, +static int omap1_cam_reqbufs(struct soc_camera_device *icd, struct v4l2_requestbuffers *p) { int i; @@ -1398,7 +1398,7 @@ static int omap1_cam_reqbufs(struct soc_camera_file *icf, * it hadn't triggered */ for (i = 0; i < p->count; i++) { - struct omap1_cam_buf *buf = container_of(icf->vb_vidq.bufs[i], + struct omap1_cam_buf *buf = container_of(icd->vb_vidq.bufs[i], struct omap1_cam_buf, vb); buf->inwork = 0; INIT_LIST_HEAD(&buf->vb.queue); @@ -1485,10 +1485,10 @@ static int omap1_cam_set_bus_param(struct soc_camera_device *icd, static unsigned int omap1_cam_poll(struct file *file, poll_table *pt) { - struct soc_camera_file *icf = file->private_data; + struct soc_camera_device *icd = file->private_data; struct omap1_cam_buf *buf; - buf = list_entry(icf->vb_vidq.stream.next, struct omap1_cam_buf, + buf = list_entry(icd->vb_vidq.stream.next, struct omap1_cam_buf, vb.stream); poll_wait(file, &buf->vb.done, pt); -- cgit v1.2.3 From 8c66caebdace925f19fcfd2d1f026044c3995c4b Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Tue, 2 Nov 2010 12:22:32 -0300 Subject: [media] SoC Camera: OMAP1: update for recent videobuf changes Recent locking related videobuf changes has not been incorporated into the new OMAP1 camera driver. Fix it. Created and tested against linux-2.6.37-rc1. Signed-off-by: Janusz Krzysztofik Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/omap1_camera.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c index 5ec38f83585..674f74e6744 100644 --- a/drivers/media/video/omap1_camera.c +++ b/drivers/media/video/omap1_camera.c @@ -235,7 +235,7 @@ static void free_buffer(struct videobuf_queue *vq, struct omap1_cam_buf *buf, BUG_ON(in_interrupt()); - videobuf_waiton(vb, 0, 0); + videobuf_waiton(vq, vb, 0, 0); if (vb_mode == OMAP1_CAM_DMA_CONTIG) { videobuf_dma_contig_free(vq, vb); @@ -1365,12 +1365,12 @@ static void omap1_cam_init_videobuf(struct videobuf_queue *q, videobuf_queue_dma_contig_init(q, &omap1_videobuf_ops, icd->dev.parent, &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, - sizeof(struct omap1_cam_buf), icd); + sizeof(struct omap1_cam_buf), icd, NULL); else videobuf_queue_sg_init(q, &omap1_videobuf_ops, icd->dev.parent, &pcdev->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, - sizeof(struct omap1_cam_buf), icd); + sizeof(struct omap1_cam_buf), icd, NULL); /* use videobuf mode (auto)selected with the module parameter */ pcdev->vb_mode = sg_mode ? OMAP1_CAM_DMA_SG : OMAP1_CAM_DMA_CONTIG; -- cgit v1.2.3 From 4b35e625da69654a71515444c1c0a6b6ce84ad2f Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Tue, 2 Nov 2010 12:30:48 -0300 Subject: [media] SOC Camera: OMAP1: typo fix Fix an outstanding typo in the recently added driver, as requested by the subsystem maintainer. Created against linux-2.6.37-rc1. Signed-off-by: Janusz Krzysztofik Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/omap1_camera.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/video/omap1_camera.c b/drivers/media/video/omap1_camera.c index 674f74e6744..cbfd07f2d9d 100644 --- a/drivers/media/video/omap1_camera.c +++ b/drivers/media/video/omap1_camera.c @@ -504,7 +504,7 @@ static void omap1_videobuf_queue(struct videobuf_queue *vq, * empty. Since the transfer of the DMA programming register set * content to the DMA working register set is done automatically * by the DMA hardware, this can pretty well happen while we - * are keeping the lock here. Levae fetching it from the queue + * are keeping the lock here. Leave fetching it from the queue * to be done when a next DMA interrupt occures instead. */ return; -- cgit v1.2.3 From d889eb1e0e371c15c24bd5c46dd2b18d5e3694e5 Mon Sep 17 00:00:00 2001 From: Janusz Krzysztofik Date: Tue, 2 Nov 2010 13:14:36 -0300 Subject: [media] SoC Camera: ov6650: minor cleanups This is a followup patch that addresses two minor issues left in the recently added ov6650 sensor driver, as I've promised to the subsystem maintainer: - remove a pair of extra brackets, - drop useless case for not possible v4l2_mbus_pixelcode enum value of 0. Created against linux-2.6.37-rc1. Signed-off-by: Janusz Krzysztofik Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/ov6650.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/media/video/ov6650.c b/drivers/media/video/ov6650.c index b7cfeab0948..31f19373bba 100644 --- a/drivers/media/video/ov6650.c +++ b/drivers/media/video/ov6650.c @@ -754,7 +754,7 @@ static int ov6650_g_fmt(struct v4l2_subdev *sd, static bool is_unscaled_ok(int width, int height, struct v4l2_rect *rect) { - return (width > rect->width >> 1 || height > rect->height >> 1); + return width > rect->width >> 1 || height > rect->height >> 1; } static u8 to_clkrc(struct v4l2_fract *timeperframe, @@ -840,8 +840,6 @@ static int ov6650_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf) coma_mask |= COMA_BW | COMA_BYTE_SWAP | COMA_WORD_SWAP; coma_set |= COMA_RAW_RGB | COMA_RGB; break; - case 0: - break; default: dev_err(&client->dev, "Pixel format not handled: 0x%x\n", code); return -EINVAL; -- cgit v1.2.3 From 6b101926f98b54549128db4d34f4a73b5f03fecc Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Mon, 8 Nov 2010 17:52:45 -0300 Subject: [media] soc-camera: Compile fixes for mx2-camera mx2-camera got broken during the last merge window. This patch fixes this and removes some unused variables. Signed-off-by: Sascha Hauer Signed-off-by: Guennadi Liakhovetski Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/mx2_camera.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/media/video/mx2_camera.c b/drivers/media/video/mx2_camera.c index 4a27862da30..072bd2d1cfa 100644 --- a/drivers/media/video/mx2_camera.c +++ b/drivers/media/video/mx2_camera.c @@ -31,6 +31,7 @@ #include #include +#include #include #include #include @@ -903,8 +904,6 @@ static int mx2_camera_set_crop(struct soc_camera_device *icd, static int mx2_camera_set_fmt(struct soc_camera_device *icd, struct v4l2_format *f) { - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct mx2_camera_dev *pcdev = ici->priv; struct v4l2_subdev *sd = soc_camera_to_subdev(icd); const struct soc_camera_format_xlate *xlate; struct v4l2_pix_format *pix = &f->fmt.pix; @@ -943,8 +942,6 @@ static int mx2_camera_set_fmt(struct soc_camera_device *icd, static int mx2_camera_try_fmt(struct soc_camera_device *icd, struct v4l2_format *f) { - struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); - struct mx2_camera_dev *pcdev = ici->priv; struct v4l2_subdev *sd = soc_camera_to_subdev(icd); const struct soc_camera_format_xlate *xlate; struct v4l2_pix_format *pix = &f->fmt.pix; @@ -1024,13 +1021,13 @@ static int mx2_camera_querycap(struct soc_camera_host *ici, return 0; } -static int mx2_camera_reqbufs(struct soc_camera_file *icf, +static int mx2_camera_reqbufs(struct soc_camera_device *icd, struct v4l2_requestbuffers *p) { int i; for (i = 0; i < p->count; i++) { - struct mx2_buffer *buf = container_of(icf->vb_vidq.bufs[i], + struct mx2_buffer *buf = container_of(icd->vb_vidq.bufs[i], struct mx2_buffer, vb); INIT_LIST_HEAD(&buf->vb.queue); } @@ -1151,9 +1148,9 @@ err_out: static unsigned int mx2_camera_poll(struct file *file, poll_table *pt) { - struct soc_camera_file *icf = file->private_data; + struct soc_camera_device *icd = file->private_data; - return videobuf_poll_stream(file, &icf->vb_vidq, pt); + return videobuf_poll_stream(file, &icd->vb_vidq, pt); } static struct soc_camera_host_ops mx2_soc_camera_host_ops = { -- cgit v1.2.3