if (ret < 0)
goto err;
- if (tmp) {
- addr = EEPROM_BASE_IT9135;
- } else {
+ if (tmp == 0x00) {
dev_dbg(&d->udev->dev, "%s: no eeprom\n", __func__);
goto skip_eeprom;
}
- } else {
- addr = EEPROM_BASE_AF9035;
}
/* check if there is dual tuners */
- ret = af9035_rd_reg(d, addr + EEPROM_DUAL_MODE, &tmp);
+ ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_DUAL_MODE, &tmp);
if (ret < 0)
goto err;
if (state->dual_mode) {
/* read 2nd demodulator I2C address */
- ret = af9035_rd_reg(d, addr + EEPROM_2ND_DEMOD_ADDR, &tmp);
+ ret = af9035_rd_reg(d,
+ state->eeprom_addr + EEPROM_2ND_DEMOD_ADDR,
+ &tmp);
if (ret < 0)
goto err;
__func__, tmp);
}
+ addr = state->eeprom_addr;
+
for (i = 0; i < state->dual_mode + 1; i++) {
/* tuner */
ret = af9035_rd_reg(d, addr + EEPROM_1_TUNER_ID, &tmp);
if (state->chip_type == 0x9135)
return 0;
- ret = af9035_rd_reg(d, EEPROM_BASE_AF9035 + EEPROM_IR_MODE, &tmp);
+ ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_IR_MODE, &tmp);
if (ret < 0)
goto err;
/* don't activate rc if in HID mode or if not available */
if (tmp == 5) {
- ret = af9035_rd_reg(d, EEPROM_BASE_AF9035 + EEPROM_IR_TYPE,
+ ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_IR_TYPE,
&tmp);
if (ret < 0)
goto err;