diff options
author | Chris Pascoe <c.pascoe@itee.uq.edu.au> | 2007-11-19 01:32:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:02:21 -0500 |
commit | 58d834ea89664b41e6e21ed2d8dc5680d0dd76b6 (patch) | |
tree | 722fa8a9918db7f3a3674c8b07b9e44f42cc2ae8 /drivers/media/dvb/frontends/zl10353.c | |
parent | a644e4a3e95f8ca6eca019c92d8dfde101150687 (diff) |
V4L/DVB (6628): zl10353: Improve support for boards without a tuner on secondary i2c
Issue FSM_GO instead of TUNER_GO if there is no tuner attached to the
secondary i2c bus.
Signed-off-by: Chris Pascoe <c.pascoe@itee.uq.edu.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/dvb/frontends/zl10353.c')
-rw-r--r-- | drivers/media/dvb/frontends/zl10353.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index 0106df4c55e8..9bfdc01fed2c 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c | |||
@@ -183,35 +183,31 @@ static int zl10353_set_parameters(struct dvb_frontend *fe, | |||
183 | if (fe->ops.i2c_gate_ctrl) | 183 | if (fe->ops.i2c_gate_ctrl) |
184 | fe->ops.i2c_gate_ctrl(fe, 0); | 184 | fe->ops.i2c_gate_ctrl(fe, 0); |
185 | 185 | ||
186 | // if there is no attached secondary tuner, we call set_params to program | 186 | /* |
187 | // a potential tuner attached somewhere else | 187 | * If there is no tuner attached to the secondary I2C bus, we call |
188 | * set_params to program a potential tuner attached somewhere else. | ||
189 | * Otherwise, we update the PLL registers via calc_regs. | ||
190 | */ | ||
188 | if (state->config.no_tuner) { | 191 | if (state->config.no_tuner) { |
189 | if (fe->ops.tuner_ops.set_params) { | 192 | if (fe->ops.tuner_ops.set_params) { |
190 | fe->ops.tuner_ops.set_params(fe, param); | 193 | fe->ops.tuner_ops.set_params(fe, param); |
191 | if (fe->ops.i2c_gate_ctrl) | 194 | if (fe->ops.i2c_gate_ctrl) |
192 | fe->ops.i2c_gate_ctrl(fe, 0); | 195 | fe->ops.i2c_gate_ctrl(fe, 0); |
193 | } | 196 | } |
194 | } | 197 | } else if (fe->ops.tuner_ops.calc_regs) { |
195 | 198 | fe->ops.tuner_ops.calc_regs(fe, param, pllbuf + 1, 5); | |
196 | // if pllbuf is defined, retrieve the settings | ||
197 | if (fe->ops.tuner_ops.calc_regs) { | ||
198 | fe->ops.tuner_ops.calc_regs(fe, param, pllbuf+1, 5); | ||
199 | pllbuf[1] <<= 1; | 199 | pllbuf[1] <<= 1; |
200 | } else { | 200 | zl10353_write(fe, pllbuf, sizeof(pllbuf)); |
201 | // fake pllbuf settings | ||
202 | pllbuf[1] = 0x61 << 1; | ||
203 | pllbuf[2] = 0; | ||
204 | pllbuf[3] = 0; | ||
205 | pllbuf[3] = 0; | ||
206 | pllbuf[4] = 0; | ||
207 | } | 201 | } |
208 | 202 | ||
209 | // there is no call to _just_ start decoding, so we send the pllbuf anyway | ||
210 | // even if there isn't a PLL attached to the secondary bus | ||
211 | zl10353_write(fe, pllbuf, sizeof(pllbuf)); | ||
212 | |||
213 | zl10353_single_write(fe, 0x5F, 0x13); | 203 | zl10353_single_write(fe, 0x5F, 0x13); |
214 | zl10353_single_write(fe, 0x70, 0x01); | 204 | |
205 | /* If no attached tuner or invalid PLL registers, just start the FSM. */ | ||
206 | if (state->config.no_tuner || fe->ops.tuner_ops.calc_regs == NULL) | ||
207 | zl10353_single_write(fe, FSM_GO, 0x01); | ||
208 | else | ||
209 | zl10353_single_write(fe, TUNER_GO, 0x01); | ||
210 | |||
215 | udelay(250); | 211 | udelay(250); |
216 | zl10353_single_write(fe, 0xE4, 0x00); | 212 | zl10353_single_write(fe, 0xE4, 0x00); |
217 | zl10353_single_write(fe, 0xE5, 0x2A); | 213 | zl10353_single_write(fe, 0xE5, 0x2A); |