aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/frontends/cx22702.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:09:31 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-25 13:09:31 -0400
commit25581ad107be24b89d805da51a03d616f8f3d1be (patch)
tree36e2bd32667b5dd5a39e1939c1c5162f18967715 /drivers/media/dvb/frontends/cx22702.c
parent72cf2709bf8e0410800f118c4298bfbf8715b303 (diff)
parent7477ddaa4d2d69bbcd49e12990af158dbb03f2f2 (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/cx22702.c')
-rw-r--r--drivers/media/dvb/frontends/cx22702.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/drivers/media/dvb/frontends/cx22702.c b/drivers/media/dvb/frontends/cx22702.c
index 0fc899f81c5e..4106d46c957f 100644
--- a/drivers/media/dvb/frontends/cx22702.c
+++ b/drivers/media/dvb/frontends/cx22702.c
@@ -40,8 +40,6 @@ struct cx22702_state {
40 40
41 struct i2c_adapter* i2c; 41 struct i2c_adapter* i2c;
42 42
43 struct dvb_frontend_ops ops;
44
45 /* configuration settings */ 43 /* configuration settings */
46 const struct cx22702_config* config; 44 const struct cx22702_config* config;
47 45
@@ -211,22 +209,10 @@ static int cx22702_set_tps (struct dvb_frontend* fe, struct dvb_frontend_paramet
211 u8 val; 209 u8 val;
212 struct cx22702_state* state = fe->demodulator_priv; 210 struct cx22702_state* state = fe->demodulator_priv;
213 211
214 /* set PLL */ 212 if (fe->ops.tuner_ops.set_params) {
215 cx22702_i2c_gate_ctrl(fe, 1); 213 fe->ops.tuner_ops.set_params(fe, p);
216 if (state->config->pll_set) { 214 if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0);
217 state->config->pll_set(fe, p);
218 } else if (state->config->pll_desc) {
219 u8 pllbuf[4];
220 struct i2c_msg msg = { .addr = state->config->pll_address,
221 .buf = pllbuf, .len = 4 };
222 dvb_pll_configure(state->config->pll_desc, pllbuf,
223 p->frequency,
224 p->u.ofdm.bandwidth);
225 i2c_transfer(state->i2c, &msg, 1);
226 } else {
227 BUG();
228 } 215 }
229 cx22702_i2c_gate_ctrl(fe, 0);
230 216
231 /* set inversion */ 217 /* set inversion */
232 cx22702_set_inversion (state, p->inversion); 218 cx22702_set_inversion (state, p->inversion);
@@ -358,10 +344,6 @@ static int cx22702_init (struct dvb_frontend* fe)
358 344
359 cx22702_writereg (state, 0xf8, (state->config->output_mode << 1) & 0x02); 345 cx22702_writereg (state, 0xf8, (state->config->output_mode << 1) & 0x02);
360 346
361 /* init PLL */
362 if (state->config->pll_init)
363 state->config->pll_init(fe);
364
365 cx22702_i2c_gate_ctrl(fe, 0); 347 cx22702_i2c_gate_ctrl(fe, 0);
366 348
367 return 0; 349 return 0;
@@ -495,7 +477,6 @@ struct dvb_frontend* cx22702_attach(const struct cx22702_config* config,
495 /* setup the state */ 477 /* setup the state */
496 state->config = config; 478 state->config = config;
497 state->i2c = i2c; 479 state->i2c = i2c;
498 memcpy(&state->ops, &cx22702_ops, sizeof(struct dvb_frontend_ops));
499 state->prevUCBlocks = 0; 480 state->prevUCBlocks = 0;
500 481
501 /* check if the demod is there */ 482 /* check if the demod is there */
@@ -503,7 +484,7 @@ struct dvb_frontend* cx22702_attach(const struct cx22702_config* config,
503 goto error; 484 goto error;
504 485
505 /* create dvb_frontend */ 486 /* create dvb_frontend */
506 state->frontend.ops = &state->ops; 487 memcpy(&state->frontend.ops, &cx22702_ops, sizeof(struct dvb_frontend_ops));
507 state->frontend.demodulator_priv = state; 488 state->frontend.demodulator_priv = state;
508 return &state->frontend; 489 return &state->frontend;
509 490
@@ -530,6 +511,7 @@ static struct dvb_frontend_ops cx22702_ops = {
530 .release = cx22702_release, 511 .release = cx22702_release,
531 512
532 .init = cx22702_init, 513 .init = cx22702_init,
514 .i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
533 515
534 .set_frontend = cx22702_set_tps, 516 .set_frontend = cx22702_set_tps,
535 .get_frontend = cx22702_get_frontend, 517 .get_frontend = cx22702_get_frontend,
@@ -540,7 +522,6 @@ static struct dvb_frontend_ops cx22702_ops = {
540 .read_signal_strength = cx22702_read_signal_strength, 522 .read_signal_strength = cx22702_read_signal_strength,
541 .read_snr = cx22702_read_snr, 523 .read_snr = cx22702_read_snr,
542 .read_ucblocks = cx22702_read_ucblocks, 524 .read_ucblocks = cx22702_read_ucblocks,
543 .i2c_gate_ctrl = cx22702_i2c_gate_ctrl,
544}; 525};
545 526
546module_param(debug, int, 0644); 527module_param(debug, int, 0644);