aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@redhat.com>2011-07-14 21:23:18 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-07-27 16:56:03 -0400
commitc4c3a3d32a2eac18dba04683bb5b7357402405c7 (patch)
tree893f38e92aaabfd5086f7d0867fe35af3cddf3f9 /drivers/media/video/em28xx
parent33ba28eebc3e1758e6adc1fcec9e1e3151bac453 (diff)
[media] Remove the double symbol increment hack from drxk_hard
Both ngene and ddbrige calls dvb_attach once for drxk_attach. The logic used there, and by tda18271c2dd driver is different from similar logic on other frontends. The right fix is to change them to use the same logic, but, while we don't do that, we need to patch em28xx-dvb in order to do cope with ngene/ddbridge magic. While here, document why drxk_t_release should do nothing. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-dvb.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/drivers/media/video/em28xx/em28xx-dvb.c b/drivers/media/video/em28xx/em28xx-dvb.c
index f8617d27ab88..ab8a740bc68c 100644
--- a/drivers/media/video/em28xx/em28xx-dvb.c
+++ b/drivers/media/video/em28xx/em28xx-dvb.c
@@ -76,9 +76,10 @@ struct em28xx_dvb {
76 struct dmx_frontend fe_mem; 76 struct dmx_frontend fe_mem;
77 struct dvb_net net; 77 struct dvb_net net;
78 78
79 /* Due to DRX-D - probably need changes */ 79 /* Due to DRX-K - probably need changes */
80 int (*gate_ctrl)(struct dvb_frontend *, int); 80 int (*gate_ctrl)(struct dvb_frontend *, int);
81 struct semaphore pll_mutex; 81 struct semaphore pll_mutex;
82 bool dont_attach_fe1;
82}; 83};
83 84
84 85
@@ -595,7 +596,7 @@ static void unregister_dvb(struct em28xx_dvb *dvb)
595 if (dvb->fe[1]) 596 if (dvb->fe[1])
596 dvb_unregister_frontend(dvb->fe[1]); 597 dvb_unregister_frontend(dvb->fe[1]);
597 dvb_unregister_frontend(dvb->fe[0]); 598 dvb_unregister_frontend(dvb->fe[0]);
598 if (dvb->fe[1]) 599 if (dvb->fe[1] && !dvb->dont_attach_fe1)
599 dvb_frontend_detach(dvb->fe[1]); 600 dvb_frontend_detach(dvb->fe[1]);
600 dvb_frontend_detach(dvb->fe[0]); 601 dvb_frontend_detach(dvb->fe[0]);
601 dvb_unregister_adapter(&dvb->adapter); 602 dvb_unregister_adapter(&dvb->adapter);
@@ -771,21 +772,22 @@ static int dvb_init(struct em28xx *dev)
771 case EM2884_BOARD_TERRATEC_H5: 772 case EM2884_BOARD_TERRATEC_H5:
772 terratec_h5_init(dev); 773 terratec_h5_init(dev);
773 774
774 /* dvb->fe[1] will be DVB-C, and dvb->fe[0] will be DVB-T */ 775 dvb->dont_attach_fe1 = 1;
776
775 dvb->fe[0] = dvb_attach(drxk_attach, &terratec_h5_drxk, &dev->i2c_adap, &dvb->fe[1]); 777 dvb->fe[0] = dvb_attach(drxk_attach, &terratec_h5_drxk, &dev->i2c_adap, &dvb->fe[1]);
776 if (!dvb->fe[0] || !dvb->fe[1]) { 778 if (!dvb->fe[0]) {
777 result = -EINVAL; 779 result = -EINVAL;
778 goto out_free; 780 goto out_free;
779 } 781 }
782
780 /* FIXME: do we need a pll semaphore? */ 783 /* FIXME: do we need a pll semaphore? */
781 dvb->fe[0]->sec_priv = dvb; 784 dvb->fe[0]->sec_priv = dvb;
782 sema_init(&dvb->pll_mutex, 1); 785 sema_init(&dvb->pll_mutex, 1);
783 dvb->gate_ctrl = dvb->fe[0]->ops.i2c_gate_ctrl; 786 dvb->gate_ctrl = dvb->fe[0]->ops.i2c_gate_ctrl;
784 dvb->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl; 787 dvb->fe[0]->ops.i2c_gate_ctrl = drxk_gate_ctrl;
785 dvb->fe[1]->ops.i2c_gate_ctrl = drxk_gate_ctrl;
786 dvb->fe[1]->id = 1; 788 dvb->fe[1]->id = 1;
787 789
788 /* Attach tda18271 */ 790 /* Attach tda18271 to DVB-C frontend */
789 if (dvb->fe[0]->ops.i2c_gate_ctrl) 791 if (dvb->fe[0]->ops.i2c_gate_ctrl)
790 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 1); 792 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 1);
791 if (!dvb_attach(tda18271c2dd_attach, dvb->fe[0], &dev->i2c_adap, 0x60)) { 793 if (!dvb_attach(tda18271c2dd_attach, dvb->fe[0], &dev->i2c_adap, 0x60)) {
@@ -794,8 +796,12 @@ static int dvb_init(struct em28xx *dev)
794 } 796 }
795 if (dvb->fe[0]->ops.i2c_gate_ctrl) 797 if (dvb->fe[0]->ops.i2c_gate_ctrl)
796 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 0); 798 dvb->fe[0]->ops.i2c_gate_ctrl(dvb->fe[0], 0);
797 if (dvb->fe[1]->ops.i2c_gate_ctrl) 799
798 dvb->fe[1]->ops.i2c_gate_ctrl(dvb->fe[1], 1); 800 /* Hack - needed by drxk/tda18271c2dd */
801 dvb->fe[1]->tuner_priv = dvb->fe[0]->tuner_priv;
802 memcpy(&dvb->fe[1]->ops.tuner_ops,
803 &dvb->fe[0]->ops.tuner_ops,
804 sizeof(dvb->fe[0]->ops.tuner_ops));
799 805
800 break; 806 break;
801 default: 807 default: