diff options
author | Manu Abraham <abraham.manu@gmail.com> | 2009-04-07 04:19:54 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-06-16 17:20:38 -0400 |
commit | 017eb0381fedbfdcad1e8e536d014c4064e6687f (patch) | |
tree | b88ea3f72137c515ad5fd18785787a07915d5a13 | |
parent | dd4c2b3f6a2d30602d22485ab725c84f2fb074b6 (diff) |
V4L/DVB (11581): stv090x and stv6110x: fix repeater level setup and ref clock
* Reference clock was unused
* Fix missing repeater level setup
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb/frontends/stv090x.c | 9 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv090x.h | 13 | ||||
-rw-r--r-- | drivers/media/dvb/frontends/stv6110x_priv.h | 6 | ||||
-rw-r--r-- | drivers/media/dvb/ttpci/budget-ci.c | 2 |
4 files changed, 24 insertions, 6 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index a65f1b7849a1..e80d163c767f 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c | |||
@@ -640,16 +640,19 @@ static int stv090x_write_reg(struct stv090x_state *state, unsigned int reg, u8 d | |||
640 | static int stv090x_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) | 640 | static int stv090x_i2c_gate_ctrl(struct dvb_frontend *fe, int enable) |
641 | { | 641 | { |
642 | struct stv090x_state *state = fe->demodulator_priv; | 642 | struct stv090x_state *state = fe->demodulator_priv; |
643 | const struct stv090x_config *config = state->config; | ||
643 | u32 reg; | 644 | u32 reg; |
644 | 645 | ||
645 | reg = STV090x_READ_DEMOD(state, I2CRPT); | 646 | reg = STV090x_READ_DEMOD(state, I2CRPT); |
646 | 647 | // STV090x_SETFIELD_Px(reg, ENARPT_LEVEL_FIELD, config->repeater_level); | |
647 | if (enable) { | 648 | if (enable) { |
649 | dprintk(FE_DEBUG, 1, "Enable Gate"); | ||
648 | STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 1); | 650 | STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 1); |
649 | if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0) | 651 | if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0) |
650 | goto err; | 652 | goto err; |
651 | 653 | ||
652 | } else { | 654 | } else { |
655 | dprintk(FE_DEBUG, 1, "Disable Gate"); | ||
653 | STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 0); | 656 | STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 0); |
654 | if ((STV090x_WRITE_DEMOD(state, I2CRPT, reg)) < 0) | 657 | if ((STV090x_WRITE_DEMOD(state, I2CRPT, reg)) < 0) |
655 | goto err; | 658 | goto err; |
@@ -3773,6 +3776,7 @@ static int stv090x_setup(struct dvb_frontend *fe) | |||
3773 | const struct stv090x_reg *stv090x_initval = NULL; | 3776 | const struct stv090x_reg *stv090x_initval = NULL; |
3774 | const struct stv090x_reg *stv090x_cut20_val = NULL; | 3777 | const struct stv090x_reg *stv090x_cut20_val = NULL; |
3775 | unsigned long t1_size = 0, t2_size = 0; | 3778 | unsigned long t1_size = 0, t2_size = 0; |
3779 | u32 reg = 0; | ||
3776 | 3780 | ||
3777 | int i; | 3781 | int i; |
3778 | 3782 | ||
@@ -3799,7 +3803,8 @@ static int stv090x_setup(struct dvb_frontend *fe) | |||
3799 | if (STV090x_WRITE_DEMOD(state, TNRCFG, 0x6c) < 0) /* check register ! (No Tuner Mode) */ | 3803 | if (STV090x_WRITE_DEMOD(state, TNRCFG, 0x6c) < 0) /* check register ! (No Tuner Mode) */ |
3800 | goto err; | 3804 | goto err; |
3801 | 3805 | ||
3802 | if (STV090x_WRITE_DEMOD(state, I2CRPT, 0x00) < 0) /* repeater OFF */ | 3806 | STV090x_SETFIELD_Px(reg, ENARPT_LEVEL_FIELD, config->repeater_level); |
3807 | if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0) /* repeater OFF */ | ||
3803 | goto err; | 3808 | goto err; |
3804 | 3809 | ||
3805 | if (stv090x_write_reg(state, STV090x_NCOARSE, 0x13) < 0) /* set PLL divider */ | 3810 | if (stv090x_write_reg(state, STV090x_NCOARSE, 0x13) < 0) /* set PLL divider */ |
diff --git a/drivers/media/dvb/frontends/stv090x.h b/drivers/media/dvb/frontends/stv090x.h index e56489cb5b92..e968c98bb70f 100644 --- a/drivers/media/dvb/frontends/stv090x.h +++ b/drivers/media/dvb/frontends/stv090x.h | |||
@@ -49,6 +49,17 @@ enum stv090x_clkmode { | |||
49 | STV090x_CLK_EXT = 2 /* Clk i/p = XTALI */ | 49 | STV090x_CLK_EXT = 2 /* Clk i/p = XTALI */ |
50 | }; | 50 | }; |
51 | 51 | ||
52 | enum stv090x_i2crpt { | ||
53 | STV090x_RPTLEVEL_256 = 0, | ||
54 | STV090x_RPTLEVEL_128 = 1, | ||
55 | STV090x_RPTLEVEL_64 = 2, | ||
56 | STV090x_RPTLEVEL_32 = 3, | ||
57 | STV090x_RPTLEVEL_16 = 4, | ||
58 | STV090x_RPTLEVEL_8 = 5, | ||
59 | STV090x_RPTLEVEL_4 = 6, | ||
60 | STV090x_RPTLEVEL_2 = 7, | ||
61 | }; | ||
62 | |||
52 | struct stv090x_config { | 63 | struct stv090x_config { |
53 | enum stv090x_device device; | 64 | enum stv090x_device device; |
54 | enum stv090x_mode demod_mode; | 65 | enum stv090x_mode demod_mode; |
@@ -62,6 +73,8 @@ struct stv090x_config { | |||
62 | u8 ts1_mode; | 73 | u8 ts1_mode; |
63 | u8 ts2_mode; | 74 | u8 ts2_mode; |
64 | 75 | ||
76 | enum stv090x_i2crpt repeater_level; | ||
77 | |||
65 | int (*tuner_init) (struct dvb_frontend *fe); | 78 | int (*tuner_init) (struct dvb_frontend *fe); |
66 | int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode); | 79 | int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode); |
67 | int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency); | 80 | int (*tuner_set_frequency) (struct dvb_frontend *fe, u32 frequency); |
diff --git a/drivers/media/dvb/frontends/stv6110x_priv.h b/drivers/media/dvb/frontends/stv6110x_priv.h index 1295272fcff8..7260da633d49 100644 --- a/drivers/media/dvb/frontends/stv6110x_priv.h +++ b/drivers/media/dvb/frontends/stv6110x_priv.h | |||
@@ -62,16 +62,14 @@ | |||
62 | 62 | ||
63 | #define TRIALS 10 | 63 | #define TRIALS 10 |
64 | #define R_DIV(__div) (1 << (__div + 1)) | 64 | #define R_DIV(__div) (1 << (__div + 1)) |
65 | #define REFCLOCK_kHz (stv6110x->reference / 1000) | 65 | #define REFCLOCK_kHz (stv6110x->config->refclk / 1000) |
66 | #define REFCLOCK_MHz (stv6110x->reference / 1000000) | 66 | #define REFCLOCK_MHz (stv6110x->config->refclk / 1000000) |
67 | 67 | ||
68 | struct stv6110x_state { | 68 | struct stv6110x_state { |
69 | struct i2c_adapter *i2c; | 69 | struct i2c_adapter *i2c; |
70 | const struct stv6110x_config *config; | 70 | const struct stv6110x_config *config; |
71 | 71 | ||
72 | struct stv6110x_devctl *devctl; | 72 | struct stv6110x_devctl *devctl; |
73 | |||
74 | u32 reference; | ||
75 | }; | 73 | }; |
76 | 74 | ||
77 | #endif /* __STV6110x_PRIV_H */ | 75 | #endif /* __STV6110x_PRIV_H */ |
diff --git a/drivers/media/dvb/ttpci/budget-ci.c b/drivers/media/dvb/ttpci/budget-ci.c index 7222030345d5..dbdc7953c6a1 100644 --- a/drivers/media/dvb/ttpci/budget-ci.c +++ b/drivers/media/dvb/ttpci/budget-ci.c | |||
@@ -1361,6 +1361,8 @@ static struct stv090x_config tt1600_stv090x_config = { | |||
1361 | .ts1_mode = STV090x_TSMODE_DVBCI, | 1361 | .ts1_mode = STV090x_TSMODE_DVBCI, |
1362 | .ts2_mode = STV090x_TSMODE_DVBCI, | 1362 | .ts2_mode = STV090x_TSMODE_DVBCI, |
1363 | 1363 | ||
1364 | .repeater_level = STV090x_RPTLEVEL_16, | ||
1365 | |||
1364 | .tuner_init = NULL, | 1366 | .tuner_init = NULL, |
1365 | .tuner_set_mode = NULL, | 1367 | .tuner_set_mode = NULL, |
1366 | .tuner_set_frequency = NULL, | 1368 | .tuner_set_frequency = NULL, |