The patch number 9315 was added via Steven Toth <[EMAIL PROTECTED]>
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:
        [EMAIL PROTECTED]

------

From: Devin Heitmueller  <[EMAIL PROTECTED]>
s5h1411: Skip reconfiguring demod modulation if already at the desired 
modulation


If we are already at the desired modulation, there is no need to reconfigure
the demod (at a tuning time cost)

Note that this change revealed that although the datasheet says the demod
starts out in VSB-8 mode, the first tuning was failing consistently unless
we went through the work of setting the registers.  So add a field to denote
this case so we always do the enable_frontend call, even if the first tuning
request is for VSB-8.

Signed-off-by: Devin Heitmueller <[EMAIL PROTECTED]>
Reviewed-by: Michael Krufky <[EMAIL PROTECTED]>
Acked-by: Steven Toth <[EMAIL PROTECTED]>


---

 linux/drivers/media/dvb/frontends/s5h1411.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff -r 1e74817c525e -r 2d6bf8c8bcd5 linux/drivers/media/dvb/frontends/s5h1411.c
--- a/linux/drivers/media/dvb/frontends/s5h1411.c       Mon Oct 20 09:17:08 
2008 -0400
+++ b/linux/drivers/media/dvb/frontends/s5h1411.c       Mon Oct 20 09:19:07 
2008 -0400
@@ -38,6 +38,7 @@ struct s5h1411_state {
        struct dvb_frontend frontend;
 
        fe_modulation_t current_modulation;
+       unsigned int first_tune:1;
 
        u32 current_frequency;
        int if_freq;
@@ -489,6 +490,12 @@ static int s5h1411_enable_modulation(str
 
        dprintk("%s(0x%08x)\n", __func__, m);
 
+       if ((state->first_tune == 0) && (m == state->current_modulation)) {
+               dprintk("%s() Already at desired modulation.  Skipping...\n",
+                       __func__);
+               return 0;
+       }
+
        switch (m) {
        case VSB_8:
                dprintk("%s() VSB_8\n", __func__);
@@ -513,6 +520,7 @@ static int s5h1411_enable_modulation(str
        }
 
        state->current_modulation = m;
+       state->first_tune = 0;
        s5h1411_softreset(fe);
 
        return 0;
@@ -621,6 +629,11 @@ static int s5h1411_init(struct dvb_front
 
        /* The datasheet says that after initialisation, VSB is default */
        state->current_modulation = VSB_8;
+
+       /* Although the datasheet says it's in VSB, empirical evidence
+          shows problems getting lock on the first tuning request.  Make
+          sure we call enable_modulation the first time around */
+       state->first_tune = 1;
 
        if (state->config->output_mode == S5H1411_SERIAL_OUTPUT)
                /* Serial */


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/2d6bf8c8bcd558cf90c07934e6b9e7040c565a23

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

Reply via email to