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/sp8870.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/sp8870.c')
-rw-r--r-- | drivers/media/dvb/frontends/sp8870.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/drivers/media/dvb/frontends/sp8870.c b/drivers/media/dvb/frontends/sp8870.c index 73829e647e50..44ec5b9a4695 100644 --- a/drivers/media/dvb/frontends/sp8870.c +++ b/drivers/media/dvb/frontends/sp8870.c | |||
@@ -44,8 +44,6 @@ struct sp8870_state { | |||
44 | 44 | ||
45 | struct i2c_adapter* i2c; | 45 | struct i2c_adapter* i2c; |
46 | 46 | ||
47 | struct dvb_frontend_ops ops; | ||
48 | |||
49 | const struct sp8870_config* config; | 47 | const struct sp8870_config* config; |
50 | 48 | ||
51 | struct dvb_frontend frontend; | 49 | struct dvb_frontend frontend; |
@@ -262,9 +260,10 @@ static int sp8870_set_frontend_parameters (struct dvb_frontend* fe, | |||
262 | sp8870_microcontroller_stop(state); | 260 | sp8870_microcontroller_stop(state); |
263 | 261 | ||
264 | // set tuner parameters | 262 | // set tuner parameters |
265 | sp8870_writereg(state, 0x206, 0x001); | 263 | if (fe->ops.tuner_ops.set_params) { |
266 | state->config->pll_set(fe, p); | 264 | fe->ops.tuner_ops.set_params(fe, p); |
267 | sp8870_writereg(state, 0x206, 0x000); | 265 | if (fe->ops.i2c_gate_ctrl) fe->ops.i2c_gate_ctrl(fe, 0); |
266 | } | ||
268 | 267 | ||
269 | // sample rate correction bit [23..17] | 268 | // sample rate correction bit [23..17] |
270 | sp8870_writereg(state, 0x0319, 0x000A); | 269 | sp8870_writereg(state, 0x0319, 0x000A); |
@@ -349,13 +348,6 @@ static int sp8870_init (struct dvb_frontend* fe) | |||
349 | sp8870_writereg(state, 0x0D00, 0x010); | 348 | sp8870_writereg(state, 0x0D00, 0x010); |
350 | sp8870_writereg(state, 0x0D01, 0x000); | 349 | sp8870_writereg(state, 0x0D01, 0x000); |
351 | 350 | ||
352 | /* setup PLL */ | ||
353 | if (state->config->pll_init) { | ||
354 | sp8870_writereg(state, 0x206, 0x001); | ||
355 | state->config->pll_init(fe); | ||
356 | sp8870_writereg(state, 0x206, 0x000); | ||
357 | } | ||
358 | |||
359 | return 0; | 351 | return 0; |
360 | } | 352 | } |
361 | 353 | ||
@@ -541,6 +533,17 @@ static int sp8870_get_tune_settings(struct dvb_frontend* fe, struct dvb_frontend | |||
541 | return 0; | 533 | return 0; |
542 | } | 534 | } |
543 | 535 | ||
536 | static int sp8870_i2c_gate_ctrl(struct dvb_frontend* fe, int enable) | ||
537 | { | ||
538 | struct sp8870_state* state = fe->demodulator_priv; | ||
539 | |||
540 | if (enable) { | ||
541 | return sp8870_writereg(state, 0x206, 0x001); | ||
542 | } else { | ||
543 | return sp8870_writereg(state, 0x206, 0x000); | ||
544 | } | ||
545 | } | ||
546 | |||
544 | static void sp8870_release(struct dvb_frontend* fe) | 547 | static void sp8870_release(struct dvb_frontend* fe) |
545 | { | 548 | { |
546 | struct sp8870_state* state = fe->demodulator_priv; | 549 | struct sp8870_state* state = fe->demodulator_priv; |
@@ -561,14 +564,13 @@ struct dvb_frontend* sp8870_attach(const struct sp8870_config* config, | |||
561 | /* setup the state */ | 564 | /* setup the state */ |
562 | state->config = config; | 565 | state->config = config; |
563 | state->i2c = i2c; | 566 | state->i2c = i2c; |
564 | memcpy(&state->ops, &sp8870_ops, sizeof(struct dvb_frontend_ops)); | ||
565 | state->initialised = 0; | 567 | state->initialised = 0; |
566 | 568 | ||
567 | /* check if the demod is there */ | 569 | /* check if the demod is there */ |
568 | if (sp8870_readreg(state, 0x0200) < 0) goto error; | 570 | if (sp8870_readreg(state, 0x0200) < 0) goto error; |
569 | 571 | ||
570 | /* create dvb_frontend */ | 572 | /* create dvb_frontend */ |
571 | state->frontend.ops = &state->ops; | 573 | memcpy(&state->frontend.ops, &sp8870_ops, sizeof(struct dvb_frontend_ops)); |
572 | state->frontend.demodulator_priv = state; | 574 | state->frontend.demodulator_priv = state; |
573 | return &state->frontend; | 575 | return &state->frontend; |
574 | 576 | ||
@@ -597,6 +599,7 @@ static struct dvb_frontend_ops sp8870_ops = { | |||
597 | 599 | ||
598 | .init = sp8870_init, | 600 | .init = sp8870_init, |
599 | .sleep = sp8870_sleep, | 601 | .sleep = sp8870_sleep, |
602 | .i2c_gate_ctrl = sp8870_i2c_gate_ctrl, | ||
600 | 603 | ||
601 | .set_frontend = sp8870_set_frontend, | 604 | .set_frontend = sp8870_set_frontend, |
602 | .get_tune_settings = sp8870_get_tune_settings, | 605 | .get_tune_settings = sp8870_get_tune_settings, |