aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-dvb.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/video/saa7134/saa7134-dvb.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/video/saa7134/saa7134-dvb.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c259
1 files changed, 175 insertions, 84 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 222a36c38917..279828b8f299 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -132,9 +132,8 @@ static int mt352_aver777_init(struct dvb_frontend* fe)
132 return 0; 132 return 0;
133} 133}
134 134
135static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, 135static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
136 struct dvb_frontend_parameters* params, 136 struct dvb_frontend_parameters* params)
137 u8* pllbuf)
138{ 137{
139 u8 off[] = { 0x00, 0xf1}; 138 u8 off[] = { 0x00, 0xf1};
140 u8 on[] = { 0x00, 0x71}; 139 u8 on[] = { 0x00, 0x71};
@@ -147,30 +146,31 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
147 f.tuner = 0; 146 f.tuner = 0;
148 f.type = V4L2_TUNER_DIGITAL_TV; 147 f.type = V4L2_TUNER_DIGITAL_TV;
149 f.frequency = params->frequency / 1000 * 16 / 1000; 148 f.frequency = params->frequency / 1000 * 16 / 1000;
149 if (fe->ops.i2c_gate_ctrl)
150 fe->ops.i2c_gate_ctrl(fe, 1);
150 i2c_transfer(&dev->i2c_adap, &msg, 1); 151 i2c_transfer(&dev->i2c_adap, &msg, 1);
151 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); 152 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
152 msg.buf = on; 153 msg.buf = on;
154 if (fe->ops.i2c_gate_ctrl)
155 fe->ops.i2c_gate_ctrl(fe, 1);
153 i2c_transfer(&dev->i2c_adap, &msg, 1); 156 i2c_transfer(&dev->i2c_adap, &msg, 1);
154 157
155 pinnacle_antenna_pwr(dev, antenna_pwr); 158 pinnacle_antenna_pwr(dev, antenna_pwr);
156 159
157 /* mt352 setup */ 160 /* mt352 setup */
158 mt352_pinnacle_init(fe); 161 return mt352_pinnacle_init(fe);
159 pllbuf[0] = 0xc2;
160 pllbuf[1] = 0x00;
161 pllbuf[2] = 0x00;
162 pllbuf[3] = 0x80;
163 pllbuf[4] = 0x00;
164 return 0;
165} 162}
166 163
167static int mt352_aver777_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf) 164static int mt352_aver777_tuner_calc_regs(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len)
168{ 165{
169 pllbuf[0] = 0xc2; 166 if (buf_len < 5)
167 return -EINVAL;
168
169 pllbuf[0] = 0x61;
170 dvb_pll_configure(&dvb_pll_philips_td1316, pllbuf+1, 170 dvb_pll_configure(&dvb_pll_philips_td1316, pllbuf+1,
171 params->frequency, 171 params->frequency,
172 params->u.ofdm.bandwidth); 172 params->u.ofdm.bandwidth);
173 return 0; 173 return 5;
174} 174}
175 175
176static struct mt352_config pinnacle_300i = { 176static struct mt352_config pinnacle_300i = {
@@ -179,13 +179,11 @@ static struct mt352_config pinnacle_300i = {
179 .if2 = 36150, 179 .if2 = 36150,
180 .no_tuner = 1, 180 .no_tuner = 1,
181 .demod_init = mt352_pinnacle_init, 181 .demod_init = mt352_pinnacle_init,
182 .pll_set = mt352_pinnacle_pll_set,
183}; 182};
184 183
185static struct mt352_config avermedia_777 = { 184static struct mt352_config avermedia_777 = {
186 .demod_address = 0xf, 185 .demod_address = 0xf,
187 .demod_init = mt352_aver777_init, 186 .demod_init = mt352_aver777_init,
188 .pll_set = mt352_aver777_pll_set,
189}; 187};
190#endif 188#endif
191 189
@@ -268,6 +266,8 @@ static int philips_tda6651_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb_
268 tuner_buf[2] = 0xca; 266 tuner_buf[2] = 0xca;
269 tuner_buf[3] = (cp << 5) | (filter << 3) | band; 267 tuner_buf[3] = (cp << 5) | (filter << 3) | band;
270 268
269 if (fe->ops.i2c_gate_ctrl)
270 fe->ops.i2c_gate_ctrl(fe, 1);
271 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 271 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
272 return -EIO; 272 return -EIO;
273 msleep(1); 273 msleep(1);
@@ -281,6 +281,8 @@ static int philips_tda6651_pll_init(u8 addr, struct dvb_frontend *fe)
281 struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; 281 struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) };
282 282
283 /* setup PLL configuration */ 283 /* setup PLL configuration */
284 if (fe->ops.i2c_gate_ctrl)
285 fe->ops.i2c_gate_ctrl(fe, 1);
284 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 286 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
285 return -EIO; 287 return -EIO;
286 msleep(1); 288 msleep(1);
@@ -290,12 +292,12 @@ static int philips_tda6651_pll_init(u8 addr, struct dvb_frontend *fe)
290 292
291/* ------------------------------------------------------------------ */ 293/* ------------------------------------------------------------------ */
292 294
293static int philips_tu1216_pll_60_init(struct dvb_frontend *fe) 295static int philips_tu1216_tuner_60_init(struct dvb_frontend *fe)
294{ 296{
295 return philips_tda6651_pll_init(0x60, fe); 297 return philips_tda6651_pll_init(0x60, fe);
296} 298}
297 299
298static int philips_tu1216_pll_60_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 300static int philips_tu1216_tuner_60_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
299{ 301{
300 return philips_tda6651_pll_set(0x60, fe, params); 302 return philips_tda6651_pll_set(0x60, fe, params);
301} 303}
@@ -315,20 +317,17 @@ static struct tda1004x_config philips_tu1216_60_config = {
315 .xtal_freq = TDA10046_XTAL_4M, 317 .xtal_freq = TDA10046_XTAL_4M,
316 .agc_config = TDA10046_AGC_DEFAULT, 318 .agc_config = TDA10046_AGC_DEFAULT,
317 .if_freq = TDA10046_FREQ_3617, 319 .if_freq = TDA10046_FREQ_3617,
318 .pll_init = philips_tu1216_pll_60_init,
319 .pll_set = philips_tu1216_pll_60_set,
320 .pll_sleep = NULL,
321 .request_firmware = philips_tu1216_request_firmware, 320 .request_firmware = philips_tu1216_request_firmware,
322}; 321};
323 322
324/* ------------------------------------------------------------------ */ 323/* ------------------------------------------------------------------ */
325 324
326static int philips_tu1216_pll_61_init(struct dvb_frontend *fe) 325static int philips_tu1216_tuner_61_init(struct dvb_frontend *fe)
327{ 326{
328 return philips_tda6651_pll_init(0x61, fe); 327 return philips_tda6651_pll_init(0x61, fe);
329} 328}
330 329
331static int philips_tu1216_pll_61_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 330static int philips_tu1216_tuner_61_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
332{ 331{
333 return philips_tda6651_pll_set(0x61, fe, params); 332 return philips_tda6651_pll_set(0x61, fe, params);
334} 333}
@@ -341,21 +340,20 @@ static struct tda1004x_config philips_tu1216_61_config = {
341 .xtal_freq = TDA10046_XTAL_4M, 340 .xtal_freq = TDA10046_XTAL_4M,
342 .agc_config = TDA10046_AGC_DEFAULT, 341 .agc_config = TDA10046_AGC_DEFAULT,
343 .if_freq = TDA10046_FREQ_3617, 342 .if_freq = TDA10046_FREQ_3617,
344 .pll_init = philips_tu1216_pll_61_init,
345 .pll_set = philips_tu1216_pll_61_set,
346 .pll_sleep = NULL,
347 .request_firmware = philips_tu1216_request_firmware, 343 .request_firmware = philips_tu1216_request_firmware,
348}; 344};
349 345
350/* ------------------------------------------------------------------ */ 346/* ------------------------------------------------------------------ */
351 347
352static int philips_europa_pll_init(struct dvb_frontend *fe) 348static int philips_europa_tuner_init(struct dvb_frontend *fe)
353{ 349{
354 struct saa7134_dev *dev = fe->dvb->priv; 350 struct saa7134_dev *dev = fe->dvb->priv;
355 static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; 351 static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab };
356 struct i2c_msg init_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; 352 struct i2c_msg init_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) };
357 353
358 /* setup PLL configuration */ 354 /* setup PLL configuration */
355 if (fe->ops.i2c_gate_ctrl)
356 fe->ops.i2c_gate_ctrl(fe, 1);
359 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) 357 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
360 return -EIO; 358 return -EIO;
361 msleep(1); 359 msleep(1);
@@ -365,18 +363,20 @@ static int philips_europa_pll_init(struct dvb_frontend *fe)
365 init_msg.len = 0x02; 363 init_msg.len = 0x02;
366 msg[0] = 0x00; 364 msg[0] = 0x00;
367 msg[1] = 0x40; 365 msg[1] = 0x40;
366 if (fe->ops.i2c_gate_ctrl)
367 fe->ops.i2c_gate_ctrl(fe, 1);
368 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) 368 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
369 return -EIO; 369 return -EIO;
370 370
371 return 0; 371 return 0;
372} 372}
373 373
374static int philips_td1316_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 374static int philips_td1316_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
375{ 375{
376 return philips_tda6651_pll_set(0x61, fe, params); 376 return philips_tda6651_pll_set(0x61, fe, params);
377} 377}
378 378
379static void philips_europa_analog(struct dvb_frontend *fe) 379static int philips_europa_tuner_sleep(struct dvb_frontend *fe)
380{ 380{
381 struct saa7134_dev *dev = fe->dvb->priv; 381 struct saa7134_dev *dev = fe->dvb->priv;
382 /* this message actually turns the tuner back to analog mode */ 382 /* this message actually turns the tuner back to analog mode */
@@ -391,7 +391,20 @@ static void philips_europa_analog(struct dvb_frontend *fe)
391 analog_msg.len = 0x02; 391 analog_msg.len = 0x02;
392 msg[0] = 0x00; 392 msg[0] = 0x00;
393 msg[1] = 0x14; 393 msg[1] = 0x14;
394 if (fe->ops.i2c_gate_ctrl)
395 fe->ops.i2c_gate_ctrl(fe, 1);
394 i2c_transfer(&dev->i2c_adap, &analog_msg, 1); 396 i2c_transfer(&dev->i2c_adap, &analog_msg, 1);
397 return 0;
398}
399
400static int philips_europa_demod_sleep(struct dvb_frontend *fe)
401{
402 struct saa7134_dev *dev = fe->dvb->priv;
403
404 if (dev->original_demod_sleep)
405 dev->original_demod_sleep(fe);
406 fe->ops.i2c_gate_ctrl(fe, 1);
407 return 0;
395} 408}
396 409
397static struct tda1004x_config philips_europa_config = { 410static struct tda1004x_config philips_europa_config = {
@@ -402,21 +415,20 @@ static struct tda1004x_config philips_europa_config = {
402 .xtal_freq = TDA10046_XTAL_4M, 415 .xtal_freq = TDA10046_XTAL_4M,
403 .agc_config = TDA10046_AGC_IFO_AUTO_POS, 416 .agc_config = TDA10046_AGC_IFO_AUTO_POS,
404 .if_freq = TDA10046_FREQ_052, 417 .if_freq = TDA10046_FREQ_052,
405 .pll_init = philips_europa_pll_init,
406 .pll_set = philips_td1316_pll_set,
407 .pll_sleep = philips_europa_analog,
408 .request_firmware = NULL, 418 .request_firmware = NULL,
409}; 419};
410 420
411/* ------------------------------------------------------------------ */ 421/* ------------------------------------------------------------------ */
412 422
413static int philips_fmd1216_pll_init(struct dvb_frontend *fe) 423static int philips_fmd1216_tuner_init(struct dvb_frontend *fe)
414{ 424{
415 struct saa7134_dev *dev = fe->dvb->priv; 425 struct saa7134_dev *dev = fe->dvb->priv;
416 /* this message is to set up ATC and ALC */ 426 /* this message is to set up ATC and ALC */
417 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 }; 427 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 };
418 struct i2c_msg tuner_msg = {.addr = 0x61,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) }; 428 struct i2c_msg tuner_msg = {.addr = 0x61,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) };
419 429
430 if (fe->ops.i2c_gate_ctrl)
431 fe->ops.i2c_gate_ctrl(fe, 1);
420 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 432 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
421 return -EIO; 433 return -EIO;
422 msleep(1); 434 msleep(1);
@@ -424,22 +436,27 @@ static int philips_fmd1216_pll_init(struct dvb_frontend *fe)
424 return 0; 436 return 0;
425} 437}
426 438
427static void philips_fmd1216_analog(struct dvb_frontend *fe) 439static int philips_fmd1216_tuner_sleep(struct dvb_frontend *fe)
428{ 440{
429 struct saa7134_dev *dev = fe->dvb->priv; 441 struct saa7134_dev *dev = fe->dvb->priv;
430 /* this message actually turns the tuner back to analog mode */ 442 /* this message actually turns the tuner back to analog mode */
431 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0x60 }; 443 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0x60 };
432 struct i2c_msg tuner_msg = {.addr = 0x61,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) }; 444 struct i2c_msg tuner_msg = {.addr = 0x61,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) };
433 445
446 if (fe->ops.i2c_gate_ctrl)
447 fe->ops.i2c_gate_ctrl(fe, 1);
434 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 448 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
435 msleep(1); 449 msleep(1);
436 fmd1216_init[2] = 0x86; 450 fmd1216_init[2] = 0x86;
437 fmd1216_init[3] = 0x54; 451 fmd1216_init[3] = 0x54;
452 if (fe->ops.i2c_gate_ctrl)
453 fe->ops.i2c_gate_ctrl(fe, 1);
438 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 454 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
439 msleep(1); 455 msleep(1);
456 return 0;
440} 457}
441 458
442static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 459static int philips_fmd1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
443{ 460{
444 struct saa7134_dev *dev = fe->dvb->priv; 461 struct saa7134_dev *dev = fe->dvb->priv;
445 u8 tuner_buf[4]; 462 u8 tuner_buf[4];
@@ -516,6 +533,8 @@ static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
516 tuner_buf[2] = 0x80 | (cp << 6) | (mode << 3) | 4; 533 tuner_buf[2] = 0x80 | (cp << 6) | (mode << 3) | 4;
517 tuner_buf[3] = 0x40 | band; 534 tuner_buf[3] = 0x40 | band;
518 535
536 if (fe->ops.i2c_gate_ctrl)
537 fe->ops.i2c_gate_ctrl(fe, 1);
519 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 538 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
520 return -EIO; 539 return -EIO;
521 return 0; 540 return 0;
@@ -528,9 +547,6 @@ static struct tda1004x_config medion_cardbus = {
528 .xtal_freq = TDA10046_XTAL_16M, 547 .xtal_freq = TDA10046_XTAL_16M,
529 .agc_config = TDA10046_AGC_IFO_AUTO_NEG, 548 .agc_config = TDA10046_AGC_IFO_AUTO_NEG,
530 .if_freq = TDA10046_FREQ_3613, 549 .if_freq = TDA10046_FREQ_3613,
531 .pll_init = philips_fmd1216_pll_init,
532 .pll_set = philips_fmd1216_pll_set,
533 .pll_sleep = philips_fmd1216_analog,
534 .request_firmware = NULL, 550 .request_firmware = NULL,
535}; 551};
536 552
@@ -578,12 +594,12 @@ static struct tda827x_data tda827x_dvbt[] = {
578 { .lomax = 0, .spd = 0, .bs = 0, .bp = 0, .cp = 0, .gc3 = 0, .div1p5 = 0} 594 { .lomax = 0, .spd = 0, .bs = 0, .bp = 0, .cp = 0, .gc3 = 0, .div1p5 = 0}
579}; 595};
580 596
581static int philips_tda827x_pll_init(struct dvb_frontend *fe) 597static int philips_tda827x_tuner_init(struct dvb_frontend *fe)
582{ 598{
583 return 0; 599 return 0;
584} 600}
585 601
586static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 602static int philips_tda827x_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
587{ 603{
588 struct saa7134_dev *dev = fe->dvb->priv; 604 struct saa7134_dev *dev = fe->dvb->priv;
589 u8 tuner_buf[14]; 605 u8 tuner_buf[14];
@@ -630,6 +646,8 @@ static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
630 tuner_buf[13] = 0x40; 646 tuner_buf[13] = 0x40;
631 647
632 tuner_msg.len = 14; 648 tuner_msg.len = 14;
649 if (fe->ops.i2c_gate_ctrl)
650 fe->ops.i2c_gate_ctrl(fe, 1);
633 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 651 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
634 return -EIO; 652 return -EIO;
635 653
@@ -638,18 +656,23 @@ static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
638 tuner_buf[0] = 0x30; 656 tuner_buf[0] = 0x30;
639 tuner_buf[1] = 0x50 + tda827x_dvbt[i].cp; 657 tuner_buf[1] = 0x50 + tda827x_dvbt[i].cp;
640 tuner_msg.len = 2; 658 tuner_msg.len = 2;
659 if (fe->ops.i2c_gate_ctrl)
660 fe->ops.i2c_gate_ctrl(fe, 1);
641 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 661 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
642 662
643 return 0; 663 return 0;
644} 664}
645 665
646static void philips_tda827x_pll_sleep(struct dvb_frontend *fe) 666static int philips_tda827x_tuner_sleep(struct dvb_frontend *fe)
647{ 667{
648 struct saa7134_dev *dev = fe->dvb->priv; 668 struct saa7134_dev *dev = fe->dvb->priv;
649 static u8 tda827x_sleep[] = { 0x30, 0xd0}; 669 static u8 tda827x_sleep[] = { 0x30, 0xd0};
650 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep, 670 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep,
651 .len = sizeof(tda827x_sleep) }; 671 .len = sizeof(tda827x_sleep) };
672 if (fe->ops.i2c_gate_ctrl)
673 fe->ops.i2c_gate_ctrl(fe, 1);
652 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 674 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
675 return 0;
653} 676}
654 677
655static struct tda1004x_config tda827x_lifeview_config = { 678static struct tda1004x_config tda827x_lifeview_config = {
@@ -659,9 +682,6 @@ static struct tda1004x_config tda827x_lifeview_config = {
659 .xtal_freq = TDA10046_XTAL_16M, 682 .xtal_freq = TDA10046_XTAL_16M,
660 .agc_config = TDA10046_AGC_TDA827X, 683 .agc_config = TDA10046_AGC_TDA827X,
661 .if_freq = TDA10046_FREQ_045, 684 .if_freq = TDA10046_FREQ_045,
662 .pll_init = philips_tda827x_pll_init,
663 .pll_set = philips_tda827x_pll_set,
664 .pll_sleep = philips_tda827x_pll_sleep,
665 .request_firmware = NULL, 685 .request_firmware = NULL,
666}; 686};
667 687
@@ -753,6 +773,8 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
753 tuner_buf[12] = 0x00; 773 tuner_buf[12] = 0x00;
754 tuner_buf[13] = 0x39; // lpsel 774 tuner_buf[13] = 0x39; // lpsel
755 msg.len = 14; 775 msg.len = 14;
776 if (fe->ops.i2c_gate_ctrl)
777 fe->ops.i2c_gate_ctrl(fe, 1);
756 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) 778 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
757 return -EIO; 779 return -EIO;
758 780
@@ -760,10 +782,14 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
760 msg.len = 2; 782 msg.len = 2;
761 reg2[0] = 0x60; 783 reg2[0] = 0x60;
762 reg2[1] = 0x3c; 784 reg2[1] = 0x3c;
785 if (fe->ops.i2c_gate_ctrl)
786 fe->ops.i2c_gate_ctrl(fe, 1);
763 i2c_transfer(&dev->i2c_adap, &msg, 1); 787 i2c_transfer(&dev->i2c_adap, &msg, 1);
764 788
765 reg2[0] = 0xa0; 789 reg2[0] = 0xa0;
766 reg2[1] = 0x40; 790 reg2[1] = 0x40;
791 if (fe->ops.i2c_gate_ctrl)
792 fe->ops.i2c_gate_ctrl(fe, 1);
767 i2c_transfer(&dev->i2c_adap, &msg, 1); 793 i2c_transfer(&dev->i2c_adap, &msg, 1);
768 794
769 msleep(2); 795 msleep(2);
@@ -771,36 +797,43 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
771 reg2[0] = 0x30; 797 reg2[0] = 0x30;
772 reg2[1] = 0x10 + tda827xa_dvbt[i].scr; 798 reg2[1] = 0x10 + tda827xa_dvbt[i].scr;
773 msg.len = 2; 799 msg.len = 2;
800 if (fe->ops.i2c_gate_ctrl)
801 fe->ops.i2c_gate_ctrl(fe, 1);
774 i2c_transfer(&dev->i2c_adap, &msg, 1); 802 i2c_transfer(&dev->i2c_adap, &msg, 1);
775 803
776 msleep(550); 804 msleep(550);
777 reg2[0] = 0x50; 805 reg2[0] = 0x50;
778 reg2[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4); 806 reg2[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4);
807 if (fe->ops.i2c_gate_ctrl)
808 fe->ops.i2c_gate_ctrl(fe, 1);
779 i2c_transfer(&dev->i2c_adap, &msg, 1); 809 i2c_transfer(&dev->i2c_adap, &msg, 1);
780 810
781 return 0; 811 return 0;
782 812
783} 813}
784 814
785static void philips_tda827xa_pll_sleep(u8 addr, struct dvb_frontend *fe) 815static int philips_tda827xa_tuner_sleep(u8 addr, struct dvb_frontend *fe)
786{ 816{
787 struct saa7134_dev *dev = fe->dvb->priv; 817 struct saa7134_dev *dev = fe->dvb->priv;
788 static u8 tda827xa_sleep[] = { 0x30, 0x90}; 818 static u8 tda827xa_sleep[] = { 0x30, 0x90};
789 struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tda827xa_sleep, 819 struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tda827xa_sleep,
790 .len = sizeof(tda827xa_sleep) }; 820 .len = sizeof(tda827xa_sleep) };
821 if (fe->ops.i2c_gate_ctrl)
822 fe->ops.i2c_gate_ctrl(fe, 1);
791 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 823 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
792 824 return 0;
793} 825}
794 826
795/* ------------------------------------------------------------------ */ 827/* ------------------------------------------------------------------ */
796 828
797static int philips_tiger_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 829static int philips_tiger_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
798{ 830{
799 int ret; 831 int ret;
800 struct saa7134_dev *dev = fe->dvb->priv; 832 struct saa7134_dev *dev = fe->dvb->priv;
801 static u8 tda8290_close[] = { 0x21, 0xc0}; 833 static u8 tda8290_close[] = { 0x21, 0xc0};
802 static u8 tda8290_open[] = { 0x21, 0x80}; 834 static u8 tda8290_open[] = { 0x21, 0x80};
803 struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2}; 835 struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2};
836
804 /* close tda8290 i2c bridge */ 837 /* close tda8290 i2c bridge */
805 tda8290_msg.buf = tda8290_close; 838 tda8290_msg.buf = tda8290_close;
806 ret = i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1); 839 ret = i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1);
@@ -816,7 +849,7 @@ static int philips_tiger_pll_set(struct dvb_frontend *fe, struct dvb_frontend_pa
816 return ret; 849 return ret;
817} 850}
818 851
819static int philips_tiger_dvb_mode(struct dvb_frontend *fe) 852static int philips_tiger_tuner_init(struct dvb_frontend *fe)
820{ 853{
821 struct saa7134_dev *dev = fe->dvb->priv; 854 struct saa7134_dev *dev = fe->dvb->priv;
822 static u8 data[] = { 0x3c, 0x33, 0x6a}; 855 static u8 data[] = { 0x3c, 0x33, 0x6a};
@@ -827,14 +860,15 @@ static int philips_tiger_dvb_mode(struct dvb_frontend *fe)
827 return 0; 860 return 0;
828} 861}
829 862
830static void philips_tiger_analog_mode(struct dvb_frontend *fe) 863static int philips_tiger_tuner_sleep(struct dvb_frontend *fe)
831{ 864{
832 struct saa7134_dev *dev = fe->dvb->priv; 865 struct saa7134_dev *dev = fe->dvb->priv;
833 static u8 data[] = { 0x3c, 0x33, 0x68}; 866 static u8 data[] = { 0x3c, 0x33, 0x68};
834 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; 867 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
835 868
836 i2c_transfer(&dev->i2c_adap, &msg, 1); 869 i2c_transfer(&dev->i2c_adap, &msg, 1);
837 philips_tda827xa_pll_sleep( 0x61, fe); 870 philips_tda827xa_tuner_sleep( 0x61, fe);
871 return 0;
838} 872}
839 873
840static struct tda1004x_config philips_tiger_config = { 874static struct tda1004x_config philips_tiger_config = {
@@ -844,15 +878,12 @@ static struct tda1004x_config philips_tiger_config = {
844 .xtal_freq = TDA10046_XTAL_16M, 878 .xtal_freq = TDA10046_XTAL_16M,
845 .agc_config = TDA10046_AGC_TDA827X, 879 .agc_config = TDA10046_AGC_TDA827X,
846 .if_freq = TDA10046_FREQ_045, 880 .if_freq = TDA10046_FREQ_045,
847 .pll_init = philips_tiger_dvb_mode,
848 .pll_set = philips_tiger_pll_set,
849 .pll_sleep = philips_tiger_analog_mode,
850 .request_firmware = NULL, 881 .request_firmware = NULL,
851}; 882};
852 883
853/* ------------------------------------------------------------------ */ 884/* ------------------------------------------------------------------ */
854 885
855static int lifeview_trio_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 886static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
856{ 887{
857 int ret; 888 int ret;
858 889
@@ -860,16 +891,12 @@ static int lifeview_trio_pll_set(struct dvb_frontend *fe, struct dvb_frontend_pa
860 return ret; 891 return ret;
861} 892}
862 893
863static int lifeview_trio_dvb_mode(struct dvb_frontend *fe) 894static int lifeview_trio_tuner_sleep(struct dvb_frontend *fe)
864{ 895{
896 philips_tda827xa_tuner_sleep(0x60, fe);
865 return 0; 897 return 0;
866} 898}
867 899
868static void lifeview_trio_analog_mode(struct dvb_frontend *fe)
869{
870 philips_tda827xa_pll_sleep(0x60, fe);
871}
872
873static struct tda1004x_config lifeview_trio_config = { 900static struct tda1004x_config lifeview_trio_config = {
874 .demod_address = 0x09, 901 .demod_address = 0x09,
875 .invert = 1, 902 .invert = 1,
@@ -877,15 +904,12 @@ static struct tda1004x_config lifeview_trio_config = {
877 .xtal_freq = TDA10046_XTAL_16M, 904 .xtal_freq = TDA10046_XTAL_16M,
878 .agc_config = TDA10046_AGC_TDA827X_GPL, 905 .agc_config = TDA10046_AGC_TDA827X_GPL,
879 .if_freq = TDA10046_FREQ_045, 906 .if_freq = TDA10046_FREQ_045,
880 .pll_init = lifeview_trio_dvb_mode,
881 .pll_set = lifeview_trio_pll_set,
882 .pll_sleep = lifeview_trio_analog_mode,
883 .request_firmware = NULL, 907 .request_firmware = NULL,
884}; 908};
885 909
886/* ------------------------------------------------------------------ */ 910/* ------------------------------------------------------------------ */
887 911
888static int ads_duo_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 912static int ads_duo_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
889{ 913{
890 int ret; 914 int ret;
891 915
@@ -893,7 +917,7 @@ static int ads_duo_pll_set(struct dvb_frontend *fe, struct dvb_frontend_paramete
893 return ret; 917 return ret;
894} 918}
895 919
896static int ads_duo_dvb_mode(struct dvb_frontend *fe) 920static int ads_duo_tuner_init(struct dvb_frontend *fe)
897{ 921{
898 struct saa7134_dev *dev = fe->dvb->priv; 922 struct saa7134_dev *dev = fe->dvb->priv;
899 /* route TDA8275a AGC input to the channel decoder */ 923 /* route TDA8275a AGC input to the channel decoder */
@@ -901,12 +925,13 @@ static int ads_duo_dvb_mode(struct dvb_frontend *fe)
901 return 0; 925 return 0;
902} 926}
903 927
904static void ads_duo_analog_mode(struct dvb_frontend *fe) 928static int ads_duo_tuner_sleep(struct dvb_frontend *fe)
905{ 929{
906 struct saa7134_dev *dev = fe->dvb->priv; 930 struct saa7134_dev *dev = fe->dvb->priv;
907 /* route TDA8275a AGC input to the analog IF chip*/ 931 /* route TDA8275a AGC input to the analog IF chip*/
908 saa_writeb(SAA7134_GPIO_GPSTATUS2, 0x20); 932 saa_writeb(SAA7134_GPIO_GPSTATUS2, 0x20);
909 philips_tda827xa_pll_sleep( 0x61, fe); 933 philips_tda827xa_tuner_sleep( 0x61, fe);
934 return 0;
910} 935}
911 936
912static struct tda1004x_config ads_tech_duo_config = { 937static struct tda1004x_config ads_tech_duo_config = {
@@ -916,31 +941,24 @@ static struct tda1004x_config ads_tech_duo_config = {
916 .xtal_freq = TDA10046_XTAL_16M, 941 .xtal_freq = TDA10046_XTAL_16M,
917 .agc_config = TDA10046_AGC_TDA827X_GPL, 942 .agc_config = TDA10046_AGC_TDA827X_GPL,
918 .if_freq = TDA10046_FREQ_045, 943 .if_freq = TDA10046_FREQ_045,
919 .pll_init = ads_duo_dvb_mode,
920 .pll_set = ads_duo_pll_set,
921 .pll_sleep = ads_duo_analog_mode,
922 .request_firmware = NULL, 944 .request_firmware = NULL,
923}; 945};
924 946
925/* ------------------------------------------------------------------ */ 947/* ------------------------------------------------------------------ */
926 948
927static int tevion_dvb220rf_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 949static int tevion_dvb220rf_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
928{ 950{
929 int ret; 951 int ret;
930 ret = philips_tda827xa_pll_set(0x60, fe, params); 952 ret = philips_tda827xa_pll_set(0x60, fe, params);
931 return ret; 953 return ret;
932} 954}
933 955
934static int tevion_dvb220rf_pll_init(struct dvb_frontend *fe) 956static int tevion_dvb220rf_tuner_sleep(struct dvb_frontend *fe)
935{ 957{
958 philips_tda827xa_tuner_sleep( 0x61, fe);
936 return 0; 959 return 0;
937} 960}
938 961
939static void tevion_dvb220rf_pll_sleep(struct dvb_frontend *fe)
940{
941 philips_tda827xa_pll_sleep( 0x61, fe);
942}
943
944static struct tda1004x_config tevion_dvbt220rf_config = { 962static struct tda1004x_config tevion_dvbt220rf_config = {
945 .demod_address = 0x08, 963 .demod_address = 0x08,
946 .invert = 1, 964 .invert = 1,
@@ -948,9 +966,6 @@ static struct tda1004x_config tevion_dvbt220rf_config = {
948 .xtal_freq = TDA10046_XTAL_16M, 966 .xtal_freq = TDA10046_XTAL_16M,
949 .agc_config = TDA10046_AGC_TDA827X, 967 .agc_config = TDA10046_AGC_TDA827X,
950 .if_freq = TDA10046_FREQ_045, 968 .if_freq = TDA10046_FREQ_045,
951 .pll_init = tevion_dvb220rf_pll_init,
952 .pll_set = tevion_dvb220rf_pll_set,
953 .pll_sleep = tevion_dvb220rf_pll_sleep,
954 .request_firmware = NULL, 969 .request_firmware = NULL,
955}; 970};
956 971
@@ -961,8 +976,6 @@ static struct tda1004x_config tevion_dvbt220rf_config = {
961#ifdef HAVE_NXT200X 976#ifdef HAVE_NXT200X
962static struct nxt200x_config avertvhda180 = { 977static struct nxt200x_config avertvhda180 = {
963 .demod_address = 0x0a, 978 .demod_address = 0x0a,
964 .pll_address = 0x61,
965 .pll_desc = &dvb_pll_tdhu2,
966}; 979};
967 980
968static int nxt200x_set_pll_input(u8 *buf, int input) 981static int nxt200x_set_pll_input(u8 *buf, int input)
@@ -976,8 +989,6 @@ static int nxt200x_set_pll_input(u8 *buf, int input)
976 989
977static struct nxt200x_config kworldatsc110 = { 990static struct nxt200x_config kworldatsc110 = {
978 .demod_address = 0x0a, 991 .demod_address = 0x0a,
979 .pll_address = 0x61,
980 .pll_desc = &dvb_pll_tuv1236d,
981 .set_pll_input = nxt200x_set_pll_input, 992 .set_pll_input = nxt200x_set_pll_input,
982}; 993};
983#endif 994#endif
@@ -1003,78 +1014,158 @@ static int dvb_init(struct saa7134_dev *dev)
1003 printk("%s: pinnacle 300i dvb setup\n",dev->name); 1014 printk("%s: pinnacle 300i dvb setup\n",dev->name);
1004 dev->dvb.frontend = mt352_attach(&pinnacle_300i, 1015 dev->dvb.frontend = mt352_attach(&pinnacle_300i,
1005 &dev->i2c_adap); 1016 &dev->i2c_adap);
1017 if (dev->dvb.frontend) {
1018 dev->dvb.frontend->ops.tuner_ops.set_params = mt352_pinnacle_tuner_set_params;
1019 }
1006 break; 1020 break;
1007 1021
1008 case SAA7134_BOARD_AVERMEDIA_777: 1022 case SAA7134_BOARD_AVERMEDIA_777:
1009 printk("%s: avertv 777 dvb setup\n",dev->name); 1023 printk("%s: avertv 777 dvb setup\n",dev->name);
1010 dev->dvb.frontend = mt352_attach(&avermedia_777, 1024 dev->dvb.frontend = mt352_attach(&avermedia_777,
1011 &dev->i2c_adap); 1025 &dev->i2c_adap);
1026 if (dev->dvb.frontend) {
1027 dev->dvb.frontend->ops.tuner_ops.calc_regs = mt352_aver777_tuner_calc_regs;
1028 }
1012 break; 1029 break;
1013#endif 1030#endif
1014#ifdef HAVE_TDA1004X 1031#ifdef HAVE_TDA1004X
1015 case SAA7134_BOARD_MD7134: 1032 case SAA7134_BOARD_MD7134:
1016 dev->dvb.frontend = tda10046_attach(&medion_cardbus, 1033 dev->dvb.frontend = tda10046_attach(&medion_cardbus,
1017 &dev->i2c_adap); 1034 &dev->i2c_adap);
1035 if (dev->dvb.frontend) {
1036 dev->dvb.frontend->ops.tuner_ops.init = philips_fmd1216_tuner_init;
1037 dev->dvb.frontend->ops.tuner_ops.sleep = philips_fmd1216_tuner_sleep;
1038 dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
1039 }
1018 break; 1040 break;
1019 case SAA7134_BOARD_PHILIPS_TOUGH: 1041 case SAA7134_BOARD_PHILIPS_TOUGH:
1020 dev->dvb.frontend = tda10046_attach(&philips_tu1216_60_config, 1042 dev->dvb.frontend = tda10046_attach(&philips_tu1216_60_config,
1021 &dev->i2c_adap); 1043 &dev->i2c_adap);
1044 if (dev->dvb.frontend) {
1045 dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_tuner_60_init;
1046 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tu1216_tuner_60_set_params;
1047 }
1022 break; 1048 break;
1023 case SAA7134_BOARD_FLYDVBTDUO: 1049 case SAA7134_BOARD_FLYDVBTDUO:
1024 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1050 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1025 &dev->i2c_adap); 1051 &dev->i2c_adap);
1052 if (dev->dvb.frontend) {
1053 dev->dvb.frontend->ops.tuner_ops.init = philips_tda827x_tuner_init;
1054 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tda827x_tuner_sleep;
1055 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda827x_tuner_set_params;
1056 }
1026 break; 1057 break;
1027 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS: 1058 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
1028 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1059 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1029 &dev->i2c_adap); 1060 &dev->i2c_adap);
1061 if (dev->dvb.frontend) {
1062 dev->dvb.frontend->ops.tuner_ops.init = philips_tda827x_tuner_init;
1063 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tda827x_tuner_sleep;
1064 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda827x_tuner_set_params;
1065 }
1030 break; 1066 break;
1031 case SAA7134_BOARD_PHILIPS_EUROPA: 1067 case SAA7134_BOARD_PHILIPS_EUROPA:
1032 dev->dvb.frontend = tda10046_attach(&philips_europa_config, 1068 dev->dvb.frontend = tda10046_attach(&philips_europa_config,
1033 &dev->i2c_adap); 1069 &dev->i2c_adap);
1070 if (dev->dvb.frontend) {
1071 dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
1072 dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
1073 dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init;
1074 dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep;
1075 dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
1076 }
1034 break; 1077 break;
1035 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 1078 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
1036 dev->dvb.frontend = tda10046_attach(&philips_europa_config, 1079 dev->dvb.frontend = tda10046_attach(&philips_europa_config,
1037 &dev->i2c_adap); 1080 &dev->i2c_adap);
1081 if (dev->dvb.frontend) {
1082 dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init;
1083 dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep;
1084 dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
1085 }
1038 break; 1086 break;
1039 case SAA7134_BOARD_VIDEOMATE_DVBT_200: 1087 case SAA7134_BOARD_VIDEOMATE_DVBT_200:
1040 dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config, 1088 dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config,
1041 &dev->i2c_adap); 1089 &dev->i2c_adap);
1090 if (dev->dvb.frontend) {
1091 dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_tuner_61_init;
1092 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tu1216_tuner_61_set_params;
1093 }
1042 break; 1094 break;
1043 case SAA7134_BOARD_PHILIPS_TIGER: 1095 case SAA7134_BOARD_PHILIPS_TIGER:
1044 dev->dvb.frontend = tda10046_attach(&philips_tiger_config, 1096 dev->dvb.frontend = tda10046_attach(&philips_tiger_config,
1045 &dev->i2c_adap); 1097 &dev->i2c_adap);
1098 if (dev->dvb.frontend) {
1099 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
1100 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep;
1101 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
1102 }
1046 break; 1103 break;
1047 case SAA7134_BOARD_ASUSTeK_P7131_DUAL: 1104 case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
1048 dev->dvb.frontend = tda10046_attach(&philips_tiger_config, 1105 dev->dvb.frontend = tda10046_attach(&philips_tiger_config,
1049 &dev->i2c_adap); 1106 &dev->i2c_adap);
1107 if (dev->dvb.frontend) {
1108 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
1109 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep;
1110 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
1111 }
1050 break; 1112 break;
1051 case SAA7134_BOARD_FLYDVBT_LR301: 1113 case SAA7134_BOARD_FLYDVBT_LR301:
1052 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1114 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1053 &dev->i2c_adap); 1115 &dev->i2c_adap);
1116 if (dev->dvb.frontend) {
1117 dev->dvb.frontend->ops.tuner_ops.init = philips_tda827x_tuner_init;
1118 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tda827x_tuner_sleep;
1119 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda827x_tuner_set_params;
1120 }
1054 break; 1121 break;
1055 case SAA7134_BOARD_FLYDVB_TRIO: 1122 case SAA7134_BOARD_FLYDVB_TRIO:
1056 dev->dvb.frontend = tda10046_attach(&lifeview_trio_config, 1123 dev->dvb.frontend = tda10046_attach(&lifeview_trio_config,
1057 &dev->i2c_adap); 1124 &dev->i2c_adap);
1125 if (dev->dvb.frontend) {
1126 dev->dvb.frontend->ops.tuner_ops.sleep = lifeview_trio_tuner_sleep;
1127 dev->dvb.frontend->ops.tuner_ops.set_params = lifeview_trio_tuner_set_params;
1128 }
1058 break; 1129 break;
1059 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: 1130 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331:
1060 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config, 1131 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config,
1061 &dev->i2c_adap); 1132 &dev->i2c_adap);
1133 if (dev->dvb.frontend) {
1134 dev->dvb.frontend->ops.tuner_ops.init = ads_duo_tuner_init;
1135 dev->dvb.frontend->ops.tuner_ops.sleep = ads_duo_tuner_sleep;
1136 dev->dvb.frontend->ops.tuner_ops.set_params = ads_duo_tuner_set_params;
1137 }
1062 break; 1138 break;
1063 case SAA7134_BOARD_TEVION_DVBT_220RF: 1139 case SAA7134_BOARD_TEVION_DVBT_220RF:
1064 dev->dvb.frontend = tda10046_attach(&tevion_dvbt220rf_config, 1140 dev->dvb.frontend = tda10046_attach(&tevion_dvbt220rf_config,
1065 &dev->i2c_adap); 1141 &dev->i2c_adap);
1142 if (dev->dvb.frontend) {
1143 dev->dvb.frontend->ops.tuner_ops.sleep = tevion_dvb220rf_tuner_sleep;
1144 dev->dvb.frontend->ops.tuner_ops.set_params = tevion_dvb220rf_tuner_set_params;
1145 }
1066 break; 1146 break;
1067 case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: 1147 case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS:
1068 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config, 1148 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config,
1069 &dev->i2c_adap); 1149 &dev->i2c_adap);
1150 if (dev->dvb.frontend) {
1151 dev->dvb.frontend->ops.tuner_ops.init = ads_duo_tuner_init;
1152 dev->dvb.frontend->ops.tuner_ops.sleep = ads_duo_tuner_sleep;
1153 dev->dvb.frontend->ops.tuner_ops.set_params = ads_duo_tuner_set_params;
1154 }
1070 break; 1155 break;
1071#endif 1156#endif
1072#ifdef HAVE_NXT200X 1157#ifdef HAVE_NXT200X
1073 case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180: 1158 case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180:
1074 dev->dvb.frontend = nxt200x_attach(&avertvhda180, &dev->i2c_adap); 1159 dev->dvb.frontend = nxt200x_attach(&avertvhda180, &dev->i2c_adap);
1160 if (dev->dvb.frontend) {
1161 dvb_pll_attach(dev->dvb.frontend, 0x61, &dev->i2c_adap, &dvb_pll_tdhu2);
1162 }
1075 break; 1163 break;
1076 case SAA7134_BOARD_KWORLD_ATSC110: 1164 case SAA7134_BOARD_KWORLD_ATSC110:
1077 dev->dvb.frontend = nxt200x_attach(&kworldatsc110, &dev->i2c_adap); 1165 dev->dvb.frontend = nxt200x_attach(&kworldatsc110, &dev->i2c_adap);
1166 if (dev->dvb.frontend) {
1167 dvb_pll_attach(dev->dvb.frontend, 0x61, &dev->i2c_adap, &dvb_pll_tuv1236d);
1168 }
1078 break; 1169 break;
1079#endif 1170#endif
1080 default: 1171 default:
@@ -1088,7 +1179,7 @@ static int dvb_init(struct saa7134_dev *dev)
1088 } 1179 }
1089 1180
1090 /* register everything else */ 1181 /* register everything else */
1091 return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev); 1182 return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev);
1092} 1183}
1093 1184
1094static int dvb_fini(struct saa7134_dev *dev) 1185static int dvb_fini(struct saa7134_dev *dev)