V4L/DVB (9225): MFE: Add configurable gate control
This adds a configurable (one per card) gate control option for multi-frontend. Prior to this point gate control was assumed to be on the primary frontend, this is a fault when the gate to the analogue section is on the secondary which is the default for both the HVR-3000 and HVR-4000 in MFE. Signed-off-by: Darron Broad <darron@kewl.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
f972e0bd93
commit
8e739090d6
|
@ -608,7 +608,10 @@ static int dvb_register(struct cx8802_dev *dev)
|
||||||
if (!fe0)
|
if (!fe0)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* init frontend */
|
/* multi-frontend gate control is undefined or defaults to fe0 */
|
||||||
|
dev->frontends.gate = 0;
|
||||||
|
|
||||||
|
/* init frontend(s) */
|
||||||
switch (core->boardnr) {
|
switch (core->boardnr) {
|
||||||
case CX88_BOARD_HAUPPAUGE_DVB_T1:
|
case CX88_BOARD_HAUPPAUGE_DVB_T1:
|
||||||
fe0->dvb.frontend = dvb_attach(cx22702_attach,
|
fe0->dvb.frontend = dvb_attach(cx22702_attach,
|
||||||
|
@ -665,6 +668,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
||||||
/* DVB-T init */
|
/* DVB-T init */
|
||||||
fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
|
fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
|
||||||
if (fe1) {
|
if (fe1) {
|
||||||
|
dev->frontends.gate = 2;
|
||||||
fe1->dvb.frontend = dvb_attach(cx22702_attach,
|
fe1->dvb.frontend = dvb_attach(cx22702_attach,
|
||||||
&hauppauge_hvr_config,
|
&hauppauge_hvr_config,
|
||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
|
@ -1008,6 +1012,7 @@ static int dvb_register(struct cx8802_dev *dev)
|
||||||
/* DVB-T Init */
|
/* DVB-T Init */
|
||||||
fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
|
fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
|
||||||
if (fe1) {
|
if (fe1) {
|
||||||
|
dev->frontends.gate = 2;
|
||||||
fe1->dvb.frontend = dvb_attach(cx22702_attach,
|
fe1->dvb.frontend = dvb_attach(cx22702_attach,
|
||||||
&hauppauge_hvr_config,
|
&hauppauge_hvr_config,
|
||||||
&dev->core->i2c_adap);
|
&dev->core->i2c_adap);
|
||||||
|
|
|
@ -116,23 +116,25 @@ static int detach_inform(struct i2c_client *client)
|
||||||
|
|
||||||
void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
|
void cx88_call_i2c_clients(struct cx88_core *core, unsigned int cmd, void *arg)
|
||||||
{
|
{
|
||||||
struct videobuf_dvb_frontend *fe0 = NULL;
|
struct videobuf_dvb_frontends *f = &core->dvbdev->frontends;
|
||||||
|
struct videobuf_dvb_frontend *fe = NULL;
|
||||||
if (0 != core->i2c_rc)
|
if (0 != core->i2c_rc)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
|
#if defined(CONFIG_VIDEO_CX88_DVB) || defined(CONFIG_VIDEO_CX88_DVB_MODULE)
|
||||||
if (core->dvbdev) {
|
if (core->dvbdev && f) {
|
||||||
/* Get the first frontend and assume that all I2C is routed through it */
|
if(f->gate <= 1) /* undefined or fe0 */
|
||||||
/* TODO: Get _THIS_FE_ then find the right i2c_gate_ctrl for it */
|
fe = videobuf_dvb_get_frontend(f, 1);
|
||||||
fe0 = videobuf_dvb_get_frontend(&core->dvbdev->frontends, 1);
|
else
|
||||||
|
fe = videobuf_dvb_get_frontend(f, f->gate);
|
||||||
|
|
||||||
if (fe0 && fe0->dvb.frontend && fe0->dvb.frontend->ops.i2c_gate_ctrl)
|
if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
|
||||||
fe0->dvb.frontend->ops.i2c_gate_ctrl(fe0->dvb.frontend, 1);
|
fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 1);
|
||||||
|
|
||||||
i2c_clients_command(&core->i2c_adap, cmd, arg);
|
i2c_clients_command(&core->i2c_adap, cmd, arg);
|
||||||
|
|
||||||
if (fe0 && fe0->dvb.frontend && fe0->dvb.frontend->ops.i2c_gate_ctrl)
|
if (fe && fe->dvb.frontend && fe->dvb.frontend->ops.i2c_gate_ctrl)
|
||||||
fe0->dvb.frontend->ops.i2c_gate_ctrl(fe0->dvb.frontend, 0);
|
fe->dvb.frontend->ops.i2c_gate_ctrl(fe->dvb.frontend, 0);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
i2c_clients_command(&core->i2c_adap, cmd, arg);
|
i2c_clients_command(&core->i2c_adap, cmd, arg);
|
||||||
|
|
|
@ -36,6 +36,7 @@ struct videobuf_dvb_frontends {
|
||||||
struct dvb_adapter adapter;
|
struct dvb_adapter adapter;
|
||||||
int active_fe_id; /* Indicates which frontend in the felist is in use */
|
int active_fe_id; /* Indicates which frontend in the felist is in use */
|
||||||
struct videobuf_dvb_frontend frontend;
|
struct videobuf_dvb_frontend frontend;
|
||||||
|
int gate; /* Frontend with gate control 0=!MFE,1=fe0,2=fe1 etc */
|
||||||
};
|
};
|
||||||
|
|
||||||
int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
|
int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f,
|
||||||
|
|
Loading…
Reference in New Issue