V4L/DVB (3254): Don't reprogram the video standard if it is unchanged.
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 9 Jan 2006 17:25:43 +0000 (15:25 -0200)
committerMauro Carvalho Chehab <mchehab@brturbo.com.br>
Mon, 9 Jan 2006 17:25:43 +0000 (15:25 -0200)
- Don't reprogram the video standard if the new standard
equals the old standard.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
drivers/media/video/saa7115.c

index 3e4e5584c5d0eebe98c2b9aa3e3f2f3d29121ead..5d33d0922e79c1362763e1bf88cbc637149e45ee 100644 (file)
@@ -668,6 +668,16 @@ static void saa7115_set_v4lstd(struct i2c_client *client, v4l2_std_id std)
        struct saa7115_state *state = i2c_get_clientdata(client);
        int taskb = saa7115_read(client, 0x80) & 0x10;
 
+       /* Prevent unnecessary standard changes. During a standard
+          change the I-Port is temporarily disabled. Any devices
+          reading from that port can get confused.
+          Note that VIDIOC_S_STD is also used to switch from
+          radio to TV mode, so if a VIDIOC_S_STD is broadcast to
+          all I2C devices then you do not want to have an unwanted
+          side-effect here. */
+       if (std == state->std)
+               return;
+
        // This works for NTSC-M, SECAM-L and the 50Hz PAL variants.
        if (std & V4L2_STD_525_60) {
                saa7115_dbg("decoder set standard 60 Hz\n");