Skip to content

Commit

Permalink
V4L/DVB (12165): cx23885: override set_frontend to allow rf input pat…
Browse files Browse the repository at this point in the history
…h 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>
  • Loading branch information
Michael Krufky authored and Mauro Carvalho Chehab committed Jul 5, 2009
1 parent 509dd02 commit f35b9e8
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions drivers/media/video/cx23885/cx23885-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,30 @@ static struct xc5000_config mygica_x8506_xc5000_config = {
.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)
{
struct cx23885_dev *dev = port->dev;
Expand Down Expand Up @@ -502,6 +526,11 @@ static int dvb_register(struct cx23885_tsport *port)
0x60, &dev->i2c_bus[1].i2c_adap,
&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;
case CX23885_BOARD_HAUPPAUGE_HVR1255:
i2c_bus = &dev->i2c_bus[0];
Expand Down
2 changes: 2 additions & 0 deletions drivers/media/video/cx23885/cx23885.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,8 @@ struct cx23885_tsport {
/* Allow a single tsport to have multiple frontends */
u32 num_frontends;
void *port_priv;
int (*set_frontend_save) (struct dvb_frontend *,
struct dvb_frontend_parameters *);
};

struct cx23885_dev {
Expand Down

0 comments on commit f35b9e8

Please sign in to comment.