Commit d716ef46 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] af9035: correct TS mode handling

Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent e8292e28
...@@ -518,11 +518,11 @@ static int af9035_download_firmware(struct dvb_usb_device *d, ...@@ -518,11 +518,11 @@ static int af9035_download_firmware(struct dvb_usb_device *d,
* which is done by master demod. * which is done by master demod.
* Master feeds also clock and controls power via GPIO. * Master feeds also clock and controls power via GPIO.
*/ */
ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_DUAL_MODE, &tmp); ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_TS_MODE, &tmp);
if (ret < 0) if (ret < 0)
goto err; goto err;
if (tmp) { if (tmp == 1 || tmp == 3) {
/* configure gpioh1, reset & power slave demod */ /* configure gpioh1, reset & power slave demod */
ret = af9035_wr_reg_mask(d, 0x00d8b0, 0x01, 0x01); ret = af9035_wr_reg_mask(d, 0x00d8b0, 0x01, 0x01);
if (ret < 0) if (ret < 0)
...@@ -640,13 +640,15 @@ static int af9035_read_config(struct dvb_usb_device *d) ...@@ -640,13 +640,15 @@ static int af9035_read_config(struct dvb_usb_device *d)
} }
/* check if there is dual tuners */ /* check if there is dual tuners */
ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_DUAL_MODE, &tmp); ret = af9035_rd_reg(d, state->eeprom_addr + EEPROM_TS_MODE, &tmp);
if (ret < 0) if (ret < 0)
goto err; goto err;
state->dual_mode = tmp; if (tmp == 1 || tmp == 3)
dev_dbg(&d->udev->dev, "%s: dual mode=%d\n", __func__, state->dual_mode = true;
state->dual_mode);
dev_dbg(&d->udev->dev, "%s: ts mode=%d dual mode=%d\n", __func__,
tmp, state->dual_mode);
if (state->dual_mode) { if (state->dual_mode) {
/* read 2nd demodulator I2C address */ /* read 2nd demodulator I2C address */
......
...@@ -100,8 +100,13 @@ static const u32 clock_lut_it9135[] = { ...@@ -100,8 +100,13 @@ static const u32 clock_lut_it9135[] = {
* eeprom is memory mapped as read only. Writing that memory mapped address * eeprom is memory mapped as read only. Writing that memory mapped address
* will not corrupt eeprom. * will not corrupt eeprom.
* *
* eeprom has value 0x00 single mode and 0x03 for dual mode as far as I have * TS mode:
* seen to this day. * 0 TS
* 1 DCA + PIP
* 3 PIP
* n DCA
*
* Values 0 and 3 are seen to this day. 0 for single TS and 3 for dual TS.
*/ */
#define EEPROM_BASE_AF9035 0x42fd #define EEPROM_BASE_AF9035 0x42fd
...@@ -109,7 +114,7 @@ static const u32 clock_lut_it9135[] = { ...@@ -109,7 +114,7 @@ static const u32 clock_lut_it9135[] = {
#define EEPROM_SHIFT 0x10 #define EEPROM_SHIFT 0x10
#define EEPROM_IR_MODE 0x10 #define EEPROM_IR_MODE 0x10
#define EEPROM_DUAL_MODE 0x29 #define EEPROM_TS_MODE 0x29
#define EEPROM_2ND_DEMOD_ADDR 0x2a #define EEPROM_2ND_DEMOD_ADDR 0x2a
#define EEPROM_IR_TYPE 0x2c #define EEPROM_IR_TYPE 0x2c
#define EEPROM_1_IF_L 0x30 #define EEPROM_1_IF_L 0x30
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment