diff options
author | Antti Palosaari <crope@iki.fi> | 2013-02-01 20:23:07 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-21 17:55:13 -0400 |
commit | bc3c9e10fcf1bf344a5d6d7e83c429a7c2e730c5 (patch) | |
tree | 92daf4cab2a0f67ca80b3403ac6687f94265d17f | |
parent | 9ea3681db4c9cd3995595aa9c3e4f1defb8a700b (diff) |
[media] af9035: basic support for IT9135 v2 chips
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/usb/dvb-usb-v2/af9035.c | 43 |
1 files changed, 30 insertions, 13 deletions
diff --git a/drivers/media/usb/dvb-usb-v2/af9035.c b/drivers/media/usb/dvb-usb-v2/af9035.c index 44a1196c7f3f..f4f3a2109245 100644 --- a/drivers/media/usb/dvb-usb-v2/af9035.c +++ b/drivers/media/usb/dvb-usb-v2/af9035.c | |||
@@ -316,7 +316,7 @@ static int af9035_identify_state(struct dvb_usb_device *d, const char **name) | |||
316 | state->chip_type); | 316 | state->chip_type); |
317 | 317 | ||
318 | if (state->chip_type == 0x9135) { | 318 | if (state->chip_type == 0x9135) { |
319 | if (state->chip_version == 2) | 319 | if (state->chip_version == 0x02) |
320 | *name = AF9035_FIRMWARE_IT9135_V2; | 320 | *name = AF9035_FIRMWARE_IT9135_V2; |
321 | else | 321 | else |
322 | *name = AF9035_FIRMWARE_IT9135_V1; | 322 | *name = AF9035_FIRMWARE_IT9135_V1; |
@@ -595,18 +595,23 @@ static int af9035_read_config(struct dvb_usb_device *d) | |||
595 | 595 | ||
596 | /* eeprom memory mapped location */ | 596 | /* eeprom memory mapped location */ |
597 | if (state->chip_type == 0x9135) { | 597 | if (state->chip_type == 0x9135) { |
598 | if (state->chip_version == 0x02) { | ||
599 | state->af9033_config[0].tuner = AF9033_TUNER_IT9135_60; | ||
600 | tmp16 = 0x00461d; | ||
601 | } else { | ||
602 | state->af9033_config[0].tuner = AF9033_TUNER_IT9135_38; | ||
603 | tmp16 = 0x00461b; | ||
604 | } | ||
605 | |||
598 | /* check if eeprom exists */ | 606 | /* check if eeprom exists */ |
599 | if (state->chip_version == 2) | 607 | ret = af9035_rd_reg(d, tmp16, &tmp); |
600 | ret = af9035_rd_reg(d, 0x00461d, &tmp); | ||
601 | else | ||
602 | ret = af9035_rd_reg(d, 0x00461b, &tmp); | ||
603 | if (ret < 0) | 608 | if (ret < 0) |
604 | goto err; | 609 | goto err; |
605 | 610 | ||
606 | if (tmp) { | 611 | if (tmp) { |
607 | addr = EEPROM_BASE_IT9135; | 612 | addr = EEPROM_BASE_IT9135; |
608 | } else { | 613 | } else { |
609 | state->af9033_config[0].tuner = AF9033_TUNER_IT9135_38; | 614 | dev_dbg(&d->udev->dev, "%s: no eeprom\n", __func__); |
610 | goto skip_eeprom; | 615 | goto skip_eeprom; |
611 | } | 616 | } |
612 | } else { | 617 | } else { |
@@ -639,12 +644,15 @@ static int af9035_read_config(struct dvb_usb_device *d) | |||
639 | if (ret < 0) | 644 | if (ret < 0) |
640 | goto err; | 645 | goto err; |
641 | 646 | ||
642 | state->af9033_config[i].tuner = tmp; | 647 | if (tmp == 0x00) |
643 | dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n", | 648 | dev_dbg(&d->udev->dev, |
644 | __func__, i, tmp); | 649 | "%s: [%d]tuner not set, using default\n", |
650 | __func__, i); | ||
651 | else | ||
652 | state->af9033_config[i].tuner = tmp; | ||
645 | 653 | ||
646 | if (state->chip_type == 0x9135 && tmp == 0x00) | 654 | dev_dbg(&d->udev->dev, "%s: [%d]tuner=%02x\n", |
647 | state->af9033_config[i].tuner = AF9033_TUNER_IT9135_38; | 655 | __func__, i, state->af9033_config[i].tuner); |
648 | 656 | ||
649 | switch (state->af9033_config[i].tuner) { | 657 | switch (state->af9033_config[i].tuner) { |
650 | case AF9033_TUNER_TUA9001: | 658 | case AF9033_TUNER_TUA9001: |
@@ -975,12 +983,12 @@ static const struct fc0012_config af9035_fc0012_config[] = { | |||
975 | }; | 983 | }; |
976 | 984 | ||
977 | static struct ite_config af9035_it913x_config = { | 985 | static struct ite_config af9035_it913x_config = { |
978 | .chip_ver = 0x01, | 986 | .chip_ver = 0x02, |
979 | .chip_type = 0x9135, | 987 | .chip_type = 0x9135, |
980 | .firmware = 0x00000000, | 988 | .firmware = 0x00000000, |
981 | .firmware_ver = 1, | 989 | .firmware_ver = 1, |
982 | .adc_x2 = 1, | 990 | .adc_x2 = 1, |
983 | .tuner_id_0 = AF9033_TUNER_IT9135_38, | 991 | .tuner_id_0 = 0x00, |
984 | .tuner_id_1 = 0x00, | 992 | .tuner_id_1 = 0x00, |
985 | .dual_mode = 0x00, | 993 | .dual_mode = 0x00, |
986 | .adf = 0x00, | 994 | .adf = 0x00, |
@@ -1153,6 +1161,7 @@ static int af9035_tuner_attach(struct dvb_usb_adapter *adap) | |||
1153 | case AF9033_TUNER_IT9135_38: | 1161 | case AF9033_TUNER_IT9135_38: |
1154 | case AF9033_TUNER_IT9135_51: | 1162 | case AF9033_TUNER_IT9135_51: |
1155 | case AF9033_TUNER_IT9135_52: | 1163 | case AF9033_TUNER_IT9135_52: |
1164 | af9035_it913x_config.chip_ver = 0x01; | ||
1156 | case AF9033_TUNER_IT9135_60: | 1165 | case AF9033_TUNER_IT9135_60: |
1157 | case AF9033_TUNER_IT9135_61: | 1166 | case AF9033_TUNER_IT9135_61: |
1158 | case AF9033_TUNER_IT9135_62: | 1167 | case AF9033_TUNER_IT9135_62: |
@@ -1453,6 +1462,7 @@ static const struct dvb_usb_device_properties af9035_props = { | |||
1453 | }; | 1462 | }; |
1454 | 1463 | ||
1455 | static const struct usb_device_id af9035_id_table[] = { | 1464 | static const struct usb_device_id af9035_id_table[] = { |
1465 | /* AF9035 devices */ | ||
1456 | { DVB_USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_9035, | 1466 | { DVB_USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_9035, |
1457 | &af9035_props, "Afatech AF9035 reference design", NULL) }, | 1467 | &af9035_props, "Afatech AF9035 reference design", NULL) }, |
1458 | { DVB_USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_1000, | 1468 | { DVB_USB_DEVICE(USB_VID_AFATECH, USB_PID_AFATECH_AF9035_1000, |
@@ -1479,6 +1489,13 @@ static const struct usb_device_id af9035_id_table[] = { | |||
1479 | &af9035_props, "Asus U3100Mini Plus", NULL) }, | 1489 | &af9035_props, "Asus U3100Mini Plus", NULL) }, |
1480 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa, | 1490 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x00aa, |
1481 | &af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) }, | 1491 | &af9035_props, "TerraTec Cinergy T Stick (rev. 2)", NULL) }, |
1492 | /* IT9135 devices */ | ||
1493 | #if 0 | ||
1494 | { DVB_USB_DEVICE(0x048d, 0x9135, | ||
1495 | &af9035_props, "IT9135 reference design", NULL) }, | ||
1496 | { DVB_USB_DEVICE(0x048d, 0x9006, | ||
1497 | &af9035_props, "IT9135 reference design", NULL) }, | ||
1498 | #endif | ||
1482 | /* XXX: that same ID [0ccd:0099] is used by af9015 driver too */ | 1499 | /* XXX: that same ID [0ccd:0099] is used by af9015 driver too */ |
1483 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x0099, | 1500 | { DVB_USB_DEVICE(USB_VID_TERRATEC, 0x0099, |
1484 | &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) }, | 1501 | &af9035_props, "TerraTec Cinergy T Stick Dual RC (rev. 2)", NULL) }, |