aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx23885
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-12-26 18:48:54 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-31 07:22:54 -0500
commita7d44baaed0a8c7d4c4fb47938455cb3fc2bb1eb (patch)
tree5132c13c7cab7576d57cca6c285cf8777f649d60 /drivers/media/video/cx23885
parentc6f56e7d794cba022353d464dfa3383d1b3e0125 (diff)
[media] cx23885-dvb: Remove a dirty hack that would require DVBv3
The cx23885-dvb driver has a dirty hack: 1) it hooks the DVBv3 legacy call to FE_SET_FRONTEND; 2) it uses internally the DVBv3 struct to decide some configs. Replace it by a change during the gate control. This will likely work, but requires testing. Anyway, the current way will break, as soon as we stop copying data for DVBv3 for pure DVBv5 calls. Compile-tested only. Cc: Michael Krufky <mkrufky@linuxtv.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx23885')
-rw-r--r--drivers/media/video/cx23885/cx23885-dvb.c41
1 files changed, 12 insertions, 29 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c
index bcb45be44bb2..28d51d89748e 100644
--- a/drivers/media/video/cx23885/cx23885-dvb.c
+++ b/drivers/media/video/cx23885/cx23885-dvb.c
@@ -111,6 +111,8 @@ static void dvb_buf_release(struct videobuf_queue *q,
111 cx23885_free_buffer(q, (struct cx23885_buffer *)vb); 111 cx23885_free_buffer(q, (struct cx23885_buffer *)vb);
112} 112}
113 113
114static int cx23885_dvb_set_frontend(struct dvb_frontend *fe);
115
114static void cx23885_dvb_gate_ctrl(struct cx23885_tsport *port, int open) 116static void cx23885_dvb_gate_ctrl(struct cx23885_tsport *port, int open)
115{ 117{
116 struct videobuf_dvb_frontends *f; 118 struct videobuf_dvb_frontends *f;
@@ -125,6 +127,12 @@ static void cx23885_dvb_gate_ctrl(struct cx23885_tsport *port, int open)
125 127
126 if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl) 128 if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
127 fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, open); 129 fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, open);
130
131 /*
132 * FIXME: Improve this path to avoid calling the
133 * cx23885_dvb_set_frontend() every time it passes here.
134 */
135 cx23885_dvb_set_frontend(fe->dvb.frontend);
128} 136}
129 137
130static struct videobuf_queue_ops dvb_qops = { 138static struct videobuf_queue_ops dvb_qops = {
@@ -479,15 +487,15 @@ static struct xc5000_config mygica_x8506_xc5000_config = {
479 .if_khz = 5380, 487 .if_khz = 5380,
480}; 488};
481 489
482static int cx23885_dvb_set_frontend(struct dvb_frontend *fe, 490static int cx23885_dvb_set_frontend(struct dvb_frontend *fe)
483 struct dvb_frontend_parameters *param)
484{ 491{
492 struct dtv_frontend_properties *p = &fe->dtv_property_cache;
485 struct cx23885_tsport *port = fe->dvb->priv; 493 struct cx23885_tsport *port = fe->dvb->priv;
486 struct cx23885_dev *dev = port->dev; 494 struct cx23885_dev *dev = port->dev;
487 495
488 switch (dev->board) { 496 switch (dev->board) {
489 case CX23885_BOARD_HAUPPAUGE_HVR1275: 497 case CX23885_BOARD_HAUPPAUGE_HVR1275:
490 switch (param->u.vsb.modulation) { 498 switch (p->modulation) {
491 case VSB_8: 499 case VSB_8:
492 cx23885_gpio_clear(dev, GPIO_5); 500 cx23885_gpio_clear(dev, GPIO_5);
493 break; 501 break;
@@ -507,31 +515,6 @@ static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
507 return 0; 515 return 0;
508} 516}
509 517
510static int cx23885_dvb_fe_ioctl_override(struct dvb_frontend *fe,
511 unsigned int cmd, void *parg,
512 unsigned int stage)
513{
514 int err = 0;
515
516 switch (stage) {
517 case DVB_FE_IOCTL_PRE:
518
519 switch (cmd) {
520 case FE_SET_FRONTEND:
521 err = cx23885_dvb_set_frontend(fe,
522 (struct dvb_frontend_parameters *) parg);
523 break;
524 }
525 break;
526
527 case DVB_FE_IOCTL_POST:
528 /* no post-ioctl handling required */
529 break;
530 }
531 return err;
532};
533
534
535static struct lgs8gxx_config magicpro_prohdtve2_lgs8g75_config = { 518static struct lgs8gxx_config magicpro_prohdtve2_lgs8g75_config = {
536 .prod = LGS8GXX_PROD_LGS8G75, 519 .prod = LGS8GXX_PROD_LGS8G75,
537 .demod_address = 0x19, 520 .demod_address = 0x19,
@@ -1151,7 +1134,7 @@ static int dvb_register(struct cx23885_tsport *port)
1151 /* register everything */ 1134 /* register everything */
1152 ret = videobuf_dvb_register_bus(&port->frontends, THIS_MODULE, port, 1135 ret = videobuf_dvb_register_bus(&port->frontends, THIS_MODULE, port,
1153 &dev->pci->dev, adapter_nr, mfe_shared, 1136 &dev->pci->dev, adapter_nr, mfe_shared,
1154 cx23885_dvb_fe_ioctl_override); 1137 NULL);
1155 if (ret) 1138 if (ret)
1156 goto frontend_detach; 1139 goto frontend_detach;
1157 1140