diff options
author | Antonio Ospite <ospite@studenti.unina.it> | 2012-12-10 15:37:17 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2012-12-27 13:36:29 -0500 |
commit | de8ed820fd594a95582562d8f9f68148c972d1a4 (patch) | |
tree | cd9eaa8aabc2363389e655f34acdc5ac3403e481 | |
parent | f6b70ec509a393a966d1307f3e8a89341ee9e7f1 (diff) |
[media] m920x: add support for the VP-7049 Twinhan DVB-T USB Stick
This device was originally made by Twinhan/Azurewave[1] and sometimes
named DTV-DVB UDTT7049, it could be also found in Italy under the name
of Digicom Digitune-S[2], or Think Xtra Hollywood DVB-T USB2.0[3].
Components:
Usb bridge: ULi M9206
Frontend: MT352CG
Tuner: MT2060F
The firmware can be downloaded with:
$ ./Documentation/dvb/get_dvb_firmware vp7049
[1] http://www.azurewave.com/Support_Utility_Driver.asp
[2] http://www.digicom.it/digisit/driver_link.nsf/driverprodotto?openform&prodotto=DigiTuneS
[3] http://www.txitalia.it/prodotto.asp?prodotto=txhollywooddvttv
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r-- | drivers/media/dvb-core/dvb-usb-ids.h | 1 | ||||
-rw-r--r-- | drivers/media/usb/dvb-usb/m920x.c | 123 |
2 files changed, 124 insertions, 0 deletions
diff --git a/drivers/media/dvb-core/dvb-usb-ids.h b/drivers/media/dvb-core/dvb-usb-ids.h index 388c2eb4d747..c6720f2991ac 100644 --- a/drivers/media/dvb-core/dvb-usb-ids.h +++ b/drivers/media/dvb-core/dvb-usb-ids.h | |||
@@ -172,6 +172,7 @@ | |||
172 | #define USB_PID_TWINHAN_VP7045_WARM 0x3206 | 172 | #define USB_PID_TWINHAN_VP7045_WARM 0x3206 |
173 | #define USB_PID_TWINHAN_VP7021_COLD 0x3207 | 173 | #define USB_PID_TWINHAN_VP7021_COLD 0x3207 |
174 | #define USB_PID_TWINHAN_VP7021_WARM 0x3208 | 174 | #define USB_PID_TWINHAN_VP7021_WARM 0x3208 |
175 | #define USB_PID_TWINHAN_VP7049 0x3219 | ||
175 | #define USB_PID_TINYTWIN 0x3226 | 176 | #define USB_PID_TINYTWIN 0x3226 |
176 | #define USB_PID_TINYTWIN_2 0xe402 | 177 | #define USB_PID_TINYTWIN_2 0xe402 |
177 | #define USB_PID_TINYTWIN_3 0x9016 | 178 | #define USB_PID_TINYTWIN_3 0x9016 |
diff --git a/drivers/media/usb/dvb-usb/m920x.c b/drivers/media/usb/dvb-usb/m920x.c index 8888b8c2f8e5..92afeb20650f 100644 --- a/drivers/media/usb/dvb-usb/m920x.c +++ b/drivers/media/usb/dvb-usb/m920x.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include "qt1010.h" | 16 | #include "qt1010.h" |
17 | #include "tda1004x.h" | 17 | #include "tda1004x.h" |
18 | #include "tda827x.h" | 18 | #include "tda827x.h" |
19 | #include "mt2060.h" | ||
19 | 20 | ||
20 | #include <media/tuner.h> | 21 | #include <media/tuner.h> |
21 | #include "tuner-simple.h" | 22 | #include "tuner-simple.h" |
@@ -550,6 +551,12 @@ static struct qt1010_config m920x_qt1010_config = { | |||
550 | .i2c_address = 0x62 | 551 | .i2c_address = 0x62 |
551 | }; | 552 | }; |
552 | 553 | ||
554 | static struct mt2060_config m920x_mt2060_config = { | ||
555 | .i2c_address = 0x60, /* 0xc0 */ | ||
556 | .clock_out = 0, | ||
557 | }; | ||
558 | |||
559 | |||
553 | /* Callbacks for DVB USB */ | 560 | /* Callbacks for DVB USB */ |
554 | static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap) | 561 | static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap) |
555 | { | 562 | { |
@@ -564,6 +571,37 @@ static int m920x_mt352_frontend_attach(struct dvb_usb_adapter *adap) | |||
564 | return 0; | 571 | return 0; |
565 | } | 572 | } |
566 | 573 | ||
574 | static int m920x_mt352_frontend_attach_vp7049(struct dvb_usb_adapter *adap) | ||
575 | { | ||
576 | struct m920x_inits vp7049_fe_init_seq[] = { | ||
577 | /* XXX without these commands the frontend cannot be detected, | ||
578 | * they must be sent BEFORE the frontend is attached */ | ||
579 | { 0xff28, 0x00 }, | ||
580 | { 0xff23, 0x00 }, | ||
581 | { 0xff28, 0x00 }, | ||
582 | { 0xff23, 0x00 }, | ||
583 | { 0xff21, 0x20 }, | ||
584 | { 0xff21, 0x60 }, | ||
585 | { 0xff28, 0x00 }, | ||
586 | { 0xff22, 0x00 }, | ||
587 | { 0xff20, 0x30 }, | ||
588 | { 0xff20, 0x20 }, | ||
589 | { 0xff20, 0x30 }, | ||
590 | { } /* terminating entry */ | ||
591 | }; | ||
592 | int ret; | ||
593 | |||
594 | deb("%s\n", __func__); | ||
595 | |||
596 | ret = m920x_write_seq(adap->dev->udev, M9206_CORE, vp7049_fe_init_seq); | ||
597 | if (ret != 0) { | ||
598 | deb("Initialization of vp7049 frontend failed."); | ||
599 | return ret; | ||
600 | } | ||
601 | |||
602 | return m920x_mt352_frontend_attach(adap); | ||
603 | } | ||
604 | |||
567 | static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap) | 605 | static int m920x_tda10046_08_frontend_attach(struct dvb_usb_adapter *adap) |
568 | { | 606 | { |
569 | deb("%s\n",__func__); | 607 | deb("%s\n",__func__); |
@@ -628,6 +666,18 @@ static int m920x_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) | |||
628 | return 0; | 666 | return 0; |
629 | } | 667 | } |
630 | 668 | ||
669 | static int m920x_mt2060_tuner_attach(struct dvb_usb_adapter *adap) | ||
670 | { | ||
671 | deb("%s\n", __func__); | ||
672 | |||
673 | if (dvb_attach(mt2060_attach, adap->fe_adap[0].fe, &adap->dev->i2c_adap, | ||
674 | &m920x_mt2060_config, 1220) == NULL) | ||
675 | return -ENODEV; | ||
676 | |||
677 | return 0; | ||
678 | } | ||
679 | |||
680 | |||
631 | /* device-specific initialization */ | 681 | /* device-specific initialization */ |
632 | static struct m920x_inits megasky_rc_init [] = { | 682 | static struct m920x_inits megasky_rc_init [] = { |
633 | { M9206_RC_INIT2, 0xa8 }, | 683 | { M9206_RC_INIT2, 0xa8 }, |
@@ -656,6 +706,15 @@ static struct m920x_inits pinnacle310e_init[] = { | |||
656 | { } /* terminating entry */ | 706 | { } /* terminating entry */ |
657 | }; | 707 | }; |
658 | 708 | ||
709 | static struct m920x_inits vp7049_rc_init[] = { | ||
710 | { 0xff28, 0x00 }, | ||
711 | { 0xff23, 0x00 }, | ||
712 | { 0xff21, 0x70 }, | ||
713 | { M9206_RC_INIT2, 0x00 }, | ||
714 | { M9206_RC_INIT1, 0xff }, | ||
715 | { } /* terminating entry */ | ||
716 | }; | ||
717 | |||
659 | /* ir keymaps */ | 718 | /* ir keymaps */ |
660 | static struct rc_map_table rc_map_megasky_table[] = { | 719 | static struct rc_map_table rc_map_megasky_table[] = { |
661 | { 0x0012, KEY_POWER }, | 720 | { 0x0012, KEY_POWER }, |
@@ -758,6 +817,7 @@ static struct dvb_usb_device_properties digivox_mini_ii_properties; | |||
758 | static struct dvb_usb_device_properties tvwalkertwin_properties; | 817 | static struct dvb_usb_device_properties tvwalkertwin_properties; |
759 | static struct dvb_usb_device_properties dposh_properties; | 818 | static struct dvb_usb_device_properties dposh_properties; |
760 | static struct dvb_usb_device_properties pinnacle_pctv310e_properties; | 819 | static struct dvb_usb_device_properties pinnacle_pctv310e_properties; |
820 | static struct dvb_usb_device_properties vp7049_properties; | ||
761 | 821 | ||
762 | static int m920x_probe(struct usb_interface *intf, | 822 | static int m920x_probe(struct usb_interface *intf, |
763 | const struct usb_device_id *id) | 823 | const struct usb_device_id *id) |
@@ -810,6 +870,13 @@ static int m920x_probe(struct usb_interface *intf, | |||
810 | goto found; | 870 | goto found; |
811 | } | 871 | } |
812 | 872 | ||
873 | ret = dvb_usb_device_init(intf, &vp7049_properties, | ||
874 | THIS_MODULE, &d, adapter_nr); | ||
875 | if (ret == 0) { | ||
876 | rc_init_seq = vp7049_rc_init; | ||
877 | goto found; | ||
878 | } | ||
879 | |||
813 | return ret; | 880 | return ret; |
814 | } else { | 881 | } else { |
815 | /* Another interface on a multi-tuner device */ | 882 | /* Another interface on a multi-tuner device */ |
@@ -841,6 +908,7 @@ static struct usb_device_id m920x_table [] = { | |||
841 | { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) }, | 908 | { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_COLD) }, |
842 | { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) }, | 909 | { USB_DEVICE(USB_VID_DPOSH, USB_PID_DPOSH_M9206_WARM) }, |
843 | { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) }, | 910 | { USB_DEVICE(USB_VID_VISIONPLUS, USB_PID_PINNACLE_PCTV310E) }, |
911 | { USB_DEVICE(USB_VID_AZUREWAVE, USB_PID_TWINHAN_VP7049) }, | ||
844 | { } /* Terminating entry */ | 912 | { } /* Terminating entry */ |
845 | }; | 913 | }; |
846 | MODULE_DEVICE_TABLE (usb, m920x_table); | 914 | MODULE_DEVICE_TABLE (usb, m920x_table); |
@@ -1133,6 +1201,61 @@ static struct dvb_usb_device_properties pinnacle_pctv310e_properties = { | |||
1133 | } | 1201 | } |
1134 | }; | 1202 | }; |
1135 | 1203 | ||
1204 | static struct dvb_usb_device_properties vp7049_properties = { | ||
1205 | .caps = DVB_USB_IS_AN_I2C_ADAPTER, | ||
1206 | |||
1207 | .usb_ctrl = DEVICE_SPECIFIC, | ||
1208 | .firmware = "dvb-usb-vp7049-0.95.fw", | ||
1209 | .download_firmware = m920x_firmware_download, | ||
1210 | |||
1211 | .rc.core = { | ||
1212 | .rc_interval = 150, | ||
1213 | .rc_codes = RC_MAP_TWINHAN_VP1027_DVBS, | ||
1214 | .rc_query = m920x_rc_core_query, | ||
1215 | .allowed_protos = RC_TYPE_UNKNOWN, | ||
1216 | }, | ||
1217 | |||
1218 | .size_of_priv = sizeof(struct m920x_state), | ||
1219 | |||
1220 | .identify_state = m920x_identify_state, | ||
1221 | .num_adapters = 1, | ||
1222 | .adapter = {{ | ||
1223 | .num_frontends = 1, | ||
1224 | .fe = {{ | ||
1225 | |||
1226 | .caps = DVB_USB_ADAP_HAS_PID_FILTER | | ||
1227 | DVB_USB_ADAP_PID_FILTER_CAN_BE_TURNED_OFF, | ||
1228 | |||
1229 | .pid_filter_count = 8, | ||
1230 | .pid_filter = m920x_pid_filter, | ||
1231 | .pid_filter_ctrl = m920x_pid_filter_ctrl, | ||
1232 | |||
1233 | .frontend_attach = m920x_mt352_frontend_attach_vp7049, | ||
1234 | .tuner_attach = m920x_mt2060_tuner_attach, | ||
1235 | |||
1236 | .stream = { | ||
1237 | .type = USB_BULK, | ||
1238 | .count = 8, | ||
1239 | .endpoint = 0x81, | ||
1240 | .u = { | ||
1241 | .bulk = { | ||
1242 | .buffersize = 512, | ||
1243 | } | ||
1244 | } | ||
1245 | }, | ||
1246 | } }, | ||
1247 | } }, | ||
1248 | .i2c_algo = &m920x_i2c_algo, | ||
1249 | |||
1250 | .num_device_descs = 1, | ||
1251 | .devices = { | ||
1252 | { "DTV-DVB UDTT7049", | ||
1253 | { &m920x_table[7], NULL }, | ||
1254 | { NULL }, | ||
1255 | } | ||
1256 | } | ||
1257 | }; | ||
1258 | |||
1136 | static struct usb_driver m920x_driver = { | 1259 | static struct usb_driver m920x_driver = { |
1137 | .name = "dvb_usb_m920x", | 1260 | .name = "dvb_usb_m920x", |
1138 | .probe = m920x_probe, | 1261 | .probe = m920x_probe, |