diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2007-11-22 15:13:00 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:02:59 -0500 |
commit | 22ee1250bd41534552c61be13994fd12d1ee1318 (patch) | |
tree | 448374620e93d5abe8bb0d1aa90512f9abc93284 /drivers/media | |
parent | 63806eeb61dcdf30fdbf488babff98aea2ca3f08 (diff) |
V4L/DVB (6678): tda18271: define init callback
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/tda18271.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/drivers/media/dvb/frontends/tda18271.c b/drivers/media/dvb/frontends/tda18271.c index aaaa2f885186..ad72ff69ce92 100644 --- a/drivers/media/dvb/frontends/tda18271.c +++ b/drivers/media/dvb/frontends/tda18271.c | |||
@@ -429,17 +429,11 @@ static void tda18271_write_regs(struct dvb_frontend *fe, int idx, int len) | |||
429 | 429 | ||
430 | /*---------------------------------------------------------------------*/ | 430 | /*---------------------------------------------------------------------*/ |
431 | 431 | ||
432 | static void tda18271_init_regs(struct dvb_frontend *fe) | 432 | static int tda18271_init_regs(struct dvb_frontend *fe) |
433 | { | 433 | { |
434 | struct tda18271_priv *priv = fe->tuner_priv; | 434 | struct tda18271_priv *priv = fe->tuner_priv; |
435 | unsigned char *regs = priv->tda18271_regs; | 435 | unsigned char *regs = priv->tda18271_regs; |
436 | 436 | ||
437 | tda18271_read_regs(fe); | ||
438 | |||
439 | /* test IR_CAL_OK to see if we need init */ | ||
440 | if ((regs[R_EP1] & 0x08) != 0) | ||
441 | return; | ||
442 | |||
443 | printk(KERN_INFO "tda18271: initializing registers\n"); | 437 | printk(KERN_INFO "tda18271: initializing registers\n"); |
444 | 438 | ||
445 | /* initialize registers */ | 439 | /* initialize registers */ |
@@ -616,6 +610,8 @@ static void tda18271_init_regs(struct dvb_frontend *fe) | |||
616 | 610 | ||
617 | regs[R_EP1] = 0xc6; | 611 | regs[R_EP1] = 0xc6; |
618 | tda18271_write_regs(fe, R_EP1, 1); | 612 | tda18271_write_regs(fe, R_EP1, 1); |
613 | |||
614 | return 0; | ||
619 | } | 615 | } |
620 | 616 | ||
621 | static int tda18271_tune(struct dvb_frontend *fe, | 617 | static int tda18271_tune(struct dvb_frontend *fe, |
@@ -626,10 +622,15 @@ static int tda18271_tune(struct dvb_frontend *fe, | |||
626 | u32 div, N = 0; | 622 | u32 div, N = 0; |
627 | int i; | 623 | int i; |
628 | 624 | ||
625 | tda18271_read_regs(fe); | ||
626 | |||
627 | /* test IR_CAL_OK to see if we need init */ | ||
628 | if ((regs[R_EP1] & 0x08) == 0) | ||
629 | tda18271_init_regs(fe); | ||
630 | |||
629 | 631 | ||
630 | dprintk(1, "freq = %d, ifc = %d\n", freq, ifc); | 632 | dprintk(1, "freq = %d, ifc = %d\n", freq, ifc); |
631 | 633 | ||
632 | tda18271_init_regs(fe); | ||
633 | /* RF tracking filter calibration */ | 634 | /* RF tracking filter calibration */ |
634 | 635 | ||
635 | /* calculate BP_Filter */ | 636 | /* calculate BP_Filter */ |
@@ -1024,6 +1025,7 @@ static struct dvb_tuner_ops tda18271_tuner_ops = { | |||
1024 | .frequency_max = 864000000, | 1025 | .frequency_max = 864000000, |
1025 | .frequency_step = 62500 | 1026 | .frequency_step = 62500 |
1026 | }, | 1027 | }, |
1028 | .init = tda18271_init_regs, | ||
1027 | .set_params = tda18271_set_params, | 1029 | .set_params = tda18271_set_params, |
1028 | .set_analog_params = tda18271_set_analog_params, | 1030 | .set_analog_params = tda18271_set_analog_params, |
1029 | .release = tda18271_release, | 1031 | .release = tda18271_release, |