aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/usb/dvb-usb-v2/lmedm04.c
diff options
context:
space:
mode:
authorMalcolm Priestley <tvboxspy@gmail.com>2012-12-29 05:34:24 -0500
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-01-01 08:05:23 -0500
commit71dc98becc3ddc9775f6e54485929927dd106b6e (patch)
tree2907c5e4f57542ae9faf55f0dabd37b00e41f05b /drivers/media/usb/dvb-usb-v2/lmedm04.c
parente003ae399c160e00c1a882dc6dd4f0ef855ae616 (diff)
[media] lmedm04: correct I2C values to 7 bit addressing
The separation the lmedm04 fails on the ts2020 portion because the correct I2C addressing. So, it's time to correct the addressing in the remainder of lmedm04. Tested all tuners. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/usb/dvb-usb-v2/lmedm04.c')
-rw-r--r--drivers/media/usb/dvb-usb-v2/lmedm04.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/lmedm04.c b/drivers/media/usb/dvb-usb-v2/lmedm04.c
index b5e1f736eb7e..f30c58cecbba 100644
--- a/drivers/media/usb/dvb-usb-v2/lmedm04.c
+++ b/drivers/media/usb/dvb-usb-v2/lmedm04.c
@@ -627,8 +627,8 @@ static int lme2510_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
627 gate = 5; 627 gate = 5;
628 628
629 for (i = 0; i < num; i++) { 629 for (i = 0; i < num; i++) {
630 read_o = 1 & (msg[i].flags & I2C_M_RD); 630 read_o = msg[i].flags & I2C_M_RD;
631 read = i+1 < num && (msg[i+1].flags & I2C_M_RD); 631 read = i + 1 < num && msg[i + 1].flags & I2C_M_RD;
632 read |= read_o; 632 read |= read_o;
633 gate = (msg[i].addr == st->i2c_tuner_addr) 633 gate = (msg[i].addr == st->i2c_tuner_addr)
634 ? (read) ? st->i2c_tuner_gate_r 634 ? (read) ? st->i2c_tuner_gate_r
@@ -641,7 +641,8 @@ static int lme2510_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msg[],
641 else 641 else
642 obuf[1] = msg[i].len + read + 1; 642 obuf[1] = msg[i].len + read + 1;
643 643
644 obuf[2] = msg[i].addr; 644 obuf[2] = msg[i].addr << 1;
645
645 if (read) { 646 if (read) {
646 if (read_o) 647 if (read_o)
647 len = 3; 648 len = 3;
@@ -895,27 +896,27 @@ static int lme2510_kill_urb(struct usb_data_stream *stream)
895} 896}
896 897
897static struct tda10086_config tda10086_config = { 898static struct tda10086_config tda10086_config = {
898 .demod_address = 0x1c, 899 .demod_address = 0x0e,
899 .invert = 0, 900 .invert = 0,
900 .diseqc_tone = 1, 901 .diseqc_tone = 1,
901 .xtal_freq = TDA10086_XTAL_16M, 902 .xtal_freq = TDA10086_XTAL_16M,
902}; 903};
903 904
904static struct stv0288_config lme_config = { 905static struct stv0288_config lme_config = {
905 .demod_address = 0xd0, 906 .demod_address = 0x68,
906 .min_delay_ms = 15, 907 .min_delay_ms = 15,
907 .inittab = s7395_inittab, 908 .inittab = s7395_inittab,
908}; 909};
909 910
910static struct ix2505v_config lme_tuner = { 911static struct ix2505v_config lme_tuner = {
911 .tuner_address = 0xc0, 912 .tuner_address = 0x60,
912 .min_delay_ms = 100, 913 .min_delay_ms = 100,
913 .tuner_gain = 0x0, 914 .tuner_gain = 0x0,
914 .tuner_chargepump = 0x3, 915 .tuner_chargepump = 0x3,
915}; 916};
916 917
917static struct stv0299_config sharp_z0194_config = { 918static struct stv0299_config sharp_z0194_config = {
918 .demod_address = 0xd0, 919 .demod_address = 0x68,
919 .inittab = sharp_z0194a_inittab, 920 .inittab = sharp_z0194a_inittab,
920 .mclk = 88000000UL, 921 .mclk = 88000000UL,
921 .invert = 0, 922 .invert = 0,
@@ -944,7 +945,7 @@ static int dm04_rs2000_set_ts_param(struct dvb_frontend *fe,
944} 945}
945 946
946static struct m88rs2000_config m88rs2000_config = { 947static struct m88rs2000_config m88rs2000_config = {
947 .demod_addr = 0xd0, 948 .demod_addr = 0x68,
948 .set_ts_params = dm04_rs2000_set_ts_param, 949 .set_ts_params = dm04_rs2000_set_ts_param,
949}; 950};
950 951
@@ -1054,7 +1055,7 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
1054 info("TUN Found Frontend TDA10086"); 1055 info("TUN Found Frontend TDA10086");
1055 st->i2c_tuner_gate_w = 4; 1056 st->i2c_tuner_gate_w = 4;
1056 st->i2c_tuner_gate_r = 4; 1057 st->i2c_tuner_gate_r = 4;
1057 st->i2c_tuner_addr = 0xc0; 1058 st->i2c_tuner_addr = 0x60;
1058 st->tuner_config = TUNER_LG; 1059 st->tuner_config = TUNER_LG;
1059 if (st->dvb_usb_lme2510_firmware != TUNER_LG) { 1060 if (st->dvb_usb_lme2510_firmware != TUNER_LG) {
1060 st->dvb_usb_lme2510_firmware = TUNER_LG; 1061 st->dvb_usb_lme2510_firmware = TUNER_LG;
@@ -1070,7 +1071,7 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
1070 info("FE Found Stv0299"); 1071 info("FE Found Stv0299");
1071 st->i2c_tuner_gate_w = 4; 1072 st->i2c_tuner_gate_w = 4;
1072 st->i2c_tuner_gate_r = 5; 1073 st->i2c_tuner_gate_r = 5;
1073 st->i2c_tuner_addr = 0xc0; 1074 st->i2c_tuner_addr = 0x60;
1074 st->tuner_config = TUNER_S0194; 1075 st->tuner_config = TUNER_S0194;
1075 if (st->dvb_usb_lme2510_firmware != TUNER_S0194) { 1076 if (st->dvb_usb_lme2510_firmware != TUNER_S0194) {
1076 st->dvb_usb_lme2510_firmware = TUNER_S0194; 1077 st->dvb_usb_lme2510_firmware = TUNER_S0194;
@@ -1087,7 +1088,7 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
1087 info("FE Found Stv0288"); 1088 info("FE Found Stv0288");
1088 st->i2c_tuner_gate_w = 4; 1089 st->i2c_tuner_gate_w = 4;
1089 st->i2c_tuner_gate_r = 5; 1090 st->i2c_tuner_gate_r = 5;
1090 st->i2c_tuner_addr = 0xc0; 1091 st->i2c_tuner_addr = 0x60;
1091 st->tuner_config = TUNER_S7395; 1092 st->tuner_config = TUNER_S7395;
1092 if (st->dvb_usb_lme2510_firmware != TUNER_S7395) { 1093 if (st->dvb_usb_lme2510_firmware != TUNER_S7395) {
1093 st->dvb_usb_lme2510_firmware = TUNER_S7395; 1094 st->dvb_usb_lme2510_firmware = TUNER_S7395;
@@ -1106,7 +1107,7 @@ static int dm04_lme2510_frontend_attach(struct dvb_usb_adapter *adap)
1106 &d->i2c_adap); 1107 &d->i2c_adap);
1107 st->i2c_tuner_gate_w = 5; 1108 st->i2c_tuner_gate_w = 5;
1108 st->i2c_tuner_gate_r = 5; 1109 st->i2c_tuner_gate_r = 5;
1109 st->i2c_tuner_addr = 0xc0; 1110 st->i2c_tuner_addr = 0x60;
1110 st->tuner_config = TUNER_RS2000; 1111 st->tuner_config = TUNER_RS2000;
1111 st->fe_set_voltage = 1112 st->fe_set_voltage =
1112 adap->fe[0]->ops.set_voltage; 1113 adap->fe[0]->ops.set_voltage;
@@ -1151,7 +1152,7 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap)
1151 1152
1152 switch (st->tuner_config) { 1153 switch (st->tuner_config) {
1153 case TUNER_LG: 1154 case TUNER_LG:
1154 if (dvb_attach(tda826x_attach, adap->fe[0], 0xc0, 1155 if (dvb_attach(tda826x_attach, adap->fe[0], 0x60,
1155 &d->i2c_adap, 1)) 1156 &d->i2c_adap, 1))
1156 ret = st->tuner_config; 1157 ret = st->tuner_config;
1157 break; 1158 break;
@@ -1161,7 +1162,7 @@ static int dm04_lme2510_tuner(struct dvb_usb_adapter *adap)
1161 ret = st->tuner_config; 1162 ret = st->tuner_config;
1162 break; 1163 break;
1163 case TUNER_S0194: 1164 case TUNER_S0194:
1164 if (dvb_attach(dvb_pll_attach , adap->fe[0], 0xc0, 1165 if (dvb_attach(dvb_pll_attach , adap->fe[0], 0x60,
1165 &d->i2c_adap, DVB_PLL_OPERA1)) 1166 &d->i2c_adap, DVB_PLL_OPERA1))
1166 ret = st->tuner_config; 1167 ret = st->tuner_config;
1167 break; 1168 break;