diff options
author | Michael Krufky <mkrufky@linuxtv.org> | 2008-04-22 13:42:07 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-04-24 13:07:43 -0400 |
commit | 12afe3781870cad7b6bbe83a2f8c4dd9ec7bf214 (patch) | |
tree | 078c450c5dea028586d5a03c00b6f6197e5cc7ec /drivers/media/dvb/frontends/tda18271-fe.c | |
parent | d1c53424f3ba9cc46bf3dbc550a916dc1b8355ee (diff) |
V4L/DVB (7214): tda18271: move init functions to directly above tda18271_tune
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/tda18271-fe.c')
-rw-r--r-- | drivers/media/dvb/frontends/tda18271-fe.c | 78 |
1 files changed, 38 insertions, 40 deletions
diff --git a/drivers/media/dvb/frontends/tda18271-fe.c b/drivers/media/dvb/frontends/tda18271-fe.c index 2f05c4cdb8b7..b5d69a8108d9 100644 --- a/drivers/media/dvb/frontends/tda18271-fe.c +++ b/drivers/media/dvb/frontends/tda18271-fe.c | |||
@@ -36,22 +36,6 @@ static LIST_HEAD(hybrid_tuner_instance_list); | |||
36 | 36 | ||
37 | /*---------------------------------------------------------------------*/ | 37 | /*---------------------------------------------------------------------*/ |
38 | 38 | ||
39 | static int tda18271_ir_cal_init(struct dvb_frontend *fe) | ||
40 | { | ||
41 | struct tda18271_priv *priv = fe->tuner_priv; | ||
42 | unsigned char *regs = priv->tda18271_regs; | ||
43 | |||
44 | tda18271_read_regs(fe); | ||
45 | |||
46 | /* test IR_CAL_OK to see if we need init */ | ||
47 | if ((regs[R_EP1] & 0x08) == 0) | ||
48 | tda18271_init_regs(fe); | ||
49 | |||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | /* ------------------------------------------------------------------ */ | ||
54 | |||
55 | static int tda18271_channel_configuration(struct dvb_frontend *fe, | 39 | static int tda18271_channel_configuration(struct dvb_frontend *fe, |
56 | u32 ifc, u32 freq, u32 bw, u8 std, | 40 | u32 ifc, u32 freq, u32 bw, u8 std, |
57 | int radio) | 41 | int radio) |
@@ -195,6 +179,8 @@ static int tda18271_read_thermometer(struct dvb_frontend *fe) | |||
195 | return tm; | 179 | return tm; |
196 | } | 180 | } |
197 | 181 | ||
182 | /* ------------------------------------------------------------------ */ | ||
183 | |||
198 | static int tda18271c2_rf_tracking_filters_correction(struct dvb_frontend *fe, | 184 | static int tda18271c2_rf_tracking_filters_correction(struct dvb_frontend *fe, |
199 | u32 freq) | 185 | u32 freq) |
200 | { | 186 | { |
@@ -587,7 +573,7 @@ static int tda18271_calc_rf_filter_curve(struct dvb_frontend *fe) | |||
587 | 573 | ||
588 | /* ------------------------------------------------------------------ */ | 574 | /* ------------------------------------------------------------------ */ |
589 | 575 | ||
590 | static int tda18271_rf_cal_init(struct dvb_frontend *fe) | 576 | static int tda18271c2_rf_cal_init(struct dvb_frontend *fe) |
591 | { | 577 | { |
592 | struct tda18271_priv *priv = fe->tuner_priv; | 578 | struct tda18271_priv *priv = fe->tuner_priv; |
593 | unsigned char *regs = priv->tda18271_regs; | 579 | unsigned char *regs = priv->tda18271_regs; |
@@ -610,28 +596,6 @@ static int tda18271_rf_cal_init(struct dvb_frontend *fe) | |||
610 | return 0; | 596 | return 0; |
611 | } | 597 | } |
612 | 598 | ||
613 | static int tda18271_init(struct dvb_frontend *fe) | ||
614 | { | ||
615 | struct tda18271_priv *priv = fe->tuner_priv; | ||
616 | |||
617 | mutex_lock(&priv->lock); | ||
618 | |||
619 | /* power up */ | ||
620 | tda18271_set_standby_mode(fe, 0, 0, 0); | ||
621 | |||
622 | /* initialization */ | ||
623 | tda18271_ir_cal_init(fe); | ||
624 | |||
625 | if (priv->id == TDA18271HDC2) | ||
626 | tda18271_rf_cal_init(fe); | ||
627 | |||
628 | mutex_unlock(&priv->lock); | ||
629 | |||
630 | return 0; | ||
631 | } | ||
632 | |||
633 | /* ------------------------------------------------------------------ */ | ||
634 | |||
635 | static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe, | 599 | static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe, |
636 | u32 freq, u32 bw) | 600 | u32 freq, u32 bw) |
637 | { | 601 | { |
@@ -729,6 +693,40 @@ static int tda18271c1_rf_tracking_filter_calibration(struct dvb_frontend *fe, | |||
729 | 693 | ||
730 | /* ------------------------------------------------------------------ */ | 694 | /* ------------------------------------------------------------------ */ |
731 | 695 | ||
696 | static int tda18271_ir_cal_init(struct dvb_frontend *fe) | ||
697 | { | ||
698 | struct tda18271_priv *priv = fe->tuner_priv; | ||
699 | unsigned char *regs = priv->tda18271_regs; | ||
700 | |||
701 | tda18271_read_regs(fe); | ||
702 | |||
703 | /* test IR_CAL_OK to see if we need init */ | ||
704 | if ((regs[R_EP1] & 0x08) == 0) | ||
705 | tda18271_init_regs(fe); | ||
706 | |||
707 | return 0; | ||
708 | } | ||
709 | |||
710 | static int tda18271_init(struct dvb_frontend *fe) | ||
711 | { | ||
712 | struct tda18271_priv *priv = fe->tuner_priv; | ||
713 | |||
714 | mutex_lock(&priv->lock); | ||
715 | |||
716 | /* power up */ | ||
717 | tda18271_set_standby_mode(fe, 0, 0, 0); | ||
718 | |||
719 | /* initialization */ | ||
720 | tda18271_ir_cal_init(fe); | ||
721 | |||
722 | if (priv->id == TDA18271HDC2) | ||
723 | tda18271c2_rf_cal_init(fe); | ||
724 | |||
725 | mutex_unlock(&priv->lock); | ||
726 | |||
727 | return 0; | ||
728 | } | ||
729 | |||
732 | static int tda18271_tune(struct dvb_frontend *fe, | 730 | static int tda18271_tune(struct dvb_frontend *fe, |
733 | u32 ifc, u32 freq, u32 bw, u8 std, int radio) | 731 | u32 ifc, u32 freq, u32 bw, u8 std, int radio) |
734 | { | 732 | { |
@@ -1093,7 +1091,7 @@ struct dvb_frontend *tda18271_attach(struct dvb_frontend *fe, u8 addr, | |||
1093 | tda18271_init_regs(fe); | 1091 | tda18271_init_regs(fe); |
1094 | 1092 | ||
1095 | if ((tda18271_cal_on_startup) && (priv->id == TDA18271HDC2)) | 1093 | if ((tda18271_cal_on_startup) && (priv->id == TDA18271HDC2)) |
1096 | tda18271_rf_cal_init(fe); | 1094 | tda18271c2_rf_cal_init(fe); |
1097 | 1095 | ||
1098 | mutex_unlock(&priv->lock); | 1096 | mutex_unlock(&priv->lock); |
1099 | break; | 1097 | break; |