[linux-dvb] [Patch] add USB 1.1 support for dvb_usb_dtt200u dvb-t stick

M A Young m.a.young at durham.ac.uk
Thu Mar 29 23:49:05 CEST 2007


On Wed, 28 Mar 2007, M A Young wrote:

> I have a Freecom dvb-t USB stick (14aa:022b with
> dvb-usb-wt220u-zl0353-01.fw firmware) which works fine when connected via
> my USB 2.0 CardBus card, but not the onboard USB 1.1 port, where the card
> initializes but fails to start when attempting to watch TV and this is a
> problem if the CardBus slot is occupied with something else.
>
> I have been doing some investigating and it seems that the differences are
> that under USB 2.0 the usb settings are
>
> T:  Bus=05 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=480 MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=14aa ProdID=022b Rev= 5.21
> S:  Manufacturer=Digital TV Receiver
> S:  Product=Digital TV Receiver
> C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=450mA
> I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00
> Driver=dvb_usb_dtt200u
> E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
> E:  Ad=82(I) Atr=02(Bulk) MxPS= 189 Ivl=0ms
>
> but under USB 1.1 they are
>
> T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
> D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
> P:  Vendor=14aa ProdID=022b Rev= 5.21
> S:  Manufacturer=Digital TV Receiver
> S:  Product=Digital TV Receiver
> C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=450mA
> I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=00 Prot=00
> Driver=dvb_usb_dtt200u
> E:  Ad=01(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=81(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
> E:  Ad=82(I) Atr=01(Isoc) MxPS= 940 Ivl=1ms
>
> so the main data stream has gone from Bulk under 2.0 to Isoc under 1.1. If
> I naively change the stream settings in wt220u_zl0353_properties from a
> USB_BULK one to USB_ISOC settings (from another driver) then the card
> works under USB 1.1 instead.
>
> Is it possible that this driver could auto-detect the USB speed and use
> the appropriate USB transfer mode so that it works under both USB 1.1 and
> USB 2.0?

To answer my own question, it is possible to patch the driver, as the one
I am attaching allows my USB stick to work under both USB 1.1 and USB 2.0.

	Michael Young
-------------- next part --------------
--- linux-2.6.20.i386/drivers/media/dvb/dvb-usb/dtt200u.c.orig	2007-02-04 18:44:54.000000000 +0000
+++ linux-2.6.20.i386/drivers/media/dvb/dvb-usb/dtt200u.c	2007-03-29 22:23:34.000000000 +0100
@@ -96,15 +96,28 @@
 static struct dvb_usb_device_properties wt220u_fc_properties;
 static struct dvb_usb_device_properties wt220u_properties;
 static struct dvb_usb_device_properties wt220u_zl0353_properties;
+static struct dvb_usb_device_properties wt220u_zl0353_usb1_properties;
 
 static int dtt200u_usb_probe(struct usb_interface *intf,
 		const struct usb_device_id *id)
 {
 	if (dvb_usb_device_init(intf,&dtt200u_properties,THIS_MODULE,NULL) == 0 ||
 		dvb_usb_device_init(intf,&wt220u_properties,THIS_MODULE,NULL) == 0 ||
-		dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0 ||
-		dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0)
+		dvb_usb_device_init(intf,&wt220u_fc_properties,THIS_MODULE,NULL) == 0)
 		return 0;
+	switch (interface_to_usbdev(intf)->speed) {
+		case USB_SPEED_FULL:
+			/* USB 1.1 settings */
+			if ( dvb_usb_device_init(intf,&wt220u_zl0353_usb1_properties,THIS_MODULE,NULL) == 0)
+				return 0;
+			break;
+		default:
+		case USB_SPEED_HIGH:
+			/* USB 2.0 settings */
+			if (dvb_usb_device_init(intf,&wt220u_zl0353_properties,THIS_MODULE,NULL) == 0)
+				return 0;
+			break;
+	}
 
 	return -ENODEV;
 }
@@ -303,6 +316,53 @@
 	}
 };
 
+static struct dvb_usb_device_properties wt220u_zl0353_usb1_properties = {
+	.usb_ctrl = CYPRESS_FX2,
+	.firmware = "dvb-usb-wt220u-zl0353-01.fw",
+
+	.num_adapters = 1,
+	.adapter = {
+		{
+			.caps = DVB_USB_ADAP_HAS_PID_FILTER | DVB_USB_ADAP_NEED_PID_FILTERING,
+			.pid_filter_count = 15,
+
+			.streaming_ctrl  = dtt200u_streaming_ctrl,
+			.pid_filter      = dtt200u_pid_filter,
+			.frontend_attach = dtt200u_frontend_attach,
+			/* parameter for the MPEG2-data transfer */
+			.stream = {
+				.type = USB_ISOC,
+				.count = 5,
+				.endpoint = 0x02,
+				.u = {
+					.isoc = {
+						.framesperurb = 4,
+						.framesize = 940,
+						.interval = 1,
+					}
+				}
+			},
+		}
+	},
+	.power_ctrl      = dtt200u_power_ctrl,
+
+	.rc_interval     = 300,
+	.rc_key_map      = dtt200u_rc_keys,
+	.rc_key_map_size = ARRAY_SIZE(dtt200u_rc_keys),
+	.rc_query        = dtt200u_rc_query,
+
+	.generic_bulk_ctrl_endpoint = 0x01,
+
+	.num_device_descs = 1,
+	.devices = {
+		{ .name = "WideView WT-220U PenType Receiver (based on ZL353) (USB1.1)",
+		  .cold_ids = { &dtt200u_usb_table[4], NULL },
+		  .warm_ids = { &dtt200u_usb_table[5], NULL },
+		},
+		{ NULL },
+	}
+};
+
 /* usb specific object needed to register this driver with the usb subsystem */
 static struct usb_driver dtt200u_usb_driver = {
 	.name		= "dvb_usb_dtt200u",


More information about the linux-dvb mailing list