Skip to content

Commit

Permalink
V4L/DVB (13982): [STV090x] setup master clock in stv090x_init instead…
Browse files Browse the repository at this point in the history
… of stv090x_setup.

This is needed when clock input is driven from tuner and an output
divider different from 1 is used.

Signed-off-by: Andreas Regel <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Andreas Regel authored and Mauro Carvalho Chehab committed Feb 26, 2010
1 parent ec2d3a6 commit 9045e72
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions drivers/media/dvb/frontends/stv090x.c
Original file line number Diff line number Diff line change
Expand Up @@ -4292,6 +4292,15 @@ static int stv090x_init(struct dvb_frontend *fe)
const struct stv090x_config *config = state->config;
u32 reg;

if (state->internal->mclk == 0) {
stv090x_set_mclk(state, 135000000, config->xtal); /* 135 Mhz */
msleep(5);
if (stv090x_write_reg(state, STV090x_SYNTCTRL,
0x20 | config->clk_mode) < 0)
goto err;
stv090x_get_mclk(state);
}

if (stv090x_wakeup(fe) < 0) {
dprintk(FE_ERROR, 1, "Error waking device");
goto err;
Expand Down Expand Up @@ -4426,12 +4435,6 @@ static int stv090x_setup(struct dvb_frontend *fe)
if (stv090x_write_reg(state, STV090x_TSTRES0, 0x00) < 0)
goto err;

stv090x_set_mclk(state, 135000000, config->xtal); /* 135 Mhz */
msleep(5);
if (stv090x_write_reg(state, STV090x_SYNTCTRL, 0x20 | config->clk_mode) < 0)
goto err;
stv090x_get_mclk(state);

return 0;
err:
dprintk(FE_ERROR, 1, "I/O error");
Expand Down

0 comments on commit 9045e72

Please sign in to comment.