From: Andreas Regel Date: Tue, 5 Jan 2010 22:23:41 +0000 (-0300) Subject: V4L/DVB (13982): [STV090x] setup master clock in stv090x_init instead of stv090x_setup. X-Git-Tag: v2.6.34-rc1~280^2~253 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9045e729447192ab0ca27191ccab324c6b97fceb;p=platform%2Fkernel%2Flinux-stable.git V4L/DVB (13982): [STV090x] setup master clock in stv090x_init instead 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 Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index 93be76c..4dc3091 100644 --- a/drivers/media/dvb/frontends/stv090x.c +++ b/drivers/media/dvb/frontends/stv090x.c @@ -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; @@ -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");