V4L/DVB (9223): MFE: Fix a number of bugs and some tidying up

A number of reference to videobuf_dvb_get_frontend used an invalid
index. This has been fixed.

The section for the HVR3000 in advise_acquire was redundant as
the same logic is used on the HVR4000. This has been removed
and both cards now use the same function.

A number of small errors and whitespace errors are also fixed.

Signed-off-by: Darron Broad <darron@kewl.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
Darron Broad 2008-10-11 11:18:53 -03:00 committed by Mauro Carvalho Chehab
parent 363c35fc44
commit 92abe9ee37
6 changed files with 13 additions and 45 deletions

View File

@ -314,7 +314,7 @@ static int dvb_register(struct cx23885_tsport *port)
struct cx23885_i2c *i2c_bus = NULL; struct cx23885_i2c *i2c_bus = NULL;
struct videobuf_dvb_frontend *fe0; struct videobuf_dvb_frontend *fe0;
fe0 = videobuf_dvb_get_frontend(&port->frontends, 0); fe0 = videobuf_dvb_get_frontend(&port->frontends, 1);
if (!fe0) if (!fe0)
return -EINVAL; return -EINVAL;
@ -336,7 +336,7 @@ static int dvb_register(struct cx23885_tsport *port)
break; break;
case CX23885_BOARD_HAUPPAUGE_HVR1800: case CX23885_BOARD_HAUPPAUGE_HVR1800:
i2c_bus = &dev->i2c_bus[0]; i2c_bus = &dev->i2c_bus[0];
switch (alt_tuner) { // XXXXXX multifrontend? switch (alt_tuner) {
case 1: case 1:
fe0->dvb.frontend = fe0->dvb.frontend =
dvb_attach(s5h1409_attach, dvb_attach(s5h1409_attach,
@ -554,7 +554,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port)
struct cx23885_dev *dev = port->dev; struct cx23885_dev *dev = port->dev;
int err; int err;
fe0 = videobuf_dvb_get_frontend(&port->frontends, 0); fe0 = videobuf_dvb_get_frontend(&port->frontends, 1);
if (!fe0) if (!fe0)
err = -EINVAL; err = -EINVAL;
@ -583,7 +583,7 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port)
{ {
struct videobuf_dvb_frontend *fe0; struct videobuf_dvb_frontend *fe0;
fe0 = videobuf_dvb_get_frontend(&port->frontends, 0); fe0 = videobuf_dvb_get_frontend(&port->frontends, 1);
/* dvb */ /* dvb */
if(fe0->dvb.frontend) if(fe0->dvb.frontend)
videobuf_dvb_unregister_bus(&port->frontends); videobuf_dvb_unregister_bus(&port->frontends);

View File

@ -3004,7 +3004,6 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr)
cx88_card_list(core, pci); cx88_card_list(core, pci);
} }
memset(&core->board, 0, sizeof(core->board));
memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board)); memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board));
if (!core->board.num_frontends) if (!core->board.num_frontends)

View File

@ -124,7 +124,6 @@ static int cx88_dvb_bus_ctrl(struct dvb_frontend* fe, int acquire)
return -EINVAL; return -EINVAL;
} }
drv = cx8802_get_driver(dev, CX88_MPEG_DVB); drv = cx8802_get_driver(dev, CX88_MPEG_DVB);
if (drv) { if (drv) {
if (acquire){ if (acquire){
@ -502,7 +501,7 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev)
.ctrl = &ctl, .ctrl = &ctl,
}; };
/* Get the first frontend */ /* Get the first frontend */
fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1); fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
if (!fe0) if (!fe0)
return -EINVAL; return -EINVAL;
@ -1136,35 +1135,7 @@ static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv)
udelay(1000); udelay(1000);
break; break;
case CX88_BOARD_HAUPPAUGE_HVR3000: /* ? */ case CX88_BOARD_HAUPPAUGE_HVR3000:
if(core->dvbdev->frontends.active_fe_id == 1) {
/* DVB-S/S2 Enabled */
/* Toggle reset on cx22702 leaving i2c active */
cx_write(MO_GP0_IO, core->board.input[0].gpio0);
udelay(1000);
cx_clear(MO_GP0_IO, 0x00000080);
udelay(50);
cx_set(MO_GP0_IO, 0x00000080); /* cx22702 out of reset */
cx_set(MO_GP0_IO, 0x00000004); /* tri-state the cx22702 pins */
udelay(1000);
cx_write(MO_SRST_IO, 1); /* Take the cx24116/cx24123 out of reset */
core->dvbdev->ts_gen_cntrl = 0x02; /* Parallel IO */
} else
if (core->dvbdev->frontends.active_fe_id == 2) {
/* DVB-T Enabled */
/* Put the cx24116/cx24123 into reset */
cx_write(MO_SRST_IO, 0);
/* cx22702 out of reset and enable it */
cx_set(MO_GP0_IO, 0x00000080);
cx_clear(MO_GP0_IO, 0x00000004);
core->dvbdev->ts_gen_cntrl = 0x0c; /* Serial IO */
udelay(1000);
}
break;
case CX88_BOARD_HAUPPAUGE_HVR4000: case CX88_BOARD_HAUPPAUGE_HVR4000:
if(core->dvbdev->frontends.active_fe_id == 1) { if(core->dvbdev->frontends.active_fe_id == 1) {
/* DVB-S/S2 Enabled */ /* DVB-S/S2 Enabled */
@ -1225,7 +1196,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
{ {
struct cx88_core *core = drv->core; struct cx88_core *core = drv->core;
struct cx8802_dev *dev = drv->core->dvbdev; struct cx8802_dev *dev = drv->core->dvbdev;
int err,i; int err, i;
struct videobuf_dvb_frontend *fe; struct videobuf_dvb_frontend *fe;
dprintk( 1, "%s\n", __func__); dprintk( 1, "%s\n", __func__);
@ -1267,8 +1238,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
if (err != 0) if (err != 0)
printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n", printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n",
core->name, err); core->name, err);
fail_core:
fail_core:
return err; return err;
} }

View File

@ -495,7 +495,6 @@ void cx88_ir_irq(struct cx88_core *core)
case CX88_BOARD_PINNACLE_PCTV_HD_800i: case CX88_BOARD_PINNACLE_PCTV_HD_800i:
ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7);
ir_dprintk("biphase decoded: %x\n", ircode); ir_dprintk("biphase decoded: %x\n", ircode);
//TODO Darron has other code here
if ((ircode & 0xfffff000) != 0x3000) if ((ircode & 0xfffff000) != 0x3000)
break; break;
ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode); ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode);

View File

@ -537,7 +537,8 @@ static int configure_tda827x_fe(struct saa7134_dev *dev,
{ {
struct videobuf_dvb_frontend *fe0; struct videobuf_dvb_frontend *fe0;
fe0 = videobuf_dvb_get_frontend(&dev->frontends, 0); /* Get the first frontend */
fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
fe0->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap); fe0->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap);
if (fe0->dvb.frontend) { if (fe0->dvb.frontend) {
@ -951,7 +952,7 @@ static int dvb_init(struct saa7134_dev *dev)
struct videobuf_dvb_frontend *fe0; struct videobuf_dvb_frontend *fe0;
/* Get the first frontend */ /* Get the first frontend */
fe0 = videobuf_dvb_get_frontend(&dev->frontends, 0); fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
if (!fe0) if (!fe0)
return -EINVAL; return -EINVAL;
@ -1070,7 +1071,7 @@ static int dvb_init(struct saa7134_dev *dev)
&tda827x_cfg_0) < 0) &tda827x_cfg_0) < 0)
goto dettach_frontend; goto dettach_frontend;
break; break;
case SAA7134_BOARD_FLYDVB_TRIO: // XXXXXX multifrontend case SAA7134_BOARD_FLYDVB_TRIO:
if (!use_frontend) { /* terrestrial */ if (!use_frontend) { /* terrestrial */
if (configure_tda827x_fe(dev, &lifeview_trio_config, if (configure_tda827x_fe(dev, &lifeview_trio_config,
&tda827x_cfg_0) < 0) &tda827x_cfg_0) < 0)

View File

@ -229,7 +229,6 @@ int videobuf_dvb_register_frontend(struct dvb_adapter *adapter, struct videobuf_
dvb->dmxdev.filternum = 256; dvb->dmxdev.filternum = 256;
dvb->dmxdev.demux = &dvb->demux.dmx; dvb->dmxdev.demux = &dvb->demux.dmx;
dvb->dmxdev.capabilities = 0; dvb->dmxdev.capabilities = 0;
//result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter);
result = dvb_dmxdev_init(&dvb->dmxdev, adapter); result = dvb_dmxdev_init(&dvb->dmxdev, adapter);
if (result < 0) { if (result < 0) {
@ -277,7 +276,7 @@ fail_dmx:
dvb_unregister_frontend(dvb->frontend); dvb_unregister_frontend(dvb->frontend);
fail_frontend: fail_frontend:
dvb_frontend_detach(dvb->frontend); dvb_frontend_detach(dvb->frontend);
dvb_unregister_adapter(&dvb->adapter); dvb_unregister_adapter(adapter);
return result; return result;
} }