aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/dvb/frontends/s5h1411.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/s5h1411.c b/drivers/media/dvb/frontends/s5h1411.c
index 40e0fedf381e..b9ac6d35a1eb 100644
--- a/drivers/media/dvb/frontends/s5h1411.c
+++ b/drivers/media/dvb/frontends/s5h1411.c
@@ -38,6 +38,7 @@ struct s5h1411_state {
38 struct dvb_frontend frontend; 38 struct dvb_frontend frontend;
39 39
40 fe_modulation_t current_modulation; 40 fe_modulation_t current_modulation;
41 unsigned int first_tune:1;
41 42
42 u32 current_frequency; 43 u32 current_frequency;
43 int if_freq; 44 int if_freq;
@@ -489,6 +490,12 @@ static int s5h1411_enable_modulation(struct dvb_frontend *fe,
489 490
490 dprintk("%s(0x%08x)\n", __func__, m); 491 dprintk("%s(0x%08x)\n", __func__, m);
491 492
493 if ((state->first_tune == 0) && (m == state->current_modulation)) {
494 dprintk("%s() Already at desired modulation. Skipping...\n",
495 __func__);
496 return 0;
497 }
498
492 switch (m) { 499 switch (m) {
493 case VSB_8: 500 case VSB_8:
494 dprintk("%s() VSB_8\n", __func__); 501 dprintk("%s() VSB_8\n", __func__);
@@ -513,6 +520,7 @@ static int s5h1411_enable_modulation(struct dvb_frontend *fe,
513 } 520 }
514 521
515 state->current_modulation = m; 522 state->current_modulation = m;
523 state->first_tune = 0;
516 s5h1411_softreset(fe); 524 s5h1411_softreset(fe);
517 525
518 return 0; 526 return 0;
@@ -622,6 +630,11 @@ static int s5h1411_init(struct dvb_frontend *fe)
622 /* The datasheet says that after initialisation, VSB is default */ 630 /* The datasheet says that after initialisation, VSB is default */
623 state->current_modulation = VSB_8; 631 state->current_modulation = VSB_8;
624 632
633 /* Although the datasheet says it's in VSB, empirical evidence
634 shows problems getting lock on the first tuning request. Make
635 sure we call enable_modulation the first time around */
636 state->first_tune = 1;
637
625 if (state->config->output_mode == S5H1411_SERIAL_OUTPUT) 638 if (state->config->output_mode == S5H1411_SERIAL_OUTPUT)
626 /* Serial */ 639 /* Serial */
627 s5h1411_set_serialmode(fe, 1); 640 s5h1411_set_serialmode(fe, 1);