aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/stb0899_algo.c
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2008-10-26 17:28:52 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2008-12-29 14:53:24 -0500
commit3f4009255bbcfcf55cf8ca40d70e4cf75e4dc68c (patch)
tree094fd545c4aac0cbca3c5471511a062fd2409ebe /drivers/media/dvb/frontends/stb0899_algo.c
parent9bb17eee39d862611d2f34d5c611661b3dfd2e54 (diff)
V4L/DVB (9469): Port STB0899 and STB6100
Signed-off-by: Manu Abraham <manu@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/frontends/stb0899_algo.c')
-rw-r--r--drivers/media/dvb/frontends/stb0899_algo.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/dvb/frontends/stb0899_algo.c b/drivers/media/dvb/frontends/stb0899_algo.c
index 750e88c2c8e6..ced9b7ae7d50 100644
--- a/drivers/media/dvb/frontends/stb0899_algo.c
+++ b/drivers/media/dvb/frontends/stb0899_algo.c
@@ -293,7 +293,7 @@ static enum stb0899_status stb0899_search_carrier(struct stb0899_state *state)
293 if (stb0899_check_carrier(state) == NOCARRIER) { 293 if (stb0899_check_carrier(state) == NOCARRIER) {
294 index++; 294 index++;
295 last_derot_freq = derot_freq; 295 last_derot_freq = derot_freq;
296 derot_freq += index * internal->direction * internal->derot_step; /* next zig zag derotator position */ 296 derot_freq += index * internal->direction * internal->derot_step; /* next zig zag derotator position */
297 297
298 if(ABS(derot_freq) > derot_limit) 298 if(ABS(derot_freq) > derot_limit)
299 next_loop--; 299 next_loop--;
@@ -309,11 +309,11 @@ static enum stb0899_status stb0899_search_carrier(struct stb0899_state *state)
309 } 309 }
310 } 310 }
311 311
312 internal->direction = -internal->direction; /* Change zigzag direction */ 312 internal->direction = -internal->direction; /* Change zigzag direction */
313 } while ((internal->status != CARRIEROK) && next_loop); 313 } while ((internal->status != CARRIEROK) && next_loop);
314 314
315 if (internal->status == CARRIEROK) { 315 if (internal->status == CARRIEROK) {
316 stb0899_read_regs(state, STB0899_CFRM, cfr, 2); /* get derotator frequency */ 316 stb0899_read_regs(state, STB0899_CFRM, cfr, 2); /* get derotator frequency */
317 internal->derot_freq = state->config->inversion * MAKEWORD16(cfr[0], cfr[1]); 317 internal->derot_freq = state->config->inversion * MAKEWORD16(cfr[0], cfr[1]);
318 dprintk(state->verbose, FE_DEBUG, 1, "----> CARRIER OK !, Derot Freq=%d", internal->derot_freq); 318 dprintk(state->verbose, FE_DEBUG, 1, "----> CARRIER OK !, Derot Freq=%d", internal->derot_freq);
319 } else { 319 } else {
@@ -396,7 +396,7 @@ static enum stb0899_status stb0899_search_data(struct stb0899_state *state)
396 do { 396 do {
397 if ((internal->status != CARRIEROK) || (stb0899_check_data(state) != DATAOK)) { 397 if ((internal->status != CARRIEROK) || (stb0899_check_data(state) != DATAOK)) {
398 398
399 derot_freq += index * internal->direction * derot_step; /* next zig zag derotator position */ 399 derot_freq += index * internal->direction * derot_step; /* next zig zag derotator position */
400 if (ABS(derot_freq) > derot_limit) 400 if (ABS(derot_freq) > derot_limit)
401 next_loop--; 401 next_loop--;
402 402
@@ -414,11 +414,11 @@ static enum stb0899_status stb0899_search_data(struct stb0899_state *state)
414 index++; 414 index++;
415 } 415 }
416 } 416 }
417 internal->direction = -internal->direction; /* change zig zag direction */ 417 internal->direction = -internal->direction; /* change zig zag direction */
418 } while ((internal->status != DATAOK) && next_loop); 418 } while ((internal->status != DATAOK) && next_loop);
419 419
420 if (internal->status == DATAOK) { 420 if (internal->status == DATAOK) {
421 stb0899_read_regs(state, STB0899_CFRM, cfr, 2); /* get derotator frequency */ 421 stb0899_read_regs(state, STB0899_CFRM, cfr, 2); /* get derotator frequency */
422 internal->derot_freq = state->config->inversion * MAKEWORD16(cfr[0], cfr[1]); 422 internal->derot_freq = state->config->inversion * MAKEWORD16(cfr[0], cfr[1]);
423 dprintk(state->verbose, FE_DEBUG, 1, "------> DATAOK ! Derot Freq=%d", internal->derot_freq); 423 dprintk(state->verbose, FE_DEBUG, 1, "------> DATAOK ! Derot Freq=%d", internal->derot_freq);
424 } 424 }
@@ -568,12 +568,12 @@ enum stb0899_status stb0899_dvbs_algo(struct stb0899_state *state)
568 STB0899_SETFIELD_VAL(DEMAPVIT_KDIVIDER, reg, 60); 568 STB0899_SETFIELD_VAL(DEMAPVIT_KDIVIDER, reg, 60);
569 stb0899_write_reg(state, STB0899_DEMAPVIT, reg); 569 stb0899_write_reg(state, STB0899_DEMAPVIT, reg);
570 570
571 stb0899_write_reg(state, STB0899_EQON, 0x01); /* Equalizer OFF while acquiring */ 571 stb0899_write_reg(state, STB0899_EQON, 0x01); /* Equalizer OFF while acquiring */
572 stb0899_write_reg(state, STB0899_VITSYNC, 0x19); 572 stb0899_write_reg(state, STB0899_VITSYNC, 0x19);
573 573
574 stb0899_first_subrange(state); 574 stb0899_first_subrange(state);
575 do { 575 do {
576 /* Initialisations */ 576 /* Initialisations */
577 cfr[0] = cfr[1] = 0; 577 cfr[0] = cfr[1] = 0;
578 stb0899_write_regs(state, STB0899_CFRM, cfr, 2); /* RESET derotator frequency */ 578 stb0899_write_regs(state, STB0899_CFRM, cfr, 2); /* RESET derotator frequency */
579 579
@@ -588,7 +588,7 @@ enum stb0899_status stb0899_dvbs_algo(struct stb0899_state *state)
588 /* enable tuner I/O */ 588 /* enable tuner I/O */
589 stb0899_i2c_gate_ctrl(&state->frontend, 1); 589 stb0899_i2c_gate_ctrl(&state->frontend, 1);
590 590
591 /* Move tuner to frequency */ 591 /* Move tuner to frequency */
592 dprintk(state->verbose, FE_DEBUG, 1, "Tuner set frequency"); 592 dprintk(state->verbose, FE_DEBUG, 1, "Tuner set frequency");
593 if (state->config->tuner_set_frequency) 593 if (state->config->tuner_set_frequency)
594 state->config->tuner_set_frequency(&state->frontend, internal->freq); 594 state->config->tuner_set_frequency(&state->frontend, internal->freq);