diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:09:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-25 13:09:31 -0400 |
commit | 25581ad107be24b89d805da51a03d616f8f3d1be (patch) | |
tree | 36e2bd32667b5dd5a39e1939c1c5162f18967715 /drivers/media/dvb/frontends/zl10353.c | |
parent | 72cf2709bf8e0410800f118c4298bfbf8715b303 (diff) | |
parent | 7477ddaa4d2d69bbcd49e12990af158dbb03f2f2 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb
* master.kernel.org:/pub/scm/linux/kernel/git/mchehab/v4l-dvb: (244 commits)
V4L/DVB (4210b): git-dvb: tea575x-tuner build fix
V4L/DVB (4210a): git-dvb versus matroxfb
V4L/DVB (4209): Added some BTTV PCI IDs for newer boards
Fixes some sync issues between V4L/DVB development and GIT
V4L/DVB (4206): Cx88-blackbird: always set encoder height based on tvnorm->id
V4L/DVB (4205): Merge tda9887 module into tuner.
V4L/DVB (4203): Explicitly set the enum values.
V4L/DVB (4202): allow selecting CX2341x port mode
V4L/DVB (4200): Disable bitrate_mode when encoding mpeg-1.
V4L/DVB (4199): Add cx2341x-specific control array to cx2341x.c
V4L/DVB (4198): Avoid newer usages of obsoleted experimental MPEGCOMP API
V4L/DVB (4197): Port new MPEG API to saa7134-empress with saa6752hs
V4L/DVB (4196): Port cx88-blackbird to the new MPEG API.
V4L/DVB (4193): Update cx2341x fw encoding API doc.
V4L/DVB (4192): Use control helpers for saa7115, cx25840, msp3400.
V4L/DVB (4191): Add CX2341X MPEG encoder module.
V4L/DVB (4190): Add helper functions for control processing to v4l2-common.
V4L/DVB (4189): Add videodev support for VIDIOC_S/G/TRY_EXT_CTRLS.
V4L/DVB (4188): Add new MPEG control/ioctl definitions to videodev2.h
V4L/DVB (4186): Add support for the DNTV Live! mini DVB-T card.
...
Diffstat (limited to 'drivers/media/dvb/frontends/zl10353.c')
-rw-r--r-- | drivers/media/dvb/frontends/zl10353.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/media/dvb/frontends/zl10353.c b/drivers/media/dvb/frontends/zl10353.c index d7d9f59d76d..2b95e8b6cd3 100644 --- a/drivers/media/dvb/frontends/zl10353.c +++ b/drivers/media/dvb/frontends/zl10353.c | |||
@@ -34,7 +34,6 @@ | |||
34 | struct zl10353_state { | 34 | struct zl10353_state { |
35 | struct i2c_adapter *i2c; | 35 | struct i2c_adapter *i2c; |
36 | struct dvb_frontend frontend; | 36 | struct dvb_frontend frontend; |
37 | struct dvb_frontend_ops ops; | ||
38 | 37 | ||
39 | struct zl10353_config config; | 38 | struct zl10353_config config; |
40 | }; | 39 | }; |
@@ -126,6 +125,7 @@ static int zl10353_set_parameters(struct dvb_frontend *fe, | |||
126 | struct dvb_frontend_parameters *param) | 125 | struct dvb_frontend_parameters *param) |
127 | { | 126 | { |
128 | struct zl10353_state *state = fe->demodulator_priv; | 127 | struct zl10353_state *state = fe->demodulator_priv; |
128 | |||
129 | u8 pllbuf[6] = { 0x67 }; | 129 | u8 pllbuf[6] = { 0x67 }; |
130 | 130 | ||
131 | /* These settings set "auto-everything" and start the FSM. */ | 131 | /* These settings set "auto-everything" and start the FSM. */ |
@@ -142,7 +142,30 @@ static int zl10353_set_parameters(struct dvb_frontend *fe, | |||
142 | zl10353_single_write(fe, 0x66, 0xE9); | 142 | zl10353_single_write(fe, 0x66, 0xE9); |
143 | zl10353_single_write(fe, 0x62, 0x0A); | 143 | zl10353_single_write(fe, 0x62, 0x0A); |
144 | 144 | ||
145 | state->config.pll_set(fe, param, pllbuf + 1); | 145 | // if there is no attached secondary tuner, we call set_params to program |
146 | // a potential tuner attached somewhere else | ||
147 | if (state->config.no_tuner) { | ||
148 | if (fe->ops.tuner_ops.set_params) { | ||
149 | fe->ops.tuner_ops.set_params(fe, param); | ||
150 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); | ||
151 | } | ||
152 | } | ||
153 | |||
154 | // if pllbuf is defined, retrieve the settings | ||
155 | if (fe->ops.tuner_ops.calc_regs) { | ||
156 | fe->ops.tuner_ops.calc_regs(fe, param, pllbuf+1, 5); | ||
157 | pllbuf[1] <<= 1; | ||
158 | } else { | ||
159 | // fake pllbuf settings | ||
160 | pllbuf[1] = 0x61 << 1; | ||
161 | pllbuf[2] = 0; | ||
162 | pllbuf[3] = 0; | ||
163 | pllbuf[3] = 0; | ||
164 | pllbuf[4] = 0; | ||
165 | } | ||
166 | |||
167 | // there is no call to _just_ start decoding, so we send the pllbuf anyway | ||
168 | // even if there isn't a PLL attached to the secondary bus | ||
146 | zl10353_write(fe, pllbuf, sizeof(pllbuf)); | 169 | zl10353_write(fe, pllbuf, sizeof(pllbuf)); |
147 | 170 | ||
148 | zl10353_single_write(fe, 0x70, 0x01); | 171 | zl10353_single_write(fe, 0x70, 0x01); |
@@ -254,14 +277,13 @@ struct dvb_frontend *zl10353_attach(const struct zl10353_config *config, | |||
254 | /* setup the state */ | 277 | /* setup the state */ |
255 | state->i2c = i2c; | 278 | state->i2c = i2c; |
256 | memcpy(&state->config, config, sizeof(struct zl10353_config)); | 279 | memcpy(&state->config, config, sizeof(struct zl10353_config)); |
257 | memcpy(&state->ops, &zl10353_ops, sizeof(struct dvb_frontend_ops)); | ||
258 | 280 | ||
259 | /* check if the demod is there */ | 281 | /* check if the demod is there */ |
260 | if (zl10353_read_register(state, CHIP_ID) != ID_ZL10353) | 282 | if (zl10353_read_register(state, CHIP_ID) != ID_ZL10353) |
261 | goto error; | 283 | goto error; |
262 | 284 | ||
263 | /* create dvb_frontend */ | 285 | /* create dvb_frontend */ |
264 | state->frontend.ops = &state->ops; | 286 | memcpy(&state->frontend.ops, &zl10353_ops, sizeof(struct dvb_frontend_ops)); |
265 | state->frontend.demodulator_priv = state; | 287 | state->frontend.demodulator_priv = state; |
266 | 288 | ||
267 | return &state->frontend; | 289 | return &state->frontend; |