From 4e02f28e367a1129eabbf9c8a94c1514d4fc7a8b Mon Sep 17 00:00:00 2001 From: Trent Piepho Date: Sat, 28 Mar 2009 18:25:35 -0700 Subject: saa7146: Remove buffer type check from vidioc_g_parm From: Trent Piepho The v4l2-ioctl core now only allows buffer types for which the corresponding ->vidioc_try_fmt_xxx() methods are defined to be used with vidioc_(g|s)_parm. The driver was only allowing VIDEO_CAPTURE buffers for g_parm, but since the driver defines ->vidioc_try_fmt_vid_overlay() it will now allow VIDEO_OVERLAY buffers as well. This should be fine as the fields the driver fills in, readbuffers and frame rate, aren't wrong for VIDEO_OVERLAY buffers. Priority: normal Signed-off-by: Trent Piepho --- linux/drivers/media/common/saa7146_video.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'linux/drivers/media/common') diff --git a/linux/drivers/media/common/saa7146_video.c b/linux/drivers/media/common/saa7146_video.c index ace925134..46c59da56 100644 --- a/linux/drivers/media/common/saa7146_video.c +++ b/linux/drivers/media/common/saa7146_video.c @@ -724,8 +724,6 @@ static int vidioc_g_parm(struct file *file, void *fh, struct saa7146_dev *dev = ((struct saa7146_fh *)fh)->dev; struct saa7146_vv *vv = dev->vv_data; - if (parm->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) - return -EINVAL; parm->parm.capture.readbuffers = 1; v4l2_video_std_frame_period(vv->standard->id, &parm->parm.capture.timeperframe); -- cgit v1.2.3 From 1784ea5527ed756f946958f45f74d1f15797c366 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 30 Mar 2009 01:04:44 +0200 Subject: v4l2: use old-style i2c API for kernels < 2.6.26 instead of < 2.6.22 From: Hans Verkuil Originally the intention was to switch to the new style i2c API starting with the introduction of the API in 2.6.22. However, the i2c_new_probed_device() function has a lethal bug that wasn't fixed until 2.6.25. Or more accurately, it was only fixed in the stable series of 2.6.25 and 2.6.26. Given the fact that the new i2c API also changed starting with 2.6.26 (the addition of i2c_device_id), it is easiest to switch APIs starting with 2.6.26. This patch updates all the legacy code accordingly. Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/common/saa7146_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/common') diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index fa9d4f90a..fc2c95a16 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -414,8 +414,8 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c saa7146_i2c_reset(dev); if (i2c_adapter) { -#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 22) - /* For kernels > 2.6.22 it can actually be NULL +#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) + /* For kernels > 2.6.26 it can actually be NULL when v4l2_subdev is used. */ BUG_ON(!i2c_adapter->class); #endif -- cgit v1.2.3 From a094d5bae41248bc239d58e5f454b6d702726dcb Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Thu, 2 Apr 2009 16:54:15 +0200 Subject: saa7146: fix incorrect comment. From: Hans Verkuil Priority: normal Signed-off-by: Hans Verkuil --- linux/drivers/media/common/saa7146_i2c.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'linux/drivers/media/common') diff --git a/linux/drivers/media/common/saa7146_i2c.c b/linux/drivers/media/common/saa7146_i2c.c index fc2c95a16..ce4f102ad 100644 --- a/linux/drivers/media/common/saa7146_i2c.c +++ b/linux/drivers/media/common/saa7146_i2c.c @@ -415,8 +415,8 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c if (i2c_adapter) { #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) - /* For kernels > 2.6.26 it can actually be NULL - when v4l2_subdev is used. */ + /* For kernels >= 2.6.26 the class field is actually + always 0, so only do this test for older kernels. */ BUG_ON(!i2c_adapter->class); #endif i2c_set_adapdata(i2c_adapter, &dev->v4l2_dev); -- cgit v1.2.3