diff options
author | Devin Heitmueller <devin.heitmueller@gmail.com> | 2008-10-20 09:19:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-21 12:31:04 -0400 |
commit | 50eac6bc466f69e1ecb3a1b64346ed7b979547ac (patch) | |
tree | 4f91152df4e8713c5b628bedde28c0ca0272a714 /drivers | |
parent | f0d041e50bc6c8a677922d72b010f80af9b23b18 (diff) |
V4L/DVB (9315): 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 <devin.heitmueller@gmail.com>
Reviewed-by: Michael Krufky <mkrufky@linuxtv.org>
Acked-by: Steven Toth <stoth@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb/frontends/s5h1411.c | 13 |
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); |