Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 366676
b: refs/heads/master
c: bc3c9e1
h: refs/heads/master
v: v3
  • Loading branch information
Antti Palosaari authored and Mauro Carvalho Chehab committed Mar 21, 2013
1 parent da78160 commit e30c030
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9ea3681db4c9cd3995595aa9c3e4f1defb8a700b
refs/heads/master: bc3c9e10fcf1bf344a5d6d7e83c429a7c2e730c5
43 changes: 30 additions & 13 deletions trunk/drivers/media/usb/dvb-usb-v2/af9035.c
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ static int af9035_identify_state(struct dvb_usb_device *d, const char **name)
state->chip_type);

if (state->chip_type == 0x9135) {
if (state->chip_version == 2)
if (state->chip_version == 0x02)
*name = AF9035_FIRMWARE_IT9135_V2;
else
*name = AF9035_FIRMWARE_IT9135_V1;
Expand Down Expand Up @@ -595,18 +595,23 @@ static int af9035_read_config(struct dvb_usb_device *d)

/* eeprom memory mapped location */
if (state->chip_type == 0x9135) {
if (state->chip_version == 0x02) {
state->af9033_config[0].tuner = AF9033_TUNER_IT9135_60;
tmp16 = 0x00461d;
} else {
state->af9033_config[0].tuner = AF9033_TUNER_IT9135_38;
tmp16 = 0x00461b;
}

/* check if eeprom exists */
if (state->chip_version == 2)
ret = af9035_rd_reg(d, 0x00461d, &tmp);
else
ret = af9035_rd_reg(d, 0x00461b, &tmp);
ret = af9035_rd_reg(d, tmp16, &tmp);
if (ret < 0)
goto err;

if (tmp) {
addr = EEPROM_BASE_IT9135;
} else {
state->af9033_config[0].tuner = AF9033_TUNER_IT9135_38;
dev_dbg(&d->udev->dev, "%s: no eeprom\n", __func__);
goto skip_eeprom;
}
} else {
Expand Down Expand Up @@ -639,12 +644,15 @@ static int af9035_read_config(struct dvb_usb_device *d)
if (ret < 0)
goto err;

state->af9033_config[i].tuner = tmp;
dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n",
__func__, i, tmp);
if (tmp == 0x00)
dev_dbg(&d->udev->dev,
"%s: [%d]tuner not set, using default\n",
__func__, i);
else
state->af9033_config[i].tuner = tmp;

if (state->chip_type == 0x9135 && tmp == 0x00)
state->af9033_config[i].tuner = AF9033_TUNER_IT9135_38;
dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n",
__func__, i, state->af9033_config[i].tuner);

switch (state->af9033_config[i].tuner) {
case AF9033_TUNER_TUA9001:
Expand Down Expand Up @@ -975,12 +983,12 @@ static const struct fc0012_config af9035_fc0012_config[] = {
};

static struct ite_config af9035_it913x_config = {
.chip_ver = 0x01,
.chip_ver = 0x02,
.chip_type = 0x9135,
.firmware = 0x00000000,
.firmware_ver = 1,
.adc_x2 = 1,
.tuner_id_0 = AF9033_TUNER_IT9135_38,
.tuner_id_0 = 0x00,
.tuner_id_1 = 0x00,
.dual_mode = 0x00,
.adf = 0x00,
Expand Down Expand Up @@ -1153,6 +1161,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap)
case AF9033_TUNER_IT9135_38:
case AF9033_TUNER_IT9135_51:
case AF9033_TUNER_IT9135_52:
af9035_it913x_config.chip_ver = 0x01;
case AF9033_TUNER_IT9135_60:
case AF9033_TUNER_IT9135_61:
case AF9033_TUNER_IT9135_62:
Expand Down Expand Up @@ -1453,6 +1462,7 @@ static const struct dvb_usb_device_properties af9035_props = {
};

static const struct usb_device_id af9035_id_table[] = {
/* AF9035 devices */
{ DVB_USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_9035,
&af9035_props, "Afatech AF9035 reference design", NULL) },
{ DVB_USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_1000,
Expand All @@ -1479,6 +1489,13 @@ static const struct usb_device_id af9035_id_table[] = {
&af9035_props, "Asus U3100Mini Plus", NULL) },
{ DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa,
&af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) },
/* IT9135 devices */
#if 0
{ DVB_USB_DEVICE(0x048d, 0x9135,
&af9035_props, "IT9135 reference design", NULL) },
{ DVB_USB_DEVICE(0x048d, 0x9006,
&af9035_props, "IT9135 reference design", NULL) },
#endif
/* XXX: that same ID [0ccd:0099] is used by af9015 driver too */
{ DVB_USB_DEVICE(USB_VID_TERRATEC, 0x0099,
&af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) },
Expand Down

0 comments on commit e30c030

Please sign in to comment.