aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHartmut Hackmann <hartmut.hackmann@t-online.de>2008-04-22 13:42:12 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:44 -0400
commit1b1cee35defe792da9aab2757c28338731c46e84 (patch)
treecf35585c63c55c02941c3e29613f8aa3547fd00f
parent6ab465a821756691009e58a51f1b4543cf1ae21a (diff)
V4L/DVB (7227): saa7134: fixed DVB-S support for Medion/Creatix CTX948
The I2C bus interface of the LNB supply sits behind the i2c gate of the tda10086, so wrappers were necessary for the set_voltage functions. For the time being, the board will show up as MD8800 Many thanks to Hermann Pitton for his help Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c45
-rw-r--r--drivers/media/video/saa7134/saa7134.h4
2 files changed, 47 insertions, 2 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 5d20ec06e48d..180d3193c971 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -846,6 +846,36 @@ static struct tda10086_config flydvbs = {
846 .diseqc_tone = 0, 846 .diseqc_tone = 0,
847}; 847};
848 848
849/* ------------------------------------------------------------------
850 * special case: lnb supply is connected to the gated i2c
851 */
852
853static int md8800_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
854{
855 int res = -EIO;
856 struct saa7134_dev *dev = fe->dvb->priv;
857 if (fe->ops.i2c_gate_ctrl) {
858 fe->ops.i2c_gate_ctrl(fe, 1);
859 if (dev->original_set_voltage)
860 res = dev->original_set_voltage(fe, voltage);
861 fe->ops.i2c_gate_ctrl(fe, 0);
862 }
863 return res;
864};
865
866static int md8800_set_high_voltage(struct dvb_frontend *fe, long arg)
867{
868 int res = -EIO;
869 struct saa7134_dev *dev = fe->dvb->priv;
870 if (fe->ops.i2c_gate_ctrl) {
871 fe->ops.i2c_gate_ctrl(fe, 1);
872 if (dev->original_set_high_voltage)
873 res = dev->original_set_high_voltage(fe, arg);
874 fe->ops.i2c_gate_ctrl(fe, 0);
875 }
876 return res;
877};
878
849/* ================================================================== 879/* ==================================================================
850 * nxt200x based ATSC cards, helper functions 880 * nxt200x based ATSC cards, helper functions
851 */ 881 */
@@ -998,14 +1028,27 @@ static int dvb_init(struct saa7134_dev *dev)
998 dev->dvb.frontend = dvb_attach(tda10086_attach, 1028 dev->dvb.frontend = dvb_attach(tda10086_attach,
999 &flydvbs, &dev->i2c_adap); 1029 &flydvbs, &dev->i2c_adap);
1000 if (dev->dvb.frontend) { 1030 if (dev->dvb.frontend) {
1031 struct dvb_frontend *fe;
1001 if (dvb_attach(tda826x_attach, dev->dvb.frontend, 1032 if (dvb_attach(tda826x_attach, dev->dvb.frontend,
1002 0x60, &dev->i2c_adap, 0) == NULL) 1033 0x60, &dev->i2c_adap, 0) == NULL)
1003 wprintk("%s: Medion Quadro, no tda826x " 1034 wprintk("%s: Medion Quadro, no tda826x "
1004 "found !\n", __FUNCTION__); 1035 "found !\n", __FUNCTION__);
1005 if (dvb_attach(isl6405_attach, dev->dvb.frontend, 1036 /* Note 10.2. Hac
1037 * up to here. configuration for ctx948 and and one branch
1038 * of md8800 should be identical
1039 */
1040 /* we need to open the i2c gate (we know it exists) */
1041 fe = dev->dvb.frontend;
1042 fe->ops.i2c_gate_ctrl(fe, 1);
1043 if (dvb_attach(isl6405_attach, fe,
1006 &dev->i2c_adap, 0x08, 0, 0) == NULL) 1044 &dev->i2c_adap, 0x08, 0, 0) == NULL)
1007 wprintk("%s: Medion Quadro, no ISL6405 " 1045 wprintk("%s: Medion Quadro, no ISL6405 "
1008 "found !\n", __FUNCTION__); 1046 "found !\n", __FUNCTION__);
1047 fe->ops.i2c_gate_ctrl(fe, 0);
1048 dev->original_set_voltage = fe->ops.set_voltage;
1049 fe->ops.set_voltage = md8800_set_voltage;
1050 dev->original_set_high_voltage = fe->ops.enable_high_lnb_voltage;
1051 fe->ops.enable_high_lnb_voltage = md8800_set_high_voltage;
1009 } 1052 }
1010 } 1053 }
1011 break; 1054 break;
diff --git a/drivers/media/video/saa7134/saa7134.h b/drivers/media/video/saa7134/saa7134.h
index 4dc66f4b0e4a..2b7661f58a70 100644
--- a/drivers/media/video/saa7134/saa7134.h
+++ b/drivers/media/video/saa7134/saa7134.h
@@ -557,7 +557,9 @@ struct saa7134_dev {
557#if defined(CONFIG_VIDEO_SAA7134_DVB) || defined(CONFIG_VIDEO_SAA7134_DVB_MODULE) 557#if defined(CONFIG_VIDEO_SAA7134_DVB) || defined(CONFIG_VIDEO_SAA7134_DVB_MODULE)
558 /* SAA7134_MPEG_DVB only */ 558 /* SAA7134_MPEG_DVB only */
559 struct videobuf_dvb dvb; 559 struct videobuf_dvb dvb;
560 int (*original_demod_sleep)(struct dvb_frontend* fe); 560 int (*original_demod_sleep)(struct dvb_frontend *fe);
561 int (*original_set_voltage)(struct dvb_frontend *fe, fe_sec_voltage_t voltage);
562 int (*original_set_high_voltage)(struct dvb_frontend *fe, long arg);
561#endif 563#endif
562}; 564};
563 565