aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-dvb.c
diff options
context:
space:
mode:
authorAndrew de Quincey <adq_dvb@lidskialf.net>2006-04-18 16:47:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 00:59:07 -0400
commita79ddae9fe993adab8d728a7a2a6a4038f0861c8 (patch)
tree03ad02e4c4b5684106960c0061385cec2f25c4fd /drivers/media/video/saa7134/saa7134-dvb.c
parent2d15fd2f01fc76dc6856a5c551e32e4510f2b492 (diff)
V4L/DVB (3879): Convert saa7134-dvb to refactored tuner code
Rename pll calls to appropriate tuner calls. Remove pll functions from demod structures. Hook tuner call into tuner_ops. Attach dvb-pll where possible. Add pll gate control calls where appropriate. Move europa specific code from tda1104x into card driver using ops overrides (this is how it should ebe done instead of hacking card specific code into the demod driver). Signed-off-by: Andrew de Quincey <adq_dvb@lidskialf.net> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c221
1 files changed, 143 insertions, 78 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 98a492ddc216..a36dab152585 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -132,9 +132,9 @@ 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_pllbuf(struct dvb_frontend* fe,
136 struct dvb_frontend_parameters* params, 136 struct dvb_frontend_parameters* params,
137 u8* pllbuf) 137 u8* pllbuf, int buf_len)
138{ 138{
139 u8 off[] = { 0x00, 0xf1}; 139 u8 off[] = { 0x00, 0xf1};
140 u8 on[] = { 0x00, 0x71}; 140 u8 on[] = { 0x00, 0x71};
@@ -143,6 +143,9 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
143 struct saa7134_dev *dev = fe->dvb->priv; 143 struct saa7134_dev *dev = fe->dvb->priv;
144 struct v4l2_frequency f; 144 struct v4l2_frequency f;
145 145
146 if (buf_len < 5)
147 return -EINVAL;
148
146 /* set frequency (mt2050) */ 149 /* set frequency (mt2050) */
147 f.tuner = 0; 150 f.tuner = 0;
148 f.type = V4L2_TUNER_DIGITAL_TV; 151 f.type = V4L2_TUNER_DIGITAL_TV;
@@ -156,21 +159,24 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe,
156 159
157 /* mt352 setup */ 160 /* mt352 setup */
158 mt352_pinnacle_init(fe); 161 mt352_pinnacle_init(fe);
159 pllbuf[0] = 0xc2; 162 pllbuf[0] = 0x61;
160 pllbuf[1] = 0x00; 163 pllbuf[1] = 0x00;
161 pllbuf[2] = 0x00; 164 pllbuf[2] = 0x00;
162 pllbuf[3] = 0x80; 165 pllbuf[3] = 0x80;
163 pllbuf[4] = 0x00; 166 pllbuf[4] = 0x00;
164 return 0; 167 return 5;
165} 168}
166 169
167static int mt352_aver777_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf) 170static int mt352_aver777_tuner_pllbuf(struct dvb_frontend *fe, struct dvb_frontend_parameters *params, u8* pllbuf, int buf_len)
168{ 171{
169 pllbuf[0] = 0xc2; 172 if (buf_len < 5)
173 return -EINVAL;
174
175 pllbuf[0] = 0x61;
170 dvb_pll_configure(&dvb_pll_philips_td1316, pllbuf+1, 176 dvb_pll_configure(&dvb_pll_philips_td1316, pllbuf+1,
171 params->frequency, 177 params->frequency,
172 params->u.ofdm.bandwidth); 178 params->u.ofdm.bandwidth);
173 return 0; 179 return 5;
174} 180}
175 181
176static struct mt352_config pinnacle_300i = { 182static struct mt352_config pinnacle_300i = {
@@ -179,13 +185,11 @@ static struct mt352_config pinnacle_300i = {
179 .if2 = 36150, 185 .if2 = 36150,
180 .no_tuner = 1, 186 .no_tuner = 1,
181 .demod_init = mt352_pinnacle_init, 187 .demod_init = mt352_pinnacle_init,
182 .pll_set = mt352_pinnacle_pll_set,
183}; 188};
184 189
185static struct mt352_config avermedia_777 = { 190static struct mt352_config avermedia_777 = {
186 .demod_address = 0xf, 191 .demod_address = 0xf,
187 .demod_init = mt352_aver777_init, 192 .demod_init = mt352_aver777_init,
188 .pll_set = mt352_aver777_pll_set,
189}; 193};
190#endif 194#endif
191 195
@@ -268,6 +272,8 @@ static int philips_tda6651_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb_
268 tuner_buf[2] = 0xca; 272 tuner_buf[2] = 0xca;
269 tuner_buf[3] = (cp << 5) | (filter << 3) | band; 273 tuner_buf[3] = (cp << 5) | (filter << 3) | band;
270 274
275 if (fe->ops->i2c_gate_ctrl)
276 fe->ops->i2c_gate_ctrl(fe, 1);
271 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 277 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
272 return -EIO; 278 return -EIO;
273 msleep(1); 279 msleep(1);
@@ -281,6 +287,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) }; 287 struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) };
282 288
283 /* setup PLL configuration */ 289 /* setup PLL configuration */
290 if (fe->ops->i2c_gate_ctrl)
291 fe->ops->i2c_gate_ctrl(fe, 1);
284 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 292 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
285 return -EIO; 293 return -EIO;
286 msleep(1); 294 msleep(1);
@@ -290,12 +298,12 @@ static int philips_tda6651_pll_init(u8 addr, struct dvb_frontend *fe)
290 298
291/* ------------------------------------------------------------------ */ 299/* ------------------------------------------------------------------ */
292 300
293static int philips_tu1216_pll_60_init(struct dvb_frontend *fe) 301static int philips_tu1216_tuner_60_init(struct dvb_frontend *fe)
294{ 302{
295 return philips_tda6651_pll_init(0x60, fe); 303 return philips_tda6651_pll_init(0x60, fe);
296} 304}
297 305
298static int philips_tu1216_pll_60_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 306static int philips_tu1216_tuner_60_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
299{ 307{
300 return philips_tda6651_pll_set(0x60, fe, params); 308 return philips_tda6651_pll_set(0x60, fe, params);
301} 309}
@@ -315,20 +323,17 @@ static struct tda1004x_config philips_tu1216_60_config = {
315 .xtal_freq = TDA10046_XTAL_4M, 323 .xtal_freq = TDA10046_XTAL_4M,
316 .agc_config = TDA10046_AGC_DEFAULT, 324 .agc_config = TDA10046_AGC_DEFAULT,
317 .if_freq = TDA10046_FREQ_3617, 325 .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, 326 .request_firmware = philips_tu1216_request_firmware,
322}; 327};
323 328
324/* ------------------------------------------------------------------ */ 329/* ------------------------------------------------------------------ */
325 330
326static int philips_tu1216_pll_61_init(struct dvb_frontend *fe) 331static int philips_tu1216_tuner_61_init(struct dvb_frontend *fe)
327{ 332{
328 return philips_tda6651_pll_init(0x61, fe); 333 return philips_tda6651_pll_init(0x61, fe);
329} 334}
330 335
331static int philips_tu1216_pll_61_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 336static int philips_tu1216_tuner_61_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
332{ 337{
333 return philips_tda6651_pll_set(0x61, fe, params); 338 return philips_tda6651_pll_set(0x61, fe, params);
334} 339}
@@ -341,21 +346,20 @@ static struct tda1004x_config philips_tu1216_61_config = {
341 .xtal_freq = TDA10046_XTAL_4M, 346 .xtal_freq = TDA10046_XTAL_4M,
342 .agc_config = TDA10046_AGC_DEFAULT, 347 .agc_config = TDA10046_AGC_DEFAULT,
343 .if_freq = TDA10046_FREQ_3617, 348 .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, 349 .request_firmware = philips_tu1216_request_firmware,
348}; 350};
349 351
350/* ------------------------------------------------------------------ */ 352/* ------------------------------------------------------------------ */
351 353
352static int philips_europa_pll_init(struct dvb_frontend *fe) 354static int philips_europa_tuner_init(struct dvb_frontend *fe)
353{ 355{
354 struct saa7134_dev *dev = fe->dvb->priv; 356 struct saa7134_dev *dev = fe->dvb->priv;
355 static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; 357 static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab };
356 struct i2c_msg init_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; 358 struct i2c_msg init_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) };
357 359
358 /* setup PLL configuration */ 360 /* setup PLL configuration */
361 if (fe->ops->i2c_gate_ctrl)
362 fe->ops->i2c_gate_ctrl(fe, 1);
359 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) 363 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
360 return -EIO; 364 return -EIO;
361 msleep(1); 365 msleep(1);
@@ -365,18 +369,20 @@ static int philips_europa_pll_init(struct dvb_frontend *fe)
365 init_msg.len = 0x02; 369 init_msg.len = 0x02;
366 msg[0] = 0x00; 370 msg[0] = 0x00;
367 msg[1] = 0x40; 371 msg[1] = 0x40;
372 if (fe->ops->i2c_gate_ctrl)
373 fe->ops->i2c_gate_ctrl(fe, 1);
368 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) 374 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
369 return -EIO; 375 return -EIO;
370 376
371 return 0; 377 return 0;
372} 378}
373 379
374static int philips_td1316_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 380static int philips_td1316_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
375{ 381{
376 return philips_tda6651_pll_set(0x61, fe, params); 382 return philips_tda6651_pll_set(0x61, fe, params);
377} 383}
378 384
379static void philips_europa_analog(struct dvb_frontend *fe) 385static int philips_europa_tuner_sleep(struct dvb_frontend *fe)
380{ 386{
381 struct saa7134_dev *dev = fe->dvb->priv; 387 struct saa7134_dev *dev = fe->dvb->priv;
382 /* this message actually turns the tuner back to analog mode */ 388 /* this message actually turns the tuner back to analog mode */
@@ -391,7 +397,20 @@ static void philips_europa_analog(struct dvb_frontend *fe)
391 analog_msg.len = 0x02; 397 analog_msg.len = 0x02;
392 msg[0] = 0x00; 398 msg[0] = 0x00;
393 msg[1] = 0x14; 399 msg[1] = 0x14;
400 if (fe->ops->i2c_gate_ctrl)
401 fe->ops->i2c_gate_ctrl(fe, 1);
394 i2c_transfer(&dev->i2c_adap, &analog_msg, 1); 402 i2c_transfer(&dev->i2c_adap, &analog_msg, 1);
403 return 0;
404}
405
406static int philips_europa_demod_sleep(struct dvb_frontend *fe)
407{
408 struct saa7134_dev *dev = fe->dvb->priv;
409
410 if (dev->original_demod_sleep)
411 dev->original_demod_sleep(fe);
412 fe->ops->i2c_gate_ctrl(fe, 1);
413 return 0;
395} 414}
396 415
397static struct tda1004x_config philips_europa_config = { 416static struct tda1004x_config philips_europa_config = {
@@ -402,21 +421,20 @@ static struct tda1004x_config philips_europa_config = {
402 .xtal_freq = TDA10046_XTAL_4M, 421 .xtal_freq = TDA10046_XTAL_4M,
403 .agc_config = TDA10046_AGC_IFO_AUTO_POS, 422 .agc_config = TDA10046_AGC_IFO_AUTO_POS,
404 .if_freq = TDA10046_FREQ_052, 423 .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, 424 .request_firmware = NULL,
409}; 425};
410 426
411/* ------------------------------------------------------------------ */ 427/* ------------------------------------------------------------------ */
412 428
413static int philips_fmd1216_pll_init(struct dvb_frontend *fe) 429static int philips_fmd1216_tuner_init(struct dvb_frontend *fe)
414{ 430{
415 struct saa7134_dev *dev = fe->dvb->priv; 431 struct saa7134_dev *dev = fe->dvb->priv;
416 /* this message is to set up ATC and ALC */ 432 /* this message is to set up ATC and ALC */
417 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 }; 433 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) }; 434 struct i2c_msg tuner_msg = {.addr = 0x61,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) };
419 435
436 if (fe->ops->i2c_gate_ctrl)
437 fe->ops->i2c_gate_ctrl(fe, 1);
420 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 438 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
421 return -EIO; 439 return -EIO;
422 msleep(1); 440 msleep(1);
@@ -424,22 +442,27 @@ static int philips_fmd1216_pll_init(struct dvb_frontend *fe)
424 return 0; 442 return 0;
425} 443}
426 444
427static void philips_fmd1216_analog(struct dvb_frontend *fe) 445static int philips_fmd1216_tuner_sleep(struct dvb_frontend *fe)
428{ 446{
429 struct saa7134_dev *dev = fe->dvb->priv; 447 struct saa7134_dev *dev = fe->dvb->priv;
430 /* this message actually turns the tuner back to analog mode */ 448 /* this message actually turns the tuner back to analog mode */
431 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0x60 }; 449 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) }; 450 struct i2c_msg tuner_msg = {.addr = 0x61,.flags = 0,.buf = fmd1216_init,.len = sizeof(fmd1216_init) };
433 451
452 if (fe->ops->i2c_gate_ctrl)
453 fe->ops->i2c_gate_ctrl(fe, 1);
434 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 454 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
435 msleep(1); 455 msleep(1);
436 fmd1216_init[2] = 0x86; 456 fmd1216_init[2] = 0x86;
437 fmd1216_init[3] = 0x54; 457 fmd1216_init[3] = 0x54;
458 if (fe->ops->i2c_gate_ctrl)
459 fe->ops->i2c_gate_ctrl(fe, 1);
438 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 460 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
439 msleep(1); 461 msleep(1);
462 return 0;
440} 463}
441 464
442static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 465static int philips_fmd1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
443{ 466{
444 struct saa7134_dev *dev = fe->dvb->priv; 467 struct saa7134_dev *dev = fe->dvb->priv;
445 u8 tuner_buf[4]; 468 u8 tuner_buf[4];
@@ -516,6 +539,8 @@ static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
516 tuner_buf[2] = 0x80 | (cp << 6) | (mode << 3) | 4; 539 tuner_buf[2] = 0x80 | (cp << 6) | (mode << 3) | 4;
517 tuner_buf[3] = 0x40 | band; 540 tuner_buf[3] = 0x40 | band;
518 541
542 if (fe->ops->i2c_gate_ctrl)
543 fe->ops->i2c_gate_ctrl(fe, 1);
519 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 544 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
520 return -EIO; 545 return -EIO;
521 return 0; 546 return 0;
@@ -528,9 +553,6 @@ static struct tda1004x_config medion_cardbus = {
528 .xtal_freq = TDA10046_XTAL_16M, 553 .xtal_freq = TDA10046_XTAL_16M,
529 .agc_config = TDA10046_AGC_IFO_AUTO_NEG, 554 .agc_config = TDA10046_AGC_IFO_AUTO_NEG,
530 .if_freq = TDA10046_FREQ_3613, 555 .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, 556 .request_firmware = NULL,
535}; 557};
536 558
@@ -578,12 +600,12 @@ static struct tda827x_data tda827x_dvbt[] = {
578 { .lomax = 0, .spd = 0, .bs = 0, .bp = 0, .cp = 0, .gc3 = 0, .div1p5 = 0} 600 { .lomax = 0, .spd = 0, .bs = 0, .bp = 0, .cp = 0, .gc3 = 0, .div1p5 = 0}
579}; 601};
580 602
581static int philips_tda827x_pll_init(struct dvb_frontend *fe) 603static int philips_tda827x_tuner_init(struct dvb_frontend *fe)
582{ 604{
583 return 0; 605 return 0;
584} 606}
585 607
586static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 608static int philips_tda827x_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
587{ 609{
588 struct saa7134_dev *dev = fe->dvb->priv; 610 struct saa7134_dev *dev = fe->dvb->priv;
589 u8 tuner_buf[14]; 611 u8 tuner_buf[14];
@@ -630,6 +652,8 @@ static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
630 tuner_buf[13] = 0x40; 652 tuner_buf[13] = 0x40;
631 653
632 tuner_msg.len = 14; 654 tuner_msg.len = 14;
655 if (fe->ops->i2c_gate_ctrl)
656 fe->ops->i2c_gate_ctrl(fe, 1);
633 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 657 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
634 return -EIO; 658 return -EIO;
635 659
@@ -638,18 +662,23 @@ static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_
638 tuner_buf[0] = 0x30; 662 tuner_buf[0] = 0x30;
639 tuner_buf[1] = 0x50 + tda827x_dvbt[i].cp; 663 tuner_buf[1] = 0x50 + tda827x_dvbt[i].cp;
640 tuner_msg.len = 2; 664 tuner_msg.len = 2;
665 if (fe->ops->i2c_gate_ctrl)
666 fe->ops->i2c_gate_ctrl(fe, 1);
641 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 667 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
642 668
643 return 0; 669 return 0;
644} 670}
645 671
646static void philips_tda827x_pll_sleep(struct dvb_frontend *fe) 672static int philips_tda827x_tuner_sleep(struct dvb_frontend *fe)
647{ 673{
648 struct saa7134_dev *dev = fe->dvb->priv; 674 struct saa7134_dev *dev = fe->dvb->priv;
649 static u8 tda827x_sleep[] = { 0x30, 0xd0}; 675 static u8 tda827x_sleep[] = { 0x30, 0xd0};
650 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep, 676 struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep,
651 .len = sizeof(tda827x_sleep) }; 677 .len = sizeof(tda827x_sleep) };
678 if (fe->ops->i2c_gate_ctrl)
679 fe->ops->i2c_gate_ctrl(fe, 1);
652 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 680 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
681 return 0;
653} 682}
654 683
655static struct tda1004x_config tda827x_lifeview_config = { 684static struct tda1004x_config tda827x_lifeview_config = {
@@ -659,9 +688,6 @@ static struct tda1004x_config tda827x_lifeview_config = {
659 .xtal_freq = TDA10046_XTAL_16M, 688 .xtal_freq = TDA10046_XTAL_16M,
660 .agc_config = TDA10046_AGC_TDA827X, 689 .agc_config = TDA10046_AGC_TDA827X,
661 .if_freq = TDA10046_FREQ_045, 690 .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, 691 .request_firmware = NULL,
666}; 692};
667 693
@@ -753,6 +779,8 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
753 tuner_buf[12] = 0x00; 779 tuner_buf[12] = 0x00;
754 tuner_buf[13] = 0x39; // lpsel 780 tuner_buf[13] = 0x39; // lpsel
755 msg.len = 14; 781 msg.len = 14;
782 if (fe->ops->i2c_gate_ctrl)
783 fe->ops->i2c_gate_ctrl(fe, 1);
756 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) 784 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
757 return -EIO; 785 return -EIO;
758 786
@@ -760,10 +788,14 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
760 msg.len = 2; 788 msg.len = 2;
761 reg2[0] = 0x60; 789 reg2[0] = 0x60;
762 reg2[1] = 0x3c; 790 reg2[1] = 0x3c;
791 if (fe->ops->i2c_gate_ctrl)
792 fe->ops->i2c_gate_ctrl(fe, 1);
763 i2c_transfer(&dev->i2c_adap, &msg, 1); 793 i2c_transfer(&dev->i2c_adap, &msg, 1);
764 794
765 reg2[0] = 0xa0; 795 reg2[0] = 0xa0;
766 reg2[1] = 0x40; 796 reg2[1] = 0x40;
797 if (fe->ops->i2c_gate_ctrl)
798 fe->ops->i2c_gate_ctrl(fe, 1);
767 i2c_transfer(&dev->i2c_adap, &msg, 1); 799 i2c_transfer(&dev->i2c_adap, &msg, 1);
768 800
769 msleep(2); 801 msleep(2);
@@ -771,36 +803,43 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
771 reg2[0] = 0x30; 803 reg2[0] = 0x30;
772 reg2[1] = 0x10 + tda827xa_dvbt[i].scr; 804 reg2[1] = 0x10 + tda827xa_dvbt[i].scr;
773 msg.len = 2; 805 msg.len = 2;
806 if (fe->ops->i2c_gate_ctrl)
807 fe->ops->i2c_gate_ctrl(fe, 1);
774 i2c_transfer(&dev->i2c_adap, &msg, 1); 808 i2c_transfer(&dev->i2c_adap, &msg, 1);
775 809
776 msleep(550); 810 msleep(550);
777 reg2[0] = 0x50; 811 reg2[0] = 0x50;
778 reg2[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4); 812 reg2[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4);
813 if (fe->ops->i2c_gate_ctrl)
814 fe->ops->i2c_gate_ctrl(fe, 1);
779 i2c_transfer(&dev->i2c_adap, &msg, 1); 815 i2c_transfer(&dev->i2c_adap, &msg, 1);
780 816
781 return 0; 817 return 0;
782 818
783} 819}
784 820
785static void philips_tda827xa_pll_sleep(u8 addr, struct dvb_frontend *fe) 821static int philips_tda827xa_tuner_sleep(u8 addr, struct dvb_frontend *fe)
786{ 822{
787 struct saa7134_dev *dev = fe->dvb->priv; 823 struct saa7134_dev *dev = fe->dvb->priv;
788 static u8 tda827xa_sleep[] = { 0x30, 0x90}; 824 static u8 tda827xa_sleep[] = { 0x30, 0x90};
789 struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tda827xa_sleep, 825 struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tda827xa_sleep,
790 .len = sizeof(tda827xa_sleep) }; 826 .len = sizeof(tda827xa_sleep) };
827 if (fe->ops->i2c_gate_ctrl)
828 fe->ops->i2c_gate_ctrl(fe, 1);
791 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 829 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
792 830 return 0;
793} 831}
794 832
795/* ------------------------------------------------------------------ */ 833/* ------------------------------------------------------------------ */
796 834
797static int philips_tiger_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 835static int philips_tiger_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
798{ 836{
799 int ret; 837 int ret;
800 struct saa7134_dev *dev = fe->dvb->priv; 838 struct saa7134_dev *dev = fe->dvb->priv;
801 static u8 tda8290_close[] = { 0x21, 0xc0}; 839 static u8 tda8290_close[] = { 0x21, 0xc0};
802 static u8 tda8290_open[] = { 0x21, 0x80}; 840 static u8 tda8290_open[] = { 0x21, 0x80};
803 struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2}; 841 struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2};
842
804 /* close tda8290 i2c bridge */ 843 /* close tda8290 i2c bridge */
805 tda8290_msg.buf = tda8290_close; 844 tda8290_msg.buf = tda8290_close;
806 ret = i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1); 845 ret = i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1);
@@ -816,7 +855,7 @@ static int philips_tiger_pll_set(struct dvb_frontend *fe, struct dvb_frontend_pa
816 return ret; 855 return ret;
817} 856}
818 857
819static int philips_tiger_dvb_mode(struct dvb_frontend *fe) 858static int philips_tiger_tuner_init(struct dvb_frontend *fe)
820{ 859{
821 struct saa7134_dev *dev = fe->dvb->priv; 860 struct saa7134_dev *dev = fe->dvb->priv;
822 static u8 data[] = { 0x3c, 0x33, 0x6a}; 861 static u8 data[] = { 0x3c, 0x33, 0x6a};
@@ -827,14 +866,15 @@ static int philips_tiger_dvb_mode(struct dvb_frontend *fe)
827 return 0; 866 return 0;
828} 867}
829 868
830static void philips_tiger_analog_mode(struct dvb_frontend *fe) 869static int philips_tiger_tuner_sleep(struct dvb_frontend *fe)
831{ 870{
832 struct saa7134_dev *dev = fe->dvb->priv; 871 struct saa7134_dev *dev = fe->dvb->priv;
833 static u8 data[] = { 0x3c, 0x33, 0x68}; 872 static u8 data[] = { 0x3c, 0x33, 0x68};
834 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; 873 struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)};
835 874
836 i2c_transfer(&dev->i2c_adap, &msg, 1); 875 i2c_transfer(&dev->i2c_adap, &msg, 1);
837 philips_tda827xa_pll_sleep( 0x61, fe); 876 philips_tda827xa_tuner_sleep( 0x61, fe);
877 return 0;
838} 878}
839 879
840static struct tda1004x_config philips_tiger_config = { 880static struct tda1004x_config philips_tiger_config = {
@@ -844,15 +884,12 @@ static struct tda1004x_config philips_tiger_config = {
844 .xtal_freq = TDA10046_XTAL_16M, 884 .xtal_freq = TDA10046_XTAL_16M,
845 .agc_config = TDA10046_AGC_TDA827X, 885 .agc_config = TDA10046_AGC_TDA827X,
846 .if_freq = TDA10046_FREQ_045, 886 .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, 887 .request_firmware = NULL,
851}; 888};
852 889
853/* ------------------------------------------------------------------ */ 890/* ------------------------------------------------------------------ */
854 891
855static int lifeview_trio_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 892static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
856{ 893{
857 int ret; 894 int ret;
858 895
@@ -860,16 +897,12 @@ static int lifeview_trio_pll_set(struct dvb_frontend *fe, struct dvb_frontend_pa
860 return ret; 897 return ret;
861} 898}
862 899
863static int lifeview_trio_dvb_mode(struct dvb_frontend *fe) 900static int lifeview_trio_tuner_sleep(struct dvb_frontend *fe)
864{ 901{
902 philips_tda827xa_tuner_sleep(0x60, fe);
865 return 0; 903 return 0;
866} 904}
867 905
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 = { 906static struct tda1004x_config lifeview_trio_config = {
874 .demod_address = 0x09, 907 .demod_address = 0x09,
875 .invert = 1, 908 .invert = 1,
@@ -877,15 +910,12 @@ static struct tda1004x_config lifeview_trio_config = {
877 .xtal_freq = TDA10046_XTAL_16M, 910 .xtal_freq = TDA10046_XTAL_16M,
878 .agc_config = TDA10046_AGC_TDA827X_GPL, 911 .agc_config = TDA10046_AGC_TDA827X_GPL,
879 .if_freq = TDA10046_FREQ_045, 912 .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, 913 .request_firmware = NULL,
884}; 914};
885 915
886/* ------------------------------------------------------------------ */ 916/* ------------------------------------------------------------------ */
887 917
888static int ads_duo_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 918static int ads_duo_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
889{ 919{
890 int ret; 920 int ret;
891 921
@@ -893,7 +923,7 @@ static int ads_duo_pll_set(struct dvb_frontend *fe, struct dvb_frontend_paramete
893 return ret; 923 return ret;
894} 924}
895 925
896static int ads_duo_dvb_mode(struct dvb_frontend *fe) 926static int ads_duo_tuner_init(struct dvb_frontend *fe)
897{ 927{
898 struct saa7134_dev *dev = fe->dvb->priv; 928 struct saa7134_dev *dev = fe->dvb->priv;
899 /* route TDA8275a AGC input to the channel decoder */ 929 /* route TDA8275a AGC input to the channel decoder */
@@ -901,12 +931,13 @@ static int ads_duo_dvb_mode(struct dvb_frontend *fe)
901 return 0; 931 return 0;
902} 932}
903 933
904static void ads_duo_analog_mode(struct dvb_frontend *fe) 934static int ads_duo_tuner_sleep(struct dvb_frontend *fe)
905{ 935{
906 struct saa7134_dev *dev = fe->dvb->priv; 936 struct saa7134_dev *dev = fe->dvb->priv;
907 /* route TDA8275a AGC input to the analog IF chip*/ 937 /* route TDA8275a AGC input to the analog IF chip*/
908 saa_writeb(SAA7134_GPIO_GPSTATUS2, 0x20); 938 saa_writeb(SAA7134_GPIO_GPSTATUS2, 0x20);
909 philips_tda827xa_pll_sleep( 0x61, fe); 939 philips_tda827xa_tuner_sleep( 0x61, fe);
940 return 0;
910} 941}
911 942
912static struct tda1004x_config ads_tech_duo_config = { 943static struct tda1004x_config ads_tech_duo_config = {
@@ -916,31 +947,24 @@ static struct tda1004x_config ads_tech_duo_config = {
916 .xtal_freq = TDA10046_XTAL_16M, 947 .xtal_freq = TDA10046_XTAL_16M,
917 .agc_config = TDA10046_AGC_TDA827X_GPL, 948 .agc_config = TDA10046_AGC_TDA827X_GPL,
918 .if_freq = TDA10046_FREQ_045, 949 .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, 950 .request_firmware = NULL,
923}; 951};
924 952
925/* ------------------------------------------------------------------ */ 953/* ------------------------------------------------------------------ */
926 954
927static int tevion_dvb220rf_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 955static int tevion_dvb220rf_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
928{ 956{
929 int ret; 957 int ret;
930 ret = philips_tda827xa_pll_set(0x60, fe, params); 958 ret = philips_tda827xa_pll_set(0x60, fe, params);
931 return ret; 959 return ret;
932} 960}
933 961
934static int tevion_dvb220rf_pll_init(struct dvb_frontend *fe) 962static int tevion_dvb220rf_tuner_sleep(struct dvb_frontend *fe)
935{ 963{
964 philips_tda827xa_tuner_sleep( 0x61, fe);
936 return 0; 965 return 0;
937} 966}
938 967
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 = { 968static struct tda1004x_config tevion_dvbt220rf_config = {
945 .demod_address = 0x08, 969 .demod_address = 0x08,
946 .invert = 1, 970 .invert = 1,
@@ -948,9 +972,6 @@ static struct tda1004x_config tevion_dvbt220rf_config = {
948 .xtal_freq = TDA10046_XTAL_16M, 972 .xtal_freq = TDA10046_XTAL_16M,
949 .agc_config = TDA10046_AGC_TDA827X, 973 .agc_config = TDA10046_AGC_TDA827X,
950 .if_freq = TDA10046_FREQ_045, 974 .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, 975 .request_firmware = NULL,
955}; 976};
956 977
@@ -961,8 +982,6 @@ static struct tda1004x_config tevion_dvbt220rf_config = {
961#ifdef HAVE_NXT200X 982#ifdef HAVE_NXT200X
962static struct nxt200x_config avertvhda180 = { 983static struct nxt200x_config avertvhda180 = {
963 .demod_address = 0x0a, 984 .demod_address = 0x0a,
964 .pll_address = 0x61,
965 .pll_desc = &dvb_pll_tdhu2,
966}; 985};
967 986
968static int nxt200x_set_pll_input(u8 *buf, int input) 987static int nxt200x_set_pll_input(u8 *buf, int input)
@@ -976,8 +995,6 @@ static int nxt200x_set_pll_input(u8 *buf, int input)
976 995
977static struct nxt200x_config kworldatsc110 = { 996static struct nxt200x_config kworldatsc110 = {
978 .demod_address = 0x0a, 997 .demod_address = 0x0a,
979 .pll_address = 0x61,
980 .pll_desc = &dvb_pll_tuv1236d,
981 .set_pll_input = nxt200x_set_pll_input, 998 .set_pll_input = nxt200x_set_pll_input,
982}; 999};
983#endif 1000#endif
@@ -1003,78 +1020,126 @@ static int dvb_init(struct saa7134_dev *dev)
1003 printk("%s: pinnacle 300i dvb setup\n",dev->name); 1020 printk("%s: pinnacle 300i dvb setup\n",dev->name);
1004 dev->dvb.frontend = mt352_attach(&pinnacle_300i, 1021 dev->dvb.frontend = mt352_attach(&pinnacle_300i,
1005 &dev->i2c_adap); 1022 &dev->i2c_adap);
1023 dev->dvb.frontend->ops->tuner_ops.pllbuf = mt352_pinnacle_tuner_pllbuf;
1006 break; 1024 break;
1007 1025
1008 case SAA7134_BOARD_AVERMEDIA_777: 1026 case SAA7134_BOARD_AVERMEDIA_777:
1009 printk("%s: avertv 777 dvb setup\n",dev->name); 1027 printk("%s: avertv 777 dvb setup\n",dev->name);
1010 dev->dvb.frontend = mt352_attach(&avermedia_777, 1028 dev->dvb.frontend = mt352_attach(&avermedia_777,
1011 &dev->i2c_adap); 1029 &dev->i2c_adap);
1030 dev->dvb.frontend->ops->tuner_ops.pllbuf = mt352_aver777_tuner_pllbuf;
1012 break; 1031 break;
1013#endif 1032#endif
1014#ifdef HAVE_TDA1004X 1033#ifdef HAVE_TDA1004X
1015 case SAA7134_BOARD_MD7134: 1034 case SAA7134_BOARD_MD7134:
1016 dev->dvb.frontend = tda10046_attach(&medion_cardbus, 1035 dev->dvb.frontend = tda10046_attach(&medion_cardbus,
1017 &dev->i2c_adap); 1036 &dev->i2c_adap);
1037 dev->dvb.frontend->ops->tuner_ops.init = philips_fmd1216_tuner_init;
1038 dev->dvb.frontend->ops->tuner_ops.sleep = philips_fmd1216_tuner_sleep;
1039 dev->dvb.frontend->ops->tuner_ops.set_params = philips_fmd1216_tuner_set_params;
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 dev->dvb.frontend->ops->tuner_ops.init = philips_tu1216_tuner_60_init;
1045 dev->dvb.frontend->ops->tuner_ops.set_params = philips_tu1216_tuner_60_set_params;
1022 break; 1046 break;
1023 case SAA7134_BOARD_FLYDVBTDUO: 1047 case SAA7134_BOARD_FLYDVBTDUO:
1024 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1048 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1025 &dev->i2c_adap); 1049 &dev->i2c_adap);
1050 dev->dvb.frontend->ops->tuner_ops.init = philips_tda827x_tuner_init;
1051 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tda827x_tuner_sleep;
1052 dev->dvb.frontend->ops->tuner_ops.set_params = philips_tda827x_tuner_set_params;
1026 break; 1053 break;
1027 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS: 1054 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
1028 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1055 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1029 &dev->i2c_adap); 1056 &dev->i2c_adap);
1057 dev->dvb.frontend->ops->tuner_ops.init = philips_tda827x_tuner_init;
1058 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tda827x_tuner_sleep;
1059 dev->dvb.frontend->ops->tuner_ops.set_params = philips_tda827x_tuner_set_params;
1030 break; 1060 break;
1031 case SAA7134_BOARD_PHILIPS_EUROPA: 1061 case SAA7134_BOARD_PHILIPS_EUROPA:
1032 dev->dvb.frontend = tda10046_attach(&philips_europa_config, 1062 dev->dvb.frontend = tda10046_attach(&philips_europa_config,
1033 &dev->i2c_adap); 1063 &dev->i2c_adap);
1064 dev->original_demod_sleep = dev->dvb.frontend->ops->sleep;
1065 dev->dvb.frontend->ops->sleep = philips_europa_demod_sleep;
1066 dev->dvb.frontend->ops->tuner_ops.init = philips_europa_tuner_init;
1067 dev->dvb.frontend->ops->tuner_ops.sleep = philips_europa_tuner_sleep;
1068 dev->dvb.frontend->ops->tuner_ops.set_params = philips_td1316_tuner_set_params;
1034 break; 1069 break;
1035 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 1070 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
1036 dev->dvb.frontend = tda10046_attach(&philips_europa_config, 1071 dev->dvb.frontend = tda10046_attach(&philips_europa_config,
1037 &dev->i2c_adap); 1072 &dev->i2c_adap);
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;
1038 break; 1076 break;
1039 case SAA7134_BOARD_VIDEOMATE_DVBT_200: 1077 case SAA7134_BOARD_VIDEOMATE_DVBT_200:
1040 dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config, 1078 dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config,
1041 &dev->i2c_adap); 1079 &dev->i2c_adap);
1080 dev->dvb.frontend->ops->tuner_ops.init = philips_tu1216_tuner_61_init;
1081 dev->dvb.frontend->ops->tuner_ops.set_params = philips_tu1216_tuner_61_set_params;
1042 break; 1082 break;
1043 case SAA7134_BOARD_PHILIPS_TIGER: 1083 case SAA7134_BOARD_PHILIPS_TIGER:
1044 dev->dvb.frontend = tda10046_attach(&philips_tiger_config, 1084 dev->dvb.frontend = tda10046_attach(&philips_tiger_config,
1045 &dev->i2c_adap); 1085 &dev->i2c_adap);
1086 dev->dvb.frontend->ops->tuner_ops.init = philips_tiger_tuner_init;
1087 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tiger_tuner_sleep;
1088 dev->dvb.frontend->ops->tuner_ops.set_params = philips_tiger_tuner_set_params;
1046 break; 1089 break;
1047 case SAA7134_BOARD_ASUSTeK_P7131_DUAL: 1090 case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
1048 dev->dvb.frontend = tda10046_attach(&philips_tiger_config, 1091 dev->dvb.frontend = tda10046_attach(&philips_tiger_config,
1049 &dev->i2c_adap); 1092 &dev->i2c_adap);
1093 dev->dvb.frontend->ops->tuner_ops.init = philips_tiger_tuner_init;
1094 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tiger_tuner_sleep;
1095 dev->dvb.frontend->ops->tuner_ops.set_params = philips_tiger_tuner_set_params;
1050 break; 1096 break;
1051 case SAA7134_BOARD_FLYDVBT_LR301: 1097 case SAA7134_BOARD_FLYDVBT_LR301:
1052 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1098 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1053 &dev->i2c_adap); 1099 &dev->i2c_adap);
1100 dev->dvb.frontend->ops->tuner_ops.init = philips_tda827x_tuner_init;
1101 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tda827x_tuner_sleep;
1102 dev->dvb.frontend->ops->tuner_ops.set_params = philips_tda827x_tuner_set_params;
1054 break; 1103 break;
1055 case SAA7134_BOARD_FLYDVB_TRIO: 1104 case SAA7134_BOARD_FLYDVB_TRIO:
1056 dev->dvb.frontend = tda10046_attach(&lifeview_trio_config, 1105 dev->dvb.frontend = tda10046_attach(&lifeview_trio_config,
1057 &dev->i2c_adap); 1106 &dev->i2c_adap);
1107 dev->dvb.frontend->ops->tuner_ops.sleep = lifeview_trio_tuner_sleep;
1108 dev->dvb.frontend->ops->tuner_ops.set_params = lifeview_trio_tuner_set_params;
1058 break; 1109 break;
1059 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: 1110 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331:
1060 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config, 1111 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config,
1061 &dev->i2c_adap); 1112 &dev->i2c_adap);
1113 dev->dvb.frontend->ops->tuner_ops.init = ads_duo_tuner_init;
1114 dev->dvb.frontend->ops->tuner_ops.sleep = ads_duo_tuner_sleep;
1115 dev->dvb.frontend->ops->tuner_ops.set_params = ads_duo_tuner_set_params;
1062 break; 1116 break;
1063 case SAA7134_BOARD_TEVION_DVBT_220RF: 1117 case SAA7134_BOARD_TEVION_DVBT_220RF:
1064 dev->dvb.frontend = tda10046_attach(&tevion_dvbt220rf_config, 1118 dev->dvb.frontend = tda10046_attach(&tevion_dvbt220rf_config,
1065 &dev->i2c_adap); 1119 &dev->i2c_adap);
1120 dev->dvb.frontend->ops->tuner_ops.sleep = tevion_dvb220rf_tuner_sleep;
1121 dev->dvb.frontend->ops->tuner_ops.set_params = tevion_dvb220rf_tuner_set_params;
1066 break; 1122 break;
1067 case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: 1123 case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS:
1068 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config, 1124 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config,
1069 &dev->i2c_adap); 1125 &dev->i2c_adap);
1126 dev->dvb.frontend->ops->tuner_ops.init = ads_duo_tuner_init;
1127 dev->dvb.frontend->ops->tuner_ops.sleep = ads_duo_tuner_sleep;
1128 dev->dvb.frontend->ops->tuner_ops.set_params = ads_duo_tuner_set_params;
1070 break; 1129 break;
1071#endif 1130#endif
1072#ifdef HAVE_NXT200X 1131#ifdef HAVE_NXT200X
1073 case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180: 1132 case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180:
1074 dev->dvb.frontend = nxt200x_attach(&avertvhda180, &dev->i2c_adap); 1133 dev->dvb.frontend = nxt200x_attach(&avertvhda180, &dev->i2c_adap);
1134 if (dev->dvb.frontend) {
1135 dvb_pll_attach(dev->dvb.frontend, 0x61, &dev->i2c_adap, &dvb_pll_tdhu2);
1136 }
1075 break; 1137 break;
1076 case SAA7134_BOARD_KWORLD_ATSC110: 1138 case SAA7134_BOARD_KWORLD_ATSC110:
1077 dev->dvb.frontend = nxt200x_attach(&kworldatsc110, &dev->i2c_adap); 1139 dev->dvb.frontend = nxt200x_attach(&kworldatsc110, &dev->i2c_adap);
1140 if (dev->dvb.frontend) {
1141 dvb_pll_attach(dev->dvb.frontend, 0x61, &dev->i2c_adap, &dvb_pll_tuv1236d);
1142 }
1078 break; 1143 break;
1079#endif 1144#endif
1080 default: 1145 default: