summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntti Palosaari <crope@iki.fi>2014-02-12 18:50:17 (GMT)
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-02-24 13:45:39 (GMT)
commit14992f0185ab8efd513d71e5a546090c2d41ffd4 (patch)
tree2ae1d87b61cfe97cbeca68583d9794152df791b9
parent37973e01d1c3ddd69982907c68312bb314d2398f (diff)
downloadlinux-14992f0185ab8efd513d71e5a546090c2d41ffd4.tar.xz
[media] af9035: use default i2c slave address for af9035 too
Some device vendors has forgotten set correct slave demod I2C address to eeprom. Use default I2C address when eeprom has no address at all. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/dvb-usb-v2/af9035.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c
index 49e8360..1434d37 100644
--- a/drivers/media/usb/dvb-usb-v2/af9035.c
+++ b/drivers/media/usb/dvb-usb-v2/af9035.c
@@ -575,11 +575,11 @@ static int af9035_download_firmware(struct dvb_usb_device *d,
if (ret < 0)
goto err;
- if (state->chip_type == 0x9135) {
- if (!tmp)
- /* default 0x9135 slave I2C address */
- tmp = 0x3a;
+ /* use default I2C address if eeprom has no address set */
+ if (!tmp)
+ tmp = 0x3a;
+ if (state->chip_type == 0x9135) {
ret = af9035_wr_reg(d, 0x004bfb, tmp);
if (ret < 0)
goto err;
@@ -641,6 +641,7 @@ static int af9035_read_config(struct dvb_usb_device *d)
/* demod I2C "address" */
state->af9033_config[0].i2c_addr = 0x38;
+ state->af9033_config[1].i2c_addr = 0x3a;
state->af9033_config[0].adc_multiplier = AF9033_ADC_MULTIPLIER_2X;
state->af9033_config[1].adc_multiplier = AF9033_ADC_MULTIPLIER_2X;
state->af9033_config[0].ts_mode = AF9033_TS_MODE_USB;
@@ -688,11 +689,9 @@ static int af9035_read_config(struct dvb_usb_device *d)
if (ret < 0)
goto err;
- if (!tmp && state->chip_type == 0x9135)
- /* default 0x9135 slave I2C address */
- tmp = 0x3a;
+ if (tmp)
+ state->af9033_config[1].i2c_addr = tmp;
- state->af9033_config[1].i2c_addr = tmp;
dev_dbg(&d->udev->dev, "%s: 2nd demod I2C addr=%02x\n",
__func__, tmp);
}