aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorPatrick Boettcher <pb@linuxtv.org>2006-05-14 04:01:31 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-06-25 01:00:42 -0400
commitdea74869f3c62b0b7addd67017b22b394e942aac (patch)
treed1a597caea6615c76f34896cc832fd1371f2e776 /drivers/media/video
parent332bed5fc25ab0eb84215ecd89a4acd48219eee0 (diff)
V4L/DVB (4028): Change dvb_frontend_ops to be a real field instead of a pointer field inside dvb_frontend
The dvb_frontend_ops is a pointer inside dvb_frontend. That's why every demod-driver is having a field of dvb_frontend_ops in its private-state-struct and using the reference for filling the pointer-field in dvb_frontend. - It saves at least two lines of code per demod-driver, - reduces object size (one less dereference per frontend_ops-access), - be coherent with dvb_tuner_ops, - makes it a little bit easier for newbies to understand how it works and - avoids stupid mistakes because you would have to copy the dvb_frontend_ops always, before you could assign the static pointer directly, which was dangerous. Signed-off-by: Patrick Boettcher <pb@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx88/cx88-dvb.c36
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c8
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c166
3 files changed, 105 insertions, 105 deletions
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c
index 4d369f8393d9..bf89cbf2b058 100644
--- a/drivers/media/video/cx88/cx88-dvb.c
+++ b/drivers/media/video/cx88/cx88-dvb.c
@@ -230,8 +230,8 @@ static int philips_fmd1216_pll_init(struct dvb_frontend *fe)
230 .buf = fmd1216_init, .len = sizeof(fmd1216_init) }; 230 .buf = fmd1216_init, .len = sizeof(fmd1216_init) };
231 int err; 231 int err;
232 232
233 if (fe->ops->i2c_gate_ctrl) 233 if (fe->ops.i2c_gate_ctrl)
234 fe->ops->i2c_gate_ctrl(fe, 1); 234 fe->ops.i2c_gate_ctrl(fe, 1);
235 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { 235 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
236 if (err < 0) 236 if (err < 0)
237 return err; 237 return err;
@@ -261,8 +261,8 @@ static int dntv_live_dvbt_pro_tuner_set_params(struct dvb_frontend* fe,
261 dvb_pll_configure(dev->core->pll_desc, buf, 261 dvb_pll_configure(dev->core->pll_desc, buf,
262 params->frequency, 262 params->frequency,
263 params->u.ofdm.bandwidth); 263 params->u.ofdm.bandwidth);
264 if (fe->ops->i2c_gate_ctrl) 264 if (fe->ops.i2c_gate_ctrl)
265 fe->ops->i2c_gate_ctrl(fe, 1); 265 fe->ops.i2c_gate_ctrl(fe, 1);
266 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { 266 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
267 267
268 printk(KERN_WARNING "cx88-dvb: %s error " 268 printk(KERN_WARNING "cx88-dvb: %s error "
@@ -300,8 +300,8 @@ static int dvico_hybrid_tuner_set_params(struct dvb_frontend *fe,
300 params->frequency, 300 params->frequency,
301 params->u.ofdm.bandwidth); 301 params->u.ofdm.bandwidth);
302 302
303 if (fe->ops->i2c_gate_ctrl) 303 if (fe->ops.i2c_gate_ctrl)
304 fe->ops->i2c_gate_ctrl(fe, 1); 304 fe->ops.i2c_gate_ctrl(fe, 1);
305 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { 305 if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) {
306 printk(KERN_WARNING "cx88-dvb: %s error " 306 printk(KERN_WARNING "cx88-dvb: %s error "
307 "(addr %02x <- %02x, err = %i)\n", 307 "(addr %02x <- %02x, err = %i)\n",
@@ -375,8 +375,8 @@ static int lgdt3302_tuner_set_params(struct dvb_frontend* fe,
375 dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n", 375 dprintk(1, "%s: tuner at 0x%02x bytes: 0x%02x 0x%02x 0x%02x 0x%02x\n",
376 __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]); 376 __FUNCTION__, msg.addr, buf[0],buf[1],buf[2],buf[3]);
377 377
378 if (fe->ops->i2c_gate_ctrl) 378 if (fe->ops.i2c_gate_ctrl)
379 fe->ops->i2c_gate_ctrl(fe, 1); 379 fe->ops.i2c_gate_ctrl(fe, 1);
380 if ((err = i2c_transfer(&core->i2c_adap, &msg, 1)) != 1) { 380 if ((err = i2c_transfer(&core->i2c_adap, &msg, 1)) != 1) {
381 printk(KERN_WARNING "cx88-dvb: %s error " 381 printk(KERN_WARNING "cx88-dvb: %s error "
382 "(addr %02x <- %02x, err = %i)\n", 382 "(addr %02x <- %02x, err = %i)\n",
@@ -586,7 +586,7 @@ static int dvb_register(struct cx8802_dev *dev)
586 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_pro_config, 586 dev->dvb.frontend = mt352_attach(&dntv_live_dvbt_pro_config,
587 &((struct vp3054_i2c_state *)dev->card_priv)->adap); 587 &((struct vp3054_i2c_state *)dev->card_priv)->adap);
588 if (dev->dvb.frontend != NULL) { 588 if (dev->dvb.frontend != NULL) {
589 dev->dvb.frontend->ops->tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params; 589 dev->dvb.frontend->ops.tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params;
590 } 590 }
591#else 591#else
592 printk("%s: built without vp3054 support\n", dev->core->name); 592 printk("%s: built without vp3054 support\n", dev->core->name);
@@ -609,7 +609,7 @@ static int dvb_register(struct cx8802_dev *dev)
609 dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_hybrid, 609 dev->dvb.frontend = zl10353_attach(&dvico_fusionhdtv_hybrid,
610 &dev->core->i2c_adap); 610 &dev->core->i2c_adap);
611 if (dev->dvb.frontend != NULL) { 611 if (dev->dvb.frontend != NULL) {
612 dev->dvb.frontend->ops->tuner_ops.set_params = dvico_hybrid_tuner_set_params; 612 dev->dvb.frontend->ops.tuner_ops.set_params = dvico_hybrid_tuner_set_params;
613 } 613 }
614 break; 614 break;
615#endif 615#endif
@@ -641,7 +641,7 @@ static int dvb_register(struct cx8802_dev *dev)
641 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold, 641 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
642 &dev->core->i2c_adap); 642 &dev->core->i2c_adap);
643 if (dev->dvb.frontend != NULL) { 643 if (dev->dvb.frontend != NULL) {
644 dev->dvb.frontend->ops->tuner_ops.set_params = lgdt3302_tuner_set_params; 644 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params;
645 } 645 }
646 } 646 }
647 break; 647 break;
@@ -660,7 +660,7 @@ static int dvb_register(struct cx8802_dev *dev)
660 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold, 660 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_3_gold,
661 &dev->core->i2c_adap); 661 &dev->core->i2c_adap);
662 if (dev->dvb.frontend != NULL) { 662 if (dev->dvb.frontend != NULL) {
663 dev->dvb.frontend->ops->tuner_ops.set_params = lgdt3302_tuner_set_params; 663 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3302_tuner_set_params;
664 } 664 }
665 } 665 }
666 break; 666 break;
@@ -677,7 +677,7 @@ static int dvb_register(struct cx8802_dev *dev)
677 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_5_gold, 677 dev->dvb.frontend = lgdt330x_attach(&fusionhdtv_5_gold,
678 &dev->core->i2c_adap); 678 &dev->core->i2c_adap);
679 if (dev->dvb.frontend != NULL) { 679 if (dev->dvb.frontend != NULL) {
680 dev->dvb.frontend->ops->tuner_ops.set_params = lgdt3303_tuner_set_params; 680 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params;
681 } 681 }
682 } 682 }
683 break; 683 break;
@@ -694,7 +694,7 @@ static int dvb_register(struct cx8802_dev *dev)
694 dev->dvb.frontend = lgdt330x_attach(&pchdtv_hd5500, 694 dev->dvb.frontend = lgdt330x_attach(&pchdtv_hd5500,
695 &dev->core->i2c_adap); 695 &dev->core->i2c_adap);
696 if (dev->dvb.frontend != NULL) { 696 if (dev->dvb.frontend != NULL) {
697 dev->dvb.frontend->ops->tuner_ops.set_params = lgdt3303_tuner_set_params; 697 dev->dvb.frontend->ops.tuner_ops.set_params = lgdt3303_tuner_set_params;
698 } 698 }
699 } 699 }
700 break; 700 break;
@@ -721,8 +721,8 @@ static int dvb_register(struct cx8802_dev *dev)
721 dev->dvb.frontend = cx24123_attach(&kworld_dvbs_100_config, 721 dev->dvb.frontend = cx24123_attach(&kworld_dvbs_100_config,
722 &dev->core->i2c_adap); 722 &dev->core->i2c_adap);
723 if (dev->dvb.frontend) { 723 if (dev->dvb.frontend) {
724 dev->core->prev_set_voltage = dev->dvb.frontend->ops->set_voltage; 724 dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage;
725 dev->dvb.frontend->ops->set_voltage = kworld_dvbs_100_set_voltage; 725 dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage;
726 } 726 }
727 break; 727 break;
728#endif 728#endif
@@ -737,8 +737,8 @@ static int dvb_register(struct cx8802_dev *dev)
737 } 737 }
738 738
739 if (dev->core->pll_desc) { 739 if (dev->core->pll_desc) {
740 dev->dvb.frontend->ops->info.frequency_min = dev->core->pll_desc->min; 740 dev->dvb.frontend->ops.info.frequency_min = dev->core->pll_desc->min;
741 dev->dvb.frontend->ops->info.frequency_max = dev->core->pll_desc->max; 741 dev->dvb.frontend->ops.info.frequency_max = dev->core->pll_desc->max;
742 } 742 }
743 743
744 /* Put the analog decoder in standby to keep it quiet */ 744 /* Put the analog decoder in standby to keep it quiet */
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index f720901e9638..7efa6def0bde 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -138,13 +138,13 @@ void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
138 return; 138 return;
139 139
140 if (core->dvbdev) { 140 if (core->dvbdev) {
141 if (core->dvbdev->dvb.frontend->ops->i2c_gate_ctrl) 141 if (core->dvbdev->dvb.frontend->ops.i2c_gate_ctrl)
142 core->dvbdev->dvb.frontend->ops->i2c_gate_ctrl(core->dvbdev->dvb.frontend, 1); 142 core->dvbdev->dvb.frontend->ops.i2c_gate_ctrl(core->dvbdev->dvb.frontend, 1);
143 143
144 i2c_clients_command(&core->i2c_adap, cmd, arg); 144 i2c_clients_command(&core->i2c_adap, cmd, arg);
145 145
146 if (core->dvbdev->dvb.frontend->ops->i2c_gate_ctrl) 146 if (core->dvbdev->dvb.frontend->ops.i2c_gate_ctrl)
147 core->dvbdev->dvb.frontend->ops->i2c_gate_ctrl(core->dvbdev->dvb.frontend, 0); 147 core->dvbdev->dvb.frontend->ops.i2c_gate_ctrl(core->dvbdev->dvb.frontend, 0);
148 } else 148 } else
149 i2c_clients_command(&core->i2c_adap, cmd, arg); 149 i2c_clients_command(&core->i2c_adap, cmd, arg);
150} 150}
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 716b829c460f..279828b8f299 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -146,13 +146,13 @@ static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe,
146 f.tuner = 0; 146 f.tuner = 0;
147 f.type = V4L2_TUNER_DIGITAL_TV; 147 f.type = V4L2_TUNER_DIGITAL_TV;
148 f.frequency = params->frequency / 1000 * 16 / 1000; 148 f.frequency = params->frequency / 1000 * 16 / 1000;
149 if (fe->ops->i2c_gate_ctrl) 149 if (fe->ops.i2c_gate_ctrl)
150 fe->ops->i2c_gate_ctrl(fe, 1); 150 fe->ops.i2c_gate_ctrl(fe, 1);
151 i2c_transfer(&dev->i2c_adap, &msg, 1); 151 i2c_transfer(&dev->i2c_adap, &msg, 1);
152 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); 152 saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f);
153 msg.buf = on; 153 msg.buf = on;
154 if (fe->ops->i2c_gate_ctrl) 154 if (fe->ops.i2c_gate_ctrl)
155 fe->ops->i2c_gate_ctrl(fe, 1); 155 fe->ops.i2c_gate_ctrl(fe, 1);
156 i2c_transfer(&dev->i2c_adap, &msg, 1); 156 i2c_transfer(&dev->i2c_adap, &msg, 1);
157 157
158 pinnacle_antenna_pwr(dev, antenna_pwr); 158 pinnacle_antenna_pwr(dev, antenna_pwr);
@@ -266,8 +266,8 @@ static int philips_tda6651_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb_
266 tuner_buf[2] = 0xca; 266 tuner_buf[2] = 0xca;
267 tuner_buf[3] = (cp << 5) | (filter << 3) | band; 267 tuner_buf[3] = (cp << 5) | (filter << 3) | band;
268 268
269 if (fe->ops->i2c_gate_ctrl) 269 if (fe->ops.i2c_gate_ctrl)
270 fe->ops->i2c_gate_ctrl(fe, 1); 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,8 +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) 284 if (fe->ops.i2c_gate_ctrl)
285 fe->ops->i2c_gate_ctrl(fe, 1); 285 fe->ops.i2c_gate_ctrl(fe, 1);
286 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 286 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
287 return -EIO; 287 return -EIO;
288 msleep(1); 288 msleep(1);
@@ -352,8 +352,8 @@ static int philips_europa_tuner_init(struct dvb_frontend *fe)
352 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) };
353 353
354 /* setup PLL configuration */ 354 /* setup PLL configuration */
355 if (fe->ops->i2c_gate_ctrl) 355 if (fe->ops.i2c_gate_ctrl)
356 fe->ops->i2c_gate_ctrl(fe, 1); 356 fe->ops.i2c_gate_ctrl(fe, 1);
357 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) 357 if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1)
358 return -EIO; 358 return -EIO;
359 msleep(1); 359 msleep(1);
@@ -363,8 +363,8 @@ static int philips_europa_tuner_init(struct dvb_frontend *fe)
363 init_msg.len = 0x02; 363 init_msg.len = 0x02;
364 msg[0] = 0x00; 364 msg[0] = 0x00;
365 msg[1] = 0x40; 365 msg[1] = 0x40;
366 if (fe->ops->i2c_gate_ctrl) 366 if (fe->ops.i2c_gate_ctrl)
367 fe->ops->i2c_gate_ctrl(fe, 1); 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
@@ -391,8 +391,8 @@ static int philips_europa_tuner_sleep(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) 394 if (fe->ops.i2c_gate_ctrl)
395 fe->ops->i2c_gate_ctrl(fe, 1); 395 fe->ops.i2c_gate_ctrl(fe, 1);
396 i2c_transfer(&dev->i2c_adap, &analog_msg, 1); 396 i2c_transfer(&dev->i2c_adap, &analog_msg, 1);
397 return 0; 397 return 0;
398} 398}
@@ -403,7 +403,7 @@ static int philips_europa_demod_sleep(struct dvb_frontend *fe)
403 403
404 if (dev->original_demod_sleep) 404 if (dev->original_demod_sleep)
405 dev->original_demod_sleep(fe); 405 dev->original_demod_sleep(fe);
406 fe->ops->i2c_gate_ctrl(fe, 1); 406 fe->ops.i2c_gate_ctrl(fe, 1);
407 return 0; 407 return 0;
408} 408}
409 409
@@ -427,8 +427,8 @@ static int philips_fmd1216_tuner_init(struct dvb_frontend *fe)
427 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 }; 427 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 };
428 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) };
429 429
430 if (fe->ops->i2c_gate_ctrl) 430 if (fe->ops.i2c_gate_ctrl)
431 fe->ops->i2c_gate_ctrl(fe, 1); 431 fe->ops.i2c_gate_ctrl(fe, 1);
432 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 432 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
433 return -EIO; 433 return -EIO;
434 msleep(1); 434 msleep(1);
@@ -443,14 +443,14 @@ static int philips_fmd1216_tuner_sleep(struct dvb_frontend *fe)
443 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0x60 }; 443 static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0x60 };
444 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) };
445 445
446 if (fe->ops->i2c_gate_ctrl) 446 if (fe->ops.i2c_gate_ctrl)
447 fe->ops->i2c_gate_ctrl(fe, 1); 447 fe->ops.i2c_gate_ctrl(fe, 1);
448 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 448 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
449 msleep(1); 449 msleep(1);
450 fmd1216_init[2] = 0x86; 450 fmd1216_init[2] = 0x86;
451 fmd1216_init[3] = 0x54; 451 fmd1216_init[3] = 0x54;
452 if (fe->ops->i2c_gate_ctrl) 452 if (fe->ops.i2c_gate_ctrl)
453 fe->ops->i2c_gate_ctrl(fe, 1); 453 fe->ops.i2c_gate_ctrl(fe, 1);
454 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 454 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
455 msleep(1); 455 msleep(1);
456 return 0; 456 return 0;
@@ -533,8 +533,8 @@ static int philips_fmd1216_tuner_set_params(struct dvb_frontend *fe, struct dvb_
533 tuner_buf[2] = 0x80 | (cp << 6) | (mode << 3) | 4; 533 tuner_buf[2] = 0x80 | (cp << 6) | (mode << 3) | 4;
534 tuner_buf[3] = 0x40 | band; 534 tuner_buf[3] = 0x40 | band;
535 535
536 if (fe->ops->i2c_gate_ctrl) 536 if (fe->ops.i2c_gate_ctrl)
537 fe->ops->i2c_gate_ctrl(fe, 1); 537 fe->ops.i2c_gate_ctrl(fe, 1);
538 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 538 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
539 return -EIO; 539 return -EIO;
540 return 0; 540 return 0;
@@ -646,8 +646,8 @@ static int philips_tda827x_tuner_set_params(struct dvb_frontend *fe, struct dvb_
646 tuner_buf[13] = 0x40; 646 tuner_buf[13] = 0x40;
647 647
648 tuner_msg.len = 14; 648 tuner_msg.len = 14;
649 if (fe->ops->i2c_gate_ctrl) 649 if (fe->ops.i2c_gate_ctrl)
650 fe->ops->i2c_gate_ctrl(fe, 1); 650 fe->ops.i2c_gate_ctrl(fe, 1);
651 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) 651 if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1)
652 return -EIO; 652 return -EIO;
653 653
@@ -656,8 +656,8 @@ static int philips_tda827x_tuner_set_params(struct dvb_frontend *fe, struct dvb_
656 tuner_buf[0] = 0x30; 656 tuner_buf[0] = 0x30;
657 tuner_buf[1] = 0x50 + tda827x_dvbt[i].cp; 657 tuner_buf[1] = 0x50 + tda827x_dvbt[i].cp;
658 tuner_msg.len = 2; 658 tuner_msg.len = 2;
659 if (fe->ops->i2c_gate_ctrl) 659 if (fe->ops.i2c_gate_ctrl)
660 fe->ops->i2c_gate_ctrl(fe, 1); 660 fe->ops.i2c_gate_ctrl(fe, 1);
661 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 661 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
662 662
663 return 0; 663 return 0;
@@ -669,8 +669,8 @@ static int philips_tda827x_tuner_sleep(struct dvb_frontend *fe)
669 static u8 tda827x_sleep[] = { 0x30, 0xd0}; 669 static u8 tda827x_sleep[] = { 0x30, 0xd0};
670 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,
671 .len = sizeof(tda827x_sleep) }; 671 .len = sizeof(tda827x_sleep) };
672 if (fe->ops->i2c_gate_ctrl) 672 if (fe->ops.i2c_gate_ctrl)
673 fe->ops->i2c_gate_ctrl(fe, 1); 673 fe->ops.i2c_gate_ctrl(fe, 1);
674 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 674 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
675 return 0; 675 return 0;
676} 676}
@@ -773,8 +773,8 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
773 tuner_buf[12] = 0x00; 773 tuner_buf[12] = 0x00;
774 tuner_buf[13] = 0x39; // lpsel 774 tuner_buf[13] = 0x39; // lpsel
775 msg.len = 14; 775 msg.len = 14;
776 if (fe->ops->i2c_gate_ctrl) 776 if (fe->ops.i2c_gate_ctrl)
777 fe->ops->i2c_gate_ctrl(fe, 1); 777 fe->ops.i2c_gate_ctrl(fe, 1);
778 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) 778 if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1)
779 return -EIO; 779 return -EIO;
780 780
@@ -782,14 +782,14 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
782 msg.len = 2; 782 msg.len = 2;
783 reg2[0] = 0x60; 783 reg2[0] = 0x60;
784 reg2[1] = 0x3c; 784 reg2[1] = 0x3c;
785 if (fe->ops->i2c_gate_ctrl) 785 if (fe->ops.i2c_gate_ctrl)
786 fe->ops->i2c_gate_ctrl(fe, 1); 786 fe->ops.i2c_gate_ctrl(fe, 1);
787 i2c_transfer(&dev->i2c_adap, &msg, 1); 787 i2c_transfer(&dev->i2c_adap, &msg, 1);
788 788
789 reg2[0] = 0xa0; 789 reg2[0] = 0xa0;
790 reg2[1] = 0x40; 790 reg2[1] = 0x40;
791 if (fe->ops->i2c_gate_ctrl) 791 if (fe->ops.i2c_gate_ctrl)
792 fe->ops->i2c_gate_ctrl(fe, 1); 792 fe->ops.i2c_gate_ctrl(fe, 1);
793 i2c_transfer(&dev->i2c_adap, &msg, 1); 793 i2c_transfer(&dev->i2c_adap, &msg, 1);
794 794
795 msleep(2); 795 msleep(2);
@@ -797,15 +797,15 @@ static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb
797 reg2[0] = 0x30; 797 reg2[0] = 0x30;
798 reg2[1] = 0x10 + tda827xa_dvbt[i].scr; 798 reg2[1] = 0x10 + tda827xa_dvbt[i].scr;
799 msg.len = 2; 799 msg.len = 2;
800 if (fe->ops->i2c_gate_ctrl) 800 if (fe->ops.i2c_gate_ctrl)
801 fe->ops->i2c_gate_ctrl(fe, 1); 801 fe->ops.i2c_gate_ctrl(fe, 1);
802 i2c_transfer(&dev->i2c_adap, &msg, 1); 802 i2c_transfer(&dev->i2c_adap, &msg, 1);
803 803
804 msleep(550); 804 msleep(550);
805 reg2[0] = 0x50; 805 reg2[0] = 0x50;
806 reg2[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4); 806 reg2[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4);
807 if (fe->ops->i2c_gate_ctrl) 807 if (fe->ops.i2c_gate_ctrl)
808 fe->ops->i2c_gate_ctrl(fe, 1); 808 fe->ops.i2c_gate_ctrl(fe, 1);
809 i2c_transfer(&dev->i2c_adap, &msg, 1); 809 i2c_transfer(&dev->i2c_adap, &msg, 1);
810 810
811 return 0; 811 return 0;
@@ -818,8 +818,8 @@ static int philips_tda827xa_tuner_sleep(u8 addr, struct dvb_frontend *fe)
818 static u8 tda827xa_sleep[] = { 0x30, 0x90}; 818 static u8 tda827xa_sleep[] = { 0x30, 0x90};
819 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,
820 .len = sizeof(tda827xa_sleep) }; 820 .len = sizeof(tda827xa_sleep) };
821 if (fe->ops->i2c_gate_ctrl) 821 if (fe->ops.i2c_gate_ctrl)
822 fe->ops->i2c_gate_ctrl(fe, 1); 822 fe->ops.i2c_gate_ctrl(fe, 1);
823 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 823 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
824 return 0; 824 return 0;
825} 825}
@@ -1015,7 +1015,7 @@ static int dvb_init(struct saa7134_dev *dev)
1015 dev->dvb.frontend = mt352_attach(&pinnacle_300i, 1015 dev->dvb.frontend = mt352_attach(&pinnacle_300i,
1016 &dev->i2c_adap); 1016 &dev->i2c_adap);
1017 if (dev->dvb.frontend) { 1017 if (dev->dvb.frontend) {
1018 dev->dvb.frontend->ops->tuner_ops.set_params = mt352_pinnacle_tuner_set_params; 1018 dev->dvb.frontend->ops.tuner_ops.set_params = mt352_pinnacle_tuner_set_params;
1019 } 1019 }
1020 break; 1020 break;
1021 1021
@@ -1024,7 +1024,7 @@ static int dvb_init(struct saa7134_dev *dev)
1024 dev->dvb.frontend = mt352_attach(&avermedia_777, 1024 dev->dvb.frontend = mt352_attach(&avermedia_777,
1025 &dev->i2c_adap); 1025 &dev->i2c_adap);
1026 if (dev->dvb.frontend) { 1026 if (dev->dvb.frontend) {
1027 dev->dvb.frontend->ops->tuner_ops.calc_regs = mt352_aver777_tuner_calc_regs; 1027 dev->dvb.frontend->ops.tuner_ops.calc_regs = mt352_aver777_tuner_calc_regs;
1028 } 1028 }
1029 break; 1029 break;
1030#endif 1030#endif
@@ -1033,124 +1033,124 @@ static int dvb_init(struct saa7134_dev *dev)
1033 dev->dvb.frontend = tda10046_attach(&medion_cardbus, 1033 dev->dvb.frontend = tda10046_attach(&medion_cardbus,
1034 &dev->i2c_adap); 1034 &dev->i2c_adap);
1035 if (dev->dvb.frontend) { 1035 if (dev->dvb.frontend) {
1036 dev->dvb.frontend->ops->tuner_ops.init = philips_fmd1216_tuner_init; 1036 dev->dvb.frontend->ops.tuner_ops.init = philips_fmd1216_tuner_init;
1037 dev->dvb.frontend->ops->tuner_ops.sleep = philips_fmd1216_tuner_sleep; 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; 1038 dev->dvb.frontend->ops.tuner_ops.set_params = philips_fmd1216_tuner_set_params;
1039 } 1039 }
1040 break; 1040 break;
1041 case SAA7134_BOARD_PHILIPS_TOUGH: 1041 case SAA7134_BOARD_PHILIPS_TOUGH:
1042 dev->dvb.frontend = tda10046_attach(&philips_tu1216_60_config, 1042 dev->dvb.frontend = tda10046_attach(&philips_tu1216_60_config,
1043 &dev->i2c_adap); 1043 &dev->i2c_adap);
1044 if (dev->dvb.frontend) { 1044 if (dev->dvb.frontend) {
1045 dev->dvb.frontend->ops->tuner_ops.init = philips_tu1216_tuner_60_init; 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; 1046 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tu1216_tuner_60_set_params;
1047 } 1047 }
1048 break; 1048 break;
1049 case SAA7134_BOARD_FLYDVBTDUO: 1049 case SAA7134_BOARD_FLYDVBTDUO:
1050 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1050 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1051 &dev->i2c_adap); 1051 &dev->i2c_adap);
1052 if (dev->dvb.frontend) { 1052 if (dev->dvb.frontend) {
1053 dev->dvb.frontend->ops->tuner_ops.init = philips_tda827x_tuner_init; 1053 dev->dvb.frontend->ops.tuner_ops.init = philips_tda827x_tuner_init;
1054 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tda827x_tuner_sleep; 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; 1055 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda827x_tuner_set_params;
1056 } 1056 }
1057 break; 1057 break;
1058 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS: 1058 case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS:
1059 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1059 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1060 &dev->i2c_adap); 1060 &dev->i2c_adap);
1061 if (dev->dvb.frontend) { 1061 if (dev->dvb.frontend) {
1062 dev->dvb.frontend->ops->tuner_ops.init = philips_tda827x_tuner_init; 1062 dev->dvb.frontend->ops.tuner_ops.init = philips_tda827x_tuner_init;
1063 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tda827x_tuner_sleep; 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; 1064 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda827x_tuner_set_params;
1065 } 1065 }
1066 break; 1066 break;
1067 case SAA7134_BOARD_PHILIPS_EUROPA: 1067 case SAA7134_BOARD_PHILIPS_EUROPA:
1068 dev->dvb.frontend = tda10046_attach(&philips_europa_config, 1068 dev->dvb.frontend = tda10046_attach(&philips_europa_config,
1069 &dev->i2c_adap); 1069 &dev->i2c_adap);
1070 if (dev->dvb.frontend) { 1070 if (dev->dvb.frontend) {
1071 dev->original_demod_sleep = dev->dvb.frontend->ops->sleep; 1071 dev->original_demod_sleep = dev->dvb.frontend->ops.sleep;
1072 dev->dvb.frontend->ops->sleep = philips_europa_demod_sleep; 1072 dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep;
1073 dev->dvb.frontend->ops->tuner_ops.init = philips_europa_tuner_init; 1073 dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init;
1074 dev->dvb.frontend->ops->tuner_ops.sleep = philips_europa_tuner_sleep; 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; 1075 dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
1076 } 1076 }
1077 break; 1077 break;
1078 case SAA7134_BOARD_VIDEOMATE_DVBT_300: 1078 case SAA7134_BOARD_VIDEOMATE_DVBT_300:
1079 dev->dvb.frontend = tda10046_attach(&philips_europa_config, 1079 dev->dvb.frontend = tda10046_attach(&philips_europa_config,
1080 &dev->i2c_adap); 1080 &dev->i2c_adap);
1081 if (dev->dvb.frontend) { 1081 if (dev->dvb.frontend) {
1082 dev->dvb.frontend->ops->tuner_ops.init = philips_europa_tuner_init; 1082 dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init;
1083 dev->dvb.frontend->ops->tuner_ops.sleep = philips_europa_tuner_sleep; 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; 1084 dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params;
1085 } 1085 }
1086 break; 1086 break;
1087 case SAA7134_BOARD_VIDEOMATE_DVBT_200: 1087 case SAA7134_BOARD_VIDEOMATE_DVBT_200:
1088 dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config, 1088 dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config,
1089 &dev->i2c_adap); 1089 &dev->i2c_adap);
1090 if (dev->dvb.frontend) { 1090 if (dev->dvb.frontend) {
1091 dev->dvb.frontend->ops->tuner_ops.init = philips_tu1216_tuner_61_init; 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; 1092 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tu1216_tuner_61_set_params;
1093 } 1093 }
1094 break; 1094 break;
1095 case SAA7134_BOARD_PHILIPS_TIGER: 1095 case SAA7134_BOARD_PHILIPS_TIGER:
1096 dev->dvb.frontend = tda10046_attach(&philips_tiger_config, 1096 dev->dvb.frontend = tda10046_attach(&philips_tiger_config,
1097 &dev->i2c_adap); 1097 &dev->i2c_adap);
1098 if (dev->dvb.frontend) { 1098 if (dev->dvb.frontend) {
1099 dev->dvb.frontend->ops->tuner_ops.init = philips_tiger_tuner_init; 1099 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
1100 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tiger_tuner_sleep; 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; 1101 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
1102 } 1102 }
1103 break; 1103 break;
1104 case SAA7134_BOARD_ASUSTeK_P7131_DUAL: 1104 case SAA7134_BOARD_ASUSTeK_P7131_DUAL:
1105 dev->dvb.frontend = tda10046_attach(&philips_tiger_config, 1105 dev->dvb.frontend = tda10046_attach(&philips_tiger_config,
1106 &dev->i2c_adap); 1106 &dev->i2c_adap);
1107 if (dev->dvb.frontend) { 1107 if (dev->dvb.frontend) {
1108 dev->dvb.frontend->ops->tuner_ops.init = philips_tiger_tuner_init; 1108 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
1109 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tiger_tuner_sleep; 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; 1110 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
1111 } 1111 }
1112 break; 1112 break;
1113 case SAA7134_BOARD_FLYDVBT_LR301: 1113 case SAA7134_BOARD_FLYDVBT_LR301:
1114 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, 1114 dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config,
1115 &dev->i2c_adap); 1115 &dev->i2c_adap);
1116 if (dev->dvb.frontend) { 1116 if (dev->dvb.frontend) {
1117 dev->dvb.frontend->ops->tuner_ops.init = philips_tda827x_tuner_init; 1117 dev->dvb.frontend->ops.tuner_ops.init = philips_tda827x_tuner_init;
1118 dev->dvb.frontend->ops->tuner_ops.sleep = philips_tda827x_tuner_sleep; 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; 1119 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda827x_tuner_set_params;
1120 } 1120 }
1121 break; 1121 break;
1122 case SAA7134_BOARD_FLYDVB_TRIO: 1122 case SAA7134_BOARD_FLYDVB_TRIO:
1123 dev->dvb.frontend = tda10046_attach(&lifeview_trio_config, 1123 dev->dvb.frontend = tda10046_attach(&lifeview_trio_config,
1124 &dev->i2c_adap); 1124 &dev->i2c_adap);
1125 if (dev->dvb.frontend) { 1125 if (dev->dvb.frontend) {
1126 dev->dvb.frontend->ops->tuner_ops.sleep = lifeview_trio_tuner_sleep; 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; 1127 dev->dvb.frontend->ops.tuner_ops.set_params = lifeview_trio_tuner_set_params;
1128 } 1128 }
1129 break; 1129 break;
1130 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: 1130 case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331:
1131 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config, 1131 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config,
1132 &dev->i2c_adap); 1132 &dev->i2c_adap);
1133 if (dev->dvb.frontend) { 1133 if (dev->dvb.frontend) {
1134 dev->dvb.frontend->ops->tuner_ops.init = ads_duo_tuner_init; 1134 dev->dvb.frontend->ops.tuner_ops.init = ads_duo_tuner_init;
1135 dev->dvb.frontend->ops->tuner_ops.sleep = ads_duo_tuner_sleep; 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; 1136 dev->dvb.frontend->ops.tuner_ops.set_params = ads_duo_tuner_set_params;
1137 } 1137 }
1138 break; 1138 break;
1139 case SAA7134_BOARD_TEVION_DVBT_220RF: 1139 case SAA7134_BOARD_TEVION_DVBT_220RF:
1140 dev->dvb.frontend = tda10046_attach(&tevion_dvbt220rf_config, 1140 dev->dvb.frontend = tda10046_attach(&tevion_dvbt220rf_config,
1141 &dev->i2c_adap); 1141 &dev->i2c_adap);
1142 if (dev->dvb.frontend) { 1142 if (dev->dvb.frontend) {
1143 dev->dvb.frontend->ops->tuner_ops.sleep = tevion_dvb220rf_tuner_sleep; 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; 1144 dev->dvb.frontend->ops.tuner_ops.set_params = tevion_dvb220rf_tuner_set_params;
1145 } 1145 }
1146 break; 1146 break;
1147 case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: 1147 case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS:
1148 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config, 1148 dev->dvb.frontend = tda10046_attach(&ads_tech_duo_config,
1149 &dev->i2c_adap); 1149 &dev->i2c_adap);
1150 if (dev->dvb.frontend) { 1150 if (dev->dvb.frontend) {
1151 dev->dvb.frontend->ops->tuner_ops.init = ads_duo_tuner_init; 1151 dev->dvb.frontend->ops.tuner_ops.init = ads_duo_tuner_init;
1152 dev->dvb.frontend->ops->tuner_ops.sleep = ads_duo_tuner_sleep; 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; 1153 dev->dvb.frontend->ops.tuner_ops.set_params = ads_duo_tuner_set_params;
1154 } 1154 }
1155 break; 1155 break;
1156#endif 1156#endif