aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-dvb.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-dvb.c60
1 files changed, 46 insertions, 14 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c
index 6b61d9b2fcb5..88e4b0f16da9 100644
--- a/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/drivers/media/video/saa7134/saa7134-dvb.c
@@ -293,7 +293,7 @@ static int philips_tu1216_tuner_60_set_params(struct dvb_frontend *fe, struct dv
293 return philips_tda6651_pll_set(0x60, fe, params); 293 return philips_tda6651_pll_set(0x60, fe, params);
294} 294}
295 295
296static int philips_tu1216_request_firmware(struct dvb_frontend *fe, 296static int philips_tda1004x_request_firmware(struct dvb_frontend *fe,
297 const struct firmware **fw, char *name) 297 const struct firmware **fw, char *name)
298{ 298{
299 struct saa7134_dev *dev = fe->dvb->priv; 299 struct saa7134_dev *dev = fe->dvb->priv;
@@ -308,7 +308,7 @@ static struct tda1004x_config philips_tu1216_60_config = {
308 .xtal_freq = TDA10046_XTAL_4M, 308 .xtal_freq = TDA10046_XTAL_4M,
309 .agc_config = TDA10046_AGC_DEFAULT, 309 .agc_config = TDA10046_AGC_DEFAULT,
310 .if_freq = TDA10046_FREQ_3617, 310 .if_freq = TDA10046_FREQ_3617,
311 .request_firmware = philips_tu1216_request_firmware, 311 .request_firmware = philips_tda1004x_request_firmware,
312}; 312};
313 313
314/* ------------------------------------------------------------------ */ 314/* ------------------------------------------------------------------ */
@@ -331,7 +331,7 @@ static struct tda1004x_config philips_tu1216_61_config = {
331 .xtal_freq = TDA10046_XTAL_4M, 331 .xtal_freq = TDA10046_XTAL_4M,
332 .agc_config = TDA10046_AGC_DEFAULT, 332 .agc_config = TDA10046_AGC_DEFAULT,
333 .if_freq = TDA10046_FREQ_3617, 333 .if_freq = TDA10046_FREQ_3617,
334 .request_firmware = philips_tu1216_request_firmware, 334 .request_firmware = philips_tda1004x_request_firmware,
335}; 335};
336 336
337/* ------------------------------------------------------------------ */ 337/* ------------------------------------------------------------------ */
@@ -812,32 +812,40 @@ static int philips_tda827xa_tuner_sleep(u8 addr, struct dvb_frontend *fe)
812 if (fe->ops.i2c_gate_ctrl) 812 if (fe->ops.i2c_gate_ctrl)
813 fe->ops.i2c_gate_ctrl(fe, 1); 813 fe->ops.i2c_gate_ctrl(fe, 1);
814 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); 814 i2c_transfer(&dev->i2c_adap, &tuner_msg, 1);
815 if (fe->ops.i2c_gate_ctrl)
816 fe->ops.i2c_gate_ctrl(fe, 0);
815 return 0; 817 return 0;
816} 818}
817 819
818/* ------------------------------------------------------------------ */ 820/* ------------------------------------------------------------------ */
819 821
820static int philips_tiger_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 822static int tda8290_i2c_gate_ctrl(struct dvb_frontend* fe, int enable)
821{ 823{
822 int ret;
823 struct saa7134_dev *dev = fe->dvb->priv; 824 struct saa7134_dev *dev = fe->dvb->priv;
824 static u8 tda8290_close[] = { 0x21, 0xc0}; 825 static u8 tda8290_close[] = { 0x21, 0xc0};
825 static u8 tda8290_open[] = { 0x21, 0x80}; 826 static u8 tda8290_open[] = { 0x21, 0x80};
826 struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2}; 827 struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2};
827 828 if (enable) {
828 /* close tda8290 i2c bridge */ 829 tda8290_msg.buf = tda8290_close;
829 tda8290_msg.buf = tda8290_close; 830 } else {
830 ret = i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1); 831 tda8290_msg.buf = tda8290_open;
831 if (ret != 1) 832 }
833 if (i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1) != 1)
832 return -EIO; 834 return -EIO;
833 msleep(20); 835 msleep(20);
836 return 0;
837}
838
839/* ------------------------------------------------------------------ */
840
841static int philips_tiger_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params)
842{
843 int ret;
844
834 ret = philips_tda827xa_pll_set(0x61, fe, params); 845 ret = philips_tda827xa_pll_set(0x61, fe, params);
835 if (ret != 0) 846 if (ret != 0)
836 return ret; 847 return ret;
837 /* open tda8290 i2c bridge */ 848 return 0;
838 tda8290_msg.buf = tda8290_open;
839 i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1);
840 return ret;
841} 849}
842 850
843static int philips_tiger_tuner_init(struct dvb_frontend *fe) 851static int philips_tiger_tuner_init(struct dvb_frontend *fe)
@@ -874,6 +882,18 @@ static struct tda1004x_config philips_tiger_config = {
874 882
875/* ------------------------------------------------------------------ */ 883/* ------------------------------------------------------------------ */
876 884
885static struct tda1004x_config pinnacle_pctv_310i_config = {
886 .demod_address = 0x08,
887 .invert = 1,
888 .invert_oclk = 0,
889 .xtal_freq = TDA10046_XTAL_16M,
890 .agc_config = TDA10046_AGC_TDA827X,
891 .if_freq = TDA10046_FREQ_045,
892 .request_firmware = philips_tda1004x_request_firmware,
893};
894
895/* ------------------------------------------------------------------ */
896
877static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe) 897static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe)
878{ 898{
879 struct saa7134_dev *dev = fe->dvb->priv; 899 struct saa7134_dev *dev = fe->dvb->priv;
@@ -1168,6 +1188,18 @@ static int dvb_init(struct saa7134_dev *dev)
1168 &philips_tiger_config, 1188 &philips_tiger_config,
1169 &dev->i2c_adap); 1189 &dev->i2c_adap);
1170 if (dev->dvb.frontend) { 1190 if (dev->dvb.frontend) {
1191 dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
1192 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
1193 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep;
1194 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;
1195 }
1196 break;
1197 case SAA7134_BOARD_PINNACLE_PCTV_310i:
1198 dev->dvb.frontend = dvb_attach(tda10046_attach,
1199 &pinnacle_pctv_310i_config,
1200 &dev->i2c_adap);
1201 if (dev->dvb.frontend) {
1202 dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl;
1171 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init; 1203 dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init;
1172 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep; 1204 dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep;
1173 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params; 1205 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params;