]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/media/video/cx88/cx88-dvb.c
Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-leds
[linux-2.6-omap-h63xx.git] / drivers / media / video / cx88 / cx88-dvb.c
index 9bb7bee0da6d8b90c2a2385af86036da81b9260c..cf6c30d4e545e5dcc6d7c02013738b51544a0b9a 100644 (file)
@@ -120,7 +120,7 @@ static int cx88_dvb_bus_ctrl(struct dvb_frontend* fe, int acquire)
 
        fe_id = videobuf_dvb_find_frontend(&dev->frontends, fe);
        if (!fe_id) {
-               printk(KERN_ERR "%s() No frontend found\n", __FUNCTION__);
+               printk(KERN_ERR "%s() No frontend found\n", __func__);
                return -EINVAL;
        }
 
@@ -575,14 +575,14 @@ static struct cx24116_config tevii_s460_config = {
 
 static struct stv0299_config tevii_tuner_sharp_config = {
        .demod_address = 0x68,
-       .inittab = sharp_z0194a__inittab,
+       .inittab = sharp_z0194a_inittab,
        .mclk = 88000000UL,
        .invert = 1,
        .skip_reinit = 0,
        .lock_output = 1,
        .volt13_op0_op1 = STV0299_VOLT13_OP1,
        .min_delay_ms = 100,
-       .set_symbol_rate = sharp_z0194a__set_symbol_rate,
+       .set_symbol_rate = sharp_z0194a_set_symbol_rate,
        .set_ts_params = cx24116_set_ts_param,
 };
 
@@ -594,14 +594,9 @@ static struct stv0288_config tevii_tuner_earda_config = {
 
 static int dvb_register(struct cx8802_dev *dev)
 {
-       //struct cx88_core *core = dev->core;
-
-       ///* init struct videobuf_dvb */
-       //fe->dvb.name = core->name;
-       //dev->ts_gen_cntrl = 0x0c;
-
        struct cx88_core *core = dev->core;
        struct videobuf_dvb_frontend *fe0, *fe1 = NULL;
+       int mfe_shared = 0; /* bus not shared by default */
 
        /* Get the first frontend */
        fe0 = videobuf_dvb_get_frontend(&dev->frontends, 1);
@@ -660,15 +655,16 @@ static int dvb_register(struct cx8802_dev *dev)
                if (fe0->dvb.frontend) {
                        if (!dvb_attach(isl6421_attach, fe0->dvb.frontend,
                        &dev->core->i2c_adap, 0x08, ISL6421_DCL, 0x00)) {
-                               dprintk( 1, "%s(): HVR3000 - DVB-S LNB Init: failed\n", __FUNCTION__);
+                               dprintk( 1, "%s(): HVR3000 - DVB-S LNB Init: failed\n", __func__);
                        }
                } else {
-                       dprintk( 1, "%s(): HVR3000 - DVB-S Init: failed\n", __FUNCTION__);
+                       dprintk( 1, "%s(): HVR3000 - DVB-S Init: failed\n", __func__);
                }
                /* DVB-T init */
                fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
                if (fe1) {
                        dev->frontends.gate = 2;
+                       mfe_shared = 1;
                        fe1->dvb.frontend = dvb_attach(cx22702_attach,
                                &hauppauge_hvr_config,
                                &dev->core->i2c_adap);
@@ -677,13 +673,13 @@ static int dvb_register(struct cx8802_dev *dev)
                                if(!dvb_attach(simple_tuner_attach, fe1->dvb.frontend,
                                                &dev->core->i2c_adap, 0x61,
                                                TUNER_PHILIPS_FMD1216ME_MK3)) {
-                                       dprintk( 1, "%s(): HVR3000 - DVB-T misc Init: failed\n", __FUNCTION__);
+                                       dprintk( 1, "%s(): HVR3000 - DVB-T misc Init: failed\n", __func__);
                                }
                        } else {
-                               dprintk( 1, "%s(): HVR3000 - DVB-T Init: failed\n", __FUNCTION__);
+                               dprintk( 1, "%s(): HVR3000 - DVB-T Init: failed\n", __func__);
                        }
                } else {
-                       dprintk( 1, "%s(): HVR3000 - DVB-T Init: can't find frontend 2.\n", __FUNCTION__);
+                       dprintk( 1, "%s(): HVR3000 - DVB-T Init: can't find frontend 2.\n", __func__);
                }
                break;
        case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS:
@@ -793,7 +789,7 @@ static int dvb_register(struct cx8802_dev *dev)
                if (fe0->dvb.frontend)
                        fe0->dvb.frontend->ops.i2c_gate_ctrl = NULL;
                if (attach_xc3028(0x61, dev) < 0)
-                       return -EINVAL;
+                       goto frontend_detach;
                break;
        case CX88_BOARD_PCHDTV_HD3000:
                fe0->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000,
@@ -1004,15 +1000,16 @@ static int dvb_register(struct cx8802_dev *dev)
                if (fe0->dvb.frontend) {
                        if(!dvb_attach(isl6421_attach, fe0->dvb.frontend,
                                &dev->core->i2c_adap, 0x08, ISL6421_DCL, 0x00)) {
-                               dprintk( 1, "%s(): HVR4000 - DVB-S LNB Init: failed\n", __FUNCTION__);
+                               dprintk( 1, "%s(): HVR4000 - DVB-S LNB Init: failed\n", __func__);
                        }
                } else {
-                       dprintk( 1, "%s(): HVR4000 - DVB-S Init: failed\n", __FUNCTION__);
+                       dprintk( 1, "%s(): HVR4000 - DVB-S Init: failed\n", __func__);
                }
                /* DVB-T Init */
                fe1 = videobuf_dvb_get_frontend(&dev->frontends, 2);
                if (fe1) {
                        dev->frontends.gate = 2;
+                       mfe_shared = 1;
                        fe1->dvb.frontend = dvb_attach(cx22702_attach,
                                &hauppauge_hvr_config,
                                &dev->core->i2c_adap);
@@ -1021,13 +1018,13 @@ static int dvb_register(struct cx8802_dev *dev)
                                if(!dvb_attach(simple_tuner_attach, fe1->dvb.frontend,
                                        &dev->core->i2c_adap, 0x61,
                                        TUNER_PHILIPS_FMD1216ME_MK3)) {
-                                       dprintk( 1, "%s(): HVR4000 - DVB-T misc Init: failed\n", __FUNCTION__);
+                                       dprintk( 1, "%s(): HVR4000 - DVB-T misc Init: failed\n", __func__);
                                }
                        } else {
-                               dprintk( 1, "%s(): HVR4000 - DVB-T Init: failed\n", __FUNCTION__);
+                               dprintk( 1, "%s(): HVR4000 - DVB-T Init: failed\n", __func__);
                        }
                } else {
-                       dprintk( 1, "%s(): HVR4000 - DVB-T Init: can't find frontend 2.\n", __FUNCTION__);
+                       dprintk( 1, "%s(): HVR4000 - DVB-T Init: can't find frontend 2.\n", __func__);
                }
                break;
        case CX88_BOARD_HAUPPAUGE_HVR4000LITE:
@@ -1061,7 +1058,6 @@ static int dvb_register(struct cx8802_dev *dev)
                                        goto frontend_detach;
                                core->prev_set_voltage = fe0->dvb.frontend->ops.set_voltage;
                                fe0->dvb.frontend->ops.set_voltage = tevii_dvbs_set_voltage;
-
                        }
                }
                break;
@@ -1110,13 +1106,10 @@ static int dvb_register(struct cx8802_dev *dev)
 
        /* register everything */
        return videobuf_dvb_register_bus(&dev->frontends, THIS_MODULE, dev,
-               &dev->pci->dev, adapter_nr);
+               &dev->pci->dev, adapter_nr, mfe_shared);
 
 frontend_detach:
-       if (fe0->dvb.frontend) {
-               dvb_frontend_detach(fe0->dvb.frontend);
-               fe0->dvb.frontend = NULL;
-       }
+       videobuf_dvb_dealloc_frontends(&dev->frontends);
        return -EINVAL;
 }
 
@@ -1227,7 +1220,7 @@ static int cx8802_dvb_probe(struct cx8802_driver *drv)
        for (i = 1; i <= core->board.num_frontends; i++) {
                fe = videobuf_dvb_get_frontend(&core->dvbdev->frontends, i);
                if (!fe) {
-                       printk(KERN_ERR "%s() failed to get frontend(%d)\n", __FUNCTION__, i);
+                       printk(KERN_ERR "%s() failed to get frontend(%d)\n", __func__, i);
                        continue;
                }
                videobuf_queue_sg_init(&fe->dvb.dvbq, &dvb_qops,
@@ -1249,8 +1242,11 @@ fail_core:
 
 static int cx8802_dvb_remove(struct cx8802_driver *drv)
 {
+       struct cx88_core *core = drv->core;
        struct cx8802_dev *dev = drv->core->dvbdev;
 
+       dprintk( 1, "%s\n", __func__);
+
        videobuf_dvb_unregister_bus(&dev->frontends);
 
        vp3054_i2c_remove(dev);