mirror of
https://github.com/torvalds/linux.git
synced 2024-11-02 10:11:36 +00:00
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>
This commit is contained in:
parent
25ea66e269
commit
92782bb003
@ -36,6 +36,7 @@ struct stv6110_priv {
|
|||||||
struct i2c_adapter *i2c;
|
struct i2c_adapter *i2c;
|
||||||
|
|
||||||
u32 mclk;
|
u32 mclk;
|
||||||
|
u8 clk_div;
|
||||||
u8 regs[8];
|
u8 regs[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -221,6 +222,10 @@ static int stv6110_init(struct dvb_frontend *fe)
|
|||||||
priv->regs[RSTV6110_CTRL1] |=
|
priv->regs[RSTV6110_CTRL1] |=
|
||||||
((((priv->mclk / 1000000) - 16) & 0x1f) << 3);
|
((((priv->mclk / 1000000) - 16) & 0x1f) << 3);
|
||||||
|
|
||||||
|
/* divisor value for the output clock */
|
||||||
|
priv->regs[RSTV6110_CTRL2] &= ~0xc0;
|
||||||
|
priv->regs[RSTV6110_CTRL2] |= (priv->clk_div << 6);
|
||||||
|
|
||||||
stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8);
|
stv6110_write_regs(fe, &priv->regs[RSTV6110_CTRL1], RSTV6110_CTRL1, 8);
|
||||||
msleep(1);
|
msleep(1);
|
||||||
stv6110_set_bandwidth(fe, 72000000);
|
stv6110_set_bandwidth(fe, 72000000);
|
||||||
@ -418,6 +423,10 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe,
|
|||||||
};
|
};
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
/* divisor value for the output clock */
|
||||||
|
reg0[2] &= ~0xc0;
|
||||||
|
reg0[2] |= (config->clk_div << 6);
|
||||||
|
|
||||||
if (fe->ops.i2c_gate_ctrl)
|
if (fe->ops.i2c_gate_ctrl)
|
||||||
fe->ops.i2c_gate_ctrl(fe, 1);
|
fe->ops.i2c_gate_ctrl(fe, 1);
|
||||||
|
|
||||||
@ -436,6 +445,7 @@ struct dvb_frontend *stv6110_attach(struct dvb_frontend *fe,
|
|||||||
priv->i2c_address = config->i2c_address;
|
priv->i2c_address = config->i2c_address;
|
||||||
priv->i2c = i2c;
|
priv->i2c = i2c;
|
||||||
priv->mclk = config->mclk;
|
priv->mclk = config->mclk;
|
||||||
|
priv->clk_div = config->clk_div;
|
||||||
|
|
||||||
memcpy(&priv->regs, ®0[1], 8);
|
memcpy(&priv->regs, ®0[1], 8);
|
||||||
|
|
||||||
|
@ -42,6 +42,7 @@ struct stv6110_config {
|
|||||||
u8 i2c_address;
|
u8 i2c_address;
|
||||||
u32 mclk;
|
u32 mclk;
|
||||||
int iq_wiring;
|
int iq_wiring;
|
||||||
|
u8 clk_div; /* divisor value for the output clock */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if defined(CONFIG_DVB_STV6110) || (defined(CONFIG_DVB_STV6110_MODULE) \
|
#if defined(CONFIG_DVB_STV6110) || (defined(CONFIG_DVB_STV6110_MODULE) \
|
||||||
|
Loading…
Reference in New Issue
Block a user