The patch number 13247 was added via Michael Krufky <mkru...@kernellabs.com>
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
        Linux Media Mailing List <linux-me...@vger.kernel.org>

------

From: Michael Krufky  <mkru...@kernellabs.com>
tuner-core: dont force every tuner to set frequency at startup


Setting the tuner frequency at the same time as initializing the other devices
on the i2c bus can cause problems on devices that require firmware download or
extensive calibration proceduces during initialization.

This change allows us to prevent the tune at startup for devices that perform
better without it.

Priority: normal

Signed-off-by: Michael Krufky <mkru...@kernellabs.com>


---

 linux/drivers/media/video/tuner-core.c |    9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff -r fb33c03e8a46 -r 01e161dc8e32 linux/drivers/media/video/tuner-core.c
--- a/linux/drivers/media/video/tuner-core.c    Tue Sep 15 22:04:18 2009 -0400
+++ b/linux/drivers/media/video/tuner-core.c    Sat Oct 24 15:42:16 2009 -0400
@@ -334,6 +334,7 @@
        struct dvb_tuner_ops *fe_tuner_ops = &t->fe.ops.tuner_ops;
        struct analog_demod_ops *analog_ops = &t->fe.ops.analog_ops;
        unsigned char buffer[4];
+       int tune_now = 1;
 
        if (type == UNSET || type == TUNER_ABSENT) {
                tuner_dbg ("tuner 0x%02x: Tuner type absent\n",c->addr);
@@ -418,6 +419,7 @@
                };
                if (!dvb_attach(xc2028_attach, &t->fe, &cfg))
                        goto attach_failed;
+               tune_now = 0;
                break;
        }
        case TUNER_TDA9887:
@@ -433,6 +435,7 @@
                if (!dvb_attach(xc5000_attach,
                                &t->fe, t->i2c->adapter, &xc5000_cfg))
                        goto attach_failed;
+               tune_now = 0;
                break;
        }
        case TUNER_NXP_TDA18271:
@@ -444,6 +447,7 @@
                if (!dvb_attach(tda18271_attach, &t->fe, t->i2c->addr,
                                t->i2c->adapter, &cfg))
                        goto attach_failed;
+               tune_now = 0;
                break;
        }
        default:
@@ -472,12 +476,13 @@
        if (t->mode_mask == T_UNINITIALIZED)
                t->mode_mask = new_mode_mask;
 
-       /* xc2028/3028 and xc5000 requires a firmware to be set-up later
+       /* Some tuners require more initialization setup before use,
+          such as firmware download or device calibration.
           trying to set a frequency here will just fail
           FIXME: better to move set_freq to the tuner code. This is needed
           on analog tuners for PLL to properly work
         */
-       if (t->type != TUNER_XC2028 && t->type != TUNER_XC5000)
+       if (tune_now)
                set_freq(c, (V4L2_TUNER_RADIO == t->mode) ?
                            t->radio_freq : t->tv_freq);
 


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/01e161dc8e3287f3ce29ab9338a4fc84fd5dec59

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to