diff options
author | Hartmut Hackmann <hartmut.hackmann@t-online.de> | 2005-11-09 00:35:13 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:01 -0500 |
commit | 634623d3ba6146e13d06d3f36188c189c8a58a23 (patch) | |
tree | 26038351a6b1191c84a9265ba75d9d2bb9a41756 | |
parent | 3cff00d91292e744a510be7256f1c80e1b0be819 (diff) |
[PATCH] dvb: tda1004x: pll communication fixes
- leave I2C bridge open at pll_sleep to support Philips EUROPA based cards.
- give an error message if the communication with the pll fails.
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Cc: Johannes Stezenbach <js@linuxtv.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | drivers/media/dvb/frontends/tda1004x.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/tda1004x.c b/drivers/media/dvb/frontends/tda1004x.c index 3529c618f828..7968743826fc 100644 --- a/drivers/media/dvb/frontends/tda1004x.c +++ b/drivers/media/dvb/frontends/tda1004x.c | |||
@@ -420,7 +420,7 @@ static void tda10046_init_plls(struct dvb_frontend* fe) | |||
420 | struct tda1004x_state* state = fe->demodulator_priv; | 420 | struct tda1004x_state* state = fe->demodulator_priv; |
421 | 421 | ||
422 | tda1004x_write_byteI(state, TDA10046H_CONFPLL1, 0xf0); | 422 | tda1004x_write_byteI(state, TDA10046H_CONFPLL1, 0xf0); |
423 | tda1004x_write_byteI(state, TDA10046H_CONFPLL2, 10); // PLL M = 10 | 423 | tda1004x_write_byteI(state, TDA10046H_CONFPLL2, 0x0a); // PLL M = 10 |
424 | if (state->config->xtal_freq == TDA10046_XTAL_4M ) { | 424 | if (state->config->xtal_freq == TDA10046_XTAL_4M ) { |
425 | dprintk("%s: setting up PLLs for a 4 MHz Xtal\n", __FUNCTION__); | 425 | dprintk("%s: setting up PLLs for a 4 MHz Xtal\n", __FUNCTION__); |
426 | tda1004x_write_byteI(state, TDA10046H_CONFPLL3, 0); // PLL P = N = 0 | 426 | tda1004x_write_byteI(state, TDA10046H_CONFPLL3, 0); // PLL P = N = 0 |
@@ -597,7 +597,10 @@ static int tda10046_init(struct dvb_frontend* fe) | |||
597 | // Init the tuner PLL | 597 | // Init the tuner PLL |
598 | if (state->config->pll_init) { | 598 | if (state->config->pll_init) { |
599 | tda1004x_enable_tuner_i2c(state); | 599 | tda1004x_enable_tuner_i2c(state); |
600 | state->config->pll_init(fe); | 600 | if (state->config->pll_init(fe)) { |
601 | printk(KERN_ERR "tda1004x: pll init failed\n"); | ||
602 | return -EIO; | ||
603 | } | ||
601 | tda1004x_disable_tuner_i2c(state); | 604 | tda1004x_disable_tuner_i2c(state); |
602 | } | 605 | } |
603 | 606 | ||
@@ -667,7 +670,10 @@ static int tda1004x_set_fe(struct dvb_frontend* fe, | |||
667 | 670 | ||
668 | // set frequency | 671 | // set frequency |
669 | tda1004x_enable_tuner_i2c(state); | 672 | tda1004x_enable_tuner_i2c(state); |
670 | state->config->pll_set(fe, fe_params); | 673 | if (state->config->pll_set(fe, fe_params)) { |
674 | printk(KERN_ERR "tda1004x: pll set failed\n"); | ||
675 | return -EIO; | ||
676 | } | ||
671 | tda1004x_disable_tuner_i2c(state); | 677 | tda1004x_disable_tuner_i2c(state); |
672 | 678 | ||
673 | // Hardcoded to use auto as much as possible on the TDA10045 as it | 679 | // Hardcoded to use auto as much as possible on the TDA10045 as it |
@@ -832,6 +838,8 @@ static int tda1004x_set_fe(struct dvb_frontend* fe, | |||
832 | 838 | ||
833 | case TDA1004X_DEMOD_TDA10046: | 839 | case TDA1004X_DEMOD_TDA10046: |
834 | tda1004x_write_mask(state, TDA1004X_AUTO, 0x40, 0x40); | 840 | tda1004x_write_mask(state, TDA1004X_AUTO, 0x40, 0x40); |
841 | msleep(1); | ||
842 | tda1004x_write_mask(state, TDA10046H_AGC_CONF, 4, 1); | ||
835 | break; | 843 | break; |
836 | } | 844 | } |
837 | 845 | ||
@@ -1129,7 +1137,12 @@ static int tda1004x_sleep(struct dvb_frontend* fe) | |||
1129 | if (state->config->pll_sleep != NULL) { | 1137 | if (state->config->pll_sleep != NULL) { |
1130 | tda1004x_enable_tuner_i2c(state); | 1138 | tda1004x_enable_tuner_i2c(state); |
1131 | state->config->pll_sleep(fe); | 1139 | state->config->pll_sleep(fe); |
1132 | tda1004x_disable_tuner_i2c(state); | 1140 | if (state->config->if_freq != TDA10046_FREQ_052) { |
1141 | /* special hack for Philips EUROPA Based boards: | ||
1142 | * keep the I2c bridge open for tuner access in analog mode | ||
1143 | */ | ||
1144 | tda1004x_disable_tuner_i2c(state); | ||
1145 | } | ||
1133 | } | 1146 | } |
1134 | tda1004x_write_mask(state, TDA1004X_CONFC4, 1, 1); | 1147 | tda1004x_write_mask(state, TDA1004X_CONFC4, 1, 1); |
1135 | break; | 1148 | break; |