Commit f35b9e80 authored by Michael Krufky's avatar Michael Krufky Committed by Mauro Carvalho Chehab

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: default avatarSteven Toth <stoth@kernellabs.com>
Signed-off-by: default avatarMichael Krufky <mkrufky@kernellabs.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 509dd025
...@@ -463,6 +463,30 @@ static struct xc5000_config mygica_x8506_xc5000_config = { ...@@ -463,6 +463,30 @@ static struct xc5000_config mygica_x8506_xc5000_config = {
.if_khz = 5380, .if_khz = 5380,
}; };
static int cx23885_dvb_set_frontend(struct dvb_frontend *fe,
struct dvb_frontend_parameters *param)
{
struct cx23885_tsport *port = fe->dvb->priv;
struct cx23885_dev *dev = port->dev;
switch (dev->board) {
case CX23885_BOARD_HAUPPAUGE_HVR1275:
switch (param->u.vsb.modulation) {
case VSB_8:
cx23885_gpio_clear(dev, GPIO_5);
break;
case QAM_64:
case QAM_256:
default:
cx23885_gpio_set(dev, GPIO_5);
break;
}
break;
}
return (port->set_frontend_save) ?
port->set_frontend_save(fe, param) : -ENODEV;
}
static int dvb_register(struct cx23885_tsport *port) static int dvb_register(struct cx23885_tsport *port)
{ {
struct cx23885_dev *dev = port->dev; struct cx23885_dev *dev = port->dev;
...@@ -502,6 +526,11 @@ static int dvb_register(struct cx23885_tsport *port) ...@@ -502,6 +526,11 @@ static int dvb_register(struct cx23885_tsport *port)
0x60, &dev->i2c_bus[1].i2c_adap, 0x60, &dev->i2c_bus[1].i2c_adap,
&hauppauge_hvr127x_config); &hauppauge_hvr127x_config);
} }
/* define bridge override to set_frontend */
port->set_frontend_save = fe0->dvb.frontend->ops.set_frontend;
fe0->dvb.frontend->ops.set_frontend = cx23885_dvb_set_frontend;
break; break;
case CX23885_BOARD_HAUPPAUGE_HVR1255: case CX23885_BOARD_HAUPPAUGE_HVR1255:
i2c_bus = &dev->i2c_bus[0]; i2c_bus = &dev->i2c_bus[0];
......
...@@ -288,6 +288,8 @@ struct cx23885_tsport { ...@@ -288,6 +288,8 @@ struct cx23885_tsport {
/* Allow a single tsport to have multiple frontends */ /* Allow a single tsport to have multiple frontends */
u32 num_frontends; u32 num_frontends;
void *port_priv; void *port_priv;
int (*set_frontend_save) (struct dvb_frontend *,
struct dvb_frontend_parameters *);
}; };
struct cx23885_dev { struct cx23885_dev {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment