aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb
diff options
context:
space:
mode:
authorIgor M. Liplianin <liplianin@netup.ru>2009-07-19 16:37:09 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-09-12 11:18:00 -0400
commit92782bb00387585e2a4249f6996da3c863c1f580 (patch)
treeddd300634b7fccc9377875536ca059f84ddaa13d /drivers/media/dvb
parent25ea66e2696066a12274119ceec084963427e75b (diff)
V4L/DVB (12309): Add output clock configuration for stv6110 tuner.
Signed-off-by: Igor M. Liplianin <liplianin@netup.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r--drivers/media/dvb/frontends/stv6110.c10
-rw-r--r--drivers/media/dvb/frontends/stv6110.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/drivers/media/dvb/frontends/stv6110.c b/drivers/media/dvb/frontends/stv6110.c
index 70efac869d28..5aabb782e311 100644
--- a/drivers/media/dvb/frontends/stv6110.c
+++ b/drivers/media/dvb/frontends/stv6110.c
@@ -36,6 +36,7 @@ struct stv6110_priv {
36 struct i2c_adapter *i2c; 36 struct i2c_adapter *i2c;
37 37
38 u32 mclk; 38 u32 mclk;
39 u8 clk_div;
39 u8 regs[8]; 40 u8 regs[8];
40}; 41};
41 42
@@ -221,6 +222,10 @@ static int stv6110_init(struct dvb_frontend *fe)
221 priv->regs[RSTV6110_CTRL1] |= 222 priv->regs[RSTV6110_CTRL1] |=
222 ((((priv->mclk / 1000000) - 16) & 0x1f) << 3); 223 ((((priv->mclk / 1000000) - 16) & 0x1f) << 3);
223 224
225 /* divisor value for the output clock */
226 priv->regs[RSTV6110_CTRL2] &= ~0xc0;
227 priv->regs[RSTV6110_CTRL2] |= (priv->clk_div << 6);
228
224 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8); 229 stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8);
225 msleep(1); 230 msleep(1);
226 stv6110_set_bandwidth(fe, 72000000); 231 stv6110_set_bandwidth(fe, 72000000);
@@ -418,6 +423,10 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe,
418 }; 423 };
419 int ret; 424 int ret;
420 425
426 /* divisor value for the output clock */
427 reg0[2] &= ~0xc0;
428 reg0[2] |= (config->clk_div << 6);
429
421 if (fe->ops.i2c_gate_ctrl) 430 if (fe->ops.i2c_gate_ctrl)
422 fe->ops.i2c_gate_ctrl(fe, 1); 431 fe->ops.i2c_gate_ctrl(fe, 1);
423 432
@@ -436,6 +445,7 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe,
436 priv->i2c_address = config->i2c_address; 445 priv->i2c_address = config->i2c_address;
437 priv->i2c = i2c; 446 priv->i2c = i2c;
438 priv->mclk = config->mclk; 447 priv->mclk = config->mclk;
448 priv->clk_div = config->clk_div;
439 449
440 memcpy(&priv->regs, &reg0[1], 8); 450 memcpy(&priv->regs, &reg0[1], 8);
441 451
diff --git a/drivers/media/dvb/frontends/stv6110.h b/drivers/media/dvb/frontends/stv6110.h
index 1c0314d6aa55..2574e1fba9d7 100644
--- a/drivers/media/dvb/frontends/stv6110.h
+++ b/drivers/media/dvb/frontends/stv6110.h
@@ -42,6 +42,7 @@ struct stv6110_config {
42 u8 i2c_address; 42 u8 i2c_address;
43 u32 mclk; 43 u32 mclk;
44 int iq_wiring; 44 int iq_wiring;
45 u8 clk_div; /* divisor value for the output clock */
45}; 46};
46 47
47#if defined(CONFIG_DVB_STV6110) || (defined(CONFIG_DVB_STV6110_MODULE) \ 48#if defined(CONFIG_DVB_STV6110) || (defined(CONFIG_DVB_STV6110_MODULE) \