Commit f35b9e8039c04f0cb9fe3a051ce941b1524a8798

Authored by Michael Krufky
Committed by Mauro Carvalho Chehab
1 parent 509dd025a4

V4L/DVB (12165): cx23885: override set_frontend to allow rf input path switching on the HVR1275

Use separate RF input spigots for Antennae and Cable.

Reviewed-by: Steven Toth <stoth@kernellabs.com>
Signed-off-by: Michael Krufky <mkrufky@kernellabs.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Showing 2 changed files with 31 additions and 0 deletions Side-by-side Diff

drivers/media/video/cx23885/cx23885-dvb.c
... ... @@ -463,6 +463,30 @@
463 463 .if_khz = 5380,
464 464 };
465 465  
  466 +static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
  467 + struct dvb_frontend_parameters *param)
  468 +{
  469 + struct cx23885_tsport *port = fe->dvb->priv;
  470 + struct cx23885_dev *dev = port->dev;
  471 +
  472 + switch (dev->board) {
  473 + case CX23885_BOARD_HAUPPAUGE_HVR1275:
  474 + switch (param->u.vsb.modulation) {
  475 + case VSB_8:
  476 + cx23885_gpio_clear(dev, GPIO_5);
  477 + break;
  478 + case QAM_64:
  479 + case QAM_256:
  480 + default:
  481 + cx23885_gpio_set(dev, GPIO_5);
  482 + break;
  483 + }
  484 + break;
  485 + }
  486 + return (port->set_frontend_save) ?
  487 + port->set_frontend_save(fe, param) : -ENODEV;
  488 +}
  489 +
466 490 static int dvb_register(struct cx23885_tsport *port)
467 491 {
468 492 struct cx23885_dev *dev = port->dev;
... ... @@ -502,6 +526,11 @@
502 526 0x60, &dev->i2c_bus[1].i2c_adap,
503 527 &hauppauge_hvr127x_config);
504 528 }
  529 +
  530 + /* define bridge override to set_frontend */
  531 + port->set_frontend_save = fe0->dvb.frontend->ops.set_frontend;
  532 + fe0->dvb.frontend->ops.set_frontend = cx23885_dvb_set_frontend;
  533 +
505 534 break;
506 535 case CX23885_BOARD_HAUPPAUGE_HVR1255:
507 536 i2c_bus = &dev->i2c_bus[0];
drivers/media/video/cx23885/cx23885.h
... ... @@ -288,6 +288,8 @@
288 288 /* Allow a single tsport to have multiple frontends */
289 289 u32 num_frontends;
290 290 void *port_priv;
  291 + int (*set_frontend_save) (struct dvb_frontend *,
  292 + struct dvb_frontend_parameters *);
291 293 };
292 294  
293 295 struct cx23885_dev {