diff options
author | Darron Broad <darron@kewl.org> | 2008-10-11 10:18:53 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-17 16:23:15 -0400 |
commit | 92abe9ee374599179033f039b095864a9cf74593 (patch) | |
tree | 2e4304cac9052a8848b972e678d372bd49d7db29 /drivers | |
parent | 363c35fc448943c3d6121332d28bcda2d2fbf87c (diff) |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/cx23885/cx23885-dvb.c | 8 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-cards.c | 1 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-dvb.c | 38 | ||||
-rw-r--r-- | drivers/media/video/cx88/cx88-input.c | 1 | ||||
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 7 | ||||
-rw-r--r-- | drivers/media/video/videobuf-dvb.c | 3 |
6 files changed, 13 insertions, 45 deletions
diff --git a/drivers/media/video/cx23885/cx23885-dvb.c b/drivers/media/video/cx23885/cx23885-dvb.c index fe1218fd44cb..d8c25a802561 100644 --- a/drivers/media/video/cx23885/cx23885-dvb.c +++ b/drivers/media/video/cx23885/cx23885-dvb.c | |||
@@ -314,7 +314,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
314 | struct cx23885_i2c *i2c_bus = NULL; | 314 | struct cx23885_i2c *i2c_bus = NULL; |
315 | struct videobuf_dvb_frontend *fe0; | 315 | struct videobuf_dvb_frontend *fe0; |
316 | 316 | ||
317 | fe0 = videobuf_dvb_get_frontend(&port->frontends, 0); | 317 | fe0 = videobuf_dvb_get_frontend(&port->frontends, 1); |
318 | if (!fe0) | 318 | if (!fe0) |
319 | return -EINVAL; | 319 | return -EINVAL; |
320 | 320 | ||
@@ -336,7 +336,7 @@ static int dvb_register(struct cx23885_tsport *port) | |||
336 | break; | 336 | break; |
337 | case CX23885_BOARD_HAUPPAUGE_HVR1800: | 337 | case CX23885_BOARD_HAUPPAUGE_HVR1800: |
338 | i2c_bus = &dev->i2c_bus[0]; | 338 | i2c_bus = &dev->i2c_bus[0]; |
339 | switch (alt_tuner) { // XXXXXX multifrontend? | 339 | switch (alt_tuner) { |
340 | case 1: | 340 | case 1: |
341 | fe0->dvb.frontend = | 341 | fe0->dvb.frontend = |
342 | dvb_attach(s5h1409_attach, | 342 | dvb_attach(s5h1409_attach, |
@@ -554,7 +554,7 @@ int cx23885_dvb_register(struct cx23885_tsport *port) | |||
554 | struct cx23885_dev *dev = port->dev; | 554 | struct cx23885_dev *dev = port->dev; |
555 | int err; | 555 | int err; |
556 | 556 | ||
557 | fe0 = videobuf_dvb_get_frontend(&port->frontends, 0); | 557 | fe0 = videobuf_dvb_get_frontend(&port->frontends, 1); |
558 | if (!fe0) | 558 | if (!fe0) |
559 | err = -EINVAL; | 559 | err = -EINVAL; |
560 | 560 | ||
@@ -583,7 +583,7 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port) | |||
583 | { | 583 | { |
584 | struct videobuf_dvb_frontend *fe0; | 584 | struct videobuf_dvb_frontend *fe0; |
585 | 585 | ||
586 | fe0 = videobuf_dvb_get_frontend(&port->frontends, 0); | 586 | fe0 = videobuf_dvb_get_frontend(&port->frontends, 1); |
587 | /* dvb */ | 587 | /* dvb */ |
588 | if(fe0->dvb.frontend) | 588 | if(fe0->dvb.frontend) |
589 | videobuf_dvb_unregister_bus(&port->frontends); | 589 | videobuf_dvb_unregister_bus(&port->frontends); |
diff --git a/drivers/media/video/cx88/cx88-cards.c b/drivers/media/video/cx88/cx88-cards.c index 638d9ec38d7f..402a5db90e44 100644 --- a/drivers/media/video/cx88/cx88-cards.c +++ b/drivers/media/video/cx88/cx88-cards.c | |||
@@ -3004,7 +3004,6 @@ struct cx88_core *cx88_core_create(struct pci_dev *pci, int nr) | |||
3004 | cx88_card_list(core, pci); | 3004 | cx88_card_list(core, pci); |
3005 | } | 3005 | } |
3006 | 3006 | ||
3007 | memset(&core->board, 0, sizeof(core->board)); | ||
3008 | memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board)); | 3007 | memcpy(&core->board, &cx88_boards[core->boardnr], sizeof(core->board)); |
3009 | 3008 | ||
3010 | if (!core->board.num_frontends) | 3009 | if (!core->board.num_frontends) |
diff --git a/drivers/media/video/cx88/cx88-dvb.c b/drivers/media/video/cx88/cx88-dvb.c index 099de66c72c4..58128687e5cc 100644 --- a/drivers/media/video/cx88/cx88-dvb.c +++ b/drivers/media/video/cx88/cx88-dvb.c | |||
@@ -124,7 +124,6 @@ static int cx88_dvb_bus_ctrl(struct dvb_frontend* fe, int acquire) | |||
124 | return -EINVAL; | 124 | return -EINVAL; |
125 | } | 125 | } |
126 | 126 | ||
127 | |||
128 | drv = cx8802_get_driver(dev, CX88_MPEG_DVB); | 127 | drv = cx8802_get_driver(dev, CX88_MPEG_DVB); |
129 | if (drv) { | 128 | if (drv) { |
130 | if (acquire){ | 129 | if (acquire){ |
@@ -502,7 +501,7 @@ static int attach_xc3028(u8 addr, struct cx8802_dev *dev) | |||
502 | .ctrl = &ctl, | 501 | .ctrl = &ctl, |
503 | }; | 502 | }; |
504 | 503 | ||
505 | /* Get the first frontend */ | 504 | /* Get the first frontend */ |
506 | fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1); | 505 | fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1); |
507 | if (!fe0) | 506 | if (!fe0) |
508 | return -EINVAL; | 507 | return -EINVAL; |
@@ -1136,35 +1135,7 @@ static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv) | |||
1136 | udelay(1000); | 1135 | udelay(1000); |
1137 | break; | 1136 | break; |
1138 | 1137 | ||
1139 | case CX88_BOARD_HAUPPAUGE_HVR3000: /* ? */ | 1138 | case CX88_BOARD_HAUPPAUGE_HVR3000: |
1140 | if(core->dvbdev->frontends.active_fe_id == 1) { | ||
1141 | /* DVB-S/S2 Enabled */ | ||
1142 | |||
1143 | /* Toggle reset on cx22702 leaving i2c active */ | ||
1144 | cx_write(MO_GP0_IO, core->board.input[0].gpio0); | ||
1145 | udelay(1000); | ||
1146 | cx_clear(MO_GP0_IO, 0x00000080); | ||
1147 | udelay(50); | ||
1148 | cx_set(MO_GP0_IO, 0x00000080); /* cx22702 out of reset */ | ||
1149 | cx_set(MO_GP0_IO, 0x00000004); /* tri-state the cx22702 pins */ | ||
1150 | udelay(1000); | ||
1151 | |||
1152 | cx_write(MO_SRST_IO, 1); /* Take the cx24116/cx24123 out of reset */ | ||
1153 | core->dvbdev->ts_gen_cntrl = 0x02; /* Parallel IO */ | ||
1154 | } else | ||
1155 | if (core->dvbdev->frontends.active_fe_id == 2) { | ||
1156 | /* DVB-T Enabled */ | ||
1157 | |||
1158 | /* Put the cx24116/cx24123 into reset */ | ||
1159 | cx_write(MO_SRST_IO, 0); | ||
1160 | |||
1161 | /* cx22702 out of reset and enable it */ | ||
1162 | cx_set(MO_GP0_IO, 0x00000080); | ||
1163 | cx_clear(MO_GP0_IO, 0x00000004); | ||
1164 | core->dvbdev->ts_gen_cntrl = 0x0c; /* Serial IO */ | ||
1165 | udelay(1000); | ||
1166 | } | ||
1167 | break; | ||
1168 | case CX88_BOARD_HAUPPAUGE_HVR4000: | 1139 | case CX88_BOARD_HAUPPAUGE_HVR4000: |
1169 | if(core->dvbdev->frontends.active_fe_id == 1) { | 1140 | if(core->dvbdev->frontends.active_fe_id == 1) { |
1170 | /* DVB-S/S2 Enabled */ | 1141 | /* DVB-S/S2 Enabled */ |
@@ -1225,7 +1196,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) | |||
1225 | { | 1196 | { |
1226 | struct cx88_core *core = drv->core; | 1197 | struct cx88_core *core = drv->core; |
1227 | struct cx8802_dev *dev = drv->core->dvbdev; | 1198 | struct cx8802_dev *dev = drv->core->dvbdev; |
1228 | int err,i; | 1199 | int err, i; |
1229 | struct videobuf_dvb_frontend *fe; | 1200 | struct videobuf_dvb_frontend *fe; |
1230 | 1201 | ||
1231 | dprintk( 1, "%s\n", __func__); | 1202 | dprintk( 1, "%s\n", __func__); |
@@ -1267,8 +1238,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv) | |||
1267 | if (err != 0) | 1238 | if (err != 0) |
1268 | printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n", | 1239 | printk(KERN_ERR "%s/2: dvb_register failed (err = %d)\n", |
1269 | core->name, err); | 1240 | core->name, err); |
1270 | 1241 | fail_core: | |
1271 | fail_core: | ||
1272 | return err; | 1242 | return err; |
1273 | } | 1243 | } |
1274 | 1244 | ||
diff --git a/drivers/media/video/cx88/cx88-input.c b/drivers/media/video/cx88/cx88-input.c index 17150cb88c80..8683d104de72 100644 --- a/drivers/media/video/cx88/cx88-input.c +++ b/drivers/media/video/cx88/cx88-input.c | |||
@@ -495,7 +495,6 @@ void cx88_ir_irq(struct cx88_core *core) | |||
495 | case CX88_BOARD_PINNACLE_PCTV_HD_800i: | 495 | case CX88_BOARD_PINNACLE_PCTV_HD_800i: |
496 | ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); | 496 | ircode = ir_decode_biphase(ir->samples, ir->scount, 5, 7); |
497 | ir_dprintk("biphase decoded: %x\n", ircode); | 497 | ir_dprintk("biphase decoded: %x\n", ircode); |
498 | //TODO Darron has other code here | ||
499 | if ((ircode & 0xfffff000) != 0x3000) | 498 | if ((ircode & 0xfffff000) != 0x3000) |
500 | break; | 499 | break; |
501 | ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode); | 500 | ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode); |
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 8ada0497fa03..cdb5f5dfe4d9 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -537,7 +537,8 @@ static int configure_tda827x_fe(struct saa7134_dev *dev, | |||
537 | { | 537 | { |
538 | struct videobuf_dvb_frontend *fe0; | 538 | struct videobuf_dvb_frontend *fe0; |
539 | 539 | ||
540 | fe0 = videobuf_dvb_get_frontend(&dev->frontends, 0); | 540 | /* Get the first frontend */ |
541 | fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1); | ||
541 | 542 | ||
542 | fe0->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap); | 543 | fe0->dvb.frontend = dvb_attach(tda10046_attach, cdec_conf, &dev->i2c_adap); |
543 | if (fe0->dvb.frontend) { | 544 | if (fe0->dvb.frontend) { |
@@ -951,7 +952,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
951 | struct videobuf_dvb_frontend *fe0; | 952 | struct videobuf_dvb_frontend *fe0; |
952 | 953 | ||
953 | /* Get the first frontend */ | 954 | /* Get the first frontend */ |
954 | fe0 = videobuf_dvb_get_frontend(&dev->frontends, 0); | 955 | fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1); |
955 | if (!fe0) | 956 | if (!fe0) |
956 | return -EINVAL; | 957 | return -EINVAL; |
957 | 958 | ||
@@ -1070,7 +1071,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
1070 | &tda827x_cfg_0) < 0) | 1071 | &tda827x_cfg_0) < 0) |
1071 | goto dettach_frontend; | 1072 | goto dettach_frontend; |
1072 | break; | 1073 | break; |
1073 | case SAA7134_BOARD_FLYDVB_TRIO: // XXXXXX multifrontend | 1074 | case SAA7134_BOARD_FLYDVB_TRIO: |
1074 | if (!use_frontend) { /* terrestrial */ | 1075 | if (!use_frontend) { /* terrestrial */ |
1075 | if (configure_tda827x_fe(dev, &lifeview_trio_config, | 1076 | if (configure_tda827x_fe(dev, &lifeview_trio_config, |
1076 | &tda827x_cfg_0) < 0) | 1077 | &tda827x_cfg_0) < 0) |
diff --git a/drivers/media/video/videobuf-dvb.c b/drivers/media/video/videobuf-dvb.c index 194fb765e58b..a0a80e1e79e3 100644 --- a/drivers/media/video/videobuf-dvb.c +++ b/drivers/media/video/videobuf-dvb.c | |||
@@ -229,7 +229,6 @@ int videobuf_dvb_register_frontend(struct dvb_adapter *adapter, struct videobuf_ | |||
229 | dvb->dmxdev.filternum = 256; | 229 | dvb->dmxdev.filternum = 256; |
230 | dvb->dmxdev.demux = &dvb->demux.dmx; | 230 | dvb->dmxdev.demux = &dvb->demux.dmx; |
231 | dvb->dmxdev.capabilities = 0; | 231 | dvb->dmxdev.capabilities = 0; |
232 | //result = dvb_dmxdev_init(&dvb->dmxdev, &dvb->adapter); | ||
233 | result = dvb_dmxdev_init(&dvb->dmxdev, adapter); | 232 | result = dvb_dmxdev_init(&dvb->dmxdev, adapter); |
234 | 233 | ||
235 | if (result < 0) { | 234 | if (result < 0) { |
@@ -277,7 +276,7 @@ fail_dmx: | |||
277 | dvb_unregister_frontend(dvb->frontend); | 276 | dvb_unregister_frontend(dvb->frontend); |
278 | fail_frontend: | 277 | fail_frontend: |
279 | dvb_frontend_detach(dvb->frontend); | 278 | dvb_frontend_detach(dvb->frontend); |
280 | dvb_unregister_adapter(&dvb->adapter); | 279 | dvb_unregister_adapter(adapter); |
281 | 280 | ||
282 | return result; | 281 | return result; |
283 | } | 282 | } |