V4L/DVB (4702): Fix: set antenna input for DVB-T for Asus P7131 Dual hybrid

This patch forces the correct antenna input input in DVB-T
mode for this card.

Signed-off-by: Hermann Pitton <hermann-pitton@arcor.de>
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t-online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>

authored by Hermann Pitton and committed by Mauro Carvalho Chehab 6b14ff9e 17b10a73

+30 -2
+30 -2
drivers/media/video/saa7134/saa7134-dvb.c
··· 874 874 875 875 /* ------------------------------------------------------------------ */ 876 876 877 + static int asus_p7131_dual_tuner_init(struct dvb_frontend *fe) 878 + { 879 + struct saa7134_dev *dev = fe->dvb->priv; 880 + static u8 data[] = { 0x3c, 0x33, 0x6a}; 881 + struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; 882 + 883 + if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) 884 + return -EIO; 885 + /* make sure the DVB-T antenna input is set */ 886 + saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000); 887 + return 0; 888 + } 889 + 890 + static int asus_p7131_dual_tuner_sleep(struct dvb_frontend *fe) 891 + { 892 + struct saa7134_dev *dev = fe->dvb->priv; 893 + static u8 data[] = { 0x3c, 0x33, 0x68}; 894 + struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; 895 + 896 + i2c_transfer(&dev->i2c_adap, &msg, 1); 897 + philips_tda827xa_tuner_sleep( 0x61, fe); 898 + /* reset antenna inputs for analog usage */ 899 + saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x0200000); 900 + return 0; 901 + } 902 + 903 + /* ------------------------------------------------------------------ */ 904 + 877 905 static int lifeview_trio_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) 878 906 { 879 907 int ret; ··· 1176 1148 &philips_tiger_config, 1177 1149 &dev->i2c_adap); 1178 1150 if (dev->dvb.frontend) { 1179 - dev->dvb.frontend->ops.tuner_ops.init = philips_tiger_tuner_init; 1180 - dev->dvb.frontend->ops.tuner_ops.sleep = philips_tiger_tuner_sleep; 1151 + dev->dvb.frontend->ops.tuner_ops.init = asus_p7131_dual_tuner_init; 1152 + dev->dvb.frontend->ops.tuner_ops.sleep = asus_p7131_dual_tuner_sleep; 1181 1153 dev->dvb.frontend->ops.tuner_ops.set_params = philips_tiger_tuner_set_params; 1182 1154 } 1183 1155 break;