diff options
author | Andreas Regel <andreas.regel@gmx.de> | 2010-01-05 17:23:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:37 -0500 |
commit | 9045e729447192ab0ca27191ccab324c6b97fceb (patch) | |
tree | e8dc790f04f1cb65e33351ffaa9243eff2aa7d1d /drivers/media | |
parent | ec2d3a62eff54b9dc556e9d9c9125b9bdc640171 (diff) |
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 <andreas.regel@gmx.de>
Signed-off-by: Manu Abraham <manu@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/dvb/frontends/stv090x.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/drivers/media/dvb/frontends/stv090x.c b/drivers/media/dvb/frontends/stv090x.c index 93be76ced896..4dc30911f408 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) | |||
4292 | const struct stv090x_config *config = state->config; | 4292 | const struct stv090x_config *config = state->config; |
4293 | u32 reg; | 4293 | u32 reg; |
4294 | 4294 | ||
4295 | if (state->internal->mclk == 0) { | ||
4296 | stv090x_set_mclk(state, 135000000, config->xtal); /* 135 Mhz */ | ||
4297 | msleep(5); | ||
4298 | if (stv090x_write_reg(state, STV090x_SYNTCTRL, | ||
4299 | 0x20 | config->clk_mode) < 0) | ||
4300 | goto err; | ||
4301 | stv090x_get_mclk(state); | ||
4302 | } | ||
4303 | |||
4295 | if (stv090x_wakeup(fe) < 0) { | 4304 | if (stv090x_wakeup(fe) < 0) { |
4296 | dprintk(FE_ERROR, 1, "Error waking device"); | 4305 | dprintk(FE_ERROR, 1, "Error waking device"); |
4297 | goto err; | 4306 | goto err; |
@@ -4426,12 +4435,6 @@ static int stv090x_setup(struct dvb_frontend *fe) | |||
4426 | if (stv090x_write_reg(state, STV090x_TSTRES0, 0x00) < 0) | 4435 | if (stv090x_write_reg(state, STV090x_TSTRES0, 0x00) < 0) |
4427 | goto err; | 4436 | goto err; |
4428 | 4437 | ||
4429 | stv090x_set_mclk(state, 135000000, config->xtal); /* 135 Mhz */ | ||
4430 | msleep(5); | ||
4431 | if (stv090x_write_reg(state, STV090x_SYNTCTRL, 0x20 | config->clk_mode) < 0) | ||
4432 | goto err; | ||
4433 | stv090x_get_mclk(state); | ||
4434 | |||
4435 | return 0; | 4438 | return 0; |
4436 | err: | 4439 | err: |
4437 | dprintk(FE_ERROR, 1, "I/O error"); | 4440 | dprintk(FE_ERROR, 1, "I/O error"); |