summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorManu Abraham <abraham.manu@gmail.com>2009-04-07 05:19:54 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-06-16 18:20:38 -0300
commit017eb0381fedbfdcad1e8e536d014c4064e6687f (patch)
treeb88ea3f72137c515ad5fd18785787a07915d5a13 /drivers
parentdd4c2b3f6a2d30602d22485ab725c84f2fb074b6 (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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/dvb/frontends/stv090x.c9
-rw-r--r--drivers/media/dvb/frontends/stv090x.h13
-rw-r--r--drivers/media/dvb/frontends/stv6110x_priv.h6
-rw-r--r--drivers/media/dvb/ttpci/budget-ci.c2
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
static int stv090x_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
{
struct stv090x_state *state = fe->demodulator_priv;
+ const struct stv090x_config *config = state->config;
u32 reg;
reg = STV090x_READ_DEMOD(state, I2CRPT);
-
+// STV090x_SETFIELD_Px(reg, ENARPT_LEVEL_FIELD, config->repeater_level);
if (enable) {
+ dprintk(FE_DEBUG, 1, "Enable Gate");
STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 1);
if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0)
goto err;
} else {
+ dprintk(FE_DEBUG, 1, "Disable Gate");
STV090x_SETFIELD_Px(reg, I2CT_ON_FIELD, 0);
if ((STV090x_WRITE_DEMOD(state, I2CRPT, reg)) < 0)
goto err;
@@ -3773,6 +3776,7 @@ static int stv090x_setup(struct dvb_frontend *fe)
const struct stv090x_reg *stv090x_initval = NULL;
const struct stv090x_reg *stv090x_cut20_val = NULL;
unsigned long t1_size = 0, t2_size = 0;
+ u32 reg = 0;
int i;
@@ -3799,7 +3803,8 @@ static int stv090x_setup(struct dvb_frontend *fe)
if (STV090x_WRITE_DEMOD(state, TNRCFG, 0x6c) < 0) /* check register ! (No Tuner Mode) */
goto err;
- if (STV090x_WRITE_DEMOD(state, I2CRPT, 0x00) < 0) /* repeater OFF */
+ STV090x_SETFIELD_Px(reg, ENARPT_LEVEL_FIELD, config->repeater_level);
+ if (STV090x_WRITE_DEMOD(state, I2CRPT, reg) < 0) /* repeater OFF */
goto err;
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 {
STV090x_CLK_EXT = 2 /* Clk i/p = XTALI */
};
+enum stv090x_i2crpt {
+ STV090x_RPTLEVEL_256 = 0,
+ STV090x_RPTLEVEL_128 = 1,
+ STV090x_RPTLEVEL_64 = 2,
+ STV090x_RPTLEVEL_32 = 3,
+ STV090x_RPTLEVEL_16 = 4,
+ STV090x_RPTLEVEL_8 = 5,
+ STV090x_RPTLEVEL_4 = 6,
+ STV090x_RPTLEVEL_2 = 7,
+};
+
struct stv090x_config {
enum stv090x_device device;
enum stv090x_mode demod_mode;
@@ -62,6 +73,8 @@ struct stv090x_config {
u8 ts1_mode;
u8 ts2_mode;
+ enum stv090x_i2crpt repeater_level;
+
int (*tuner_init) (struct dvb_frontend *fe);
int (*tuner_set_mode) (struct dvb_frontend *fe, enum tuner_mode mode);
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 @@
#define TRIALS 10
#define R_DIV(__div) (1 << (__div + 1))
-#define REFCLOCK_kHz (stv6110x->reference / 1000)
-#define REFCLOCK_MHz (stv6110x->reference / 1000000)
+#define REFCLOCK_kHz (stv6110x->config->refclk / 1000)
+#define REFCLOCK_MHz (stv6110x->config->refclk / 1000000)
struct stv6110x_state {
struct i2c_adapter *i2c;
const struct stv6110x_config *config;
struct stv6110x_devctl *devctl;
-
- u32 reference;
};
#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 = {
.ts1_mode = STV090x_TSMODE_DVBCI,
.ts2_mode = STV090x_TSMODE_DVBCI,
+ .repeater_level = STV090x_RPTLEVEL_16,
+
.tuner_init = NULL,
.tuner_set_mode = NULL,
.tuner_set_frequency = NULL,