aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index 75d99aec10b6..1ccc9ce02d8c 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -606,18 +606,14 @@ static int af9035_read_config(struct dvb_usb_device *d)
606 if (ret < 0) 606 if (ret < 0)
607 goto err; 607 goto err;
608 608
609 if (tmp) { 609 if (tmp == 0x00) {
610 addr = EEPROM_BASE_IT9135;
611 } else {
612 dev_dbg(&d->udev->dev, "%s: no eeprom\n", __func__); 610 dev_dbg(&d->udev->dev, "%s: no eeprom\n", __func__);
613 goto skip_eeprom; 611 goto skip_eeprom;
614 } 612 }
615 } else {
616 addr = EEPROM_BASE_AF9035;
617 } 613 }
618 614
619 /* check if there is dual tuners */ 615 /* check if there is dual tuners */
620 ret = af9035_rd_reg(d, addr + EEPROM_DUAL_MODE, &tmp); 616 ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_DUAL_MODE, &tmp);
621 if (ret < 0) 617 if (ret < 0)
622 goto err; 618 goto err;
623 619
@@ -627,7 +623,9 @@ static int af9035_read_config(struct dvb_usb_device *d)
627 623
628 if (state->dual_mode) { 624 if (state->dual_mode) {
629 /* read 2nd demodulator I2C address */ 625 /* read 2nd demodulator I2C address */
630 ret = af9035_rd_reg(d, addr + EEPROM_2ND_DEMOD_ADDR, &tmp); 626 ret = af9035_rd_reg(d,
627 state->eeprom_addr + EEPROM_2ND_DEMOD_ADDR,
628 &tmp);
631 if (ret < 0) 629 if (ret < 0)
632 goto err; 630 goto err;
633 631
@@ -636,6 +634,8 @@ static int af9035_read_config(struct dvb_usb_device *d)
636 __func__, tmp); 634 __func__, tmp);
637 } 635 }
638 636
637 addr = state->eeprom_addr;
638
639 for (i = 0; i < state->dual_mode + 1; i++) { 639 for (i = 0; i < state->dual_mode + 1; i++) {
640 /* tuner */ 640 /* tuner */
641 ret = af9035_rd_reg(d, addr + EEPROM_1_TUNER_ID, &tmp); 641 ret = af9035_rd_reg(d, addr + EEPROM_1_TUNER_ID, &tmp);
@@ -1258,7 +1258,7 @@ static int af9035_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc)
1258 if (state->chip_type == 0x9135) 1258 if (state->chip_type == 0x9135)
1259 return 0; 1259 return 0;
1260 1260
1261 ret = af9035_rd_reg(d, EEPROM_BASE_AF9035 + EEPROM_IR_MODE, &tmp); 1261 ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_IR_MODE, &tmp);
1262 if (ret < 0) 1262 if (ret < 0)
1263 goto err; 1263 goto err;
1264 1264
@@ -1266,7 +1266,7 @@ static int af9035_get_rc_config(struct dvb_usb_device *d, struct dvb_usb_rc *rc)
1266 1266
1267 /* don't activate rc if in HID mode or if not available */ 1267 /* don't activate rc if in HID mode or if not available */
1268 if (tmp == 5) { 1268 if (tmp == 5) {
1269 ret = af9035_rd_reg(d, EEPROM_BASE_AF9035 + EEPROM_IR_TYPE, 1269 ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_IR_TYPE,
1270 &tmp); 1270 &tmp);
1271 if (ret < 0) 1271 if (ret < 0)
1272 goto err; 1272 goto err;