--- /dev/null
+From 776f979e0e2a0847214d8af0bd1050e61e0d5564 Mon Sep 17 00:00:00 2001
+From: Devin Heitmueller <dheitmueller@linuxtv.org>
+Date: Mon, 26 Jan 2009 03:07:59 -0300
+Subject: DVB: s5h1409: Perform s5h1409 soft reset after tuning
+
+From: Devin Heitmueller <dheitmueller@linuxtv.org>
+
+(cherry picked from commit 67e70baf043cfdcdaf5972bc94be82632071536b)
+
+Just like with the s5h1411, the s5h1409 needs a soft-reset in order for it
+to know that the tuner has been told to change frequencies. This change
+changes the behavior from "random tuning times between 500ms to complete
+tuning lock failures" to "tuning lock consistently within 700ms".
+
+Thanks to Robert Krakora <rob.krakora@messagenetsystems.com> for doing
+initial testing of the patch on the KWorld 330U.
+
+Thanks to Andy Walls <awalls@radix.net> for doing testing of the patch on
+the HVR-1600.
+
+Thanks to Michael Krufky <mkrufky@linuxtv.org> for doing additional testing.
+
+Signed-off-by: Devin Heitmueller <dheitmueller@linuxtv.org>
+Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/dvb/frontends/s5h1409.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+--- a/drivers/media/dvb/frontends/s5h1409.c
++++ b/drivers/media/dvb/frontends/s5h1409.c
+@@ -545,9 +545,6 @@ static int s5h1409_set_frontend(struct d
+
+ s5h1409_enable_modulation(fe, p->u.vsb.modulation);
+
+- /* Allow the demod to settle */
+- msleep(100);
+-
+ if (fe->ops.tuner_ops.set_params) {
+ if (fe->ops.i2c_gate_ctrl)
+ fe->ops.i2c_gate_ctrl(fe, 1);
+@@ -562,6 +559,10 @@ static int s5h1409_set_frontend(struct d
+ s5h1409_set_qam_interleave_mode(fe);
+ }
+
++ /* Issue a reset to the demod so it knows to resync against the
++ newly tuned frequency */
++ s5h1409_softreset(fe);
++
+ return 0;
+ }
+
--- /dev/null
+From ff4f3bdf78afa7005574364a71fc1cf001ee6974 Mon Sep 17 00:00:00 2001
+From: Michael Krufky <mkrufky@linuxtv.org>
+Date: Mon, 5 Jan 2009 18:25:04 -0300
+Subject: V4L: tda8290: fix TDA8290 + TDA18271 initialization
+
+From: Michael Krufky <mkrufky@linuxtv.org>
+
+(cherry picked from commit 439b72b69e4992e9ec34b74304f0fa95623934eb)
+
+Don't call tda8290_init_tuner unless we have either a TDA8275 or TDA8275A
+present. Calling this function will cause a TDA18271 to get sick, so we
+should only call it when needed.
+
+Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/common/tuners/tda8290.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+--- a/drivers/media/common/tuners/tda8290.c
++++ b/drivers/media/common/tuners/tda8290.c
+@@ -724,7 +724,8 @@ struct dvb_frontend *tda829x_attach(stru
+ fe->ops.analog_ops.info.name = name;
+
+ if (priv->ver & TDA8290) {
+- tda8290_init_tuner(fe);
++ if (priv->ver & (TDA8275 | TDA8275A))
++ tda8290_init_tuner(fe);
+ tda8290_init_if(fe);
+ } else if (priv->ver & TDA8295)
+ tda8295_init_if(fe);
--- /dev/null
+From 62cf228a1d4e184128699194d8d43c023646235b Mon Sep 17 00:00:00 2001
+From: Martin Dauskardt <martin.dauskardt@gmx.de>
+Date: Thu, 12 Mar 2009 17:43:44 -0400
+Subject: V4L: saa7127: fix broken S-Video with saa7129
+
+From: Martin Dauskardt <martin.dauskardt@gmx.de>
+
+(backported from commit 0f3559ef17362a7dd5017521a4dd4cad31263395)
+
+Register 0x2d has to be set differently in the saa7129 compared to the
+saa7127. This was not done correctly, so S-Video was broken in certain
+circumstances.
+
+This fixes a regression introduced in 2.6.28.
+
+Signed-off-by: Martin Dauskardt <martin.dauskardt@gmx.de>
+Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/video/saa7127.c | 52 ++++++++++++++++++++++++------------------
+ 1 file changed, 30 insertions(+), 22 deletions(-)
+
+--- a/drivers/media/video/saa7127.c
++++ b/drivers/media/video/saa7127.c
+@@ -149,7 +149,7 @@ static const struct i2c_reg_value saa712
+ { SAA7127_REG_COPYGEN_0, 0x77 },
+ { SAA7127_REG_COPYGEN_1, 0x41 },
+ { SAA7127_REG_COPYGEN_2, 0x00 }, /* Macrovision enable/disable */
+- { SAA7127_REG_OUTPUT_PORT_CONTROL, 0x9e },
++ { SAA7127_REG_OUTPUT_PORT_CONTROL, 0xbf },
+ { SAA7127_REG_GAIN_LUMINANCE_RGB, 0x00 },
+ { SAA7127_REG_GAIN_COLORDIFF_RGB, 0x00 },
+ { SAA7127_REG_INPUT_PORT_CONTROL_1, 0x80 }, /* for color bars */
+@@ -479,12 +479,18 @@ static int saa7127_set_output_type(struc
+ break;
+
+ case SAA7127_OUTPUT_TYPE_COMPOSITE:
+- state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */
++ if (state->ident == V4L2_IDENT_SAA7129)
++ state->reg_2d = 0x20; /* CVBS only */
++ else
++ state->reg_2d = 0x08; /* 00001000 CVBS only, RGB DAC's off (high impedance mode) */
+ state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */
+ break;
+
+ case SAA7127_OUTPUT_TYPE_SVIDEO:
+- state->reg_2d = 0xff; /* 11111111 croma -> R, luma -> CVBS + G + B */
++ if (state->ident == V4L2_IDENT_SAA7129)
++ state->reg_2d = 0x18; /* Y + C */
++ else
++ state->reg_2d = 0xff; /*11111111 croma -> R, luma -> CVBS + G + B */
+ state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */
+ break;
+
+@@ -499,7 +505,10 @@ static int saa7127_set_output_type(struc
+ break;
+
+ case SAA7127_OUTPUT_TYPE_BOTH:
+- state->reg_2d = 0xbf;
++ if (state->ident == V4L2_IDENT_SAA7129)
++ state->reg_2d = 0x38;
++ else
++ state->reg_2d = 0xbf;
+ state->reg_3a = 0x13; /* by default switch YUV to RGB-matrix on */
+ break;
+
+@@ -691,24 +700,6 @@ static int saa7127_probe(struct i2c_clie
+
+ i2c_set_clientdata(client, state);
+
+- /* Configure Encoder */
+-
+- v4l_dbg(1, debug, client, "Configuring encoder\n");
+- saa7127_write_inittab(client, saa7127_init_config_common);
+- saa7127_set_std(client, V4L2_STD_NTSC);
+- saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH);
+- saa7127_set_vps(client, &vbi);
+- saa7127_set_wss(client, &vbi);
+- saa7127_set_cc(client, &vbi);
+- saa7127_set_xds(client, &vbi);
+- if (test_image == 1)
+- /* The Encoder has an internal Colorbar generator */
+- /* This can be used for debugging */
+- saa7127_set_input_type(client, SAA7127_INPUT_TYPE_TEST_IMAGE);
+- else
+- saa7127_set_input_type(client, SAA7127_INPUT_TYPE_NORMAL);
+- saa7127_set_video_enable(client, 1);
+-
+ if (id->driver_data) { /* Chip type is already known */
+ state->ident = id->driver_data;
+ } else { /* Needs detection */
+@@ -730,6 +721,23 @@ static int saa7127_probe(struct i2c_clie
+
+ v4l_info(client, "%s found @ 0x%x (%s)\n", client->name,
+ client->addr << 1, client->adapter->name);
++
++ v4l_dbg(1, debug, client, "Configuring encoder\n");
++ saa7127_write_inittab(client, saa7127_init_config_common);
++ saa7127_set_std(client, V4L2_STD_NTSC);
++ saa7127_set_output_type(client, SAA7127_OUTPUT_TYPE_BOTH);
++ saa7127_set_vps(client, &vbi);
++ saa7127_set_wss(client, &vbi);
++ saa7127_set_cc(client, &vbi);
++ saa7127_set_xds(client, &vbi);
++ if (test_image == 1)
++ /* The Encoder has an internal Colorbar generator */
++ /* This can be used for debugging */
++ saa7127_set_input_type(client, SAA7127_INPUT_TYPE_TEST_IMAGE);
++ else
++ saa7127_set_input_type(client, SAA7127_INPUT_TYPE_NORMAL);
++ saa7127_set_video_enable(client, 1);
++
+ if (state->ident == V4L2_IDENT_SAA7129)
+ saa7127_write_inittab(client, saa7129_init_config_extra);
+ return 0;
--- /dev/null
+From ecc30addbaa83029a9fb6de6c2756fef1cc6a7f8 Mon Sep 17 00:00:00 2001
+From: Hans Verkuil <hverkuil@xs4all.nl>
+Date: Sat, 14 Feb 2009 19:58:33 -0300
+Subject: V4L: ivtv: fix decoder crash regression
+
+From: Hans Verkuil <hverkuil@xs4all.nl>
+
+(cherry picked from commit ac9575f75c52bcb455120f8c43376b556acba048)
+
+The video_ioctl2 conversion of ivtv in kernel 2.6.27 introduced a bug
+causing decoder commands to crash. The decoder commands should have been
+handled from the video_ioctl2 default handler, ensuring correct mapping
+of the argument between user and kernel space. Unfortunately they ended
+up before the video_ioctl2 call, causing random crashes.
+
+Thanks to hannes@linus.priv.at for testing and helping me track down the
+cause!
+
+Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
+Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
+Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
+
+---
+ drivers/media/video/ivtv/ivtv-ioctl.c | 24 ++++++++++++------------
+ 1 file changed, 12 insertions(+), 12 deletions(-)
+
+--- a/drivers/media/video/ivtv/ivtv-ioctl.c
++++ b/drivers/media/video/ivtv/ivtv-ioctl.c
+@@ -1750,6 +1750,18 @@ static int ivtv_default(struct file *fil
+ break;
+ }
+
++ case IVTV_IOC_DMA_FRAME:
++ case VIDEO_GET_PTS:
++ case VIDEO_GET_FRAME_COUNT:
++ case VIDEO_GET_EVENT:
++ case VIDEO_PLAY:
++ case VIDEO_STOP:
++ case VIDEO_FREEZE:
++ case VIDEO_CONTINUE:
++ case VIDEO_COMMAND:
++ case VIDEO_TRY_COMMAND:
++ return ivtv_decoder_ioctls(file, cmd, (void *)arg);
++
+ default:
+ return -EINVAL;
+ }
+@@ -1792,18 +1804,6 @@ static long ivtv_serialized_ioctl(struct
+ ivtv_vapi(itv, CX2341X_DEC_SET_AUDIO_MODE, 2, itv->audio_bilingual_mode, itv->audio_stereo_mode);
+ return 0;
+
+- case IVTV_IOC_DMA_FRAME:
+- case VIDEO_GET_PTS:
+- case VIDEO_GET_FRAME_COUNT:
+- case VIDEO_GET_EVENT:
+- case VIDEO_PLAY:
+- case VIDEO_STOP:
+- case VIDEO_FREEZE:
+- case VIDEO_CONTINUE:
+- case VIDEO_COMMAND:
+- case VIDEO_TRY_COMMAND:
+- return ivtv_decoder_ioctls(filp, cmd, (void *)arg);
+-
+ default:
+ break;
+ }