[PATCH] Fix buglets in v4l1 compatibility layer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Russell King <rmk@xxxxxxxxxxxxxxxx>

The following patch fixes a few bugs I've noticed in the V4L1
compatibility layer:
- VIDEO_MODE_AUTO for get/set input ioctls was not being handled
- wrong V4L2 ioctl being used in v4l1_compat_select_tuner

Signed-off-by: Russell King <rmk+kernel@xxxxxxxxxxxxxxxx>
---

 drivers/media/video/v4l1-compat.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c
index b617bf0..02f2a6d 100644
--- a/drivers/media/video/v4l1-compat.c
+++ b/drivers/media/video/v4l1-compat.c
@@ -575,6 +575,8 @@ static noinline long v4l1_compat_get_input_info(
 			chan->norm = VIDEO_MODE_NTSC;
 		if (sid & V4L2_STD_SECAM)
 			chan->norm = VIDEO_MODE_SECAM;
+		if (sid == V4L2_STD_ALL)
+			chan->norm = VIDEO_MODE_AUTO;
 	}
 done:
 	return err;
@@ -601,6 +603,9 @@ static noinline long v4l1_compat_set_input(
 	case VIDEO_MODE_SECAM:
 		sid = V4L2_STD_SECAM;
 		break;
+	case VIDEO_MODE_AUTO:
+		sid = V4L2_STD_ALL;
+		break;
 	}
 	if (0 != sid) {
 		err = drv(file, VIDIOC_S_STD, &sid);
@@ -804,9 +809,9 @@ static noinline long v4l1_compat_select_tuner(
 
 	t.index = tun->tuner;
 
-	err = drv(file, VIDIOC_S_INPUT, &t);
+	err = drv(file, VIDIOC_S_TUNER, &t);
 	if (err < 0)
-		dprintk("VIDIOCSTUNER / VIDIOC_S_INPUT: %ld\n", err);
+		dprintk("VIDIOCSTUNER / VIDIOC_S_TUNER: %ld\n", err);
 	return err;
 }
 
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux